ATLAS Offline Software
Loading...
Searching...
No Matches
TruthParticleHitCountAlg.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 ACTSTRK_TRUTHPARTICLEHITCOUNT_H
6#define ACTSTRK_TRUTHPARTICLEHITCOUNT_H 1
7
8// Base Class
10
11
12// Handle Keys
15
21
22#include <mutex>
24
25#include <string>
26#include <memory>
27#include <array>
28#include <atomic>
29#include <type_traits>
30
31#include <cmath>
32#include <iomanip>
33#include <ostream>
34#include <string>
35#include <sstream>
36#include <vector>
37
38namespace ActsTrk
39{
40 constexpr bool TruthParticleHitCountDebugHists = false;
41
43 {
44 public:
45 using AthReentrantAlgorithm::AthReentrantAlgorithm;
46
47 virtual StatusCode initialize() override;
48 virtual StatusCode finalize() override;
49 virtual StatusCode execute(const EventContext &ctx) const override;
50
51 private:
54
56 {this, "MeasurementAssocKeys", {}, "Association map from the measurements to generator particles." };
58 {this, "TruthParticleHitCountsOut", "", "Map from truth particle to hit counts." };
59
60 Gaudi::Property<float> m_maxEnergyLoss
61 {this, "MaxEnergyLoss", 10e12, "Stop moving up the decay chain if the energy loss is above this value." };
62 Gaudi::Property<unsigned int> m_nHitsMin
63 {this, "NHitsMin", 1, "Minimum number of hits associated to a truth particle to consider the particle." };
64
66 static constexpr float s_unitGeV = 1e3;
67
68 Gaudi::Property<std::vector<float>> m_energyLossBinning
69 {this, "EnergyLossBinning", {20.,0.,5.*s_unitGeV}, "Binning to be used for the energy loss histograms." };
70
71 template <bool IsDebug>
73 struct Empty {
74 template <typename... T_Args>
75 Empty(T_Args... ) {}
76 };
77 mutable typename std::conditional<IsDebug,
78 std::mutex,
80 mutable typename std::conditional<IsDebug,
82 Empty>::type m_measPerTruthParticle ATLAS_THREAD_SAFE {20,-.5,40.-.5};
83
84 template <class T_OutStream>
85 void dumpStatistics(T_OutStream &out) const;
86 void fillStatistics(unsigned int n_measurements) const;
87 };
89 mutable std::atomic<std::size_t> m_nTruthParticlesWithHits ATLAS_THREAD_SAFE {};
90 };
91
92} // namespace
93
94#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 -...
ElasticDecayUtil< TruthParticleHitCountDebugHists > m_elasticDecayUtil
Gaudi::Property< std::vector< float > > m_energyLossBinning
Gaudi::Property< unsigned int > m_nHitsMin
ContextUtility m_ctxProvider
Context provider for geometry, magnetic field and calibration contexts.
virtual StatusCode execute(const EventContext &ctx) const override
SG::WriteHandleKey< TruthParticleHitCounts > m_truthHitCountsOut
std::atomic< std::size_t > m_nTruthParticlesWithHits ATLAS_THREAD_SAFE
SG::ReadHandleKeyArray< MeasurementToTruthParticleAssociation > m_measAssocKeys
virtual StatusCode initialize() override
AssociationCounter< TruthParticleHitCountDebugHists > m_associationCounter
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 WriteHandle is made.
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
constexpr bool TruthParticleHitCountDebugHists
HandleKeyArray< ReadHandle< T >, ReadHandleKey< T >, Gaudi::DataHandle::Reader > ReadHandleKeyArray
std::conditional< IsDebug, std::mutex, Empty >::type m_mutex ATLAS_THREAD_SAFE