15 #include "GaudiKernel/ISvcLocator.h"
16 #include "GaudiKernel/ITHistSvc.h"
17 #include "GaudiKernel/Bootstrap.h"
25 m_inputTrackCollection(
"Tracks"),
52 return StatusCode::SUCCESS;
61 return StatusCode::SUCCESS;
74 if (!m_inputTrackCollection.empty()) {
75 sc = evtStore()->retrieve(trackCollection,m_inputTrackCollection);
77 ATH_MSG_ERROR(
"TrackCollection "<<m_inputTrackCollection<<
" not found!" );
79 ATH_MSG_VERBOSE(
"TrackCollection " << m_inputTrackCollection<<
" found." );
83 return StatusCode::FAILURE;
92 for (;itTracks!=endTracks;++itTracks) {
95 const Trk::TrackStates *currentTSOSList =(*itTracks)->trackStateOnSurfaces();
103 m_currentPathInX0 = 0.;
106 for (;itTSOS!=endTSOS;++itTSOS) {
115 if (mEffect&&tParameter) {
118 m_currentPathInX0 += m_stepInX0;
121 m_positionR[m_updates] = tParameter->
position().perp();
122 m_positionX[m_updates] = tParameter->
position().x();
123 m_positionY[m_updates] = tParameter->
position().y();
124 m_positionZ[m_updates] = tParameter->
position().z();
127 m_momentum[m_updates] = tParameter->
momentum().mag();
134 }
else if ( (mef!=
nullptr) && (mef->
energyLoss() !=
nullptr) ) {
136 }
else m_momentumChange[m_updates] = 0.0;
138 m_eta[m_updates] = tParameter->
position().eta();
139 m_traversedStepInX0[m_updates] = m_stepInX0;
140 m_traversedPathInX0[m_updates] = m_currentPathInX0;
146 return StatusCode::FAILURE;
160 return StatusCode::SUCCESS;
169 m_Tree =
new TTree(
"MaterialOnTrackValidation",
"Material on track validation");
172 m_Tree->Branch(
"Updates" ,&m_updates ,
"updates/I");
173 m_Tree->Branch(
"UpdatePositionX", m_positionX ,
"updateX[updates]/F");
174 m_Tree->Branch(
"UpdatePositionR", m_positionR ,
"updateR[updates]/F");
175 m_Tree->Branch(
"PreMomentum" , m_momentum ,
"preMomentum[updates]/F");
176 m_Tree->Branch(
"MomentumChange" , m_momentumChange ,
"momentumChange[updates]/F");
177 m_Tree->Branch(
"PathInX0" , m_traversedPathInX0 ,
"PathInX0[updates]/F");
178 m_Tree->Branch(
"StepInX0" , m_traversedStepInX0 ,
"StepInX0[updates]/F");
179 m_Tree->Branch(
"Eta" , m_eta ,
"Eta[updates]/F");
183 SmartIF<ITHistSvc> tHistSvc{service(
"THistSvc")};
185 ATH_MSG_ERROR(
"initialize() Could not find Hist Service -> Switching ValidationMode Off !");
186 delete m_Tree; m_Tree =
nullptr;
190 if ((tHistSvc->regTree(
"/val/MaterialOnTrackValidation", m_Tree)).isFailure()) {
191 ATH_MSG_ERROR(
"initialize() Could not register the Tree -> Switching ValidationMode Off !");
192 delete m_Tree; m_Tree =
nullptr;