ATLAS Offline Software
TrackFindingValidationAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 #undef NDEBUG
6 
7 namespace ActsTrk
8 {
9 
11  {
13  ATH_CHECK( m_trackToTruth.initialize() );
14  return sc;
15  }
16 
18  {
20  return sc;
21  }
22 
23  StatusCode TrackFindingValidationAlg::execute(const EventContext &ctx) const
24  {
25  const TruthParticleHitCounts &truth_particle_hit_counts = getTruthParticleHitCounts(ctx);
27  if (!track_to_truth_handle.isValid()) {
28  ATH_MSG_ERROR("No track to truth particle association for key " << m_trackToTruth.key() );
29  return StatusCode::FAILURE;
30  }
31 
32  EventStat event_stat(truthSelectionTool(),
33  perEtaSize(),
34  perPdgIdSize(),
35  track_to_truth_handle->size());
36 
37  for(const HitCountsPerTrack &track_hit_counts : *track_to_truth_handle) {
38  analyseTrackTruth(truth_particle_hit_counts,
39  track_hit_counts,
40  event_stat);
41  }
42  postProcessEventStat(truth_particle_hit_counts,
43  track_to_truth_handle->size(),
44  event_stat);
45  return StatusCode::SUCCESS;
46  }
47 
48 }
ActsTrk::TrackTruthMatchingBaseAlg::postProcessEventStat
void postProcessEventStat(const TruthParticleHitCounts &truth_particle_hit_counts, std::size_t n_tracks, EventStat &event_stat) const
Definition: TrackTruthMatchingBaseAlg.cxx:331
ActsTrk::HitCountsPerTrack
Container for hit counts per track Contains hit counts per associated truth particle and the total hi...
Definition: TrackToTruthParticleAssociation.h:37
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
ActsTrk::TrackTruthMatchingBaseAlg::initialize
virtual StatusCode initialize() override
Definition: TrackTruthMatchingBaseAlg.cxx:135
ActsTrk::TrackFindingValidationAlg::m_trackToTruth
SG::ReadHandleKey< TrackToTruthParticleAssociation > m_trackToTruth
Definition: TrackFindingValidationAlg.h:34
ActsTrk::TrackTruthMatchingBaseAlg::truthSelectionTool
const IAthSelectionTool & truthSelectionTool() const
Definition: TrackTruthMatchingBaseAlg.h:69
TrackFindingValidationAlg.h
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:270
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ActsTrk::TrackFindingValidationAlg::initialize
virtual StatusCode initialize() override
Definition: TrackFindingValidationAlg.cxx:10
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ActsTrk::TrackFindingValidationAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: TrackFindingValidationAlg.cxx:23
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
ActsTrk::TrackTruthMatchingBaseAlg::EventStatBase
Definition: TrackTruthMatchingBaseAlg.h:79
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ActsTrk::TrackFindingValidationAlg::finalize
virtual StatusCode finalize() override
Definition: TrackFindingValidationAlg.cxx:17
ActsTrk::TrackTruthMatchingBaseAlg::perEtaSize
std::size_t perEtaSize() const
Definition: TrackTruthMatchingBaseAlg.h:71
ActsTrk::TruthParticleHitCounts
std::unordered_map< const xAOD::TruthParticle *, HitCounterArray > TruthParticleHitCounts
Definition: TruthParticleHitCounts.h:19
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:49
ActsTrk::TrackTruthMatchingBaseAlg::analyseTrackTruth
TruthMatchResult analyseTrackTruth(const TruthParticleHitCounts &truth_particle_hit_counts, const HitCountsPerTrack &track_hit_counts, EventStat &event_stat) const
Definition: TrackTruthMatchingBaseAlg.cxx:209
ActsTrk::TrackTruthMatchingBaseAlg::getTruthParticleHitCounts
const TruthParticleHitCounts & getTruthParticleHitCounts(const EventContext &ctx) const
Definition: TrackTruthMatchingBaseAlg.h:60
ActsTrk::TrackTruthMatchingBaseAlg::perPdgIdSize
std::size_t perPdgIdSize() const
Definition: TrackTruthMatchingBaseAlg.h:74
ActsTrk::TrackTruthMatchingBaseAlg::finalize
virtual StatusCode finalize() override
Definition: TrackTruthMatchingBaseAlg.cxx:173