From f9550b3c7ebc59874dacf35c4a6285879fc27aba Mon Sep 17 00:00:00 2001
From: Nils Erik Krumnack <nils.erik.krumnack@cern.ch>
Date: Tue, 7 May 2024 13:25:46 +0200
Subject: [PATCH] expose skipSystematicJetSelection option in
 MetAnalysisConfig, rename associated property in MetMaker tool

expose doSimpleOR option in MetAnalysisConfig

This should make it easier for more users to run their own tests with
this simplified OR scheme.  It is not meant for actual physics analysis,
but strictly to simplify such performance studies.
---
 .../MetAnalysisAlgorithms/python/MetAnalysisConfig.py  |  6 ++++++
 .../MET/METUtilities/METUtilities/METMaker.h           |  2 +-
 Reconstruction/MET/METUtilities/Root/METMaker.cxx      | 10 +++++++---
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/python/MetAnalysisConfig.py b/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/python/MetAnalysisConfig.py
index e8467ad038b2..b47b3eff204d 100644
--- a/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/python/MetAnalysisConfig.py
+++ b/PhysicsAnalysis/Algorithms/MetAnalysisAlgorithms/python/MetAnalysisConfig.py
@@ -44,6 +44,11 @@ class MetAnalysisConfig (ConfigBlock):
         self.addOption ('metWP', "Tight", type=str,
             info="the MET working point to use: Loose, Tight, Tighter, "
             "Tenacious")
+        self.addOption ('skipSystematicJetSelection', False, type=bool,
+            info="EXPERIMENTAL: whether to use simplified OR based on nominal jets "
+            "and for jet-related systematics only. "
+            "WARNING: this option is strictly for doing physics studies of the feasibility "
+            "of this OR scheme, it should not be used in a regular analysis")
 
     def makeAlgs (self, config) :
 
@@ -67,6 +72,7 @@ class MetAnalysisConfig (ConfigBlock):
         alg = config.createAlgorithm( 'CP::MetMakerAlg', 'MetMakerAlg' + postfix)
         config.addPrivateTool( 'makerTool', 'met::METMaker' )
         config.addPrivateTool( 'makerTool.JvtSelTool', 'CP::NNJvtSelectionTool' )
+        alg.makerTool.skipSystematicJetSelection = self.skipSystematicJetSelection
         alg.makerTool.JvtSelTool.JetContainer = config.readName (self.jets)
         alg.makerTool.JetSelection = self.metWP
         alg.makerTool.DoPFlow = 'PFlow' in metSuffix or metSuffix=="AnalysisMET"
diff --git a/Reconstruction/MET/METUtilities/METUtilities/METMaker.h b/Reconstruction/MET/METUtilities/METUtilities/METMaker.h
index ab801fb9bf19..583b85b9c331 100644
--- a/Reconstruction/MET/METUtilities/METUtilities/METMaker.h
+++ b/Reconstruction/MET/METUtilities/METUtilities/METMaker.h
@@ -213,7 +213,7 @@ namespace met {
     bool m_doRemoveElecTrks;
     bool m_doRemoveElecTrksEM;
     bool m_doSetMuonJetEMScale;
-    bool m_doSimpleOR;
+    bool m_skipSystematicJetSelection;
 
     bool m_muEloss;
     bool m_orCaloTaggedMuon;
diff --git a/Reconstruction/MET/METUtilities/Root/METMaker.cxx b/Reconstruction/MET/METUtilities/Root/METMaker.cxx
index 1fa2b63cea70..6e8a02f36976 100644
--- a/Reconstruction/MET/METUtilities/Root/METMaker.cxx
+++ b/Reconstruction/MET/METUtilities/Root/METMaker.cxx
@@ -142,7 +142,11 @@ namespace met {
     declareProperty("DoRemoveElecTrks",   m_doRemoveElecTrks   = true                );
     declareProperty("DoRemoveElecTrksEM", m_doRemoveElecTrksEM = false               );
 
-    declareProperty("DoSimpleOR",         m_doSimpleOR         = false                );
+    declareProperty("skipSystematicJetSelection", m_skipSystematicJetSelection = false,
+            "EXPERIMENTAL: whether to use simplified OR based on nominal jets "
+            "and for jet-related systematics only. "
+            "WARNING: this property is strictly for doing physics studies of the feasibility "
+            "of this OR scheme, it should not be used in a regular analysis");
 
     // muon overlap variables (expert use only)
     declareProperty("JetTrkNMuOlap",      m_jetTrkNMuOlap = 5                        );
@@ -232,7 +236,7 @@ namespace met {
     ATH_MSG_INFO("Suppressing warnings of objects missing in METAssociationMap for objects with pT < " << m_missObjWarningPtThreshold/1e3 << " GeV.");
 
     // overlap removal simplification?
-    if (m_doSimpleOR) {
+    if (m_skipSystematicJetSelection) {
       ATH_MSG_INFO("Requesting simplified overlap removal procedure in MET calculation");
     }
     
@@ -719,7 +723,7 @@ namespace met {
 
         // init nominal_jet and either actually asign nominal jet or fall back to systematic jet
         const xAOD::Jet * nominal_jet = nullptr;
-        if(m_doSimpleOR) {
+        if(m_skipSystematicJetSelection) {
           // retrieve nominal calibrated jet
           if (acc_nominalObject.isAvailable(*jet))
             nominal_jet = static_cast<const xAOD::Jet*>(*acc_nominalObject(*jet));
-- 
GitLab