From 4b1249a0f6facc59ef6aaf76933492748e249c46 Mon Sep 17 00:00:00 2001
From: Giovanni Marchiori <giovanni.marchiori@cern.ch>
Date: Fri, 31 May 2024 17:51:22 +0200
Subject: [PATCH 1/3] automatic formatting by black

---
 .../DerivationFrameworkEGamma/python/EGAM2.py       | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/python/EGAM2.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/python/EGAM2.py
index 4020357e188a..7db347d657ea 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/python/EGAM2.py
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/python/EGAM2.py
@@ -179,7 +179,9 @@ def EGAM2KernelCfg(flags, name="EGAM2Kernel", **kwargs):
     # Gain and cluster energies per layer decoration tool
     # ====================================================================
     from DerivationFrameworkCalo.DerivationFrameworkCaloConfig import (
-        CaloDecoratorKernelCfg)
+        CaloDecoratorKernelCfg,
+    )
+
     acc.merge(CaloDecoratorKernelCfg(flags))
 
     # thinning tools
@@ -348,6 +350,15 @@ def EGAM2Cfg(flags):
     EGAM2TriggerListsHelper = TriggerListsHelper(flags)
 
     # configure skimming/thinning/augmentation tools
+    # add some single-leg trigger matching info needed for Jpsi triggers
+    if flags.Trigger.EDMVersion == 2:
+        EGAM2TriggerListsHelper.Run2TriggerNamesNoTau.extend(
+            [
+                "HLT_e5_lhtight_nod0",
+                "HLT_e9_lhtight_nod0",
+                "HLT_e14_lhtight_nod0",
+            ]
+        )
     acc.merge(
         EGAM2KernelCfg(
             flags,
-- 
GitLab


From 7e855e14c76b94ae8ed70f3ea9928eb4422869ba Mon Sep 17 00:00:00 2001
From: Giovanni Marchiori <giovanni.marchiori@cern.ch>
Date: Tue, 4 Jun 2024 00:27:02 +0200
Subject: [PATCH 2/3] fix for running in train

---
 .../DerivationFrameworkEGamma/python/EGAM2.py | 35 +++++++++++++------
 1 file changed, 24 insertions(+), 11 deletions(-)

diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/python/EGAM2.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/python/EGAM2.py
index 7db347d657ea..bf27e11246bc 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/python/EGAM2.py
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/python/EGAM2.py
@@ -157,7 +157,7 @@ def EGAM2KernelCfg(flags, name="EGAM2Kernel", **kwargs):
 
     acc.merge(
         PhysCommonAugmentationsCfg(
-            flags, TriggerListsHelper=kwargs["TriggerListsHelper"]
+            flags, TriggerListsHelper=kwargs["TriggerListsHelper"],
         )
     )
 
@@ -349,16 +349,6 @@ def EGAM2Cfg(flags):
 
     EGAM2TriggerListsHelper = TriggerListsHelper(flags)
 
-    # configure skimming/thinning/augmentation tools
-    # add some single-leg trigger matching info needed for Jpsi triggers
-    if flags.Trigger.EDMVersion == 2:
-        EGAM2TriggerListsHelper.Run2TriggerNamesNoTau.extend(
-            [
-                "HLT_e5_lhtight_nod0",
-                "HLT_e9_lhtight_nod0",
-                "HLT_e14_lhtight_nod0",
-            ]
-        )
     acc.merge(
         EGAM2KernelCfg(
             flags,
@@ -508,6 +498,29 @@ def EGAM2Cfg(flags):
             OutputContainerPrefix="TrigMatch_",
             TriggerList=EGAM2TriggerListsHelper.Run2TriggerNamesNoTau,
         )
+
+        # add some single-leg trigger matching info needed for Jpsi triggers
+        from DerivationFrameworkPhys.TriggerMatchingCommonConfig import (
+            TriggerMatchingCommonRun2Cfg
+        )
+        EGAM2TrigMatchList = [
+            "HLT_e5_lhtight_nod0",
+            "HLT_e9_lhtight_nod0",
+            "HLT_e14_lhtight_nod0",
+        ]
+        acc.merge(TriggerMatchingCommonRun2Cfg(
+            flags,
+            name="EGAM2TrigMatch",
+            OutputContainerPrefix="TrigMatch_",
+            ChainNames=EGAM2TrigMatchList)
+        )
+
+        AddRun2TriggerMatchingToSlimmingHelper(
+            SlimmingHelper=EGAM2SlimmingHelper,
+            OutputContainerPrefix="TrigMatch_",
+            TriggerList=EGAM2TrigMatchList
+        )
+
     # Run 3
     if flags.Trigger.EDMVersion == 3:
         from TrigNavSlimmingMT.TrigNavSlimmingMTConfig import (
-- 
GitLab


From 16b83b5355e3d491e411e4bfecd40566bd80c5fb Mon Sep 17 00:00:00 2001
From: Giovanni Marchiori <giovanni.marchiori@cern.ch>
Date: Tue, 4 Jun 2024 00:31:06 +0200
Subject: [PATCH 3/3] fix for running in train

---
 .../DerivationFrameworkEGamma/python/EGAM2.py                  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/python/EGAM2.py b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/python/EGAM2.py
index bf27e11246bc..2b38d3729ffd 100644
--- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/python/EGAM2.py
+++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/python/EGAM2.py
@@ -157,7 +157,7 @@ def EGAM2KernelCfg(flags, name="EGAM2Kernel", **kwargs):
 
     acc.merge(
         PhysCommonAugmentationsCfg(
-            flags, TriggerListsHelper=kwargs["TriggerListsHelper"],
+            flags, TriggerListsHelper=kwargs["TriggerListsHelper"]
         )
     )
 
@@ -349,6 +349,7 @@ def EGAM2Cfg(flags):
 
     EGAM2TriggerListsHelper = TriggerListsHelper(flags)
 
+    # configure skimming/thinning/augmentation tools
     acc.merge(
         EGAM2KernelCfg(
             flags,
-- 
GitLab