1 #ifndef PhysicsTools_HepMCCandAlgos_GenParticlesHelper_h
2 #define PhysicsTools_HepMCCandAlgos_GenParticlesHelper_h
5 #include "HepPDT/ParticleID.hh"
12 namespace MCTruthHelper {
214 namespace MCTruthHelper {
231 return p.status()==1 &&
isPrompt(p);
262 return tau && tau==dm;
270 return tau && tau==dm &&
isPrompt(*tau);
297 return heppdtid.isHadron();
305 if (p.status()==3)
return true;
308 if (p.status()>20 && p.status()<30)
return true;
314 if (p.status()==1 || p.status()==2) {
317 bool fromResonance =
firstCopy(*um)->status()==22;
320 bool fsrBranching = umNext && umNext->status()>50 && umNext->status()<60;
322 if (fromResonance && !fsrBranching)
return true;
366 if (p.status()==3)
return true;
370 if (!hpc)
return false;
374 if (hpc->status()==21 && (&
p)==hpc)
return true;
377 if (hpc->status()==22 &&
isLastCopy(p))
return true;
443 bool hasDaughterCopy =
true;
444 while (hasDaughterCopy) {
445 hasDaughterCopy =
false;
448 for (
unsigned int idau = 0; idau<ndau; ++idau) {
456 for (
unsigned int idau = 0; idau<ndau; ++idau) {
460 hasDaughterCopy =
true;
473 bool hasDaughterCopy =
true;
474 while (hasDaughterCopy) {
475 hasDaughterCopy =
false;
478 for (
unsigned int idau = 0; idau<ndau; ++idau) {
486 for (
unsigned int idau = 0; idau<ndau; ++idau) {
490 hasDaughterCopy =
true;
518 for (
unsigned int imoth = 0; imoth<nmoth; ++imoth) {
519 const P *moth =
mother(p,imoth);
533 for (
unsigned int idau = 0; idau<ndau; ++idau) {
590 return p.production_vertex() ? p.production_vertex()->particles_in_size() : 0;
600 return p.production_vertex() && p.production_vertex()->particles_in_size() ? *(p.production_vertex()->particles_in_const_begin() + imoth) : 0;
610 return p.end_vertex() ? p.end_vertex()->particles_out_size() : 0;
620 return *(p.end_vertex()->particles_out_const_begin() + idau);
bool fromHardProcessDecayed(const P &p)
int absPdgId(const reco::GenParticle &p)
virtual int pdgId() const
PDG identifier.
unsigned int numberOfDaughters(const reco::GenParticle &p)
unsigned int numberOfMothers(const reco::GenParticle &p)
bool isDirectTauDecayProduct(const P &p)
bool isPromptMuonDecayProduct(const P &p)
bool isTauDecayProduct(const P &p)
const reco::GenParticle * mother(const reco::GenParticle &p, unsigned int imoth=0)
bool fromHardProcessFinalState(const P &p)
bool isPrompt(const P &p)
const P * lastCopyBeforeFSR(const P &p)
void setIsLastCopyBeforeFSR(bool b)
bool isHadron(const P &p)
bool isDirectHadronDecayProduct(const P &p)
void setIsTauDecayProduct(bool b)
void setIsDirectPromptTauDecayProduct(bool b)
void fillGenStatusFlags(const P &p, reco::GenStatusFlags &statusFlags)
void setIsDirectHadronDecayProduct(bool b)
bool isPromptTauDecayProduct(const P &p)
bool fromHardProcess(const P &p)
void setIsDirectHardProcessTauDecayProduct(bool b)
void setIsHardProcess(bool b)
const P * findDecayedMother(const P &p)
bool isHardProcessTauDecayProduct(const P &p)
virtual size_t numberOfMothers() const
number of mothers
virtual size_t numberOfDaughters() const
number of daughters
bool isLastCopyBeforeFSR(const P &p)
virtual const Candidate * daughter(size_type) const
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
bool isMuonDecayProduct(const P &p)
const reco::GenParticle * daughter(const reco::GenParticle &p, unsigned int idau)
Abs< T >::type abs(const T &t)
void setIsHardProcessTauDecayProduct(bool b)
const P * previousCopy(const P &p)
const P * firstCopy(const P &p)
void setFromHardProcess(bool b)
bool isPromptFinalState(const P &p)
bool isDirectHardProcessTauDecayProduct(const P &p)
void setIsPromptTauDecayProduct(bool b)
void setIsDecayedLeptonHadron(bool b)
bool isFirstCopy(const P &p)
const P * hardProcessMotherCopy(const P &p)
void setIsFirstCopy(bool b)
int pdgId(const reco::GenParticle &p)
bool isDirectPromptTauDecayProduct(const P &p)
const P * uniqueMother(const P &p)
const P * nextCopy(const P &p)
bool fromHardProcessBeforeFSR(const P &p)
bool isLastCopy(const P &p)
void setIsDirectTauDecayProduct(bool b)
const P * lastCopy(const P &p)
void setFromHardProcessBeforeFSR(bool b)
bool isPromptDecayed(const P &p)
bool isDecayedLeptonHadron(const P &p)
void setIsLastCopy(bool b)
const P * lastDaughterCopyBeforeFSR(const P &p)
bool isHardProcess(const P &p)
virtual const Candidate * mother(size_type=0) const
return mother at a given position, i = 0, ... numberOfMothers() - 1 (read only mode) ...