1 #ifndef PhysicsTools_HepMCCandAlgos_GenParticlesHelper_h 2 #define PhysicsTools_HepMCCandAlgos_GenParticlesHelper_h 5 #include "HepPDT/ParticleID.hh" 11 #include <unordered_set> 204 return p.status()==1 &&
isPrompt(p);
235 return tau && tau==
dm;
243 return tau && tau==dm &&
isPrompt(*tau);
270 return heppdtid.isHadron();
278 if (p.status()==3)
return true;
281 if (p.status()>20 && p.status()<30)
return true;
287 if (p.status()==1 || p.status()==2) {
291 bool fromResonance = firstcopy && firstcopy->status()==22;
294 bool fsrBranching = umNext && umNext->status()>50 && umNext->status()<60;
296 if (fromResonance && !fsrBranching)
return true;
340 if (p.status()==3)
return true;
344 if (!hpc)
return false;
348 if (hpc->status()==21 && (&
p)==hpc)
return true;
351 if (hpc->status()==22 &&
isLastCopy(p))
return true;
426 if (!pcopy)
return 0;
427 bool hasDaughterCopy =
true;
429 while (hasDaughterCopy) {
431 hasDaughterCopy =
false;
434 for (
unsigned int idau = 0; idau<ndau; ++idau) {
442 for (
unsigned int idau = 0; idau<ndau; ++idau) {
446 hasDaughterCopy =
true;
460 bool hasDaughterCopy =
true;
462 while (hasDaughterCopy) {
464 hasDaughterCopy =
false;
467 for (
unsigned int idau = 0; idau<ndau; ++idau) {
475 for (
unsigned int idau = 0; idau<ndau; ++idau) {
479 hasDaughterCopy =
true;
511 for (
unsigned int imoth = 0; imoth<nmoth; ++imoth) {
512 const P *moth =
mother(p,imoth);
526 for (
unsigned int idau = 0; idau<ndau; ++idau) {
595 return p.production_vertex() ? p.production_vertex()->particles_in_size() : 0;
607 return p.production_vertex() && p.production_vertex()->particles_in_size() ? *(p.production_vertex()->particles_in_const_begin() + imoth) : 0;
619 return p.end_vertex() ? p.end_vertex()->particles_out_size() : 0;
631 return *(p.end_vertex()->particles_out_const_begin() + idau);
const P * lastDaughterCopyBeforeFSR(const P &p)
bool isTauDecayProduct(const P &p)
void fillGenStatusFlags(const P &p, reco::GenStatusFlags &statusFlags)
bool fromHardProcess(const P &p)
bool isDirectHadronDecayProduct(const P &p)
const P * hardProcessMotherCopy(const P &p)
bool isPromptMuonDecayProduct(const P &p)
bool fromHardProcessFinalState(const P &p)
unsigned int numberOfMothers(const reco::GenParticle &p)
bool isDirectPromptTauDecayProduct(const P &p)
const reco::GenParticle * daughter(const reco::GenParticle &p, unsigned int idau)
void setIsLastCopyBeforeFSR(bool b)
void setIsTauDecayProduct(bool b)
void setIsDirectPromptTauDecayProduct(bool b)
bool isPromptFinalState(const P &p)
bool isHardProcess(const P &p)
void setIsDirectHadronDecayProduct(bool b)
bool isPrompt(const P &p)
void setIsDirectHardProcessTauDecayProduct(bool b)
void setIsHardProcess(bool b)
bool isLastCopyBeforeFSR(const P &p)
unsigned int numberOfDaughters(const reco::GenParticle &p)
bool isPromptDecayed(const P &p)
bool isDirectHardProcessTauDecayProduct(const P &p)
const P * uniqueMother(const P &p)
const P * firstCopy(const P &p)
const P * findDecayedMother(const P &p)
const P * previousCopy(const P &p)
virtual size_t numberOfMothers() const
number of mothers
bool isFirstCopy(const P &p)
virtual size_t numberOfDaughters() const
number of daughters
virtual const Candidate * daughter(size_type) const
return daughter at a given position, i = 0, ... numberOfDaughters() - 1 (read only mode) ...
virtual int pdgId() const final
PDG identifier.
Abs< T >::type abs(const T &t)
void setIsHardProcessTauDecayProduct(bool b)
bool isHardProcessTauDecayProduct(const P &p)
void setFromHardProcess(bool b)
bool isDirectTauDecayProduct(const P &p)
const P * nextCopy(const P &p)
bool isHadron(const P &p)
bool fromHardProcessDecayed(const P &p)
void setIsPromptTauDecayProduct(bool b)
int absPdgId(const reco::GenParticle &p)
bool isPromptTauDecayProduct(const P &p)
void setIsDecayedLeptonHadron(bool b)
void setIsFirstCopy(bool b)
std::unordered_set< const P * > dupCheck_
std::pair< OmniClusterRef, TrackingParticleRef > P
bool isDecayedLeptonHadron(const P &p)
bool fromHardProcessBeforeFSR(const P &p)
bool isMuonDecayProduct(const P &p)
void setIsDirectTauDecayProduct(bool b)
void setFromHardProcessBeforeFSR(bool b)
bool isLastCopy(const P &p)
const P * lastCopy(const P &p)
void setIsLastCopy(bool b)
const P * lastCopyBeforeFSR(const P &p)
int pdgId(const reco::GenParticle &p)
virtual const Candidate * mother(size_type=0) const
return mother at a given position, i = 0, ... numberOfMothers() - 1 (read only mode) ...
const reco::GenParticle * mother(const reco::GenParticle &p, unsigned int imoth=0)