7 namespace GenParticlesHelper {
13 for(
IG ig = sourceParticles.begin();
14 ig!= sourceParticles.end(); ++ig, ++
index) {
33 int status,
int pdgId ) {
39 idr!= daughterRefs.
end(); ++idr ) {
41 if( (*idr)->status() == status &&
42 (!pdgId ||
std::abs((*idr)->pdgId()) == pdgId) ) {
58 assert( baseSister->numberOfMothers() > 0 );
65 = mothers[0]->daughterRefVector();
68 for(IT
id = allRefs.
begin();
72 if( *
id == baseSister ) {
82 assert( (particle->status() != 0) && (particle->status() < 4 ) );
83 if( particle->status() == 3 )
86 assert( particle->numberOfMothers() > 0 );
90 if( mothers[0]->
status() == 3 )
99 int pdgId,
int status ) {
101 if( particle->
pdgId() == pdgId &&
107 for(
IGR im = mothers.
begin(); im!=mothers.
end(); ++im) {
122 out<<genRef.
key()<<
" "<<genRef->pt();
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
reco::GenParticleRefVector::const_iterator IGR
void findParticles(const reco::GenParticleCollection &sourceParticles, reco::GenParticleRefVector &particleRefs, int pdgId, int status)
find all particles of a given pdgId and status
virtual int pdgId() const GCC11_FINAL
PDG identifier.
bool isDirect(const reco::GenParticleRef &particle)
check if particle is direct (has status 3 or is a daughter of particle with status 3) ...
reco::GenParticleCollection::const_iterator IG
const_iterator end() const
Termination of iteration.
const_iterator begin() const
Initialize an iterator over the RefVector.
std::ostream & operator<<(std::ostream &, BeamSpot beam)
virtual int status() const GCC11_FINAL
status word
const mothers & motherRefVector() const
references to mothers
Abs< T >::type abs(const T &t)
std::vector< LinkConnSpec >::const_iterator IT
key_type key() const
Accessor for product key.
bool hasAncestor(const reco::GenParticle *particle, int pdgId, int status)
does the particle have an ancestor with this pdgId and this status?
void push_back(value_type const &ref)
Add a Ref<C, T> to the RefVector.
void findSisters(const reco::GenParticleRef &baseSister, reco::GenParticleRefVector &sisterRefs)
find the particles having the same daughter as baseSister
void findDescendents(const reco::GenParticleRef &base, reco::GenParticleRefVector &descendents, int status, int pdgId=0)
find all descendents of a given status and pdgId (recursive)