14 typedef std::pair<HepMC::ConstGenParticlePtr, unsigned int> Parent;
15 std::vector<Parent> parents;
16 parents.push_back(Parent(particle, 0));
17 while (!parents.empty()) {
19 const unsigned int level = parents.back().second;
20 if (std::abs(p->pdg_id()) == 15) { result.set(
TAU_PARENT_BIT, 1); }
21 if (std::abs(p->pdg_id()) == 5) { result.set(
B_PARENT_BIT, 1); }
24 if (result.count() ==
NBITS) {
break; }
26 if (!(p->production_vertex())) {
continue; }
29 parents.push_back(Parent(i, level + 1));
32 for (HepMC::GenVertex::particle_iterator i = p->production_vertex()->particles_begin(HepMC::parents), f = p->production_vertex()->particles_end(HepMC::parents); i != f; ++i) {
33 parents.push_back(Parent(*i, level + 1));