ATLAS Offline Software
Loading...
Searching...
No Matches
TruthParticleHitCountAlg.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 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// Gaudi includes
12#include "Gaudi/Property.h"
13
14// Handle Keys
17
23
24#include <mutex>
26
27#include <string>
28#include <memory>
29#include <array>
30#include <atomic>
31#include <type_traits>
32
33#include <cmath>
34#include <iomanip>
35#include <ostream>
36#include <string>
37#include <sstream>
38#include <vector>
39
40namespace ActsTrk
41{
42 constexpr bool TruthParticleHitCountDebugHists = false;
43
45 {
46 public:
47 TruthParticleHitCountAlg(const std::string &name,
48 ISvcLocator *pSvcLocator);
49
50 virtual StatusCode initialize() override;
51 virtual StatusCode finalize() override;
52 virtual StatusCode execute(const EventContext &ctx) const override;
53
54 private:
55 PublicToolHandle<ActsTrk::ITrackingGeometryTool> m_trackingGeometryTool
56 {this, "TrackingGeometryTool", ""};
57
59 {this, "PixelClustersToTruthAssociationMap", "", "Association map from pixel measurements to generator particles." };
61 {this, "StripClustersToTruthAssociationMap", "", "Association map from strip measurements to generator particles." };
63 {this, "HgtdClustersToTruthAssociationMap", "", "Association map from HGTD measurements to generator particles." };
64
66 {this, "TruthParticleHitCountsOut", "", "Map from truth particle to hit counts." };
67
68 Gaudi::Property<float> m_maxEnergyLoss
69 {this, "MaxEnergyLoss", 10e12, "Stop moving up the decay chain if the energy loss is above this value." };
70 Gaudi::Property<unsigned int> m_nHitsMin
71 {this, "NHitsMin", 1, "Minimum number of hits associated to a truth particle to consider the particle." };
72
74 static constexpr float s_unitGeV = 1e3;
75 std::conditional<TruthParticleHitCountDebugHists,
76 Gaudi::Property<std::vector<float> >,
78 {this, "EnergyLossBinning", {20.,0.,5.*s_unitGeV}, "Binning to be used for the energy loss histograms." };
79
80 template <bool IsDebug>
82 struct Empty {
83 template <typename... T_Args>
84 Empty(T_Args... ) {}
85 };
86 mutable typename std::conditional<IsDebug,
87 std::mutex,
89 mutable typename std::conditional<IsDebug,
91 Empty>::type m_measPerTruthParticle ATLAS_THREAD_SAFE {20,-.5,40.-.5};
92
93 template <class T_OutStream>
94 void dumpStatistics(T_OutStream &out) const;
95 void fillStatistics(unsigned int n_measurements) const;
96 };
98 mutable std::atomic<std::size_t> m_nTruthParticlesWithHits ATLAS_THREAD_SAFE {};
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.
ElasticDecayUtil< TruthParticleHitCountDebugHists > m_elasticDecayUtil
Gaudi::Property< unsigned int > m_nHitsMin
SG::ReadHandleKey< MeasurementToTruthParticleAssociation > m_hgtdClustersToTruth
PublicToolHandle< ActsTrk::ITrackingGeometryTool > m_trackingGeometryTool
std::conditional< TruthParticleHitCountDebugHists, Gaudi::Property< std::vector< float > >, EmptyProperty >::type m_energyLossBinning
TruthParticleHitCountAlg(const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode execute(const EventContext &ctx) const override
SG::WriteHandleKey< TruthParticleHitCounts > m_truthHitCountsOut
std::atomic< std::size_t > m_nTruthParticlesWithHits ATLAS_THREAD_SAFE
SG::ReadHandleKey< MeasurementToTruthParticleAssociation > m_pixelClustersToTruth
SG::ReadHandleKey< MeasurementToTruthParticleAssociation > m_stripClustersToTruth
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 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 TruthParticleHitCountDebugHists
std::conditional< IsDebug, std::mutex, Empty >::type m_mutex ATLAS_THREAD_SAFE