From a3dad7b94e8ff77d21180b16a703d449e12a7ada Mon Sep 17 00:00:00 2001
From: Savanna Marie Shaw <savanna.marie.shaw@cern.ch>
Date: Thu, 17 Nov 2022 11:24:14 +0100
Subject: [PATCH] Change default setting of run3Commissioning flag for muon
 trigger

Setting the default value of the run3Commissioning flag for the new JO in the muon trigger to be False. This is to align with the same flag in the old-style JO which is False by default in the trigger. As discussed in ATR-26543, the different default behaviour was causing some confusion.
---
 .../python/TriggerConfigFlags.py              |  1 +
 .../python/HLT/Muon/MuonMenuSequences.py      | 22 ++++++++++++++-----
 2 files changed, 17 insertions(+), 6 deletions(-)

diff --git a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py
index 14dd155c4a2c..7b1bc95e7f0f 100644
--- a/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py
+++ b/Trigger/TriggerCommon/TriggerJobOpts/python/TriggerConfigFlags.py
@@ -295,6 +295,7 @@ def createTriggerRecoFlags():
         muonflags.Muon.useTGCPriorNextBC=True
         muonflags.Muon.MuonTrigger=True
         muonflags.Muon.SAMuonTrigger=True
+        muonflags.Muon.runCommissioningChain=False
         return muonflags
 
     def __muon():
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Muon/MuonMenuSequences.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Muon/MuonMenuSequences.py
index 9efcf2e37825..51c93907707e 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Muon/MuonMenuSequences.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLT/Muon/MuonMenuSequences.py
@@ -52,9 +52,11 @@ def muFastAlgSequence(ConfigFlags):
     #
     l2MuViewsMaker.ViewFallThrough = True
 
-    ### get muFast reco sequence ###    
+    ### get muFast reco sequence ###   
+    #Clone and replace offline flags so we can set muon trigger specific values
+    muonflags = ConfigFlags.cloneAndReplace('Muon', 'Trigger.Offline.SA.Muon') 
     from .MuonRecoSequences import muFastRecoSequence, muonDecodeCfg
-    viewAlgs_MuonPRD = algorithmCAToGlobalWrapper(muonDecodeCfg,ConfigFlags,RoIs=l2MuViewsMaker.InViewRoIs.path())
+    viewAlgs_MuonPRD = algorithmCAToGlobalWrapper(muonDecodeCfg,muonflags,RoIs=l2MuViewsMaker.InViewRoIs.path())
     
     ##### L2 mutli-track mode #####
     from TrigMuonEF.TrigMuonEFConf import MuonChainFilterAlg
@@ -103,8 +105,10 @@ def muFastCalibAlgSequence(ConfigFlags):
     l2MuViewsMaker.ViewFallThrough = True
 
     ### get muFast reco sequence ###
+    #Clone and replace offline flags so we can set muon trigger specific values
+    muonflags = ConfigFlags.cloneAndReplace('Muon', 'Trigger.Offline.SA.Muon') 
     from .MuonRecoSequences import muFastRecoSequence, muonDecodeCfg
-    viewAlgs_MuonPRD = algorithmCAToGlobalWrapper(muonDecodeCfg,ConfigFlags,RoIs=l2MuViewsMaker.InViewRoIs.path())
+    viewAlgs_MuonPRD = algorithmCAToGlobalWrapper(muonDecodeCfg,muonflags,RoIs=l2MuViewsMaker.InViewRoIs.path())
 
     from .MuonRecoSequences  import  isCosmic
     muFastRecoSeq, sequenceOut = muFastRecoSequence( l2MuViewsMaker.InViewRoIs, doFullScanID= isCosmic(), calib=True )
@@ -442,9 +446,11 @@ def muEFSAAlgSequence(ConfigFlags):
     efsaViewsMaker.RequireParentView = True
     efsaViewsMaker.ViewFallThrough = True
 
+    #Clone and replace offline flags so we can set muon trigger specific values
+    muonflags = ConfigFlags.cloneAndReplace('Muon', 'Trigger.Offline.SA.Muon') 
     from .MuonRecoSequences import muEFSARecoSequence, muonDecodeCfg
     #Run decoding again since we are using updated RoIs
-    viewAlgs_MuonPRD = algorithmCAToGlobalWrapper(muonDecodeCfg,ConfigFlags,RoIs=efsaViewsMaker.InViewRoIs.path())
+    viewAlgs_MuonPRD = algorithmCAToGlobalWrapper(muonDecodeCfg,muonflags,RoIs=efsaViewsMaker.InViewRoIs.path())
     ### get EF reco sequence ###    
     muEFSARecoSequence, sequenceOut = muEFSARecoSequence( efsaViewsMaker.InViewRoIs, 'RoI' )
 
@@ -663,8 +669,10 @@ def muEFSAFSAlgSequence(ConfigFlags):
     efsafsInputMaker.ViewFallThrough=True
 
     ### get EF reco sequence ###    
+    #Clone and replace offline flags so we can set muon trigger specific values
+    muonflags = ConfigFlags.cloneAndReplace('Muon', 'Trigger.Offline.SA.Muon') 
     from .MuonRecoSequences import muEFSARecoSequence, muonDecodeCfg
-    viewAlgs_MuonPRD = algorithmCAToGlobalWrapper(muonDecodeCfg,ConfigFlags,RoIs=efsafsInputMaker.InViewRoIs.path())
+    viewAlgs_MuonPRD = algorithmCAToGlobalWrapper(muonDecodeCfg,muonflags,RoIs=efsafsInputMaker.InViewRoIs.path())
     muEFSAFSRecoSequence, sequenceOut = muEFSARecoSequence( efsafsInputMaker.InViewRoIs,'FS' )
 
     muEFFSRecoSequence = parOR("muEFSAFSRecoSequence",[viewAlgs_MuonPRD, muEFSAFSRecoSequence])
@@ -815,8 +823,10 @@ def efLateMuAlgSequence(ConfigFlags):
     #
     eflateViewsMaker.ViewFallThrough = True
 
+    #Clone and replace offline flags so we can set muon trigger specific values
+    muonflags = ConfigFlags.cloneAndReplace('Muon', 'Trigger.Offline.SA.Muon') 
     #decode data in these RoIs
-    viewAlgs_MuonPRD = algorithmCAToGlobalWrapper(muonDecodeCfg,ConfigFlags,RoIs=eflateViewsMaker.InViewRoIs.path())
+    viewAlgs_MuonPRD = algorithmCAToGlobalWrapper(muonDecodeCfg,muonflags,RoIs=eflateViewsMaker.InViewRoIs.path())
     #ID fast tracking
     muFastIDRecoSequence = muonIDFastTrackingSequence( eflateViewsMaker.InViewRoIs,"Late" )
     #inside-out reco sequence
-- 
GitLab