ATLAS Offline Software
Public Types | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
IDTPM::TrackAnalysisCollections Class Reference

#include <TrackAnalysisCollections.h>

Inheritance diagram for IDTPM::TrackAnalysisCollections:
Collaboration diagram for IDTPM::TrackAnalysisCollections:

Public Types

enum  Stage : size_t { FULL, FS, InRoI, NStages }
 Enum for selection stages. More...
 

Public Member Functions

 TrackAnalysisCollections (const std::string &anaTag)
 Constructor. More...
 
 ~TrackAnalysisCollections ()=default
 Destructor. More...
 
TrackAnalysisCollectionsoperator= (const TrackAnalysisCollections &)=delete
 = operator More...
 
StatusCode initialize ()
 initialize More...
 
StatusCode fillTruthPartContainer (const SG::ReadHandleKey< xAOD::TruthParticleContainer > &handleKey)
 — Setter methods — More...
 
StatusCode fillOfflTrackContainer (const SG::ReadHandleKey< xAOD::TrackParticleContainer > &handleKey)
 Offline track particles. More...
 
StatusCode fillTrigTrackContainer (const SG::ReadHandleKey< xAOD::TrackParticleContainer > &handleKey)
 Trigger track particles. More...
 
StatusCode fillTestTruthVec (const std::vector< const xAOD::TruthParticle * > &vec, Stage stage=FULL)
 fill TEST vectors More...
 
StatusCode fillTestTrackVec (const std::vector< const xAOD::TrackParticle * > &vec, Stage stage=FULL)
 TEST = tracks. More...
 
StatusCode fillRefTruthVec (const std::vector< const xAOD::TruthParticle * > &vec, Stage stage=FULL)
 fill REFERENCE vectors More...
 
StatusCode fillRefTrackVec (const std::vector< const xAOD::TrackParticle * > &vec, Stage stage=FULL)
 REFERENCE = tracks. More...
 
StatusCode fillTruthPartVec (const std::vector< const xAOD::TruthParticle * > &vec, Stage stage=FULL)
 get truth/offline/trigger track vector (TEST or REFERENCE) More...
 
StatusCode fillOfflTrackVec (const std::vector< const xAOD::TrackParticle * > &vec, Stage stage=FULL)
 Offline tracks. More...
 
StatusCode fillTrigTrackVec (const std::vector< const xAOD::TrackParticle * > &vec, Stage stage=FULL)
 Trigger tracks. More...
 
bool empty (Stage stage=FULL)
 Utility methods — More...
 
void clear (Stage stage=FULL)
 Clear vectors. More...
 
void copyFS ()
 copy content of FS vectors to InRoI vectors More...
 
std::string printInfo (Stage stage=FULL) const
 print Information about tracks in the collection(s) More...
 
const std::string & anaTag ()
 — Getter methods — More...
 
const xAOD::TruthParticleContainertestTruthContainer ()
 get full TEST containers More...
 
const xAOD::TrackParticleContainertestTrackContainer ()
 TEST = Track. More...
 
const xAOD::TruthParticleContainerrefTruthContainer ()
 get full REFERENCE containers More...
 
const xAOD::TrackParticleContainerrefTrackContainer ()
 REFERENCE = Track. More...
 
const xAOD::TruthParticleContainertruthPartContainer ()
 get truth/offline/trigger track containers (TEST or REFERENCE) More...
 
const xAOD::TrackParticleContainerofflTrackContainer ()
 
const xAOD::TrackParticleContainertrigTrackContainer ()
 
const std::vector< const xAOD::TruthParticle * > & testTruthVec (Stage stage=FULL)
 get TEST track vectors More...
 
const std::vector< const xAOD::TrackParticle * > & testTrackVec (Stage stage=FULL)
 TEST = Track. More...
 
const std::vector< const xAOD::TruthParticle * > & refTruthVec (Stage stage=FULL)
 get REFERENCE track vectors More...
 
const std::vector< const xAOD::TrackParticle * > & refTrackVec (Stage stage=FULL)
 TEST = Track. More...
 
const std::vector< const xAOD::TruthParticle * > & truthPartVec (Stage stage=FULL)
 get truth/offline/trigger track vector (TEST or REFERENCE) More...
 
const std::vector< const xAOD::TrackParticle * > & offlTrackVec (Stage stage=FULL)
 
const std::vector< const xAOD::TrackParticle * > & trigTrackVec (Stage stage=FULL)
 
ITrackMatchingLookupmatches ()
 return matching information More...
 
std::string printMatchInfo ()
 print matching information More...
 
bool updateChainRois (const std::string &chainRoi, const std::string &roiStr)
 update chainRois map More...
 
bool msgLvl (const MSG::Level lvl) const
 Test the output level. More...
 
MsgStream & msg () const
 The standard message stream. More...
 
MsgStream & msg (const MSG::Level lvl) const
 The standard message stream. More...
 
void setLevel (MSG::Level lvl)
 Change the current logging level. More...
 

Private Types

typedef std::unordered_map< std::string, std::string > mapChainRoi_t
 map of chainRoiNames for caching More...
 

Private Member Functions

void initMessaging () const
 Initialize our message level and MessageSvc. More...
 

Private Attributes

std::string m_anaTag
 TrackAnalysis properties. More...
 
ITrackAnalysisDefinitionSvcm_trkAnaDefSvc
 
const xAOD::TruthParticleContainerm_truthPartContainer {nullptr}
 — Collections class variables — Full collections More...
 
const xAOD::TrackParticleContainerm_offlTrackContainer {nullptr}
 
const xAOD::TrackParticleContainerm_trigTrackContainer {nullptr}
 
std::vector< std::vector< const xAOD::TruthParticle * > > m_truthPartVec {}
 vectors of track/truth particles at different stages of the selection/workflow More...
 
std::vector< std::vector< const xAOD::TrackParticle * > > m_offlTrackVec {}
 
std::vector< std::vector< const xAOD::TrackParticle * > > m_trigTrackVec {}
 
std::vector< const xAOD::TrackParticle * > m_nullTrackVec {}
 null vectors More...
 
std::vector< const xAOD::TruthParticle * > m_nullTruthVec {}
 
std::unique_ptr< ITrackMatchingLookupm_matches
 Lookup table for test-reference matching. More...
 
mapChainRoi_t m_chainRois {}
 
std::string m_nm
 Message source name. More...
 
boost::thread_specific_ptr< MsgStream > m_msg_tls
 MsgStream instance (a std::cout like with print-out levels) More...
 
std::atomic< IMessageSvc * > m_imsg { nullptr }
 MessageSvc pointer. More...
 
std::atomic< MSG::Level > m_lvl { MSG::NIL }
 Current logging level. More...
 
std::atomic_flag m_initialized ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
 Messaging initialized (initMessaging) More...
 

Detailed Description

Definition at line 41 of file TrackAnalysisCollections.h.

Member Typedef Documentation

◆ mapChainRoi_t

typedef std::unordered_map< std::string, std::string > IDTPM::TrackAnalysisCollections::mapChainRoi_t
private

map of chainRoiNames for caching

Definition at line 191 of file TrackAnalysisCollections.h.

Member Enumeration Documentation

◆ Stage

Enum for selection stages.

  • FULL = full track collections, no selectrions
  • FS = Full-Scan track collections, after quality-based selection
  • InRoI = selected track collections inside the RoI
Enumerator
FULL 
FS 
InRoI 
NStages 

Definition at line 49 of file TrackAnalysisCollections.h.

49 : size_t { FULL, FS, InRoI, NStages };

Constructor & Destructor Documentation

◆ TrackAnalysisCollections()

IDTPM::TrackAnalysisCollections::TrackAnalysisCollections ( const std::string &  anaTag)

Constructor.

local includes


— Constructor —

Definition at line 19 of file TrackAnalysisCollections.cxx.

20  :
21  AthMessaging( "TrackAnalysisCollections"+anaTag ),
22  m_anaTag( anaTag ), m_trkAnaDefSvc( nullptr )
23 {
24  m_truthPartVec.resize( NStages );
25  m_offlTrackVec.resize( NStages );
26  m_trigTrackVec.resize( NStages );
27 }

◆ ~TrackAnalysisCollections()

IDTPM::TrackAnalysisCollections::~TrackAnalysisCollections ( )
default

Destructor.

Member Function Documentation

◆ anaTag()

const std::string& IDTPM::TrackAnalysisCollections::anaTag ( )
inline

— Getter methods —

get TrackAnalysis tag

Definition at line 123 of file TrackAnalysisCollections.h.

123 { return m_anaTag; }

◆ clear()

void IDTPM::TrackAnalysisCollections::clear ( Stage  stage = FULL)

Clear vectors.

clear collections

Definition at line 314 of file TrackAnalysisCollections.cxx.

316 {
317  if( stage == FULL ) {
318  m_truthPartVec[ FULL ].clear();
319  m_offlTrackVec[ FULL ].clear();
320  m_trigTrackVec[ FULL ].clear();
321  }
322  if( stage == FULL or stage == FS ) {
323  m_truthPartVec[ FS ].clear();
324  m_offlTrackVec[ FS ].clear();
325  m_trigTrackVec[ FS ].clear();
326  }
327  if( stage == FULL or stage == FS or stage == InRoI ) {
328  m_truthPartVec[ InRoI ].clear();
329  m_offlTrackVec[ InRoI ].clear();
330  m_trigTrackVec[ InRoI ].clear();
331  }
332 }

◆ copyFS()

void IDTPM::TrackAnalysisCollections::copyFS ( )

copy content of FS vectors to InRoI vectors

copy inRoI collections from FullScan collections

offline copy

truth copy

EF trigger copy

Debug printout

Definition at line 335 of file TrackAnalysisCollections.cxx.

336 {
337  ATH_MSG_DEBUG( "Copying tracks in RoI" );
338 
340  m_offlTrackVec[ InRoI ].clear();
341  m_offlTrackVec[ InRoI ].insert(
343  m_offlTrackVec[ FS ].begin(),
344  m_offlTrackVec[ FS ].end() );
345 
347  m_truthPartVec[ InRoI ].clear();
348  m_truthPartVec[ InRoI ].insert(
350  m_truthPartVec[ FS ].begin(),
351  m_truthPartVec[ FS ].end() );
352 
354  if (m_trkAnaDefSvc->useEFTrigger()) {
355  m_trigTrackVec[ InRoI ].clear();
356  m_trigTrackVec[ InRoI ].insert(
358  m_trigTrackVec[ FS ].begin(),
359  m_trigTrackVec[ FS ].end() );
360  }
361 
363  ATH_MSG_DEBUG( "Tracks after in RoI copy: " << printInfo( InRoI ) );
364 }

◆ empty()

bool IDTPM::TrackAnalysisCollections::empty ( Stage  stage = FULL)

Utility methods —

check if collection are empty


— Utility methods —

empty

check if empty disabled for FS trigger track vector (always empty by construction)

Definition at line 293 of file TrackAnalysisCollections.cxx.

295 {
298  bool isTrigEmpty = m_trkAnaDefSvc->useTrigger() and not m_trkAnaDefSvc->useEFTrigger() and
300  m_trigTrackVec[ stage ].empty() : false;
301  bool isEFTrigEmpty = m_trkAnaDefSvc->useEFTrigger() ?
302  m_trigTrackVec[ stage ].empty() : false;
303  bool isOfflEmpty = m_trkAnaDefSvc->useOffline() ?
304  m_offlTrackVec[ stage ].empty() : false;
305  bool isTruthEmpty = m_trkAnaDefSvc->useTruth() ?
306  m_truthPartVec[ stage ].empty() : false;
307 
308  if( isTrigEmpty or isEFTrigEmpty or isOfflEmpty or isTruthEmpty ) return true;
309 
310  return false;
311 }

◆ fillOfflTrackContainer()

StatusCode IDTPM::TrackAnalysisCollections::fillOfflTrackContainer ( const SG::ReadHandleKey< xAOD::TrackParticleContainer > &  handleKey)

Offline track particles.

Fill container

Fill FULL vector

Definition at line 92 of file TrackAnalysisCollections.cxx.

94 {
95  if( m_trkAnaDefSvc->useOffline() ) {
96  ATH_MSG_DEBUG( "Loading collection: " << handleKey.key() );
97 
99 
100  if( not pColl.isValid() ) {
101  ATH_MSG_ERROR( "Non valid offline tracks collection: " << handleKey.key() );
102  return StatusCode::FAILURE;
103  }
104 
106  m_offlTrackContainer = pColl.ptr();
107 
109  m_offlTrackVec[ FULL ].clear();
110  m_offlTrackVec[ FULL ].insert(
112  pColl->begin(), pColl->end() );
113  } else {
114  m_offlTrackContainer = nullptr;
115  m_offlTrackVec[ FULL ].clear();
116  }
117 
118  return StatusCode::SUCCESS;
119 }

◆ fillOfflTrackVec()

StatusCode IDTPM::TrackAnalysisCollections::fillOfflTrackVec ( const std::vector< const xAOD::TrackParticle * > &  vec,
Stage  stage = FULL 
)

Offline tracks.

Definition at line 256 of file TrackAnalysisCollections.cxx.

259 {
260  if( m_trkAnaDefSvc->useOffline() ) {
261  m_offlTrackVec[ stage ].clear();
262  m_offlTrackVec[ stage ].insert(
264  vec.begin(), vec.end() );
265  return StatusCode::SUCCESS;
266  }
267 
268  ATH_MSG_DEBUG( "No Offline TrackParticle vector" );
269  return StatusCode::SUCCESS;
270 }

◆ fillRefTrackVec()

StatusCode IDTPM::TrackAnalysisCollections::fillRefTrackVec ( const std::vector< const xAOD::TrackParticle * > &  vec,
Stage  stage = FULL 
)

REFERENCE = tracks.

Definition at line 214 of file TrackAnalysisCollections.cxx.

217 {
219  m_offlTrackVec[ stage ].clear();
220  m_offlTrackVec[ stage ].insert(
222  vec.begin(), vec.end() );
223  return StatusCode::SUCCESS;
224  }
225 
227  m_trigTrackVec[ stage ].clear();
228  m_trigTrackVec[ stage ].insert(
230  vec.begin(), vec.end() );
231  return StatusCode::SUCCESS;
232  }
233 
234  ATH_MSG_DEBUG( "No REFERENCE TrackParticle vector" );
235  return StatusCode::SUCCESS;
236 }

◆ fillRefTruthVec()

StatusCode IDTPM::TrackAnalysisCollections::fillRefTruthVec ( const std::vector< const xAOD::TruthParticle * > &  vec,
Stage  stage = FULL 
)

fill REFERENCE vectors

REFERENCE = truth.

Definition at line 197 of file TrackAnalysisCollections.cxx.

200 {
202  m_truthPartVec[ stage ].clear();
203  m_truthPartVec[ stage ].insert(
205  vec.begin(), vec.end() );
206  return StatusCode::SUCCESS;
207  }
208 
209  ATH_MSG_DEBUG( "No REFERENCE TruthParticle vector" );
210  return StatusCode::SUCCESS;
211 }

◆ fillTestTrackVec()

StatusCode IDTPM::TrackAnalysisCollections::fillTestTrackVec ( const std::vector< const xAOD::TrackParticle * > &  vec,
Stage  stage = FULL 
)

TEST = tracks.

Definition at line 172 of file TrackAnalysisCollections.cxx.

175 {
176  if( m_trkAnaDefSvc->isTestOffline() ) {
177  m_offlTrackVec[ stage ].clear();
178  m_offlTrackVec[ stage ].insert(
180  vec.begin(), vec.end() );
181  return StatusCode::SUCCESS;
182  }
183 
184  if( m_trkAnaDefSvc->isTestTrigger() ) {
185  m_trigTrackVec[ stage ].clear();
186  m_trigTrackVec[ stage ].insert(
188  vec.begin(), vec.end() );
189  return StatusCode::SUCCESS;
190  }
191 
192  ATH_MSG_DEBUG( "No TEST TrackParticle vector");
193  return StatusCode::SUCCESS;
194 }

◆ fillTestTruthVec()

StatusCode IDTPM::TrackAnalysisCollections::fillTestTruthVec ( const std::vector< const xAOD::TruthParticle * > &  vec,
Stage  stage = FULL 
)

fill TEST vectors


— Fill TEST vectors —

TEST = truth

Definition at line 155 of file TrackAnalysisCollections.cxx.

158 {
159  if( m_trkAnaDefSvc->isTestTruth() ) {
160  m_truthPartVec[ stage ].clear();
161  m_truthPartVec[ stage ].insert(
163  vec.begin(), vec.end() );
164  return StatusCode::SUCCESS;
165  }
166 
167  ATH_MSG_DEBUG( "No TEST TruthParticle vector" );
168  return StatusCode::SUCCESS;
169 }

◆ fillTrigTrackContainer()

StatusCode IDTPM::TrackAnalysisCollections::fillTrigTrackContainer ( const SG::ReadHandleKey< xAOD::TrackParticleContainer > &  handleKey)

Trigger track particles.

Fill container

Fill FULL vector

Definition at line 122 of file TrackAnalysisCollections.cxx.

124 {
125  if( m_trkAnaDefSvc->useTrigger()) {
126  ATH_MSG_DEBUG( "Loading collection: " << handleKey.key() );
127 
129 
130  if( not pColl.isValid() ) {
131  ATH_MSG_ERROR( "Non valid trigger tracks collection: " << handleKey.key() );
132  return StatusCode::FAILURE;
133  }
134 
136  m_trigTrackContainer = pColl.ptr();
137 
139  m_trigTrackVec[ FULL ].clear();
140  m_trigTrackVec[ FULL ].insert(
142  pColl->begin(), pColl->end() );
143  } else {
144  m_trigTrackContainer = nullptr;
145  m_trigTrackVec[ FULL ].clear();
146  }
147 
148  return StatusCode::SUCCESS;
149 }

◆ fillTrigTrackVec()

StatusCode IDTPM::TrackAnalysisCollections::fillTrigTrackVec ( const std::vector< const xAOD::TrackParticle * > &  vec,
Stage  stage = FULL 
)

Trigger tracks.

Definition at line 273 of file TrackAnalysisCollections.cxx.

276 {
278  m_trigTrackVec[ stage ].clear();
279  m_trigTrackVec[ stage ].insert(
281  vec.begin(), vec.end() );
282  return StatusCode::SUCCESS;
283  }
284 
285  ATH_MSG_DEBUG( "No Trigger TrackParticle vector" );
286  return StatusCode::SUCCESS;
287 }

◆ fillTruthPartContainer()

StatusCode IDTPM::TrackAnalysisCollections::fillTruthPartContainer ( const SG::ReadHandleKey< xAOD::TruthParticleContainer > &  handleKey)

— Setter methods —

fill FULL collections and vectors


— Fill FULL containers —

Truth particles

Fill container

Fill FULL vector

Definition at line 62 of file TrackAnalysisCollections.cxx.

64 {
65  if( m_trkAnaDefSvc->useTruth() ) {
66  ATH_MSG_DEBUG( "Loading collection: " << handleKey.key() );
67 
69 
70  if( not pColl.isValid() ) {
71  ATH_MSG_ERROR( "Non valid truth particles collection: " << handleKey.key() );
72  return StatusCode::FAILURE;
73  }
74 
76  m_truthPartContainer = pColl.ptr();
77 
79  m_truthPartVec[ FULL ].clear();
80  m_truthPartVec[ FULL ].insert(
82  pColl->begin(), pColl->end() );
83  } else {
84  m_truthPartContainer = nullptr;
85  m_truthPartVec[ FULL ].clear();
86  }
87 
88  return StatusCode::SUCCESS;
89 }

◆ fillTruthPartVec()

StatusCode IDTPM::TrackAnalysisCollections::fillTruthPartVec ( const std::vector< const xAOD::TruthParticle * > &  vec,
Stage  stage = FULL 
)

get truth/offline/trigger track vector (TEST or REFERENCE)

Truth tracks.

Definition at line 239 of file TrackAnalysisCollections.cxx.

242 {
243  if( m_trkAnaDefSvc->useTruth() ) {
244  m_truthPartVec[ stage ].clear();
245  m_truthPartVec[ stage ].insert(
247  vec.begin(), vec.end() );
248  return StatusCode::SUCCESS;
249  }
250 
251  ATH_MSG_DEBUG( "No TruthParticle vector" );
252  return StatusCode::SUCCESS;
253 }

◆ initialize()

StatusCode IDTPM::TrackAnalysisCollections::initialize ( )

initialize


— initialize —

load trkAnaDefSvc

construct track matching lookup table based on the types of test and reference Truth->Track

Track->Truth

Track->Track

Definition at line 32 of file TrackAnalysisCollections.cxx.

33 {
35  if( not m_trkAnaDefSvc ) {
36  ISvcLocator* svcLoc = Gaudi::svcLocator();
37  ATH_CHECK( svcLoc->service( "TrkAnaDefSvc"+m_anaTag, m_trkAnaDefSvc ) );
38  }
39 
43  if( m_trkAnaDefSvc->isTestTruth() ) {
44  m_matches = std::make_unique< TrackMatchingLookup_truthTrk >( m_anaTag );
45  }
47  else if( m_trkAnaDefSvc->isReferenceTruth() ) {
48  m_matches = std::make_unique< TrackMatchingLookup_trkTruth >( m_anaTag );
49  }
51  else {
52  m_matches = std::make_unique< TrackMatchingLookup_trk >( m_anaTag );
53  }
54 
55  return StatusCode::SUCCESS;
56 }

◆ initMessaging()

void AthMessaging::initMessaging ( ) const
privateinherited

Initialize our message level and MessageSvc.

This method should only be called once.

Definition at line 39 of file AthMessaging.cxx.

40 {
42  m_lvl = m_imsg ?
43  static_cast<MSG::Level>( m_imsg.load()->outputLevel(m_nm) ) :
44  MSG::INFO;
45 }

◆ matches()

ITrackMatchingLookup& IDTPM::TrackAnalysisCollections::matches ( )
inline

return matching information

Definition at line 158 of file TrackAnalysisCollections.h.

158 { return *m_matches; }

◆ msg() [1/2]

MsgStream & AthMessaging::msg ( ) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 164 of file AthMessaging.h.

165 {
166  MsgStream* ms = m_msg_tls.get();
167  if (!ms) {
168  if (!m_initialized.test_and_set()) initMessaging();
169  ms = new MsgStream(m_imsg,m_nm);
170  m_msg_tls.reset( ms );
171  }
172 
173  ms->setLevel (m_lvl);
174  return *ms;
175 }

◆ msg() [2/2]

MsgStream & AthMessaging::msg ( const MSG::Level  lvl) const
inlineinherited

The standard message stream.

Returns a reference to the default message stream May not be invoked before sysInitialize() has been invoked.

Definition at line 179 of file AthMessaging.h.

180 { return msg() << lvl; }

◆ msgLvl()

bool AthMessaging::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Test the output level.

Parameters
lvlThe message level to test against
Returns
boolean Indicating if messages at given level will be printed
Return values
trueMessages at level "lvl" will be printed

Definition at line 151 of file AthMessaging.h.

152 {
153  if (!m_initialized.test_and_set()) initMessaging();
154  if (m_lvl <= lvl) {
155  msg() << lvl;
156  return true;
157  } else {
158  return false;
159  }
160 }

◆ offlTrackContainer()

const xAOD::TrackParticleContainer* IDTPM::TrackAnalysisCollections::offlTrackContainer ( )
inline

Definition at line 136 of file TrackAnalysisCollections.h.

136  {
137  return m_offlTrackContainer; }

◆ offlTrackVec()

const std::vector< const xAOD::TrackParticle* >& IDTPM::TrackAnalysisCollections::offlTrackVec ( Stage  stage = FULL)
inline

Definition at line 152 of file TrackAnalysisCollections.h.

152  {
153  return m_offlTrackVec[ stage ]; }

◆ operator=()

TrackAnalysisCollections& IDTPM::TrackAnalysisCollections::operator= ( const TrackAnalysisCollections )
delete

= operator

◆ printInfo()

std::string IDTPM::TrackAnalysisCollections::printInfo ( Stage  stage = FULL) const

print Information about tracks in the collection(s)


— Print collection info (for debug) —

print tracks

Definition at line 488 of file TrackAnalysisCollections.cxx.

490 {
491  std::stringstream ss;
492  ss << "\n==========================================" << std::endl;
493 
494  size_t it(0);
495  for( const xAOD::TrackParticle* thisOfflineTrack : m_offlTrackVec[ stage ] ) {
496  ss << "Offline track"
497  << " : pt = " << pT( *thisOfflineTrack )
498  << " : eta = " << eta( *thisOfflineTrack )
499  << " : phi = " << phi( *thisOfflineTrack )
500  << std::endl;
501  if( it > 20 ) { ss << "et al...." << std::endl; break; }
502  it++;
503  }
504 
505  if( not m_offlTrackVec[ stage ].empty() )
506  ss << "==========================================" << std::endl;
507 
508  it = 0;
509  for( const xAOD::TruthParticle* thisTruthParticle : m_truthPartVec[ stage ] ) {
510  ss << "Truth particle"
511  << " : pt = " << pT( *thisTruthParticle )
512  << " : eta = " << eta( *thisTruthParticle )
513  << " : phi = " << phi( *thisTruthParticle )
514  << std::endl;
515  if( it > 20 ) { ss << "et al...." << std::endl; break; }
516  it++;
517  }
518 
519  if( not m_truthPartVec[ stage ].empty() )
520  ss << "==========================================" << std::endl;
521 
522  it = 0;
523  for( const xAOD::TrackParticle* thisTriggerTrack : m_trigTrackVec[ stage ] ) {
524  ss << "Trigger track"
525  << " : pt = " << pT( *thisTriggerTrack )
526  << " : eta = " << eta( *thisTriggerTrack )
527  << " : phi = " << phi( *thisTriggerTrack )
528  << std::endl;
529  if( it > 20 ) { ss << "et al...." << std::endl; break; }
530  it++;
531  }
532 
533  if( not m_trigTrackVec[ stage ].empty() )
534  ss << "==========================================" << std::endl;
535 
536  return ss.str();
537 }

◆ printMatchInfo()

std::string IDTPM::TrackAnalysisCollections::printMatchInfo ( )

print matching information


— Print matching information (for debug) —

Truth->Track

Track->Truth

Track->Track

Definition at line 543 of file TrackAnalysisCollections.cxx.

544 {
546  if( m_trkAnaDefSvc->isTestTruth() ) {
547  return m_matches->printInfo( testTruthVec( InRoI ), refTrackVec( InRoI ) );
548  }
551  return m_matches->printInfo( testTrackVec( InRoI ), refTruthVec( InRoI ) );
552  }
554  return m_matches->printInfo( testTrackVec( InRoI ), refTrackVec( InRoI ) );
555 }

◆ refTrackContainer()

const xAOD::TrackParticleContainer * IDTPM::TrackAnalysisCollections::refTrackContainer ( )

REFERENCE = Track.

Definition at line 408 of file TrackAnalysisCollections.cxx.

409 {
411  return m_offlTrackContainer;
412  }
413 
415  return m_trigTrackContainer;
416  }
417 
418  return nullptr;
419 }

◆ refTrackVec()

const std::vector< const xAOD::TrackParticle * > & IDTPM::TrackAnalysisCollections::refTrackVec ( Stage  stage = FULL)

TEST = Track.

Definition at line 469 of file TrackAnalysisCollections.cxx.

471 {
473  return m_offlTrackVec[ stage ];
474  }
475 
477  return m_trigTrackVec[ stage ];
478  }
479 
480  ATH_MSG_DEBUG( "No Test track vector found" );
481  return m_nullTrackVec;
482 }

◆ refTruthContainer()

const xAOD::TruthParticleContainer * IDTPM::TrackAnalysisCollections::refTruthContainer ( )

get full REFERENCE containers

REFERENCE = Truth.

Definition at line 397 of file TrackAnalysisCollections.cxx.

398 {
400  return m_truthPartContainer;
401  }
402 
403  return nullptr;
404 }

◆ refTruthVec()

const std::vector< const xAOD::TruthParticle * > & IDTPM::TrackAnalysisCollections::refTruthVec ( Stage  stage = FULL)

get REFERENCE track vectors

REFERENCE = Truth.

Definition at line 456 of file TrackAnalysisCollections.cxx.

458 {
460  return m_truthPartVec[ stage ];
461  }
462 
463  ATH_MSG_DEBUG( "No Reference truth vector found" );
464  return m_nullTruthVec;
465 }

◆ setLevel()

void AthMessaging::setLevel ( MSG::Level  lvl)
inherited

Change the current logging level.

Use this rather than msg().setLevel() for proper operation with MT.

Definition at line 28 of file AthMessaging.cxx.

29 {
30  m_lvl = lvl;
31 }

◆ testTrackContainer()

const xAOD::TrackParticleContainer * IDTPM::TrackAnalysisCollections::testTrackContainer ( )

TEST = Track.

Definition at line 382 of file TrackAnalysisCollections.cxx.

383 {
384  if( m_trkAnaDefSvc->isTestOffline() ) {
385  return m_offlTrackContainer;
386  }
387 
388  if( m_trkAnaDefSvc->isTestTrigger() ) {
389  return m_trigTrackContainer;
390  }
391 
392  return nullptr;
393 }

◆ testTrackVec()

const std::vector< const xAOD::TrackParticle * > & IDTPM::TrackAnalysisCollections::testTrackVec ( Stage  stage = FULL)

TEST = Track.

Definition at line 439 of file TrackAnalysisCollections.cxx.

441 {
442  if( m_trkAnaDefSvc->isTestOffline() ) {
443  return m_offlTrackVec[ stage ];
444  }
445 
446  if( m_trkAnaDefSvc->isTestTrigger() ) {
447  return m_trigTrackVec[ stage ];
448  }
449 
450  ATH_MSG_DEBUG( "No Test track vector found" );
451  return m_nullTrackVec;
452 }

◆ testTruthContainer()

const xAOD::TruthParticleContainer * IDTPM::TrackAnalysisCollections::testTruthContainer ( )

get full TEST containers


— Get FULL containers —

TEST = Truth

Definition at line 371 of file TrackAnalysisCollections.cxx.

372 {
373  if( m_trkAnaDefSvc->isTestTruth() ) {
374  return m_truthPartContainer;
375  }
376 
377  return nullptr;
378 }

◆ testTruthVec()

const std::vector< const xAOD::TruthParticle * > & IDTPM::TrackAnalysisCollections::testTruthVec ( Stage  stage = FULL)

get TEST track vectors


— Get track vectors —

TEST = Truth

Definition at line 426 of file TrackAnalysisCollections.cxx.

428 {
429  if( m_trkAnaDefSvc->isTestTruth() ) {
430  return m_truthPartVec[ stage ];
431  }
432 
433  ATH_MSG_DEBUG( "No Test truth vector found" );
434  return m_nullTruthVec;
435 }

◆ trigTrackContainer()

const xAOD::TrackParticleContainer* IDTPM::TrackAnalysisCollections::trigTrackContainer ( )
inline

Definition at line 138 of file TrackAnalysisCollections.h.

138  {
139  return m_trigTrackContainer; }

◆ trigTrackVec()

const std::vector< const xAOD::TrackParticle* >& IDTPM::TrackAnalysisCollections::trigTrackVec ( Stage  stage = FULL)
inline

Definition at line 154 of file TrackAnalysisCollections.h.

154  {
155  return m_trigTrackVec[ stage ]; }

◆ truthPartContainer()

const xAOD::TruthParticleContainer* IDTPM::TrackAnalysisCollections::truthPartContainer ( )
inline

get truth/offline/trigger track containers (TEST or REFERENCE)

Definition at line 134 of file TrackAnalysisCollections.h.

134  {
135  return m_truthPartContainer; }

◆ truthPartVec()

const std::vector< const xAOD::TruthParticle* >& IDTPM::TrackAnalysisCollections::truthPartVec ( Stage  stage = FULL)
inline

get truth/offline/trigger track vector (TEST or REFERENCE)

Definition at line 150 of file TrackAnalysisCollections.h.

150  {
151  return m_truthPartVec[ stage ]; }

◆ updateChainRois()

bool IDTPM::TrackAnalysisCollections::updateChainRois ( const std::string &  chainRoi,
const std::string &  roiStr 
)

update chainRois map


— update chainRois map —

Creating new matching lookup table for newChainRoiName

m_matches is now ready to be updated with new entries for the maps...

Definition at line 561 of file TrackAnalysisCollections.cxx.

563 {
564  ATH_MSG_DEBUG( "Updating TrackAnalysisCollection with ChainRoiName: " << chainRoi );
565 
566  std::pair< mapChainRoi_t::iterator, bool > result =
567  m_chainRois.insert( mapChainRoi_t::value_type( chainRoi, roiStr ) );
568 
569  if( not result.second ) {
570  ATH_MSG_WARNING( "ChainRoiName has already been cached. No update." );
571  return false;
572  }
573 
575  m_matches->clear();
576  m_matches->chainRoiName( chainRoi );
578 
579  return result.second;
580 }

Member Data Documentation

◆ ATLAS_THREAD_SAFE

std::atomic_flag m_initialized AthMessaging::ATLAS_THREAD_SAFE = ATOMIC_FLAG_INIT
mutableprivateinherited

Messaging initialized (initMessaging)

Definition at line 141 of file AthMessaging.h.

◆ m_anaTag

std::string IDTPM::TrackAnalysisCollections::m_anaTag
private

TrackAnalysis properties.

Definition at line 169 of file TrackAnalysisCollections.h.

◆ m_chainRois

mapChainRoi_t IDTPM::TrackAnalysisCollections::m_chainRois {}
private

Definition at line 192 of file TrackAnalysisCollections.h.

◆ m_imsg

std::atomic<IMessageSvc*> AthMessaging::m_imsg { nullptr }
mutableprivateinherited

MessageSvc pointer.

Definition at line 135 of file AthMessaging.h.

◆ m_lvl

std::atomic<MSG::Level> AthMessaging::m_lvl { MSG::NIL }
mutableprivateinherited

Current logging level.

Definition at line 138 of file AthMessaging.h.

◆ m_matches

std::unique_ptr< ITrackMatchingLookup > IDTPM::TrackAnalysisCollections::m_matches
private

Lookup table for test-reference matching.

Definition at line 188 of file TrackAnalysisCollections.h.

◆ m_msg_tls

boost::thread_specific_ptr<MsgStream> AthMessaging::m_msg_tls
mutableprivateinherited

MsgStream instance (a std::cout like with print-out levels)

Definition at line 132 of file AthMessaging.h.

◆ m_nm

std::string AthMessaging::m_nm
privateinherited

Message source name.

Definition at line 129 of file AthMessaging.h.

◆ m_nullTrackVec

std::vector< const xAOD::TrackParticle* > IDTPM::TrackAnalysisCollections::m_nullTrackVec {}
private

null vectors

Definition at line 184 of file TrackAnalysisCollections.h.

◆ m_nullTruthVec

std::vector< const xAOD::TruthParticle* > IDTPM::TrackAnalysisCollections::m_nullTruthVec {}
private

Definition at line 185 of file TrackAnalysisCollections.h.

◆ m_offlTrackContainer

const xAOD::TrackParticleContainer* IDTPM::TrackAnalysisCollections::m_offlTrackContainer {nullptr}
private

Definition at line 175 of file TrackAnalysisCollections.h.

◆ m_offlTrackVec

std::vector<std::vector< const xAOD::TrackParticle* > > IDTPM::TrackAnalysisCollections::m_offlTrackVec {}
private

Definition at line 180 of file TrackAnalysisCollections.h.

◆ m_trigTrackContainer

const xAOD::TrackParticleContainer* IDTPM::TrackAnalysisCollections::m_trigTrackContainer {nullptr}
private

Definition at line 176 of file TrackAnalysisCollections.h.

◆ m_trigTrackVec

std::vector<std::vector< const xAOD::TrackParticle* > > IDTPM::TrackAnalysisCollections::m_trigTrackVec {}
private

Definition at line 181 of file TrackAnalysisCollections.h.

◆ m_trkAnaDefSvc

ITrackAnalysisDefinitionSvc* IDTPM::TrackAnalysisCollections::m_trkAnaDefSvc
private

Definition at line 170 of file TrackAnalysisCollections.h.

◆ m_truthPartContainer

const xAOD::TruthParticleContainer* IDTPM::TrackAnalysisCollections::m_truthPartContainer {nullptr}
private

— Collections class variables — Full collections

Definition at line 174 of file TrackAnalysisCollections.h.

◆ m_truthPartVec

std::vector<std::vector< const xAOD::TruthParticle* > > IDTPM::TrackAnalysisCollections::m_truthPartVec {}
private

vectors of track/truth particles at different stages of the selection/workflow

Definition at line 179 of file TrackAnalysisCollections.h.


The documentation for this class was generated from the following files:
AthMessaging::m_lvl
std::atomic< MSG::Level > m_lvl
Current logging level.
Definition: AthMessaging.h:138
ITrackAnalysisDefinitionSvc::useEFTrigger
virtual bool useEFTrigger() const =0
IDTPM::TrackAnalysisCollections::m_matches
std::unique_ptr< ITrackMatchingLookup > m_matches
Lookup table for test-reference matching.
Definition: TrackAnalysisCollections.h:188
ITrackAnalysisDefinitionSvc::useOffline
virtual bool useOffline() const =0
get_generator_info.result
result
Definition: get_generator_info.py:21
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
python.FPGATrackSimAnalysisConfig.stage
stage
Definition: FPGATrackSimAnalysisConfig.py:604
IDTPM::TrackAnalysisCollections::NStages
@ NStages
Definition: TrackAnalysisCollections.h:49
IDTPM::TrackAnalysisCollections::m_offlTrackVec
std::vector< std::vector< const xAOD::TrackParticle * > > m_offlTrackVec
Definition: TrackAnalysisCollections.h:180
IDTPM::TrackAnalysisCollections::m_trigTrackVec
std::vector< std::vector< const xAOD::TrackParticle * > > m_trigTrackVec
Definition: TrackAnalysisCollections.h:181
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
IDTPM::TrackAnalysisCollections::m_nullTrackVec
std::vector< const xAOD::TrackParticle * > m_nullTrackVec
null vectors
Definition: TrackAnalysisCollections.h:184
PlotCalibFromCool.begin
begin
Definition: PlotCalibFromCool.py:94
skel.it
it
Definition: skel.GENtoEVGEN.py:423
IDTPM::TrackAnalysisCollections::m_offlTrackContainer
const xAOD::TrackParticleContainer * m_offlTrackContainer
Definition: TrackAnalysisCollections.h:175
ITrackAnalysisDefinitionSvc::isTestOffline
virtual bool isTestOffline() const =0
vec
std::vector< size_t > vec
Definition: CombinationsGeneratorTest.cxx:12
IDTPM::TrackAnalysisCollections::m_nullTruthVec
std::vector< const xAOD::TruthParticle * > m_nullTruthVec
Definition: TrackAnalysisCollections.h:185
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
AthMessaging::m_imsg
std::atomic< IMessageSvc * > m_imsg
MessageSvc pointer.
Definition: AthMessaging.h:135
python.SystemOfUnits.ms
int ms
Definition: SystemOfUnits.py:132
IDTPM::phi
float phi(const U &p)
Accessor utility function for getting the value of phi.
Definition: TrackParametersHelper.h:53
Athena::getMessageSvc
IMessageSvc * getMessageSvc(bool quiet=false)
Definition: getMessageSvc.cxx:20
mergePhysValFiles.end
end
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:93
ITrackAnalysisDefinitionSvc::isReferenceTruth
virtual bool isReferenceTruth() const =0
IDTPM::TrackAnalysisCollections::testTrackVec
const std::vector< const xAOD::TrackParticle * > & testTrackVec(Stage stage=FULL)
TEST = Track.
Definition: TrackAnalysisCollections.cxx:439
AthMessaging::AthMessaging
AthMessaging()
Default constructor:
IDTPM::TrackAnalysisCollections::m_trigTrackContainer
const xAOD::TrackParticleContainer * m_trigTrackContainer
Definition: TrackAnalysisCollections.h:176
TrigConf::MSGTC::Level
Level
Definition: Trigger/TrigConfiguration/TrigConfBase/TrigConfBase/MsgStream.h:21
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ITrackAnalysisDefinitionSvc::useTrigger
virtual bool useTrigger() const =0
IDTPM::eta
float eta(const U &p)
Accessor utility function for getting the value of eta.
Definition: TrackParametersHelper.h:40
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
IDTPM::TrackAnalysisCollections::FS
@ FS
Definition: TrackAnalysisCollections.h:49
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
IDTPM::pT
float pT(const U &p)
Accessor utility function for getting the value of pT.
Definition: TrackParametersHelper.h:30
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
AthMessaging::msg
MsgStream & msg() const
The standard message stream.
Definition: AthMessaging.h:164
ITrackAnalysisDefinitionSvc::isTestTruth
virtual bool isTestTruth() const =0
ITrackAnalysisDefinitionSvc::isReferenceOffline
virtual bool isReferenceOffline() const =0
ITrackAnalysisDefinitionSvc::isReferenceTrigger
virtual bool isReferenceTrigger() const =0
IDTPM::TrackAnalysisCollections::m_truthPartContainer
const xAOD::TruthParticleContainer * m_truthPartContainer
— Collections class variables — Full collections
Definition: TrackAnalysisCollections.h:174
IDTPM::TrackAnalysisCollections::refTrackVec
const std::vector< const xAOD::TrackParticle * > & refTrackVec(Stage stage=FULL)
TEST = Track.
Definition: TrackAnalysisCollections.cxx:469
IDTPM::TrackAnalysisCollections::m_trkAnaDefSvc
ITrackAnalysisDefinitionSvc * m_trkAnaDefSvc
Definition: TrackAnalysisCollections.h:170
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
IDTPM::TrackAnalysisCollections::InRoI
@ InRoI
Definition: TrackAnalysisCollections.h:49
ITrackAnalysisDefinitionSvc::useTruth
virtual bool useTruth() const =0
AthMessaging::m_nm
std::string m_nm
Message source name.
Definition: AthMessaging.h:129
IDTPM::TrackAnalysisCollections::printInfo
std::string printInfo(Stage stage=FULL) const
print Information about tracks in the collection(s)
Definition: TrackAnalysisCollections.cxx:488
IDTPM::TrackAnalysisCollections::testTruthVec
const std::vector< const xAOD::TruthParticle * > & testTruthVec(Stage stage=FULL)
get TEST track vectors
Definition: TrackAnalysisCollections.cxx:426
IDTPM::TrackAnalysisCollections::empty
bool empty(Stage stage=FULL)
— Utility methods —
Definition: TrackAnalysisCollections.cxx:293
IDTPM::TrackAnalysisCollections::m_anaTag
std::string m_anaTag
TrackAnalysis properties.
Definition: TrackAnalysisCollections.h:169
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
AthMessaging::initMessaging
void initMessaging() const
Initialize our message level and MessageSvc.
Definition: AthMessaging.cxx:39
IDTPM::TrackAnalysisCollections::FULL
@ FULL
Definition: TrackAnalysisCollections.h:49
AthMessaging::m_msg_tls
boost::thread_specific_ptr< MsgStream > m_msg_tls
MsgStream instance (a std::cout like with print-out levels)
Definition: AthMessaging.h:132
IDTPM::TrackAnalysisCollections::anaTag
const std::string & anaTag()
— Getter methods —
Definition: TrackAnalysisCollections.h:123
IDTPM::TrackAnalysisCollections::m_chainRois
mapChainRoi_t m_chainRois
Definition: TrackAnalysisCollections.h:192
ITrackAnalysisDefinitionSvc::isTestTrigger
virtual bool isTestTrigger() const =0
IDTPM::TrackAnalysisCollections::m_truthPartVec
std::vector< std::vector< const xAOD::TruthParticle * > > m_truthPartVec
vectors of track/truth particles at different stages of the selection/workflow
Definition: TrackAnalysisCollections.h:179
IDTPM::TrackAnalysisCollections::refTruthVec
const std::vector< const xAOD::TruthParticle * > & refTruthVec(Stage stage=FULL)
get REFERENCE track vectors
Definition: TrackAnalysisCollections.cxx:456