31 const std::string& name,
32 const IInterface* parent)
48 CHECK( AthAlgTool::initialize() );
50 return StatusCode::SUCCESS;
62 return std::get<2>(
m_classifier->particleTruthClassifier_full(&g));
78 RconvMC = +9.999e+10 ;
79 ZconvMC = +9.999e+10 ;
80 if (!truePart)
return false;
83 if (!v || v->nOutgoingParticles() < 2)
86 int pdgId = truePart->
pdgId();
94 if ( v->nOutgoingParticles() == 2 ) {
95 int pdgChild[2] = {0};
96 for (
unsigned u=0; u<2 ; ++u) {
99 pdgChild[u] = p->pdgId();
101 if ( pdgChild[0]+pdgChild[1]==0 && pdgChild[0]*pdgChild[1]==-121 ) {
107 else if ( std::abs(pdgId) == 11 ) {
109 if ( v->nIncomingParticles()==1 && v->nOutgoingParticles()==2 ) {
110 int pdgBrother[2] = {0};
111 for (
unsigned u=0 ; u<2 ; ++u ) {
114 pdgBrother[u] = p->pdgId();
116 if ( pdgBrother[0]+pdgBrother[1]==(22+pdgId) &&
117 pdgBrother[0]*pdgBrother[1]==(22*pdgId) )
144 if ( truePart == 0 )
return false ;
145 const std::vector<const xAOD::TruthParticle*> mothers =
147 unsigned nmothers = mothers.size() ;
148 if ( nmothers == 0 ) {
152 else if ( nmothers == 1 ) {
156 int aPdgMother = abs(mothers[0]->pdgId());
157 return (( aPdgMother>=23 && aPdgMother<=39 ) || aPdgMother==5000039 ) ;
163 int nParentPartons = 0 ;
164 for (
unsigned u=0 ; u<nmothers ; ++u ) {
165 int pdgMother = mothers[u]->pdgId() ;
166 if ( pdgMother==21 || ( std::abs(pdgMother)<7 && pdgMother!=0 ) )
169 return ( nParentPartons >= 1 ) ;
181 const std::vector<const xAOD::TruthParticle*> mothers =
183 if ( mothers.size() != 1 )
return false ;
184 int pdgMother = mothers[0]->pdgId() ;
185 return ( pdgMother==21 || ( std::abs(pdgMother)<7 && pdgMother!=0 ) ) ;
205 if ( truePart ==
nullptr )
return false;
218 if (!v)
return false;
219 if ( v->nOutgoingParticles()>0 ) {
236 while (v && v->nIncomingParticles() == 1 &&
237 v->incomingParticle(0)->pdgId() == p->pdgId())
239 p = v->incomingParticle(0);
255 if (!v || v->nIncomingParticles() == 0)
258 return v->incomingParticle(0);
265std::vector<const xAOD::TruthParticle*>
268 std::vector<const xAOD::TruthParticle*> out;
272 int n = v->nIncomingParticles();
274 for (
int i = 0; i < n; i++)
275 out.push_back (v->incomingParticle(i));
Helpers for checking error return status codes and reporting errors.
#define CHECK(...)
Evaluate an expression and check for errors.
ATLAS-specific HepMC functions.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
int pdgId() const
PDG ID code.
const TruthVertex_v1 * decayVtx() const
The decay vertex of this particle.
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
Block filler tool for noisy FEB information.
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 isPhoton(const T &p)
bool isElectron(const T &p)
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
TruthVertex_v1 TruthVertex
Typedef to implementation.
TruthParticle_v1 TruthParticle
Typedef to implementation.
Photon_v1 Photon
Definition of the current "egamma version".