Skip to content

CPAlgorithms: better default options for OR

Baptiste Ravina requested to merge ravinab/athena:better_default_or into main

This MR attempts to simplify a little bit the YAML config needed by users who request ≥2 Overlap Removal setups (e.g. one on tight leptons and one on loose leptons, common for fake estimations). The changes are as follows:

  • addToAllSelections has its default changed from True to False: when we define e.g. AnaElectrons.tight and AnaElectrons.loose, we may want to run OR only on AnaElectrons.tight. Having addToAllSelections set to True will add that OR decision also to AnaElectrons.loose - but a loose-not-tight electron gets a failed flag from the OR tool, which means that AnaElectrons.loose is now equivalent to AnaElectrons.tight and that can't be the desired behaviour by default.
  • to avoid issues with duplicated names, the output branch with the OR decision is called select_or if it is meant to be applied to the entire containers, or select_or_<user label> otherwise.
  • if a user specifies the property e.g. electronsSelectionName, we apply the OR decision on top of that selection. If no such property is specified, we look at the electron container that was passed as input and check if a selection is specified (e.g. AnaElectrons.tight vs AnaElectrons). If there is one, we use it. If not, we fall back on selectionName (which may be set, or maybe the empty string and once again means we apply the OR decision to the entire container.

As an example, for a fake estimation in a ttbar lepton+jets analysis, one would previously need to set up the OR block as follows:

OverlapRemoval:
  - inputLabel: 'preselectORtight'
    outputLabel: 'passesORtight'
    jets: 'AnaJets.baselineJvt'
    electrons: 'AnaElectrons.tight'
    muons: 'AnaMuons.tight'
    electronsSelectionName: 'tight'
    muonsSelectionName: 'tight'
    jetsSelectionName: 'baselineJvt'
    addToAllSelections: False
  - inputLabel: 'preselectORloose'
    outputLabel: 'passesORloose'
    jets: 'AnaJets.baselineJvt'
    electrons: 'AnaElectrons.loose'
    muons: 'AnaMuons.loose'
    electronsSelectionName: 'loose'
    muonsSelectionName: 'loose'
    jetsSelectionName: 'baselineJvtLoose'
    selectionName: 'notuseful'
    addToAllSelections: False

which seems rather redundant (and most of these options have to be set manually, and are rather hard to understand without extensive documentation / tutorial). With this MR, the setup is simplified to:

OverlapRemoval:
  - inputLabel: 'preselectORtight'
    outputLabel: 'passesORtight'
    jets: 'AnaJets.baselineJvt'
    electrons: 'AnaElectrons.tight'
    muons: 'AnaMuons.tight'
  - inputLabel: 'preselectORloose'
    outputLabel: 'passesORloose'
    jets: 'AnaJets.baselineJvt'
    electrons: 'AnaElectrons.loose'
    muons: 'AnaMuons.loose'
    jetsSelectionName: 'baselineJvtLoose'

where one creates a new jet selection 'baselineJvtLoose' since different jets might be overlap-removed with respect to loose or tight leptons.

I also filled in a couple of info-strings that were missing.

Merge request reports