ATLAS Offline Software
Loading...
Searching...
No Matches
TrackToTruthParticleAssociation.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4#ifndef TRACKTOGENPARTICLEASSOCIATION_H
5#define TRACKTOGENPARTICLEASSOCIATION_H
6#include "boost/container/small_vector.hpp"
10#include "AthLinks/DataLink.h"
11#include <vector>
12#include <array>
13#include <cstdint>
14#include <utility>
15
16namespace ActsTrk
17{
18 // NHitCounter is the number of types, without the Other (i.e. unknown) type
19 constexpr unsigned int NHitCounter = static_cast< std::underlying_type<xAOD::UncalibMeasType>::type >(xAOD::UncalibMeasType::nTypes);
20 constexpr unsigned int NTruthParticlesPerTrack = 5; // a tiny fraction of measurements will have more than
21 // 5 associated GenParticles
22
23 // Wrapper around std::array to ensure that by default elements are initialised to zero
24 class HitCounterArray : public std::array<uint8_t, NHitCounter>
25 {
26 public:
27 HitCounterArray() : std::array<uint8_t, NHitCounter>{} {}
28 };
29
38 public:
39 using container = boost::container::small_vector<std::pair<const xAOD::TruthParticle *, HitCounterArray >, NTruthParticlesPerTrack>;
40
43 const container &countsPerTruthParticle() const { return m_counts; }
44
48
52
55 const HitCounterArray &totalCounts() const { return m_recoCounts[kTotal]; }
56
60
63 const HitCounterArray &noiseCounts() const { return m_recoCounts[kNoise]; }
64
65 private:
68 std::array<HitCounterArray,kNRecoCounts> m_recoCounts;
69 };
70
71 class TrackToTruthParticleAssociation : public std::vector<HitCountsPerTrack> {
72 public:
73 using std::vector<HitCountsPerTrack>::vector ;
74
76 m_sourceTracks = std::move(source);
77 }
79 return m_sourceTracks.getDataPtr();
80 }
81
82 private:
84 };
85}
86
89
90#endif
macros to associate a CLID to a type
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Container for hit counts per track Contains hit counts per associated truth particle and the total hi...
const HitCounterArray & noiseCounts() const
Noise hit counts per track (read only).
const HitCounterArray & totalCounts() const
Total hit counts per track (read only).
boost::container::small_vector< std::pair< const xAOD::TruthParticle *, HitCounterArray >, NTruthParticlesPerTrack > container
const container & countsPerTruthParticle() const
vector with counts per associated truth particle (read only)
std::array< HitCounterArray, kNRecoCounts > m_recoCounts
container & countsPerTruthParticle()
vector with counts per associated truth particle
HitCounterArray & noiseCounts()
Noise hit counts per track.
HitCounterArray & totalCounts()
Total hit counts per track.
void setSourceContainer(DataLink< ActsTrk::TrackContainer > &&source)
const ActsTrk::TrackContainer * sourceContainer() const
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
constexpr unsigned int NHitCounter
constexpr unsigned int NTruthParticlesPerTrack
STL namespace.