6 namespace GenParticlesHelper {
13 for (
IG ig = sourceParticles.begin(); ig != sourceParticles.end(); ++ig, ++
index) {
34 for (
IGR idr = daughterRefs.
begin(); idr != daughterRefs.
end(); ++idr) {
35 if ((*idr)->status() == status && (!pdgId ||
std::abs((*idr)->pdgId()) == pdgId)) {
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) {
96 out << genRef.
key() <<
" " << genRef->pt();
std::vector< GenParticle > GenParticleCollection
collection of GenParticles
reco::GenParticleRefVector::const_iterator IGR
uint16_t *__restrict__ id
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
key_type key() const
Accessor for product key.
reco::GenParticleCollection::const_iterator IG
const_iterator end() const
Termination of iteration.
const_iterator begin() const
Initialize an iterator over the RefVector.
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
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)