From b11a6f323f2f6d249215dccbad04a940441ac681 Mon Sep 17 00:00:00 2001
From: Rafal Bielski <rafal.bielski@cern.ch>
Date: Sun, 2 Oct 2022 20:55:52 +0200
Subject: [PATCH] Enable legacy L1Calo/L1Topo reco in CA for Run3 data

Enable legacy L1Calo/L1Topo reco in CA for Run3 data
---
 .../TriggerJobOpts/python/TriggerRecoConfig.py | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerRecoConfig.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerRecoConfig.py
index 91fdbe256f90..26eee7ca92f8 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerRecoConfig.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerRecoConfig.py
@@ -49,14 +49,6 @@ def TriggerRecoCfg(flags):
     elif flags.Trigger.EDMVersion in [1, 2]:
         acc.merge( Run1Run2BSExtractionCfg(flags) )
 
-        from AnalysisTriggerAlgs.AnalysisTriggerAlgsCAConfig import RoIBResultToxAODCfg
-        xRoIBResultAcc, _ = RoIBResultToxAODCfg(flags)
-        acc.merge( xRoIBResultAcc )
-
-        if flags.Input.Format is Format.BS:
-            from L1TopoByteStream.L1TopoByteStreamConfig import L1TopoRawDataContainerBSCnvCfg
-            acc.merge( L1TopoRawDataContainerBSCnvCfg(flags) )
-
         from TrigDecisionMaker.TrigDecisionMakerConfig import Run1Run2DecisionMakerCfg
         acc.merge (Run1Run2DecisionMakerCfg(flags) )
 
@@ -65,6 +57,16 @@ def TriggerRecoCfg(flags):
     else:
         raise RuntimeError("Invalid EDMVersion=%s " % flags.Trigger.EDMVersion)
 
+    # Legacy L1Calo, L1Topo reco
+    if flags.Trigger.enableL1CaloLegacy:
+        from AnalysisTriggerAlgs.AnalysisTriggerAlgsCAConfig import RoIBResultToxAODCfg
+        xRoIBResultAcc, _ = RoIBResultToxAODCfg(flags)
+        acc.merge( xRoIBResultAcc )
+
+        if flags.Input.Format is Format.BS:
+            from L1TopoByteStream.L1TopoByteStreamConfig import L1TopoRawDataContainerBSCnvCfg
+            acc.merge( L1TopoRawDataContainerBSCnvCfg(flags) )
+
     if flags.Output.doWriteESD or flags.Output.doWriteAOD:
         acc.merge(TriggerEDMCfg(flags))
 
-- 
GitLab