10 #include "GaudiKernel/ISvcLocator.h"
12 #include "GaudiKernel/Service.h"
27 const std::string&
name ) :
41 m_trkAnaDefSvc = Gaudi::svcLocator()->service(
"TrkAnaDefSvc" + m_anaTag.value());
44 return StatusCode::SUCCESS;
54 const std::string&
chain,
56 const std::string& roiStr )
const
60 if( not
wh.key().ends_with( m_anaTag.value() ) ) {
62 return StatusCode::FAILURE;
76 wh->push_back( std::make_unique< SG::AuxElement >() );
79 if( m_trkAnaDefSvc->useTrigger() and not m_trkAnaDefSvc->useEFTrigger() ) {
80 chainAcc( *(
wh->back()) ) =
chain;
81 roiIdxAcc( *(
wh->back()) ) = roiIdx;
82 roiStrAcc( *(
wh->back()) ) = roiStr;
87 if( m_trkAnaDefSvc->isReferenceTruth() ) {
89 matchInfo = getMatchInfo(
96 testTracksAcc( *(
wh->back()) ) = std::get<0>( matchInfo );
97 refTruthsAcc( *(
wh->back()) ) = std::get<1>( matchInfo );
98 matchDistsAcc( *(
wh->back()) ) = std::get<2>( matchInfo );
101 else if( m_trkAnaDefSvc->isTestTruth() ) {
103 matchInfo = getMatchInfo(
110 testTruthsAcc( *(
wh->back()) ) = std::get<0>( matchInfo );
111 refTracksAcc( *(
wh->back()) ) = std::get<1>( matchInfo );
112 matchDistsAcc( *(
wh->back()) ) = std::get<2>( matchInfo );
117 matchInfo = getMatchInfo(
124 testTracksAcc( *(
wh->back()) ) = std::get<0>( matchInfo );
125 refTracksAcc( *(
wh->back()) ) = std::get<1>( matchInfo );
126 matchDistsAcc( *(
wh->back()) ) = std::get<2>( matchInfo );
129 return StatusCode::SUCCESS;
139 if( not
wh.isValid() ) {
153 std::stringstream
ss;
154 ss <<
wh.key() <<
" : " << m_trkAnaDefSvc->testType()
155 <<
" --> " << m_trkAnaDefSvc->referenceType() <<
" ( dist ) :\n";
157 for(
size_t icr=0; icr<
wh->size(); icr++ ) {
159 chainCAcc( *(
wh->at(icr)) ) :
"Offline";
160 std::string roiIdx = roiIdxCAcc.
isAvailable( *(
wh->at(icr)) ) ?
162 std::string roiStr = roiStrCAcc.
isAvailable( *(
wh->at(icr)) ) ?
163 roiStrCAcc( *(
wh->at(icr)) ) :
"N/A";
165 ss <<
"\t\tChain : " <<
chain <<
"\n";
166 ss <<
"\t\tRoI ( " << roiIdx <<
" ) : " << roiStr <<
"\n";
167 ss <<
"\t\tMatch Info (pT) : " <<
"\n";
170 if( m_trkAnaDefSvc->isReferenceTruth() ) {
171 ss << printMatchInfo< xAOD::TrackParticleContainer, xAOD::TruthParticleContainer >(
172 testTracksCAcc( *(
wh->at(icr)) ),
173 refTruthsCAcc( *(
wh->at(icr)) ),
174 matchDistsCAcc( *(
wh->at(icr)) ) );
177 else if( m_trkAnaDefSvc->isTestTruth() ) {
178 ss << printMatchInfo< xAOD::TruthParticleContainer, xAOD::TrackParticleContainer >(
179 testTruthsCAcc( *(
wh->at(icr)) ),
180 refTracksCAcc( *(
wh->at(icr)) ),
181 matchDistsCAcc( *(
wh->at(icr)) ) );
185 ss << printMatchInfo< xAOD::TrackParticleContainer, xAOD::TrackParticleContainer >(
186 testTracksCAcc( *(
wh->at(icr)) ),
187 refTracksCAcc( *(
wh->at(icr)) ),
188 matchDistsCAcc( *(
wh->at(icr)) ) );