Improve Reduction methods for jagged arrays
This improves handling of jagged array reductions from the config:
- You can now select the
nth
object in an event by specifying an integer as the argument toreduce
- You can now call reductions within a selection stage, eg to cut on the lead or sub-leading jet.
Example config file:
stages:
- define: fast_carpenter.define.Define
- base_selection: fast_carpenter.selection.CutFlow
define:
variables:
- SubLeadJet_pt {reduce: 1, formula: CleanedJet_pt}
base_selection:
selection:
All:
- nPhoton == 0
# Cut on the leading jet pt
- {reduce: 0, formula: CleanedJet_pt > 40}