ATLAS Offline Software
TrackAnalysisPlotsMgr.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
11 #include "TrackAnalysisPlotsMgr.h"
14 #include "ITrackMatchingLookup.h"
16 
18 #include "GaudiKernel/ISvcLocator.h"
19 #include "GaudiKernel/Service.h"
20 
21 
26  const std::string& dirName,
27  const std::string& anaTag,
28  const std::string& chain,
29  PlotMgr* pParent ) :
30  PlotMgr( dirName, anaTag, pParent ),
31  m_anaTag( anaTag ), m_chain( chain ),
32  m_directory( dirName ) { }
33 
34 
39 {
40  ATH_MSG_DEBUG( "Initialising in directory: " << m_directory );
41 
43  m_trkAnaDefSvc = Gaudi::svcLocator()->service( "TrkAnaDefSvc"+m_anaTag );
44  ATH_CHECK( m_trkAnaDefSvc.isValid() );
45 
47  if( m_trkAnaDefSvc->plotTrackParameters() ) {
48  m_plots_trkParam_vsTest = std::make_unique< TrackParametersPlots >(
49  this, "Tracks/Parameters", m_anaTag, m_trkAnaDefSvc->testTag() );
50  m_plots_trkParam_vsRef = std::make_unique< TrackParametersPlots >(
51  this, "Tracks/Parameters", m_anaTag, m_trkAnaDefSvc->referenceTag() );
52  }
53 
55  if( m_trkAnaDefSvc->plotTrackMultiplicities() ) {
56  m_plots_nTracks_test = std::make_unique< NtracksPlots >(
57  this, "Tracks/Multiplicities", m_anaTag, m_trkAnaDefSvc->testTag(),
58  m_trkAnaDefSvc->useTrigger() and not m_trkAnaDefSvc->useEFTrigger(), true );
59  m_plots_nTracks_ref = std::make_unique< NtracksPlots >(
60  this, "Tracks/Multiplicities", m_anaTag, m_trkAnaDefSvc->referenceTag(),
61  m_trkAnaDefSvc->useTrigger() and not m_trkAnaDefSvc->useEFTrigger() );
62  }
63 
65  if( m_trkAnaDefSvc->plotEfficiencies() ) {
66  m_plots_eff_vsTest = std::make_unique< EfficiencyPlots >(
67  this, "Tracks/Efficiencies", m_anaTag, m_trkAnaDefSvc->testTag() );
68  m_plots_eff_vsRef = std::make_unique< EfficiencyPlots >(
69  this, "Tracks/Efficiencies", m_anaTag, m_trkAnaDefSvc->referenceTag(), true );
70  if( m_trkAnaDefSvc->matchingType() == "EFTruthMatch" ) {
71  m_plots_eff_vsTruth = std::make_unique< EfficiencyPlots >(
72  this, "Tracks/Efficiencies", m_anaTag, "truth" );
73  }
74  }
75 
77  if( m_trkAnaDefSvc->plotTechnicalEfficiencies()) {
78  m_plots_tech_eff_vsTest = std::make_unique< EfficiencyPlots >(
79  this, "Tracks/Efficiencies/Technical", m_anaTag, m_trkAnaDefSvc->testTag());
80  m_plots_tech_eff_vsRef = std::make_unique< EfficiencyPlots >(
81  this, "Tracks/Efficiencies/Technical", m_anaTag, m_trkAnaDefSvc->referenceTag(), true );
82  if( m_trkAnaDefSvc->matchingType() == "EFTruthMatch" ) {
83  m_plots_tech_eff_vsTruth = std::make_unique< EfficiencyPlots >(
84  this, "Tracks/Efficiencies/Technical", m_anaTag, "truth" );
85  }
86  }
87 
89  if( m_trkAnaDefSvc->plotResolutions() ) {
90  m_plots_resolution = std::make_unique< ResolutionPlots >(
91  this, "Tracks/Resolutions", m_anaTag,
92  m_trkAnaDefSvc->testTag(), m_trkAnaDefSvc->referenceTag(),
93  m_trkAnaDefSvc->resolutionMethod() );
94  }
95 
97  if( m_trkAnaDefSvc->plotFakeRates() and m_trkAnaDefSvc->isReferenceTruth() ) {
98  m_plots_fakeRate = std::make_unique< FakeRatePlots >(
99  this, "Tracks/FakeRates", m_anaTag, m_trkAnaDefSvc->testTag(), true );
100  if ( not m_trkAnaDefSvc->unlinkedAsFakes() ) {
101  m_plots_missingTruth = std::make_unique< FakeRatePlots >(
102  this, "Tracks/FakeRates/Unlinked", m_anaTag, m_trkAnaDefSvc->testTag(), true );
103  }
104  }
105 
107  if( m_trkAnaDefSvc->plotDuplicateRates() ) {
108  m_plots_duplRate = std::make_unique< DuplicateRatePlots >(
109  this, "Tracks/Duplicates", m_anaTag, m_trkAnaDefSvc->referenceTag(), true );
110  }
111 
114  if( m_trkAnaDefSvc->plotHitsOnTracks() and not m_trkAnaDefSvc->isTestTruth() ) {
115  m_plots_hitsOnTrk_vsTest = std::make_unique< HitsOnTracksPlots >(
116  this, "Tracks/HitsOnTracks", m_anaTag,
117  m_trkAnaDefSvc->testTag(), m_trkAnaDefSvc->isITk(), true );
118  }
119  if( m_trkAnaDefSvc->plotHitsOnTracksReference() and not m_trkAnaDefSvc->isReferenceTruth() ) {
120  m_plots_hitsOnTrk_vsRef = std::make_unique< HitsOnTracksPlots >(
121  this, "Tracks/HitsOnTracks", m_anaTag,
122  m_trkAnaDefSvc->referenceTag(), m_trkAnaDefSvc->isITk() );
123  }
125  if( m_trkAnaDefSvc->plotHitsOnMatchedTracks() and not m_trkAnaDefSvc->isTestTruth() ) {
126  m_plots_hitsOnMatchedTrk = std::make_unique< HitsOnTracksPlots >(
127  this, "Tracks/Resolutions/HitsOnTracks", m_anaTag,
128  m_trkAnaDefSvc->testTag(), m_trkAnaDefSvc->isITk(), true );
129  m_plots_hitsOnMatchedTrk_vsRef = std::make_unique< HitsOnTracksPlots >(
130  this, "Tracks/Resolutions/HitsOnTracks", m_anaTag,
131  m_trkAnaDefSvc->testTag(), m_trkAnaDefSvc->referenceTag(), m_trkAnaDefSvc->isITk() );
132  }
134  if( m_trkAnaDefSvc->plotHitsOnFakeTracks() and m_trkAnaDefSvc->isReferenceTruth() ) {
135  m_plots_hitsOnFakeTrk = std::make_unique< HitsOnTracksPlots >(
136  this, "Tracks/FakeRates/HitsOnTracks", m_anaTag,
137  m_trkAnaDefSvc->testTag(), m_trkAnaDefSvc->isITk(), true );
138  if ( not m_trkAnaDefSvc->unlinkedAsFakes() ) {
139  m_plots_hitsOnUnlinkedTrk = std::make_unique< HitsOnTracksPlots >(
140  this, "Tracks/FakeRates/Unlinked/HitsOnTracks", m_anaTag,
141  m_trkAnaDefSvc->testTag(), m_trkAnaDefSvc->isITk(), true );
142  }
143  }
144 
146  if( m_trkAnaDefSvc->plotOfflineElectrons() ) {
147  m_plots_offEle = std::make_unique< OfflineElectronPlots >(
148  this, "Tracks/Parameters", m_anaTag );
149  if( m_trkAnaDefSvc->plotEfficiencies() ) {
150  m_plots_eff_vsOffEle = std::make_unique< OfflineElectronPlots >(
151  this, "Tracks/Efficiencies", m_anaTag, true );
152  }
153  }
154 
157 
158  return StatusCode::SUCCESS;
159 }
160 
161 
166  TrackAnalysisCollections& trkAnaColls, float weight )
167 {
168  float actualMu = trkAnaColls.eventInfo() ?
169  trkAnaColls.eventInfo()->actualInteractionsPerCrossing() : 0.;
170  float truthMu = 0.; // TODO - do proper calculation
171 
173  if( m_trkAnaDefSvc->isTestTruth() ) {
174  ATH_CHECK( fillPlotsTest(
176  trkAnaColls.matches(), truthMu, actualMu, weight ) );
177  } else {
178  ATH_CHECK( fillPlotsTest(
180  trkAnaColls.matches(), truthMu, actualMu, weight ) );
181  }
182 
184  if( m_trkAnaDefSvc->isReferenceTruth() ) {
185  ATH_CHECK( fillPlotsReference(
187  trkAnaColls.matches(), truthMu, actualMu, weight ) );
188  } else {
189  ATH_CHECK( fillPlotsReference(
191  trkAnaColls.matches(), truthMu, actualMu, weight ) );
192  }
193 
195  if( m_trkAnaDefSvc->matchingType() == "EFTruthMatch" ) {
196  ATH_CHECK( fillPlotsTruth(
200  trkAnaColls.matches(), truthMu, actualMu, weight ) );
201  }
202 
204  if( m_plots_nTracks_test ) {
205  std::vector< unsigned int > countsTest( NtracksPlots::NCOUNTERS, 0 );
206  countsTest[ NtracksPlots::ALL ] = m_trkAnaDefSvc->isTestTruth() ?
207  trkAnaColls.testTruthVec( TrackAnalysisCollections::FULL ).size() :
208  trkAnaColls.testTrackVec( TrackAnalysisCollections::FULL ).size();
209  countsTest[ NtracksPlots::FS ] = m_trkAnaDefSvc->isTestTruth() ?
210  trkAnaColls.testTruthVec( TrackAnalysisCollections::FS ).size() :
211  trkAnaColls.testTrackVec( TrackAnalysisCollections::FS ).size();
212  countsTest[ NtracksPlots::INROI ] = m_trkAnaDefSvc->isTestTruth() ?
213  trkAnaColls.testTruthVec( TrackAnalysisCollections::InRoI ).size() :
214  trkAnaColls.testTrackVec( TrackAnalysisCollections::InRoI ).size();
215  countsTest[ NtracksPlots::MATCHED ] = trkAnaColls.matches().getNmatches();
216 
217  ATH_CHECK( m_plots_nTracks_test->fillPlots( countsTest, truthMu, actualMu, weight ) );
218  }
219 
220  if( m_plots_nTracks_ref ) {
221  std::vector< unsigned int > countsRef( NtracksPlots::NCOUNTERS, 0 );
222  countsRef[ NtracksPlots::ALL ] = m_trkAnaDefSvc->isReferenceTruth() ?
223  trkAnaColls.refTruthVec( TrackAnalysisCollections::FULL ).size() :
224  trkAnaColls.refTrackVec( TrackAnalysisCollections::FULL ).size();
225  countsRef[ NtracksPlots::FS ] = m_trkAnaDefSvc->isReferenceTruth() ?
226  trkAnaColls.refTruthVec( TrackAnalysisCollections::FS ).size() :
227  trkAnaColls.refTrackVec( TrackAnalysisCollections::FS ).size();
228  countsRef[ NtracksPlots::INROI ] = m_trkAnaDefSvc->isReferenceTruth() ?
229  trkAnaColls.refTruthVec( TrackAnalysisCollections::InRoI ).size() :
230  trkAnaColls.refTrackVec( TrackAnalysisCollections::InRoI ).size();
231  countsRef[ NtracksPlots::MATCHED ] = trkAnaColls.matches().getNmatches( true );
232 
233  ATH_CHECK( m_plots_nTracks_ref->fillPlots( countsRef, truthMu, actualMu, weight ) );
234  }
235 
236  return StatusCode::SUCCESS;
237 }
238 
239 
243 template< typename PARTICLE >
245  const std::vector< const PARTICLE* >& particles,
246  const ITrackMatchingLookup& matches,
247  float truthMu, float actualMu, float weight )
248 {
249 
250  for( const PARTICLE* particle : particles ) {
252  if( m_plots_trkParam_vsTest ) {
253  ATH_CHECK( m_plots_trkParam_vsTest->fillPlots( *particle, weight ) );
254  }
255 
257  if( m_plots_hitsOnTrk_vsTest ) {
258  ATH_CHECK( m_plots_hitsOnTrk_vsTest->fillPlots( *particle, truthMu, actualMu, weight ) );
259  }
260 
261  bool isMatched = matches.isTestMatched( *particle );
262 
264  if( m_plots_eff_vsTest ) {
265  ATH_CHECK( m_plots_eff_vsTest->fillPlots(
266  *particle, isMatched, truthMu, actualMu, weight ) );
267  }
268 
270  if( m_plots_tech_eff_vsTest ) {
271  if ( m_trkAnaDefSvc->isTestTruth() and
272  isReconstructable( *particle, m_trkAnaDefSvc->minSilHits(), m_trkAnaDefSvc->etaBins() )) {
273  ATH_CHECK( m_plots_tech_eff_vsTest->fillPlots(
274  *particle, isMatched, truthMu, actualMu, weight ) );
275  }
276  else if ( m_trkAnaDefSvc->isReferenceTruth() ) {
277  bool isTechMatched = isMatched ?
278  isReconstructable( *(matches.getMatchedRefTruth( *particle )), m_trkAnaDefSvc->minSilHits(), m_trkAnaDefSvc->etaBins() ) : false;
279  ATH_CHECK( m_plots_tech_eff_vsTest->fillPlots(
280  *particle, isTechMatched, truthMu, actualMu, weight ) );
281  }
282  else if ( m_trkAnaDefSvc->matchingType() == "EFTruthMatch" ) {
283  const xAOD::TruthParticle* linkedTruth = getLinkedTruth(
284  *particle, m_trkAnaDefSvc->truthProbCut() );
285  bool isTechMatched = isMatched ?
286  isReconstructable( *linkedTruth, m_trkAnaDefSvc->minSilHits(), m_trkAnaDefSvc->etaBins() ) : false;
287  ATH_CHECK( m_plots_tech_eff_vsTest->fillPlots(
288  *particle, isTechMatched, truthMu, actualMu, weight ) );
289  }
290  }
291 
293  if( m_plots_resolution ) {
294  if( isMatched ) {
295  if( m_trkAnaDefSvc->isReferenceTruth() ) {
296  ATH_CHECK( m_plots_resolution->fillPlots(
297  *particle, *(matches.getMatchedRefTruth( *particle )), weight ) );
298  } else {
299  ATH_CHECK( m_plots_resolution->fillPlots(
300  *particle, *(matches.getMatchedRefTrack( *particle )), weight ) );
301  }
302  }
303  }
304 
306  if( m_plots_hitsOnMatchedTrk and m_plots_hitsOnMatchedTrk_vsRef and isMatched ) {
307  ATH_CHECK( m_plots_hitsOnMatchedTrk->fillPlots( *particle, truthMu, actualMu, weight ) );
308  if( m_trkAnaDefSvc->isReferenceTruth() ) {
309  ATH_CHECK( m_plots_hitsOnMatchedTrk_vsRef->fillPlots(
310  *particle, *(matches.getMatchedRefTruth( *particle )), truthMu, actualMu, weight ) );
311  } else {
312  ATH_CHECK( m_plots_hitsOnMatchedTrk_vsRef->fillPlots(
313  *particle, *(matches.getMatchedRefTrack( *particle )), truthMu, actualMu, weight ) );
314  }
315  }
316 
318  bool isUnlinked = isUnlinkedTruth( *particle );
319  if( m_plots_missingTruth ) {
320  ATH_CHECK( m_plots_missingTruth->fillPlots( *particle, isUnlinked, truthMu, actualMu, weight ) );
321  if( m_plots_hitsOnUnlinkedTrk and isUnlinked ) {
322  ATH_CHECK( m_plots_hitsOnUnlinkedTrk->fillPlots( *particle, truthMu, actualMu, weight ) );
323  }
324  }
325 
326  bool doFakes = m_trkAnaDefSvc->unlinkedAsFakes() ? true : not isUnlinked;
327  if( doFakes and m_plots_fakeRate ) {
328  bool isFake = isFakeTruth( *particle, m_trkAnaDefSvc->truthProbCut(),
329  m_trkAnaDefSvc->unlinkedAsFakes() );
330  ATH_CHECK( m_plots_fakeRate->fillPlots( *particle, isFake, truthMu, actualMu, weight ) );
331  if( m_plots_hitsOnFakeTrk and isFake ) {
332  ATH_CHECK( m_plots_hitsOnFakeTrk->fillPlots( *particle, truthMu, actualMu, weight ) );
333  }
334  }
335 
337  if( m_trkAnaDefSvc->isTestOffline() ) {
338  if( m_plots_offEle ) {
339  ATH_CHECK( m_plots_offEle->fillPlots( *particle, false, weight ) );
340  }
341  if( m_plots_eff_vsOffEle ) {
342  ATH_CHECK( m_plots_eff_vsOffEle->fillPlots( *particle, isMatched, weight ) );
343  }
344  }
345 
346  } // close loop over particles
347 
348  return StatusCode::SUCCESS;
349 }
350 
351 template StatusCode
353  const std::vector< const xAOD::TrackParticle* >& particles,
354  const ITrackMatchingLookup& matches,
355  float truthMu, float actualMu, float weight );
356 
357 template StatusCode
359  const std::vector< const xAOD::TruthParticle* >& particles,
360  const ITrackMatchingLookup& matches,
361  float truthMu, float actualMu, float weight );
362 
363 
367 template< typename PARTICLE >
369  const std::vector< const PARTICLE* >& particles,
370  const ITrackMatchingLookup& matches,
371  float truthMu, float actualMu, float weight )
372 {
373 
374  for( const PARTICLE* particle : particles ) {
375 
377  if( m_plots_trkParam_vsRef ) {
378  ATH_CHECK( m_plots_trkParam_vsRef->fillPlots( *particle, weight ) );
379  }
380 
382  if( m_plots_hitsOnTrk_vsRef ) {
383  ATH_CHECK( m_plots_hitsOnTrk_vsRef->fillPlots( *particle, truthMu, actualMu, weight ) );
384  }
385 
386  bool isMatched = matches.isRefMatched( *particle );
387 
389  if( m_plots_eff_vsRef ) {
390  ATH_CHECK( m_plots_eff_vsRef->fillPlots(
391  *particle, isMatched, truthMu, actualMu, weight ) );
392  }
393 
395  if( m_plots_tech_eff_vsRef ) {
396  if( m_trkAnaDefSvc->isReferenceTruth() and
397  isReconstructable( *particle, m_trkAnaDefSvc->minSilHits(), m_trkAnaDefSvc->etaBins() ) )
398  {
399  ATH_CHECK( m_plots_tech_eff_vsRef->fillPlots(
400  *particle, isMatched, truthMu, actualMu, weight ) );
401  }
402  else if ( m_trkAnaDefSvc->isTestTruth() ) {
403 
404  bool isTechMatched = false;
405 
406  if (isMatched) {
407  for ( const xAOD::TruthParticle *thisTruth : (matches.getMatchedTestTruths( *particle ))) {
408  if ( isReconstructable( *thisTruth, m_trkAnaDefSvc->minSilHits(), m_trkAnaDefSvc->etaBins() ) ) {
409  isTechMatched = true;
410  break;
411  }
412  }
413  }
414  ATH_CHECK( m_plots_tech_eff_vsRef->fillPlots(
415  *particle, isTechMatched, truthMu, actualMu, weight ) );
416  }
417 
418  else if ( m_trkAnaDefSvc->matchingType() == "EFTruthMatch" ) {
419  const xAOD::TruthParticle* linkedTruth = getLinkedTruth(
420  *particle, m_trkAnaDefSvc->truthProbCut() );
421  bool isTechMatched = isMatched ?
422  isReconstructable( *linkedTruth, m_trkAnaDefSvc->minSilHits(), m_trkAnaDefSvc->etaBins() ) : false;
423  ATH_CHECK( m_plots_tech_eff_vsRef->fillPlots(
424  *particle, isTechMatched, truthMu, actualMu, weight ) );
425  }
426  }
427 
429  if( m_plots_duplRate ) {
430  unsigned int nMatched = m_trkAnaDefSvc->isTestTruth() ?
431  matches.getMatchedTestTruths( *particle ).size() :
432  matches.getMatchedTestTracks( *particle ).size();
433 
434  ATH_CHECK( m_plots_duplRate->fillPlots(
435  *particle, nMatched, truthMu, actualMu, weight ) );
436  }
437 
439  if( m_trkAnaDefSvc->isReferenceOffline() ) {
440  if( m_plots_offEle ) {
441  ATH_CHECK( m_plots_offEle->fillPlots( *particle, false, weight ) );
442  }
443  if( m_plots_eff_vsOffEle ) {
444  ATH_CHECK( m_plots_eff_vsOffEle->fillPlots( *particle, isMatched, weight ) );
445  }
446  }
447 
448  } // close loop over particles
449 
450  return StatusCode::SUCCESS;
451 }
452 
453 template StatusCode
455  const std::vector< const xAOD::TrackParticle* >& particles,
456  const ITrackMatchingLookup& matches,
457  float truthMu, float actualMu, float weight );
458 
459 template StatusCode
461  const std::vector< const xAOD::TruthParticle* >& particles,
462  const ITrackMatchingLookup& matches,
463  float truthMu, float actualMu, float weight );
464 
465 
470  const std::vector< const xAOD::TrackParticle* >& testTracks,
471  const std::vector< const xAOD::TrackParticle* >& refTracks,
472  const std::vector< const xAOD::TruthParticle* >& truths,
473  const ITrackMatchingLookup& matches,
474  float truthMu, float actualMu, float weight )
475 {
476 
477  for( const xAOD::TruthParticle* thisTruth : truths ) {
478 
479  bool isMatched( false ); // test track matched to reference track through EFTruthMatch method
480  bool refMatched( false ); // reference track matched to thisTruth
481 
483  for( const xAOD::TrackParticle* thisTrack : refTracks ) {
484  const xAOD::TruthParticle* linkedTruth = getLinkedTruth(
485  *thisTrack, m_trkAnaDefSvc->truthProbCut() );
486  if( not linkedTruth ) {
487  ATH_MSG_WARNING( "Unlinked track!!" );
488  continue;
489  }
490  if( thisTruth == linkedTruth ) {
491  refMatched = true;
492  break;
493  }
494  } // close loop over reference tracks
495 
497  if ( not refMatched ) continue;
498 
499  else {
500 
502  for( const xAOD::TrackParticle* thisTrack : testTracks ) {
503  const xAOD::TruthParticle* linkedTruth = getLinkedTruth(
504  *thisTrack, m_trkAnaDefSvc->truthProbCut() );
505  if( not linkedTruth ) {
506  ATH_MSG_WARNING( "Unlinked track!!" );
507  continue;
508  }
509  if( thisTruth == linkedTruth ) {
510  isMatched = matches.isTestMatched( *thisTrack ); // Check if this test is matched to reference with EFTruthMatch
511  break;
512  }
513  } // close loop over test tracks
514 
516  if( m_plots_eff_vsTruth ) {
517  ATH_CHECK( m_plots_eff_vsTruth->fillPlots(
518  *thisTruth, isMatched, truthMu, actualMu, weight ) );
519  }
520 
522  if( m_plots_tech_eff_vsTruth ) {
523  if (isReconstructable( *thisTruth, m_trkAnaDefSvc->minSilHits(), m_trkAnaDefSvc->etaBins() )) {
524  ATH_CHECK( m_plots_tech_eff_vsTruth->fillPlots(
525  *thisTruth, isMatched , truthMu, actualMu, weight ) );
526  }
527  }
528  }
529  } // close loop over truth particles
530 
531  return StatusCode::SUCCESS;
532 }
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
IDTPM::TrackAnalysisCollections
Definition: TrackAnalysisCollections.h:44
InDetSecVtxTruthMatchUtils::isFake
bool isFake(int matchInfo)
Definition: InDetSecVtxTruthMatchTool.h:60
IDTPM::getLinkedTruth
const xAOD::TruthParticle * getLinkedTruth(const xAOD::TrackParticle &track, const float truthProbCut)
getLinkedTruth
Definition: OfflineObjectDecorHelper.cxx:59
IDTPM::NtracksPlots::FS
@ FS
Definition: NtracksPlots.h:49
IDTPM::ITrackMatchingLookup::getMatchedTestTruths
virtual const std::vector< const xAOD::TruthParticle * > & getMatchedTestTruths(const xAOD::TrackParticle &r) const =0
vec Truth <- Track
IDTPM::TrackAnalysisPlotsMgr::fillPlotsTruth
StatusCode fillPlotsTruth(const std::vector< const xAOD::TrackParticle * > &testTracks, const std::vector< const xAOD::TrackParticle * > &refTracks, const std::vector< const xAOD::TruthParticle * > &truths, const ITrackMatchingLookup &matches, float truthMu=0., float actualMu=0., float weight=1.0)
Fill efficiency plots w.r.t. truth (for EFTruthMatch only)
Definition: TrackAnalysisPlotsMgr.cxx:469
IDTPM::NtracksPlots::ALL
@ ALL
Definition: NtracksPlots.h:49
IDTPM::TrackAnalysisCollections::eventInfo
const xAOD::EventInfo * eventInfo()
get event info
Definition: TrackAnalysisCollections.h:135
InDetSecVtxTruthMatchUtils::isMatched
bool isMatched(int matchInfo)
Definition: InDetSecVtxTruthMatchTool.h:48
TrackAnalysisCollections.h
Class to hold for each event collections needed in the TrkAnalsis.
TrackAnalysisPlotsMgr.h
class to manage (book, fill) all the plots for the processed TrackAnalysis for tracking performance v...
IDTPM::ITrackMatchingLookup::getMatchedRefTrack
virtual const xAOD::TrackParticle * getMatchedRefTrack(const xAOD::TrackParticle &t) const =0
get matched reference (1 to 1) Track -> Track
IDTPM::NtracksPlots::INROI
@ INROI
Definition: NtracksPlots.h:49
IDTPM::ITrackMatchingLookup::getMatchedRefTruth
virtual const xAOD::TruthParticle * getMatchedRefTruth(const xAOD::TrackParticle &t) const =0
Track -> Truth.
dqt_zlumi_pandas.weight
int weight
Definition: dqt_zlumi_pandas.py:189
IDTPM::TrackAnalysisCollections::testTrackVec
const std::vector< const xAOD::TrackParticle * > & testTrackVec(Stage stage=FULL)
TEST = Track.
Definition: TrackAnalysisCollections.cxx:497
IDTPM::ITrackMatchingLookup::getMatchedTestTracks
virtual const std::vector< const xAOD::TrackParticle * > & getMatchedTestTracks(const xAOD::TrackParticle &r) const =0
get matched test vector (1 to 1+) vec Track <- Track
IDTPM::PlotMgr
Definition: PlotMgr.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
IDTPM::TrackAnalysisCollections::FS
@ FS
Definition: TrackAnalysisCollections.h:52
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
IDTPM::ITrackMatchingLookup::isTestMatched
virtual bool isTestMatched(const xAOD::TrackParticle &t) const =0
return true if test is matched
IDTPM::TrackAnalysisCollections::matches
ITrackMatchingLookup & matches()
return matching information
Definition: TrackAnalysisCollections.h:170
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ITrackMatchingLookup.h
Interace for TrackMatchingLookup objects (templated)
IDTPM::ITrackMatchingLookup::isRefMatched
virtual bool isRefMatched(const xAOD::TrackParticle &r) const =0
return true if reference is matched
IDTPM::TrackAnalysisPlotsMgr::fillPlotsTest
StatusCode fillPlotsTest(const std::vector< const PARTICLE * > &particles, const ITrackMatchingLookup &matches, float truthMu=0., float actualMu=0., float weight=1.0)
Fill all plots w.r.t.
Definition: TrackAnalysisPlotsMgr.cxx:244
fillPlotsTest< xAOD::TruthParticle >
template StatusCode IDTPM::TrackAnalysisPlotsMgr::fillPlotsTest< xAOD::TruthParticle >(const std::vector< const xAOD::TruthParticle * > &particles, const ITrackMatchingLookup &matches, float truthMu, float actualMu, float weight)
IDTPM::TrackAnalysisCollections::refTrackVec
const std::vector< const xAOD::TrackParticle * > & refTrackVec(Stage stage=FULL)
TEST = Track.
Definition: TrackAnalysisCollections.cxx:527
IDTPM::TrackAnalysisPlotsMgr::TrackAnalysisPlotsMgr
TrackAnalysisPlotsMgr(const std::string &dirName, const std::string &anaTag, const std::string &chain, PlotMgr *pParent=nullptr)
Constructor.
Definition: TrackAnalysisPlotsMgr.cxx:25
IDTPM::TrackAnalysisPlotsMgr::fill
StatusCode fill(TrackAnalysisCollections &trkAnaColls, float weight=1.0)
General fill method.
Definition: TrackAnalysisPlotsMgr.cxx:165
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
IDTPM::TrackAnalysisCollections::InRoI
@ InRoI
Definition: TrackAnalysisCollections.h:52
fillPlotsTest< xAOD::TrackParticle >
template StatusCode IDTPM::TrackAnalysisPlotsMgr::fillPlotsTest< xAOD::TrackParticle >(const std::vector< const xAOD::TrackParticle * > &particles, const ITrackMatchingLookup &matches, float truthMu, float actualMu, float weight)
IDTPM::ITrackMatchingLookup::getNmatches
virtual unsigned getNmatches(bool getRefN=false) const =0
get overall number of matches
IDTPM::TrackAnalysisCollections::truthPartVec
const std::vector< const xAOD::TruthParticle * > & truthPartVec(Stage stage=FULL)
get truth/offline/trigger track vector (TEST or REFERENCE)
Definition: TrackAnalysisCollections.h:162
LArG4FSStartPointFilter.particles
list particles
Definition: LArG4FSStartPointFilter.py:84
IDTPM::NtracksPlots::NCOUNTERS
@ NCOUNTERS
Definition: NtracksPlots.h:49
IDTPM::isReconstructable
bool isReconstructable(const xAOD::TruthParticle &truth, const std::vector< unsigned int > &minSilHits, const std::vector< float > &etaBins)
isReconstructable
Definition: OfflineObjectDecorHelper.cxx:81
IDTPM::TrackAnalysisCollections::testTruthVec
const std::vector< const xAOD::TruthParticle * > & testTruthVec(Stage stage=FULL)
get TEST track vectors
Definition: TrackAnalysisCollections.cxx:484
IDTPM::isFakeTruth
bool isFakeTruth(const xAOD::TrackParticle &track, const float truthProbCut, const bool unlinkedAsFakes)
isFake
Definition: OfflineObjectDecorHelper.cxx:70
IDTPM::TrackAnalysisPlotsMgr::initialize
StatusCode initialize()
initialize
Definition: TrackAnalysisPlotsMgr.cxx:38
IDTPM::PlotMgr::initialize
StatusCode initialize()
initialize
Definition: PlotMgr.cxx:37
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
OfflineObjectDecorHelper.h
Utility methods to access offline object decorations.
IDTPM::ITrackMatchingLookup
Definition: ITrackMatchingLookup.h:30
IDTPM::TrackAnalysisCollections::FULL
@ FULL
Definition: TrackAnalysisCollections.h:52
IDTPM::isUnlinkedTruth
bool isUnlinkedTruth(const xAOD::TrackParticle &track)
isUnlinkedTruth
Definition: OfflineObjectDecorHelper.cxx:45
IDTPM::TrackAnalysisPlotsMgr::fillPlotsReference
StatusCode fillPlotsReference(const std::vector< const PARTICLE * > &particles, const ITrackMatchingLookup &matches, float truthMu=0., float actualMu=0., float weight=1.0)
Fill all plots w.r.t.
Definition: TrackAnalysisPlotsMgr.cxx:368
fillPlotsReference< xAOD::TrackParticle >
template StatusCode IDTPM::TrackAnalysisPlotsMgr::fillPlotsReference< xAOD::TrackParticle >(const std::vector< const xAOD::TrackParticle * > &particles, const ITrackMatchingLookup &matches, float truthMu, float actualMu, float weight)
fillPlotsReference< xAOD::TruthParticle >
template StatusCode IDTPM::TrackAnalysisPlotsMgr::fillPlotsReference< xAOD::TruthParticle >(const std::vector< const xAOD::TruthParticle * > &particles, const ITrackMatchingLookup &matches, float truthMu, float actualMu, float weight)
IDTPM::NtracksPlots::MATCHED
@ MATCHED
Definition: NtracksPlots.h:49
xAOD::EventInfo_v1::actualInteractionsPerCrossing
float actualInteractionsPerCrossing() const
Average interactions per crossing for the current BCID - for in-time pile-up.
Definition: EventInfo_v1.cxx:380
IDTPM::TrackAnalysisCollections::refTruthVec
const std::vector< const xAOD::TruthParticle * > & refTruthVec(Stage stage=FULL)
get REFERENCE track vectors
Definition: TrackAnalysisCollections.cxx:514