From bd9773fe4363c30e51128e77f86b6a21940163ea Mon Sep 17 00:00:00 2001
From: Moe Wakida <wakida@hepl.phys.nagoya-u.ac.jp>
Date: Fri, 29 Nov 2019 13:04:55 +0100
Subject: [PATCH] Use L2SA muon RoIs for muonIDFastTracking

---
 .../TrigUpgradeTest/share/full_menu_build.ref             | 4 ++--
 .../TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py  | 1 +
 .../python/HLTMenuConfig/Muon/MuonSequenceSetup.py        | 8 ++++++--
 .../TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py  | 8 +++++---
 4 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_build.ref b/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_build.ref
index 4c39dfe4022..ccf8dcdb152 100644
--- a/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_build.ref
+++ b/Trigger/TrigValidation/TrigUpgradeTest/share/full_menu_build.ref
@@ -116,8 +116,8 @@ TrigSignatureMoniMT                                 INFO HLT_j85_ftf_L1J20
 TrigSignatureMoniMT                                 INFO HLT_j85_ftf_L1J20 decisions                       1         0         0         0         0         0         
 TrigSignatureMoniMT                                 INFO HLT_mu10_lateMu_L1MU10        20        20        0         0         0         0         0         0         0         
 TrigSignatureMoniMT                                 INFO HLT_mu10_lateMu_L1MU10 decisions                    0         0         0         0         0         0         
-TrigSignatureMoniMT                                 INFO HLT_mu20_ivar_L1MU6           20        20        3         1         1         0         0         0         1         
-TrigSignatureMoniMT                                 INFO HLT_mu20_ivar_L1MU6 decisions                     3         1         1         0         0         0         
+TrigSignatureMoniMT                                 INFO HLT_mu20_ivar_L1MU6           20        20        3         1         0         0         0         0         0         
+TrigSignatureMoniMT                                 INFO HLT_mu20_ivar_L1MU6 decisions                     3         1         0         0         0         0         
 TrigSignatureMoniMT                                 INFO HLT_mu24_idperf_L1MU20        20        20        2         2         0         0         0         0         0         
 TrigSignatureMoniMT                                 INFO HLT_mu24_idperf_L1MU20 decisions                    2         2         0         0         0         0         
 TrigSignatureMoniMT                                 INFO HLT_mu26_ivarmedium_L1MU20    20        20        2         1         0         0         0         0         0         
diff --git a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
index 95afbcfc28f..30ecdadbd46 100644
--- a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
+++ b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDMRun3.py
@@ -198,6 +198,7 @@ TriggerHLTListRun3 = [
     ('xAOD::L2IsoMuonContainer#HLT_MuonL2ISInfo',               'BS ESD AODFULL', 'Muon', 'inViews:MUIsoViewRoIs'),
     ('xAOD::L2IsoMuonAuxContainer#HLT_MuonL2ISInfoAux.',        'BS ESD AODFULL', 'Muon'),
 
+    ('TrigRoiDescriptorCollection#HLT_forID',                   'BS ESD AODFULL', 'Muon', 'inViews = MUViewRoIs'),
 
     # Tau
 
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py
index fd57504582b..2267aa8f277 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSequenceSetup.py
@@ -103,10 +103,14 @@ def muCombAlgSequence(ConfigFlags):
     l2muCombViewsMaker.InViewRoIs = "EMIDRoIs" #name of the RoIS inside of the view, because in principle we can have more than one RoI/view
     l2muCombViewsMaker.Views = "EMCombViewRoIs" #output of the views maker (key in "storegate")
     l2muCombViewsMaker.RequireParentView = True
-    
+
+    from TrigFastTrackFinder.TrigFastTrackFinder_Config import TrigFastTrackFinderBase
+    FTFAlg = TrigFastTrackFinderBase("TrigFastTrackFinder","Muon")
+    FTFAlg.RoIs = "HLT_forID" 
+
     ### get ID tracking and muComb reco sequences ###    
     from TriggerMenuMT.HLTMenuConfig.Muon.MuonSetup  import muCombRecoSequence, muonIDFastTrackingSequence
-    muFastIDRecoSequence = muonIDFastTrackingSequence( l2muCombViewsMaker.InViewRoIs,"")
+    muFastIDRecoSequence = muonIDFastTrackingSequence( FTFAlg.RoIs, "")
     muCombRecoSequence, sequenceOut = muCombRecoSequence( l2muCombViewsMaker.InViewRoIs )
  
     #Filter algorithm to run muComb only if non-Bphysics muon chains are active
diff --git a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
index da00763ded0..e0f9cbf2298 100644
--- a/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
+++ b/Trigger/TriggerCommon/TriggerMenuMT/python/HLTMenuConfig/Muon/MuonSetup.py
@@ -35,6 +35,7 @@ class muonNames(object):
     self.EFCBInOutName = "HLT_MuonsCBInsideOut"
     self.L2IsoMuonName = recordable("HLT_MuonL2ISInfo")
     self.EFIsoMuonName = recordable("HLT_MuonsIso")
+    self.L2forIDName   = recordable("HLT_forID")
 
   def getNames(self, name):
 
@@ -298,8 +299,8 @@ def muFastRecoSequence( RoIs ):
   muFastAlg.MuRoIs = RoIs
   muFastAlg.MuonL2SAInfo = muNames.L2SAName
   muFastAlg.MuonCalibrationStream = "MuonCalibrationStream"
-  muFastAlg.forID = "forID"
-  muFastAlg.forMS = "forMS"
+  muFastAlg.forID = muNames.L2forIDName
+  muFastAlg.forMS = "forMS" 
 
   muFastRecoSequence += muFastAlg
   sequenceOut = muFastAlg.MuonL2SAInfo
@@ -346,7 +347,8 @@ def muCombRecoSequence( RoIs ):
   ### Required to satisfy data dependencies                                       ###
   import AthenaCommon.CfgMgr as CfgMgr
   ViewVerify = CfgMgr.AthViews__ViewDataVerifier("muFastViewDataVerifier")
-  ViewVerify.DataObjects = [('xAOD::L2StandAloneMuonContainer','StoreGateSvc+'+muNames.L2SAName)]
+  ViewVerify.DataObjects = [('xAOD::L2StandAloneMuonContainer','StoreGateSvc+'+muNames.L2SAName),
+                            ('TrigRoiDescriptorCollection','StoreGateSvc+'+muNames.L2forIDName)]
   muCombRecoSequence+=ViewVerify
 
   ### please read out TrigmuCombMTConfig file ###
-- 
GitLab