#include <CachedGetAssocTruth.h>
Definition at line 21 of file CachedGetAssocTruth.h.
◆ CachedGetAssocTruth() [1/3]
| IDPVM::CachedGetAssocTruth::CachedGetAssocTruth |
( |
| ) |
|
|
default |
◆ CachedGetAssocTruth() [2/3]
◆ ~CachedGetAssocTruth()
| IDPVM::CachedGetAssocTruth::~CachedGetAssocTruth |
( |
| ) |
|
|
default |
◆ CachedGetAssocTruth() [3/3]
◆ clear()
| void IDPVM::CachedGetAssocTruth::clear |
( |
| ) |
|
clear the cache
Definition at line 17 of file CachedGetAssocTruth.cxx.
17 {
19 }
std::unordered_map< const xAOD::TrackParticle *, const xAOD::TruthParticle * > m_cache
private cache container; map or unordered_map could be used
◆ getTruth()
Definition at line 29 of file CachedGetAssocTruth.cxx.
29 {
30 if (not trackParticle) {
31 return nullptr;
32 }
33 auto pCache =
m_cache.find(trackParticle);
35 return pCache->second;
36 }
37 using ElementTruthLink_t = ElementLink<xAOD::TruthParticleContainer>;
40
41 if (truthParticleLinkAcc.isAvailable(*trackParticle)) {
42
43 const ElementTruthLink_t ptruthContainer = truthParticleLinkAcc(*trackParticle);
44 if (ptruthContainer.isValid()) {
46 }
47 }
50 }
static const std::string s_trackParticleLinkDecorationName
TruthParticle_v1 TruthParticle
Typedef to implementation.
◆ neededTrackParticleDecorations()
| void IDPVM::CachedGetAssocTruth::neededTrackParticleDecorations |
( |
std::vector< std::string > & | decorations | ) |
|
|
static |
◆ operator()()
Get the associated truth particle, given a track particle.
Definition at line 53 of file CachedGetAssocTruth.cxx.
53 {
55 }
const xAOD::TruthParticle * getTruth(const xAOD::TrackParticle *const trackParticle)
◆ operator=() [1/2]
◆ operator=() [2/2]
copy and assignment are not possible
◆ m_cache
◆ s_trackParticleLinkDecorationName
| const std::string IDPVM::CachedGetAssocTruth::s_trackParticleLinkDecorationName |
|
staticprivate |
The documentation for this class was generated from the following files: