Skip to content

Improve Reduction methods for jagged arrays

Benjamin Krikler requested to merge BK_improve_reductions into master

This improves handling of jagged array reductions from the config:

  1. You can now select the nth object in an event by specifying an integer as the argument to reduce
  2. 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}

Merge request reports