15 #include "GaudiKernel/ITHistSvc.h"
31 m_ValidationNtupleTools(),
32 m_extrapolatorHandle(
"Trk::Extrapolator/InDetExtrapolator"),
36 declareInterface<IDirectTrackNtupleWriter>(
this);
60 SmartIF<ITHistSvc> tHistSvc{service(
"THistSvc")};
65 m_nt =
new TTree(TString(m_ntupleTreeName),
"Track Validation");
67 std::string fullNtupleName =
"/"+m_ntupleFileName+
"/"+m_ntupleDirName+
"/"+m_ntupleTreeName;
68 ATH_CHECK( tHistSvc->regTree(fullNtupleName, m_nt) );
71 ATH_CHECK( m_ValidationNtupleTools.retrieve() );
75 itTools = m_ValidationNtupleTools.begin();
76 for ( ; itTools != m_ValidationNtupleTools.end(); ++itTools ) {
77 if (((*itTools)->addNtupleItems(m_nt)).isFailure()) {
78 ATH_MSG_ERROR (
"ValidationNtupleTool could not add its branches for tree " << fullNtupleName);
79 return StatusCode::FAILURE;
85 return StatusCode::SUCCESS;
94 return StatusCode::SUCCESS;
102 const int iterationIndex,
103 const unsigned int fitStatCode ) {
109 itTools = m_ValidationNtupleTools.begin();
110 for ( ; itTools != m_ValidationNtupleTools.end(); ++itTools ) {
111 if (((*itTools)->fillTrackData(
track, iterationIndex, fitStatCode )).isFailure()) {
112 ATH_MSG_ERROR (
"Validation Ntuple Tool could not fill track data.");
113 return StatusCode::FAILURE;
119 return writeRecord(m_nt);
131 itTools = m_ValidationNtupleTools.begin();
132 for ( ; itTools != m_ValidationNtupleTools.end(); ++itTools ) {
133 if (((*itTools)->fillTrackParticleData( particlebase )).isFailure()) {
134 ATH_MSG_ERROR (
"Validation Ntuple Tool could not fill particlebase data.");
135 return StatusCode::FAILURE;
141 return writeRecord(m_nt);
148 if (!
tree)
return StatusCode::FAILURE;
152 itTools = m_ValidationNtupleTools.begin();
153 for ( ; itTools != m_ValidationNtupleTools.end(); ++itTools ) (*itTools)->resetVariables();
154 return StatusCode::SUCCESS;