Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
ActsInspectTruthContentAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef ACTSMONITORING_INSPECTTRUTHCONTENTALG_H
6 #define ACTSMONITORING_INSPECTTRUTHCONTENTALG_H
7 
15 
16 namespace ActsTrk {
17 
19  : public AthReentrantAlgorithm {
20  public:
21  ActsInspectTruthContentAlg(const std::string& name, ISvcLocator* pSvcLocator);
22  virtual ~ActsInspectTruthContentAlg() override = default;
23 
24  virtual StatusCode initialize() override;
25  virtual StatusCode execute(const EventContext& ctx) const override;
26  virtual StatusCode finalize() override;
27 
28  // enum defs
29  enum class EStatClusters : std::size_t {
30  kNTotal,
40  kNStat
41  };
42 
43  enum class EStatSeeds : std::size_t {
44  kNTotal,
57  kNStat
58  };
59 
60  enum class EStatTracks : std::size_t {
61  kNTotal,
72  kNStat
73  };
74 
75  enum class SeedType : std::size_t {
76  PPP,
77  SSS,
78  PPS,
79  PSS,
80  Others,
81  nTypes
82  };
83 
84  enum class TrackType : std::size_t {
85  Main,
86  nTypes
87  };
88 
89  private:
90  static constexpr std::size_t s_nClusterTypes = static_cast<std::size_t>(xAOD::UncalibMeasType::nTypes);
91  static constexpr std::size_t s_nSeedTypes = static_cast<std::size_t>(SeedType::nTypes);
93  std::array<std::size_t, s_nClusterTypes>,
94  static_cast<std::size_t>(EStatClusters::kNStat)>;
96  std::array<std::size_t, s_nSeedTypes>,
97  static_cast<std::size_t>(EStatSeeds::kNStat)>;
99  std::array<std::size_t, 1>,
100  static_cast<std::size_t>(EStatTracks::kNStat)>;
101 
104  cluster_stat_t& stat) const;
106  std::array<const ActsTrk::MeasurementToTruthParticleAssociation*, s_nClusterTypes>& truths,
107  seed_stat_t& stat) const;
109  std::array<const ActsTrk::MeasurementToTruthParticleAssociation*, s_nClusterTypes>& truths,
110  track_stat_t& trackStat,
111  cluster_stat_t& onTrackClusterStat) const;
112 
113  template <typename row_t,
114  typename coll_t,
115  typename stat_t>
116  StatusCode printStatTables(const std::string& objectCollectionName,
117  const stat_t& stat) const;
118  template <typename stat_t>
119  StatusCode copyStatTable(const stat_t& contextual,
120  stat_t& global) const;
121 
122  SeedType deduceSeedType(const ActsTrk::Seed&) const;
123 
128 
129  private:
130  mutable std::mutex m_mutex ATLAS_THREAD_SAFE {};
131  mutable cluster_stat_t m_clusterStat ATLAS_THREAD_SAFE {};
132  mutable seed_stat_t m_seedStat ATLAS_THREAD_SAFE {};
133  mutable std::vector<std::pair<std::string, track_stat_t>> m_trackStat ATLAS_THREAD_SAFE {};
134  mutable std::vector<std::pair<std::string, cluster_stat_t>> m_onTrack_clusterStat ATLAS_THREAD_SAFE {};
135 
136  private:
137  inline std::string to_string(xAOD::UncalibMeasType type) const;
143  };
144 
145 } // namespace
146 
148 
149 #endif
ReadHandleKeyArray.h
ActsTrk::ActsInspectTruthContentAlg::EStatTracks::kNTracks3Outliers
@ kNTracks3Outliers
ActsTrk::ActsInspectTruthContentAlg::EStatSeeds::nKSeedsSame4Matches
@ nKSeedsSame4Matches
ActsTrk::TrackContainer
Definition: TrackContainer.h:31
ActsTrk::ActsInspectTruthContentAlg::s_nSeedTypes
static constexpr std::size_t s_nSeedTypes
Definition: ActsInspectTruthContentAlg.h:91
ActsTrk::ActsInspectTruthContentAlg::EStatTracks::kNTracks1Holes
@ kNTracks1Holes
ActsTrk::ActsInspectTruthContentAlg::EStatClusters::kNStat
@ kNStat
ActsTrk::ActsInspectTruthContentAlg::m_clusters
SG::ReadHandleKeyArray< xAOD::UncalibratedMeasurementContainer > m_clusters
Definition: ActsInspectTruthContentAlg.h:124
ActsTrk::ActsInspectTruthContentAlg::to_string
std::string to_string(ActsInspectTruthContentAlg::SeedType type) const
ActsTrk::ActsInspectTruthContentAlg::TrackType::Main
@ Main
ActsTrk::ActsInspectTruthContentAlg::EStatClusters::kNClustersWith200kBarcode
@ kNClustersWith200kBarcode
ActsTrk::ActsInspectTruthContentAlg::EStatClusters::kNClustersWith1ValidContribution
@ kNClustersWith1ValidContribution
BeamSpot::mutex
std::mutex mutex
Definition: InDetBeamSpotVertex.cxx:18
ActsTrk::ActsInspectTruthContentAlg::EStatClusters::kNClustersWith1Contribution
@ kNClustersWith1Contribution
ActsTrk::ActsInspectTruthContentAlg::EStatSeeds::nKSeedsSame6Matches
@ nKSeedsSame6Matches
ActsTrk::ActsInspectTruthContentAlg::EStatTracks::kNTracks0Holes
@ kNTracks0Holes
ActsTrk::ActsInspectTruthContentAlg::TrackType::nTypes
@ nTypes
ActsTrk::ActsInspectTruthContentAlg::EStatSeeds::nKSeedsSame5Matches
@ nKSeedsSame5Matches
ActsTrk::ActsInspectTruthContentAlg::to_label
std::string to_label(ActsInspectTruthContentAlg::EStatTracks type) const
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:38
ActsTrk::ActsInspectTruthContentAlg::m_tracks
SG::ReadHandleKeyArray< ActsTrk::TrackContainer > m_tracks
Definition: ActsInspectTruthContentAlg.h:127
ActsTrk::ActsInspectTruthContentAlg::EStatSeeds::nKSeedsSame3Matches
@ nKSeedsSame3Matches
ActsTrk::ActsInspectTruthContentAlg::EStatSeeds::nKSeedsWith2Matches
@ nKSeedsWith2Matches
ActsTrk::ActsInspectTruthContentAlg::EStatTracks
EStatTracks
Definition: ActsInspectTruthContentAlg.h:60
InDetDD::global
@ global
Definition: InDetDD_Defs.h:16
ActsTrk::ActsInspectTruthContentAlg::EStatTracks::kNTotal
@ kNTotal
ActsTrk::ActsInspectTruthContentAlg::SeedType::nTypes
@ nTypes
ActsTrk::ActsInspectTruthContentAlg::EStatClusters::kNClustersFromPrimaries
@ kNClustersFromPrimaries
ActsTrk::ActsInspectTruthContentAlg::SeedType::SSS
@ SSS
ActsTrk::ActsInspectTruthContentAlg::fillStatClusters
StatusCode fillStatClusters(const xAOD::UncalibratedMeasurementContainer &container, const ActsTrk::MeasurementToTruthParticleAssociation &truth, cluster_stat_t &stat) const
Definition: ActsInspectTruthContentAlg.cxx:146
ActsTrk::MeasurementToTruthParticleAssociation
Definition: MeasurementToTruthParticleAssociation.h:18
ActsTrk::ActsInspectTruthContentAlg::EStatTracks::kNTracks2Holes
@ kNTracks2Holes
SeedContainer.h
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:74
ActsTrk::ActsInspectTruthContentAlg::ActsInspectTruthContentAlg
ActsInspectTruthContentAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: ActsInspectTruthContentAlg.cxx:17
ActsTrk::ActsInspectTruthContentAlg::EStatTracks::kNTracks3Holes
@ kNTracks3Holes
ActsTrk::ActsInspectTruthContentAlg::EStatTracks::kNTracks1Outliers
@ kNTracks1Outliers
ActsTrk::ActsInspectTruthContentAlg::EStatTracks::kNStat
@ kNStat
ActsTrk::ActsInspectTruthContentAlg::EStatSeeds::kNTotal
@ kNTotal
ActsTrk::ActsInspectTruthContentAlg::EStatClusters::kNClustersWith3Contribution
@ kNClustersWith3Contribution
ActsTrk::ActsInspectTruthContentAlg::EStatSeeds::nKSeedsWith5Matches
@ nKSeedsWith5Matches
ActsTrk::ActsInspectTruthContentAlg::SeedType::PPS
@ PPS
ActsTrk::ActsInspectTruthContentAlg::cluster_stat_t
std::array< std::array< std::size_t, s_nClusterTypes >, static_cast< std::size_t >(EStatClusters::kNStat)> cluster_stat_t
Definition: ActsInspectTruthContentAlg.h:94
ActsTrk::ActsInspectTruthContentAlg::EStatSeeds
EStatSeeds
Definition: ActsInspectTruthContentAlg.h:43
ActsTrk::ActsInspectTruthContentAlg::SeedType::PPP
@ PPP
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ActsTrk::ActsInspectTruthContentAlg::SeedType::PSS
@ PSS
ActsTrk::ActsInspectTruthContentAlg::EStatSeeds::nKSeedsWith0Matches
@ nKSeedsWith0Matches
ActsTrk::ActsInspectTruthContentAlg::seed_stat_t
std::array< std::array< std::size_t, s_nSeedTypes >, static_cast< std::size_t >(EStatSeeds::kNStat)> seed_stat_t
Definition: ActsInspectTruthContentAlg.h:97
ActsTrk::ActsInspectTruthContentAlg::printStatTables
StatusCode printStatTables(const std::string &objectCollectionName, const stat_t &stat) const
ActsTrk::ActsInspectTruthContentAlg::m_seeds
SG::ReadHandleKeyArray< ActsTrk::SeedContainer > m_seeds
Definition: ActsInspectTruthContentAlg.h:125
ActsTrk::Seed
Acts::Seed< xAOD::SpacePoint, 3ul > Seed
Definition: Seed.h:12
ActsTrk::ActsInspectTruthContentAlg::to_label
std::string to_label(ActsInspectTruthContentAlg::EStatClusters type) const
ActsTrk::ActsInspectTruthContentAlg::EStatClusters::kNClustersWith2Contribution
@ kNClustersWith2Contribution
MeasurementDefs.h
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
beamspotman.stat
stat
Definition: beamspotman.py:266
ActsTrk::ActsInspectTruthContentAlg::EStatSeeds::nKSeedsSame2Matches
@ nKSeedsSame2Matches
ActsTrk::ActsInspectTruthContentAlg::to_string
std::string to_string(ActsInspectTruthContentAlg::TrackType type) const
AthReentrantAlgorithm.h
lumiFormat.array
array
Definition: lumiFormat.py:91
WriteHandleKey.h
Property holding a SG store/key/clid from which a WriteHandle is made.
xAOD::UncalibMeasType::nTypes
@ nTypes
ActsTrk::ActsInspectTruthContentAlg::EStatSeeds::nKSeedsWith3Matches
@ nKSeedsWith3Matches
ActsTrk::ActsInspectTruthContentAlg::fillStatTracks
StatusCode fillStatTracks(const ActsTrk::TrackContainer &tracks, std::array< const ActsTrk::MeasurementToTruthParticleAssociation *, s_nClusterTypes > &truths, track_stat_t &trackStat, cluster_stat_t &onTrackClusterStat) const
Definition: ActsInspectTruthContentAlg.cxx:305
ActsTrk::ActsInspectTruthContentAlg::fillStatSeeds
StatusCode fillStatSeeds(const ActsTrk::SeedContainer &seeds, std::array< const ActsTrk::MeasurementToTruthParticleAssociation *, s_nClusterTypes > &truths, seed_stat_t &stat) const
Definition: ActsInspectTruthContentAlg.cxx:199
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
ActsTrk::ActsInspectTruthContentAlg::EStatClusters::kNTotal
@ kNTotal
ActsTrk::ActsInspectTruthContentAlg::EStatClusters::kNClustersWith3ValidContribution
@ kNClustersWith3ValidContribution
ActsInspectTruthContentAlg.icc
ActsTrk::ActsInspectTruthContentAlg::EStatSeeds::nKSeedsWith4Matches
@ nKSeedsWith4Matches
ActsTrk::ActsInspectTruthContentAlg::EStatSeeds::nKSeedsWith6Matches
@ nKSeedsWith6Matches
ActsTrk::ActsInspectTruthContentAlg::TrackType
TrackType
Definition: ActsInspectTruthContentAlg.h:84
ActsTrk::ActsInspectTruthContentAlg::SeedType
SeedType
Definition: ActsInspectTruthContentAlg.h:75
ActsTrk::ActsInspectTruthContentAlg::to_label
std::string to_label(ActsInspectTruthContentAlg::EStatSeeds type) const
ActsTrk::ActsInspectTruthContentAlg::ATLAS_THREAD_SAFE
std::mutex m_mutex ATLAS_THREAD_SAFE
Definition: ActsInspectTruthContentAlg.h:130
ActsTrk::ActsInspectTruthContentAlg::EStatSeeds::nKSeedsWith1Matches
@ nKSeedsWith1Matches
ActsTrk::ActsInspectTruthContentAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition: ActsInspectTruthContentAlg.cxx:79
ActsTrk::ActsInspectTruthContentAlg::EStatTracks::kNPerfectMatch
@ kNPerfectMatch
ActsTrk::ActsInspectTruthContentAlg::EStatClusters::kNClustersWithNoBarcode
@ kNClustersWithNoBarcode
ActsTrk::ActsInspectTruthContentAlg::SeedType::Others
@ Others
xAOD::UncalibMeasType
UncalibMeasType
Define the type of the uncalibrated measurement.
Definition: MeasurementDefs.h:25
ActsTrk::ActsInspectTruthContentAlg::copyStatTable
StatusCode copyStatTable(const stat_t &contextual, stat_t &global) const
ActsTrk::ActsInspectTruthContentAlg::EStatClusters
EStatClusters
Definition: ActsInspectTruthContentAlg.h:29
ActsTrk::ActsInspectTruthContentAlg::EStatTracks::kNFullMatch
@ kNFullMatch
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:55
ActsTrk::ActsInspectTruthContentAlg
Definition: ActsInspectTruthContentAlg.h:19
MeasurementToTruthParticleAssociation.h
ActsTrk::ActsInspectTruthContentAlg::track_stat_t
std::array< std::array< std::size_t, 1 >, static_cast< std::size_t >(EStatTracks::kNStat)> track_stat_t
Definition: ActsInspectTruthContentAlg.h:100
ActsTrk::ActsInspectTruthContentAlg::initialize
virtual StatusCode initialize() override
Definition: ActsInspectTruthContentAlg.cxx:22
ActsTrk::ActsInspectTruthContentAlg::~ActsInspectTruthContentAlg
virtual ~ActsInspectTruthContentAlg() override=default
ActsTrk::ActsInspectTruthContentAlg::EStatTracks::kNTracks0Outliers
@ kNTracks0Outliers
ActsTrk::ActsInspectTruthContentAlg::deduceSeedType
SeedType deduceSeedType(const ActsTrk::Seed &) const
Definition: ActsInspectTruthContentAlg.cxx:277
ActsTrk::ActsInspectTruthContentAlg::finalize
virtual StatusCode finalize() override
Definition: ActsInspectTruthContentAlg.cxx:45
TrackContainer.h
ActsTrk::ActsInspectTruthContentAlg::s_nClusterTypes
static constexpr std::size_t s_nClusterTypes
Definition: ActsInspectTruthContentAlg.h:90
ActsTrk::ActsInspectTruthContentAlg::EStatTracks::kNTracks2Outliers
@ kNTracks2Outliers
ActsTrk::ActsInspectTruthContentAlg::m_associationMap_key
SG::ReadHandleKeyArray< ActsTrk::MeasurementToTruthParticleAssociation > m_associationMap_key
Definition: ActsInspectTruthContentAlg.h:126
ActsTrk::ActsInspectTruthContentAlg::EStatClusters::kNClustersWith2ValidContribution
@ kNClustersWith2ValidContribution
ActsTrk::ActsInspectTruthContentAlg::EStatSeeds::kNStat
@ kNStat
ActsTrk::ActsInspectTruthContentAlg::to_string
std::string to_string(xAOD::UncalibMeasType type) const
TrackType
Definition: TrackTypes.h:10