6#include "AthLinks/ElementLink.h"
31 static const SG::AuxElement::ConstAccessor< Link_t >
acc(
"truthParticleLink" );
34 if(
acc.isAvailable( p ) ) {
36 const Link_t& link =
acc( p );
39 if( link.isValid() ) {
46 static const SG::AuxElement::ConstAccessor< Link_t > acc_alt(
"TruthLink" );
49 if( acc_alt.isAvailable( p ) ) {
51 const Link_t& link_alt = acc_alt( p );
54 if( link_alt.isValid() ) {
72 for(
size_t i{}; i < particle.nChildren(); ++i ) {
75 if( particle.child( i ) !=
nullptr && particle.child( i )->pdgId() == particle.pdgId() ) {
94 static const SG::AuxElement::ConstAccessor< int >
acc(
"truthType" );
97 if( !
acc.isAvailable( p ) ) {
112 static const SG::AuxElement::ConstAccessor< int >
acc(
"truthOrigin" );
115 if( !
acc.isAvailable( p ) ) {
130 static const SG::AuxElement::ConstAccessor< unsigned int >
acc(
"truthClassification" );
131 static const SG::AuxElement::ConstAccessor< unsigned int > accLegacy(
"Classification" );
134 if( !
acc.isAvailable( p ) ) {
135 if( ! accLegacy.isAvailable( p ) ) {
140 return accLegacy( p );
Base class for elements of a container that can have aux data.
ElementLink implementation for ROOT usage.
Class providing the definition of the 4-vector interface.
Dedicated namespace for the helper functions.
const xAOD::TruthParticle * getFinalCopy(const xAOD::TruthParticle &particle)
Return the final copy of the truth particle (or same particle if no copies done).
const xAOD::TruthParticle * getTruthParticle(const xAOD::IParticle &p)
Return the truthParticle associated to the given IParticle (if any).
int getParticleTruthClassification(const xAOD::IParticle &p)
Return the particle's truth classification (as defined by the MC Truth Classifier).
int getParticleTruthType(const xAOD::IParticle &p)
Return the particle's truth type (as defined by the MC Truth Classifier).
int getParticleTruthOrigin(const xAOD::IParticle &p)
Return the particle's truth origin (as defined by the MC Truth Classifier).
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
TruthParticle_v1 TruthParticle
Typedef to implementation.
static const SG::AuxElement::Accessor< ElementLink< IParticleContainer > > acc("originalObjectLink")
Object used for setting/getting the dynamic decoration in question.