Skip to content

Iterators for the Gen/HepMC tree

Pieter David requested to merge piedavid/bamboo:geniterators into master

Suggested by @swertz (thanks!). In NanoAOD only the parent GenPart index is stored, so only iterating over the ancestors is possible (the parent is in genPartMother - maybe it would be more consistent to put it also in parent?).

Caveat: genparticle.ancestors behaves like a range, but it only provides a forward-traversal iterator, so op.rng_len does not work for now (op.rng_count does; it should be possible to fix this in the decorators).

I'll try to also make this work for the trees used in phase2 physics studies, where a larger part of the HepMC record is stored (then "children" and "descendants" ranges are also possible), hence the WIP status.

Edited by Pieter David

Merge request reports