ATLAS Offline Software
CachedGetAssocTruth.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef IDPVM_CachedGetAssocTruth_h
6 #define IDPVM_CachedGetAssocTruth_h
7 
14 #include <unordered_map>
15 #include <string>
18 
20 namespace IDPVM {
22  public:
23  CachedGetAssocTruth() = default;
26  ~CachedGetAssocTruth() = default;
31  void clear();
33  const xAOD::TruthParticle* operator () (const xAOD::TrackParticle* trackParticle);
34  const xAOD::TruthParticle* getTruth(const xAOD::TrackParticle* const trackParticle);
35  private:
37  std::unordered_map<const xAOD::TrackParticle*, const xAOD::TruthParticle*> m_cache;
38  };
39 }// end of namespace
40 #endif
IDPVM
Class to retrieve associated truth from a track, implementing a cached response.
Definition: InDetPhysValMonitoringTool.h:55
IDPVM::CachedGetAssocTruth::clear
void clear()
clear the cache
Definition: CachedGetAssocTruth.cxx:17
IDPVM::CachedGetAssocTruth
Definition: CachedGetAssocTruth.h:21
IDPVM::CachedGetAssocTruth::~CachedGetAssocTruth
~CachedGetAssocTruth()=default
IDPVM::CachedGetAssocTruth::CachedGetAssocTruth
CachedGetAssocTruth(const CachedGetAssocTruth &)=delete
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:41
IDPVM::CachedGetAssocTruth::getTruth
const xAOD::TruthParticle * getTruth(const xAOD::TrackParticle *const trackParticle)
Definition: CachedGetAssocTruth.cxx:22
IDPVM::CachedGetAssocTruth::operator=
CachedGetAssocTruth & operator=(CachedGetAssocTruth &&)=default
IDPVM::CachedGetAssocTruth::operator()
const xAOD::TruthParticle * operator()(const xAOD::TrackParticle *trackParticle)
Get the associated truth particle, given a track particle.
Definition: CachedGetAssocTruth.cxx:46
IDPVM::CachedGetAssocTruth::CachedGetAssocTruth
CachedGetAssocTruth(CachedGetAssocTruth &&)=default
TrackParticle.h
IDPVM::CachedGetAssocTruth::CachedGetAssocTruth
CachedGetAssocTruth()=default
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
IDPVM::CachedGetAssocTruth::m_cache
std::unordered_map< const xAOD::TrackParticle *, const xAOD::TruthParticle * > m_cache
private cache container; map or unordered_map could be used
Definition: CachedGetAssocTruth.h:37
TruthParticle.h