46 return std::abs(
pdgId() );
64 acc_prodVtxLink(
"prodVtxLink" );
71 return ( acc_prodVtxLink.isAvailable( *
this ) &&
72 acc_prodVtxLink( *this ).isValid() );
82 prodVtxLink, setProdVtxLink )
96 ElementLink< TruthVertexContainer >,
97 decayVtxLink, setDecayVtxLink )
109 acc_parentLinks(
"parentLinks" );
120 }
else if ( acc_parentLinks.isAvailable( *
this ) ) {
121 return acc_parentLinks( *this ).size();
129 }
else if ( acc_parentLinks.isAvailable( *
this ) && i<acc_parentLinks( *this ).size() ) {
130 return acc_parentLinks( *
this )[i].isValid() ? *(acc_parentLinks( *
this )[i]) :
nullptr;
164 const double localPx =
static_cast< double >(
px() );
165 const double localPy =
static_cast< double >(
py() );
166 return std::sqrt( localPx * localPx + localPy * localPy );
202 return Type::TruthParticle;
215 return std::abs(
eta() );
232 acc( *
this ) = value;
238 acc( *
this ) = value;
251#define MC_PID_HELPER( TYPE, FNAME ) \
252 TYPE TruthParticle_v1::FNAME() const { \
253 return MC::FNAME( pdgId() ); \
332 std::cerr <<
"xAOD::TruthParticle_v1::polarizationParameter ERROR "
333 <<
"Request for an unknown (" << param <<
") polarization "
334 <<
"parameter type" << std::endl;
338 if( !
acc->isAvailable( *
this ) ) {
344 value = ( *acc )( *this );
355 std::cerr <<
"xAOD::TruthParticle_v1::setPolarizationParameter ERROR "
356 <<
"Request for an unknown (" << param <<
") polarization "
357 <<
"parameter type" << std::endl;
362 ( *acc )( *this ) = value;
372 throw std::runtime_error(
"Unrecognized polarization parameter "
377 return ( *
acc )( *this );
395 if( acc_prodVtxLink.isAvailableWritable( *
this ) ) {
396 acc_prodVtxLink( *this ).toPersistent();
bool hasStrange(const T &p)
bool isBottomBaryon(const T &p)
bool isBottomMeson(const T &p)
bool isElectron(const T &p)
bool isChLepton(const T &p)
APID: the fourth generation leptons are leptons.
bool isStrangeHadron(const T &p)
bool isLepton(const T &p)
APID: the fourth generation leptons are leptons.
bool isHiggs(const T &p)
APID: HIGGS boson is only one particle.
bool isLightBaryon(const T &p)
bool isCharged(const T &p)
bool isHeavyMeson(const T &p)
bool hasBottom(const T &p)
bool isLightHadron(const T &p)
double charge(const T &p)
bool isResonance(const T &p)
bool isParton(const T &p)
bool isStrangeBaryon(const T &p)
bool hasCharm(const T &p)
bool isBottomHadron(const T &p)
bool isQuark(const T &p)
PDG rule 2: Quarks and leptons are numbered consecutively starting from 1 and 11 respectively; to do ...
bool isMeson(const T &p)
Table 43.1 PDG rule 5a: The numbers specifying the meson’s quark content conform to the convention nq...
bool isNeutrino(const T &p)
APID: the fourth generation neutrinos are neutrinos.
bool isCharmBaryon(const T &p)
bool isPhoton(const T &p)
bool isHeavyBaryon(const T &p)
double threeCharge(const T &p)
bool isCharmMeson(const T &p)
bool isBaryon(const T &p)
Table 43.2 APID: states with fourth generation quarks are not baryons.
bool isCharmHadron(const T &p)
bool isHadron(const T &p)
bool isLightMeson(const T &p)
bool isStrangeMeson(const T &p)
bool isHeavyHadron(const T &p)
bool isGenSpecific(const T &p)
Main Table for MC internal use 81–100,901–930,998-999,1901–1930,2901–2930, and 3901–3930.
bool isBSM(const T &p)
APID: graviton and all Higgs extensions are BSM.
bool isNeutral(const T &p)
Base class for elements of a container that can have aux data.
#define AUXSTORE_PRIMITIVE_GETTER_WITH_CAST(CL, PERSTYPE, TRANSTYPE, NAME)
Macro creating a getter function with a type conversion.
#define AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
Macro creating the accessors of primitive auxiliary properties.
#define AUXSTORE_OBJECT_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
Macro creating the accessors of complex auxiliary properties.
ATLAS-specific HepMC functions.
#define MC_PID_HELPER(TYPE, FNAME)
Helper macro to implement the functions that rely in functions from MC:: namespace.
SG::ConstAccessor< T, ALLOC > ConstAccessor
SG::Accessor< T, ALLOC > Accessor
SG::Accessor< T, ALLOC > Accessor
Class describing a truth particle in the MC record.
bool isSimulationParticle() const
Check if this particle was produced during the simulation.
const TruthParticle_v1 * child(size_t i) const
Retrieve the i-th mother (TruthParticle) of this TruthParticle.
double abseta() const
The absolute pseudorapidity ( ) of the particle.
IParticle::FourMom_t FourMom_t
Definition of the 4-momentum type.
double absrapidity() const
The true absolute rapidity ( ) of the particle.
virtual double rapidity() const override final
The true rapidity ( ) of the particle.
void toPersistent()
Function making sure that the object is ready for persistification.
GenVecFourMom_t genvecP4() const
The full 4-momentum of the particle : GenVector form.
void setM(float value)
Also store the mass.
void setE(float value)
Set the energy of the particle.
bool isStable() const
Check if this is a stable particle (generator or simulation produced)
int pdgId() const
PDG ID code.
const ElementLink< TruthVertexContainer > & decayVtxLink() const
The decay vertex link of this particle.
const TruthVertex_v1 * decayVtx() const
The decay vertex of this particle.
TruthParticle_v1()
Default constructor.
const TruthParticle_v1 * parent(size_t i) const
Retrieve the i-th mother (TruthParticle) of this TruthParticle.
Polarization polarization() const
Retrieve a full Polarization with a single call.
int absPdgId() const
Absolute PDG ID code (often useful)
bool hasProdVtx() const
Check for a production vertex on this particle.
virtual Type::ObjectType type() const override final
The type of the object as a simple enumeration.
float px() const
The x component of the particle's momentum.
bool hasDecayVtx() const
Check for a decay vertex on this particle.
virtual double e() const override final
The total energy of the particle.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
bool isGenStable() const
Check if this is generator stable particle.
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > GenVecFourMom_t
Base 4 Momentum type for TruthParticle.
bool setPolarizationParameter(float value, PolParam parameter)
Set method for polarization parameter values.
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
float py() const
The y component of the particle's momentum.
size_t nParents() const
Number of parents of this particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
virtual double phi() const override final
The azimuthal angle ( ) of the particle.
size_t nChildren() const
Number of children of this particle.
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
bool polarizationParameter(float &value, PolParam parameter) const
Accessor for polarization parameters.
float pz() const
The z component of the particle's momentum.
PolParam
Polarization parameter types.
@ polarizationPhi
Polarization in ( )
@ polarizationTheta
Polarization in ( )
const ElementLink< TruthVertexContainer > & prodVtxLink() const
The production vertex link of this particle.
const TruthParticle_v1 * outgoingParticle(size_t index) const
Get one of the outgoing particles.
const TruthParticle_v1 * incomingParticle(size_t index) const
Get one of the incoming particles.
size_t nOutgoingParticles() const
Get the number of outgoing particles.
size_t nIncomingParticles() const
Get the number of incoming particles.
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
bool isGenStable(const T &p)
Determine if the particle is stable at the generator (not det-sim) level,.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
const SG::AuxElement::Accessor< float > * polarizationAccessorV1(TruthParticle_v1::PolParam type)
This function holds on to Accessor objects that can be used by each TruthParticle_v1 object at runtim...
static AUXSTORE_OBJECT_SETTER_AND_GETTER(TruthParticle_v1, ElementLink< TruthVertexContainer >, prodVtxLink, setProdVtxLink) bool TruthParticle_v1 const SG::AuxElement::ConstAccessor< std::vector< ElementLink< xAOD::TruthParticleContainer > > > acc_childLinks("childLinks")
TruthVertex_v1 TruthVertex
Typedef to implementation.
static const SG::AuxElement::Accessor< ElementLink< IParticleContainer > > acc("originalObjectLink")
Object used for setting/getting the dynamic decoration in question.
static AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(TruthParticle_v1, int, pdgId, setPdgId) int TruthParticle_v1 const SG::AuxElement::Accessor< ElementLink< TruthVertexContainer > > acc_decayVtxLink("decayVtxLink")
Accessor for the decay vertex.
Single container for full polarization information.
float phi
Polarization in ( )
float theta
Polarization in ( )