ATLAS Offline Software
Loading...
Searching...
No Matches
TrackToTruthAssociationAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef ACTSTRKFINDING_TRACKTOTRUTHASSOCIATIONALG_H
6#define ACTSTRKFINDING_TRACKTOTRUTHASSOCIATIONALG_H 1
7
8// Base Class
10
11// Gaudi includes
12#include "Gaudi/Property.h"
13
14// Handle Keys
17
24
25#include <mutex>
27
28#include <string>
29#include <memory>
30#include <array>
31#include <atomic>
32#include <type_traits>
33
34#include <cmath>
35#include <iomanip>
36#include <ostream>
37#include <string>
38#include <sstream>
39#include <vector>
40
41namespace ActsTrk
42{
44
46 {
47 public:
48 using AthReentrantAlgorithm::AthReentrantAlgorithm;
49
50 virtual StatusCode initialize() override;
51 virtual StatusCode finalize() override;
52 virtual StatusCode execute(const EventContext &ctx) const override;
53
54 private:
57
59 {this, "ACTSTracksLocation", "","Track collection (ActsTrk variant)"};
60
62 {this, "MeasurementAssocKeys", {}, "Association map from the measurements to generator particles." };
64 {this, "AssociationMapOut", "", "Output association map from measurements to generator particles." };
65
66 Gaudi::Property<float> m_maxEnergyLoss
67 {this, "MaxEnergyLoss", 10e12, "Stop moving up the decay chain if the energy loss is above this value." };
68
70 static constexpr float s_unitGeV = 1e3;
71 Gaudi::Property<std::vector<float>> m_energyLossBinning
72 {this, "EnergyLossBinning", {20.,0.,5.*s_unitGeV}, "Binning to be used for the energy loss histograms." };
73
74 template <bool IsDebug>
76 struct Empty {
77 template <typename... T_Args>
78 Empty(T_Args... ) {}
79 };
80 mutable typename std::conditional<IsDebug,
81 std::mutex,
83 mutable typename std::conditional<IsDebug,
85 Empty>::type m_measPerTrack ATLAS_THREAD_SAFE {20,-.5,40.-.5};
86 mutable typename std::conditional<IsDebug,
88 Empty>::type m_truthParticlesPerTrack ATLAS_THREAD_SAFE {20,-.5,20.-.5};
89
90 template <class T_OutStream>
91 void dumpStatistics(T_OutStream &out) const;
92 void fillStatistics(unsigned int n_measurements, unsigned int n_particles) const;
93 };
95 static constexpr unsigned int s_NCounterForAssociatedTruth = 4;
96 mutable std::array<std::atomic<std::size_t>,s_NCounterForAssociatedTruth> m_nTracksWithAssociatedTruth ATLAS_THREAD_SAFE {};
97 mutable std::atomic<std::size_t> m_nIncompatibleMeasurementContainer{};
98 mutable std::atomic<std::size_t> m_nCcompatibleMeasurementContainer{};
99 };
100
101} // namespace
102
103#endif
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
Utility class to handle the three contexts neeeded in an ACTS reconstruction job 1) GeometryContext -...
std::atomic< std::size_t > m_nCcompatibleMeasurementContainer
static constexpr unsigned int s_NCounterForAssociatedTruth
AssociationCounter< TrackToTruthParticleAssociationDebugHists > m_associationCounter
SG::WriteHandleKey< TrackToTruthParticleAssociation > m_trackToTruthOut
std::atomic< std::size_t > m_nIncompatibleMeasurementContainer
std::array< std::atomic< std::size_t >, s_NCounterForAssociatedTruth > m_nTracksWithAssociatedTruth ATLAS_THREAD_SAFE
SG::ReadHandleKey< ActsTrk::TrackContainer > m_tracksContainerKey
virtual StatusCode execute(const EventContext &ctx) const override
Gaudi::Property< std::vector< float > > m_energyLossBinning
ContextUtility m_ctxProvider
Context provider for geometry, magnetic field and calibration contexts.
SG::ReadHandleKeyArray< MeasurementToTruthParticleAssociation > m_measAssocKeys
ElasticDecayUtil< TrackToTruthParticleAssociationDebugHists > m_elasticDecayUtil
Extend Stat helper by an equidistant binned histogram.
Definition StatUtils.h:81
An algorithm that can be simultaneously executed in multiple threads.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
constexpr bool TrackToTruthParticleAssociationDebugHists
HandleKeyArray< ReadHandle< T >, ReadHandleKey< T >, Gaudi::DataHandle::Reader > ReadHandleKeyArray
std::conditional< IsDebug, std::mutex, Empty >::type m_mutex ATLAS_THREAD_SAFE
void fillStatistics(unsigned int n_measurements, unsigned int n_particles) const