13 for (
IG ig = sourceParticles.begin(); ig != sourceParticles.end(); ++ig, ++
index) {
34 for (
IGR idr = daughterRefs.
begin(); idr != daughterRefs.
end(); ++idr) {
44 assert(baseSister->numberOfMothers() > 0);
53 for (
IT id = allRefs.
begin();
id != allRefs.
end(); ++
id) {
54 if (*
id == baseSister) {
62 assert((particle->status() != 0) && (particle->status() < 4));
63 if (particle->status() == 3)
66 assert(particle->numberOfMothers() > 0);
70 if (mothers[0]->
status() == 3)
83 for (
IGR im = mothers.
begin(); im != mothers.
end(); ++im) {
99 out <<
"key:" << genRef.
key() <<
" pt:" << genRef->pt();
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
void findParticles(const reco::GenParticleCollection &sourceParticles, reco::GenParticleRefVector &particleRefs, int pdgId, int status)
find all particles of a given pdgId and status
bool isDirect(const reco::GenParticleRef &particle)
check if particle is direct (has status 3 or is a daughter of particle with status 3) ...
int status() const final
status word
reco::GenParticleCollection::const_iterator IG
key_type key() const
Accessor for product key.
int pdgId() const final
PDG identifier.
std::ostream & operator<<(std::ostream &, BeamSpot beam)
const mothers & motherRefVector() const
references to mothers
Abs< T >::type abs(const T &t)
std::vector< LinkConnSpec >::const_iterator IT
const_iterator end() const
Termination of iteration.
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
const_iterator begin() const
Initialize an iterator over the RefVector.
void findDescendents(const reco::GenParticleRef &base, reco::GenParticleRefVector &descendents, int status, int pdgId=0)
find all descendents of a given status and pdgId (recursive)