std::size_t CompositeParticle_v1::FUNCNAME() const { \
std::size_t n(0); \
std::size_t nParts = this->nOtherParts(); \
for ( std::size_t i=0; i<nParts; ++i ) { \
if (!part) { throw std::runtime_error("Got a zero pointer to an xAOD::IParticle!"); } \
if (!truthParticle) { throw std::runtime_error("Zero pointer to xAOD::TruthParticle"); } \
if ( PIDMETHOD(truthParticle->
pdgId()) ) {
n += 1; } \
} \
}
int pdgId() const
PDG ID code.
@ TruthParticle
The object is a truth particle.
TruthParticle_v1 TruthParticle
Typedef to implementation.
1045#define NUM_OTHERTRUTHPARTS( FUNCNAME, PIDMETHOD ) \
1046 std::size_t CompositeParticle_v1::FUNCNAME() const { \
1047 std::size_t n(0); \
1048 std::size_t nParts = this->nOtherParts(); \
1049 for ( std::size_t i=0; i<nParts; ++i ) { \
1050 const xAOD::IParticle* part = this->otherPart(i); \
1051 if (!part) { throw std::runtime_error("Got a zero pointer to an xAOD::IParticle!"); } \
1052 if ( part->type() != xAOD::Type::TruthParticle ) { continue; } \
1053 const xAOD::TruthParticle* truthParticle = dynamic_cast<const xAOD::TruthParticle*>(part); \
1054 if (!truthParticle) { throw std::runtime_error("Zero pointer to xAOD::TruthParticle"); } \
1055 if ( PIDMETHOD(truthParticle->pdgId()) ) { n += 1; } \
1056 } \
1057 return n; \
1058 }