|
ATLAS Offline Software
|
Go to the documentation of this file.
20 const ElementTruthLink_t ptruthContainer =
21 truthParticleLinkAcc(
track);
22 if (ptruthContainer.isValid()) {
29 std::vector<const xAOD::TrackParticle*>
35 }
catch (
const std::out_of_range& oor) {
36 throw std::out_of_range(
37 "Truth particle was not found in lookup map. Did you remember to call TrackTruthLookup::cache?");
47 }
catch (
const std::out_of_range& oor) {
48 throw std::out_of_range(
49 "Track particle was not found in lookup map. Did you remember to call TrackTruthLookup::cache?");
108 const std::vector<const xAOD::TruthParticle*>* truthParticlesVec) {
std::unordered_map< const xAOD::TruthParticle *, std::vector< const xAOD::TrackParticle * > > m_mapTruth
Class to retrieve associated truth from a track, implementing a cached response.
const xAOD::TruthParticle * getTruth(const xAOD::TrackParticle *track) const
Accessor to get the unique xAOD::TruthParticle associated with 'track', or a nullptr is none is assoc...
Helper class to provide constant type-safe access to aux data.
void clear()
Clears the contents of the unordered map data members.
Class describing a truth particle in the MC record.
const xAOD::TruthParticle * getTruthPointer(const xAOD::TrackParticle &track)
std::vector< const xAOD::TrackParticle * > getTracks(const xAOD::TruthParticle *truth) const
Accessor to get the vector of xAOD::TrackParticles associated with 'truth', possibly empty if none is...
ElementLink implementation for ROOT usage.
void cache(const xAOD::TrackParticleContainer *trackParticles, const std::vector< const xAOD::TruthParticle * > *truthParticlesVec)
Cache using a vector of TruthParticles, for compatibility with datatype returned from the xAOD::Truth...
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
std::unordered_map< const xAOD::TrackParticle *, const xAOD::TruthParticle * > m_mapTrack
Data member(s).
Class describing a TrackParticle.
Helper class to provide constant type-safe access to aux data.
void cacheTruth(const xAOD::TruthParticleContainer *truthParticles)
void cacheTracks(const xAOD::TrackParticleContainer *trackParticles)
bool contains(const xAOD::TruthParticle *truth) const
Returns true if the Lookup contains the pointer 'truth'.