30 if (not trackParticle) {
33 auto pCache =
m_cache.find(trackParticle);
35 return pCache->second;
41 if (truthParticleLinkAcc.
isAvailable(*trackParticle)) {
43 const ElementTruthLink_t ptruthContainer = truthParticleLinkAcc(*trackParticle);
44 if (ptruthContainer.isValid()) {
Helper class to provide constant type-safe access to aux data.
ElementLink implementation for ROOT usage.
void clear()
clear the cache
const xAOD::TruthParticle * operator()(const xAOD::TrackParticle *trackParticle)
Get the associated truth particle, given a track particle.
std::unordered_map< const xAOD::TrackParticle *, const xAOD::TruthParticle * > m_cache
private cache container; map or unordered_map could be used
static void neededTrackParticleDecorations(std::vector< std::string > &decorations)
static const std::string s_trackParticleLinkDecorationName
const xAOD::TruthParticle * getTruth(const xAOD::TrackParticle *const trackParticle)
Helper class to provide constant type-safe access to aux data.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Class to retrieve associated truth from a track, implementing a cached response.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TruthParticle_v1 TruthParticle
Typedef to implementation.