ATLAS Offline Software
MeasurementToTruthParticleAssociation.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 MEASUREMENTTOGENPARTICLEASSOCIATION_H
5 #define MEASUREMENTTOGENPARTICLEASSOCIATION_H
6 #include "boost/container/small_vector.hpp"
9 #include "AthLinks/DataLink.h"
10 #include <vector>
11 
12 namespace ActsTrk
13 {
14  constexpr unsigned int NTruthParticlesPerMeasurement = 5; // chosen to make the small_vector fit into 164 bytes
15  // a tiny fraction of measurements will have more than
16  // 5 associated GenParticles
17  using ParticleVector = boost::container::small_vector<const xAOD::TruthParticle *, NTruthParticlesPerMeasurement>;
18  class MeasurementToTruthParticleAssociation : public std::vector<ParticleVector> {
19  public:
20  using std::vector<ParticleVector>::vector ;
21 
23  m_sourceMeasurements = std::move(source);
24  }
26  return m_sourceMeasurements.getDataPtr();
27  }
29  return container == m_sourceMeasurements;
30  }
31 
32  // convenience methods to convert "data-links" to derived measurement container
33  template <class T_MeasurementContainer>
34  void setSourceContainer(const T_MeasurementContainer &source, const EventContext &ctx) {
36  }
37  template <class T_MeasurementContainer>
40  }
41 
42  private:
44  };
45 
46 }
47 
48 #include "AthenaKernel/CLASS_DEF.h"
50 
51 #endif
ActsTrk::MeasurementToTruthParticleAssociation::setSourceContainer
void setSourceContainer(DataLink< xAOD::UncalibratedMeasurementContainer > &&source)
Definition: MeasurementToTruthParticleAssociation.h:22
ActsTrk::MeasurementToTruthParticleAssociation
Definition: MeasurementToTruthParticleAssociation.h:18
UncalibratedMeasurementContainer.h
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
ActsTrk::ParticleVector
boost::container::small_vector< const xAOD::TruthParticle *, NTruthParticlesPerMeasurement > ParticleVector
Definition: MeasurementToTruthParticleAssociation.h:17
ActsTrk::MeasurementToTruthParticleAssociation::m_sourceMeasurements
DataLink< xAOD::UncalibratedMeasurementContainer > m_sourceMeasurements
Definition: MeasurementToTruthParticleAssociation.h:43
ActsTrk::MeasurementToTruthParticleAssociation::sourceContainer
const xAOD::UncalibratedMeasurementContainer * sourceContainer() const
Definition: MeasurementToTruthParticleAssociation.h:25
CLASS_DEF
#define CLASS_DEF(NAME, CID, VERSION)
associate a clid and a version to a type eg
Definition: Control/AthenaKernel/AthenaKernel/CLASS_DEF.h:64
ActsTrk::MeasurementToTruthParticleAssociation::setSourceContainer
void setSourceContainer(const T_MeasurementContainer &source, const EventContext &ctx)
Definition: MeasurementToTruthParticleAssociation.h:34
ActsTrk
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
Definition: MuonDetectorBuilderTool.cxx:49
copySelective.source
string source
Definition: copySelective.py:32
TruthParticle.h
CLASS_DEF.h
macros to associate a CLID to a type
ActsTrk::MeasurementToTruthParticleAssociation::setSourceContainer
void setSourceContainer(const DataLink< T_MeasurementContainer > &source)
Definition: MeasurementToTruthParticleAssociation.h:38
ActsTrk::NTruthParticlesPerMeasurement
constexpr unsigned int NTruthParticlesPerMeasurement
Definition: MeasurementToTruthParticleAssociation.h:14
ActsTrk::MeasurementToTruthParticleAssociation::isCompatibleWith
bool isCompatibleWith(const xAOD::UncalibratedMeasurementContainer *container) const
Definition: MeasurementToTruthParticleAssociation.h:28