ATLAS Offline Software
Loading...
Searching...
No Matches
TrackToTruthAssociationAlg.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 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
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{
43
45 {
46 public:
47 TrackToTruthAssociationAlg(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, "ACTSTracksLocation", "","Track collection (ActsTrk variant)"};
60
62 {this, "PixelClustersToTruthAssociationMap", "", "Association map from pixel measurements to generator particles." };
64 {this, "StripClustersToTruthAssociationMap", "", "Association map from strip measurements to generator particles." };
66 {this, "HgtdClustersToTruthAssociationMap", "", "Association map from HGTD measurements to generator particles." };
67
69 {this, "AssociationMapOut", "", "Output association map from measurements to generator particles." };
70
71 Gaudi::Property<float> m_maxEnergyLoss
72 {this, "MaxEnergyLoss", 10e12, "Stop moving up the decay chain if the energy loss is above this value." };
73
75 static constexpr float s_unitGeV = 1e3;
77 Gaudi::Property<std::vector<float> >,
79 {this, "EnergyLossBinning", {20.,0.,5.*s_unitGeV}, "Binning to be used for the energy loss histograms." };
80
81 template <bool IsDebug>
83 struct Empty {
84 template <typename... T_Args>
85 Empty(T_Args... ) {}
86 };
87 mutable typename std::conditional<IsDebug,
88 std::mutex,
90 mutable typename std::conditional<IsDebug,
92 Empty>::type m_measPerTrack ATLAS_THREAD_SAFE {20,-.5,40.-.5};
93 mutable typename std::conditional<IsDebug,
95 Empty>::type m_truthParticlesPerTrack ATLAS_THREAD_SAFE {20,-.5,20.-.5};
96
97 template <class T_OutStream>
98 void dumpStatistics(T_OutStream &out) const;
99 void fillStatistics(unsigned int n_measurements, unsigned int n_particles) const;
100 };
102 static constexpr unsigned int s_NCounterForAssociatedTruth = 4;
103 mutable std::array<std::atomic<std::size_t>,s_NCounterForAssociatedTruth> m_nTracksWithAssociatedTruth ATLAS_THREAD_SAFE {};
104 mutable std::atomic<std::size_t> m_nIncompatibleMeasurementContainer{};
105 mutable std::atomic<std::size_t> m_nCcompatibleMeasurementContainer{};
106 };
107
108} // namespace
109
110#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.
std::atomic< std::size_t > m_nCcompatibleMeasurementContainer
static constexpr unsigned int s_NCounterForAssociatedTruth
AssociationCounter< TrackToTruthParticleAssociationDebugHists > m_associationCounter
PublicToolHandle< ActsTrk::ITrackingGeometryTool > m_trackingGeometryTool
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
std::conditional< TrackToTruthParticleAssociationDebugHists, Gaudi::Property< std::vector< float > >, EmptyProperty >::type m_energyLossBinning
SG::ReadHandleKey< MeasurementToTruthParticleAssociation > m_hgtdClustersToTruth
ElasticDecayUtil< TrackToTruthParticleAssociationDebugHists > m_elasticDecayUtil
SG::ReadHandleKey< MeasurementToTruthParticleAssociation > m_pixelClustersToTruth
TrackToTruthAssociationAlg(const std::string &name, ISvcLocator *pSvcLocator)
SG::ReadHandleKey< MeasurementToTruthParticleAssociation > m_stripClustersToTruth
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
std::conditional< IsDebug, std::mutex, Empty >::type m_mutex ATLAS_THREAD_SAFE
void fillStatistics(unsigned int n_measurements, unsigned int n_particles) const