ATLAS Offline Software
Loading...
Searching...
No Matches
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
7namespace 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(),
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}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_ERROR(x)
static Double_t sc
Container for hit counts per track Contains hit counts per associated truth particle and the total hi...
virtual StatusCode execute(const EventContext &ctx) const override
SG::ReadHandleKey< TrackToTruthParticleAssociation > m_trackToTruth
const IAthSelectionTool & truthSelectionTool() const
TruthMatchResult analyseTrackTruth(const TruthParticleHitCounts &truth_particle_hit_counts, const HitCountsPerTrack &track_hit_counts, EventStat &event_stat) const
const TruthParticleHitCounts & getTruthParticleHitCounts(const EventContext &ctx) const
EventStatBase< TrackFindingValidationDetailedStat > EventStat
void postProcessEventStat(const TruthParticleHitCounts &truth_particle_hit_counts, std::size_t n_tracks, EventStat &event_stat) const
virtual bool isValid() override final
Can the handle be successfully dereferenced?
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
std::unordered_map< const xAOD::TruthParticle *, HitCounterArray > TruthParticleHitCounts
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())