10 #include "GaudiKernel/ISvcLocator.h"
12 #include "GaudiKernel/Service.h"
28 const std::string&
name ) :
29 asg::AsgTool(
name ), m_trkAnaDefSvc( nullptr ) { }
42 ISvcLocator* svcLoc = Gaudi::svcLocator();
43 ATH_CHECK( svcLoc->service(
"TrkAnaDefSvc" + m_anaTag.value(), m_trkAnaDefSvc ) );
45 return StatusCode::SUCCESS;
55 const std::string&
chain,
57 const std::string& roiStr )
const
63 return StatusCode::FAILURE;
77 wh->push_back( std::make_unique< SG::AuxElement >() );
80 if( m_trkAnaDefSvc->useTrigger() and not m_trkAnaDefSvc->useEFTrigger() ) {
81 chainAcc( *(
wh->back()) ) =
chain;
82 roiIdxAcc( *(
wh->back()) ) = roiIdx;
83 roiStrAcc( *(
wh->back()) ) = roiStr;
88 if( m_trkAnaDefSvc->isReferenceTruth() ) {
90 matchInfo = getMatchInfo(
97 testTracksAcc( *(
wh->back()) ) = std::get<0>( matchInfo );
98 refTruthsAcc( *(
wh->back()) ) = std::get<1>( matchInfo );
99 matchDistsAcc( *(
wh->back()) ) = std::get<2>( matchInfo );
102 else if( m_trkAnaDefSvc->isTestTruth() ) {
104 matchInfo = getMatchInfo(
111 testTruthsAcc( *(
wh->back()) ) = std::get<0>( matchInfo );
112 refTracksAcc( *(
wh->back()) ) = std::get<1>( matchInfo );
113 matchDistsAcc( *(
wh->back()) ) = std::get<2>( matchInfo );
118 matchInfo = getMatchInfo(
125 testTracksAcc( *(
wh->back()) ) = std::get<0>( matchInfo );
126 refTracksAcc( *(
wh->back()) ) = std::get<1>( matchInfo );
127 matchDistsAcc( *(
wh->back()) ) = std::get<2>( matchInfo );
130 return StatusCode::SUCCESS;
140 if( not
wh.isValid() ) {
154 std::stringstream
ss;
155 ss <<
wh.key() <<
" : " << m_trkAnaDefSvc->testType()
156 <<
" --> " << m_trkAnaDefSvc->referenceType() <<
" ( dist ) :\n";
158 for(
size_t icr=0; icr<
wh->size(); icr++ ) {
160 chainCAcc( *(
wh->at(icr)) ) :
"Offline";
161 std::string roiIdx = roiIdxCAcc.
isAvailable( *(
wh->at(icr)) ) ?
163 std::string roiStr = roiStrCAcc.
isAvailable( *(
wh->at(icr)) ) ?
164 roiStrCAcc( *(
wh->at(icr)) ) :
"N/A";
166 ss <<
"\t\tChain : " <<
chain <<
"\n";
167 ss <<
"\t\tRoI ( " << roiIdx <<
" ) : " << roiStr <<
"\n";
168 ss <<
"\t\tMatch Info (pT) : " <<
"\n";
171 if( m_trkAnaDefSvc->isReferenceTruth() ) {
172 ss << printMatchInfo< xAOD::TrackParticleContainer, xAOD::TruthParticleContainer >(
173 testTracksCAcc( *(
wh->at(icr)) ),
174 refTruthsCAcc( *(
wh->at(icr)) ),
175 matchDistsCAcc( *(
wh->at(icr)) ) );
178 else if( m_trkAnaDefSvc->isTestTruth() ) {
179 ss << printMatchInfo< xAOD::TruthParticleContainer, xAOD::TrackParticleContainer >(
180 testTruthsCAcc( *(
wh->at(icr)) ),
181 refTracksCAcc( *(
wh->at(icr)) ),
182 matchDistsCAcc( *(
wh->at(icr)) ) );
186 ss << printMatchInfo< xAOD::TrackParticleContainer, xAOD::TrackParticleContainer >(
187 testTracksCAcc( *(
wh->at(icr)) ),
188 refTracksCAcc( *(
wh->at(icr)) ),
189 matchDistsCAcc( *(
wh->at(icr)) ) );