ATLAS Offline Software
MuonChainConfiguration.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 
8 from AthenaCommon.Logging import logging
9 logging.getLogger().info("Importing %s",__name__)
10 log = logging.getLogger(__name__)
11 
12 from ..Config.ChainConfigurationBase import ChainConfigurationBase
13 
14 from .MuonMenuSequences import (
15  muFastSequenceGenCfg, muFastCalibSequenceGenCfg, mul2mtSAOvlpRmSequenceGenCfg,
16  muCombSequenceGenCfg, muCombOvlpRmSequenceGenCfg, mul2mtCBOvlpRmSequenceGenCfg,
17  mul2IOOvlpRmSequenceGenCfg, muCombLRTSequenceGenCfg, muEFSASequenceGenCfg,
18  muEFSAFSSequenceGenCfg, efLateMuSequenceGenCfg, muEFCBSequenceGenCfg,
19  muEFCBIDperfSequenceGenCfg, muEFCBLRTSequenceGenCfg, muEFCBLRTIDperfSequenceGenCfg,
20  muEFCBFSSequenceGenCfg, muEFIDtpSequenceGenCfg, muEFIsoSequenceGenCfg,
21  muEFMSIsoSequenceGenCfg, efLateMuRoISequenceGenCfg, muRoiClusterSequenceGenCfg )
22 
23 from TrigMuonHypo.TrigMuonHypoConfig import TrigMuonEFInvMassHypoToolFromDict
24 from TrigMuonHypo.TrigMuonHypoConfig import TrigMuonEFIdtpInvMassHypoToolFromDict
25 
26 
27 
30 
32 
33  def __init__(self, chainDict):
34  ChainConfigurationBase.__init__(self,chainDict)
35 
36  # ----------------------
37  # Assemble the chain depending on information from chainName
38  # ----------------------
39 
40  def assembleChainImpl(self, flags):
41  chainSteps = []
42 
43  stepDictionary = self.getStepDictionary()
44 
45  is_probe_leg = self.chainPart['tnpInfo']=="probe"
46  key = self.chainPart['extra']
47 
48  steps=stepDictionary[key]
49 
50  for step in steps:
51  if step:
52  chainstep = getattr(self, step)(flags, is_probe_leg=is_probe_leg)
53  chainSteps+=[chainstep]
54 
55  myChain = self.buildChain(chainSteps)
56  return myChain
57 
58  def getStepDictionary(self):
59 
60  # --------------------
61  # define here the names of the steps and obtain the chainStep configuration
62  # --------------------
63  doMSonly = 'msonly' in self.chainPart['msonlyInfo']
64  muCombStep = 'getmuComb'
65  efCBStep = 'getmuEFCB'
66  if self.chainPart['isoInfo']:
67  isoStep = 'getmuEFIso'
68  if doMSonly:
69  isoStep = 'getmuEFMSIso'
70  #need to align SA and isolation steps between
71  # ms-only and standard iso chains
72  muCombStep = 'getmuMSEmpty'
73  efCBStep = 'getEFCBEmpty'
74  else:
75  isoStep=None
76  if doMSonly:
77  #need to align final SA step between ms-only
78  #and standard chains
79  muCombStep = 'getmuMSEmpty'
80  efCBStep = None
81 
82  stepDictionary = {
83  "":['getmuFast', muCombStep, 'getmuEFSA',efCBStep, isoStep], #RoI-based triggers
84  "noL1":['getFSmuEFSA'] if doMSonly else ['getFSmuEFSA', 'getFSmuEFCB'], #full scan triggers
85  "lateMu":['getLateMuRoI','getLateMu'], #late muon triggers
86  "muoncalib":['getmuFast'], #calibration
87  "vtx":['getmuRoiClu'], #LLP Trigger
88  "mucombTag":['getmuFast', muCombStep], #Trigger for alignment
89  }
90 
91  return stepDictionary
92 
93 
94  # --------------------
95  def getmuFast(self, flags, is_probe_leg=False):
96 
97  if 'muoncalib' in self.chainPart['extra']:
98  return self.getStep(flags, "mufastcalib", [muFastCalibSequenceGenCfg], is_probe_leg=is_probe_leg )
99  elif 'l2mt' in self.chainPart['l2AlgInfo']:
100  return self.getStep(flags, "mufastl2mt", [mul2mtSAOvlpRmSequenceGenCfg], is_probe_leg=is_probe_leg )
101  else:
102  return self.getStep(flags, "mufast", [muFastSequenceGenCfg], is_probe_leg=is_probe_leg )
103 
104 
105  # --------------------
106  def getmuComb(self, flags, is_probe_leg=False):
107 
108  doOvlpRm = False
109  if self.chainPart['signature'] == 'Bphysics':
110  doOvlpRm = False
111  elif self.mult>1:
112  doOvlpRm = True
113  elif len( self.dict['signatures'] )>1 and not self.chainPart['extra']:
114  doOvlpRm = True
115  else:
116  doOvlpRm = False
117 
118  trkMode = "FTF"
119  stepSuffix=""
120  if 'fT' in self.chainPart['addInfo']:
121  trkMode = "fastTracking"
122  stepSuffix = "fT"
123 
124  if 'l2mt' in self.chainPart['l2AlgInfo']:
125  return self.getStep(flags, f"muCombl2mt{stepSuffix}", [mul2mtCBOvlpRmSequenceGenCfg], is_probe_leg=is_probe_leg, trackingMode=trkMode)
126  elif 'l2io' in self.chainPart['l2AlgInfo']:
127  return self.getStep(flags, f'muCombIO{stepSuffix}', [mul2IOOvlpRmSequenceGenCfg], is_probe_leg=is_probe_leg, trackingMode=trkMode)
128  elif doOvlpRm:
129  return self.getStep(flags, f'muCombOVR{stepSuffix}', [muCombOvlpRmSequenceGenCfg], is_probe_leg=is_probe_leg, trackingMode=trkMode )
130  elif "LRT" in self.chainPart['addInfo']:
131  return self.getStep(flags, f'muCombLRT{stepSuffix}', [muCombLRTSequenceGenCfg], is_probe_leg=is_probe_leg, trackingMode=trkMode )
132  else:
133  return self.getStep(flags, f'muComb{stepSuffix}', [muCombSequenceGenCfg], is_probe_leg=is_probe_leg, trackingMode=trkMode )
134 
135  # --------------------
136  def getmuCombIO(self, flags, is_probe_leg=False):
137  return self.getStep(flags, 'muCombIO', [mul2IOOvlpRmSequenceGenCfg], is_probe_leg=is_probe_leg )
138 
139  # --------------------
140  def getmuEFSA(self, flags, is_probe_leg=False):
141  return self.getStep(flags, 'muEFSA',[ muEFSASequenceGenCfg], is_probe_leg=is_probe_leg)
142 
143  # --------------------
144  def getmuEFCB(self, flags, is_probe_leg=False):
145 
146  if 'invm' in self.chainPart['invMassInfo']: # No T&P support, add if needed
147  return self.getStep(flags, 'EFCB', [muEFCBSequenceGenCfg], comboTools=[TrigMuonEFInvMassHypoToolFromDict], is_probe_leg=is_probe_leg)
148  elif "LRT" in self.chainPart['addInfo']:
149  if "idperf" in self.chainPart['addInfo']:
150  return self.getStep(flags, 'EFCBLRTIDPERF', [muEFCBLRTIDperfSequenceGenCfg], is_probe_leg=is_probe_leg)
151  else:
152  return self.getStep(flags, 'EFCBLRT', [muEFCBLRTSequenceGenCfg], is_probe_leg=is_probe_leg)
153  elif "idperf" in self.chainPart['addInfo']:
154  return self.getStep(flags, 'EFCBIDPERF', [muEFCBIDperfSequenceGenCfg], is_probe_leg=is_probe_leg)
155  elif "idtp" in self.chainPart['addInfo']:
156  return self.getStep(flags, 'EFIDTP', [muEFIDtpSequenceGenCfg], is_probe_leg=is_probe_leg)
157  else:
158  return self.getStep(flags, 'EFCB', [muEFCBSequenceGenCfg], is_probe_leg=is_probe_leg)
159 
160  # --------------------
161  def getFSmuEFSA(self, flags, is_probe_leg=False):
162  return self.getStep(flags, 'FSmuEFSA', [muEFSAFSSequenceGenCfg], is_probe_leg=is_probe_leg)
163 
164  # --------------------
165  def getFSmuEFCB(self, flags, is_probe_leg=False):
166  if 'invm' in self.chainPart['invMassInfo']:
167  return self.getStep(flags, 'FSmuEFCB', [muEFCBFSSequenceGenCfg],comboTools=[TrigMuonEFInvMassHypoToolFromDict], is_probe_leg=is_probe_leg)
168  else:
169  return self.getStep(flags, 'FSmuEFCB', [muEFCBFSSequenceGenCfg], is_probe_leg=is_probe_leg)
170 
171  #---------------------
172  def getmuEFIso(self, flags, is_probe_leg=False):
173  if any(x in self.dict['topo'] for x in ['b7invmAB9vtx20', 'b11invmAB60vtx20', 'b11invmAB24vtx20', 'b24invmAB60vtx20']):
174  from TrigBphysHypo.TrigMultiTrkComboHypoConfig import DrellYanComboHypoCfg, TrigMultiTrkComboHypoToolFromDict
175  return self.getStep(flags, 'muEFIsoDY', [muEFIsoSequenceGenCfg], comboHypoCfg=DrellYanComboHypoCfg, comboTools=[TrigMultiTrkComboHypoToolFromDict], is_probe_leg=is_probe_leg)
176  else:
177  return self.getStep(flags, 'muEFIso', [muEFIsoSequenceGenCfg], is_probe_leg=is_probe_leg)
178 
179  #---------------------
180  def getmuEFMSIso(self, flags, is_probe_leg=False):
181  return self.getStep(flags, 'muEFMSIso',[ muEFMSIsoSequenceGenCfg], is_probe_leg=is_probe_leg)
182 
183  #--------------------
184  def getmuMSEmptyAll(self, flags, stepID): # No T&P info needed for empty step?
185  return self.getEmptyStep(stepID,'muMS_empty')
186 
187  #--------------------
188  def getmuMSEmpty(self, flags, is_probe_leg=False): # No T&P info needed for empty step?
189  return self.getmuMSEmptyAll(flags, 2)
190 
191  #--------------------
192  def getmuFastEmpty(self, flags, is_probe_leg=False): # No T&P info needed for empty step?
193  return self.getEmptyStep(1,'muFast_empty')
194 
195  #--------------------
196  def getEFCBEmpty(self, flags, is_probe_leg=False): # No T&P info needed for empty step?
197  return self.getEmptyStep(4,'muefCB_Empty')
198 
199  #--------------------
200  def getLateMuRoI(self, flags, is_probe_leg=False): # No T&P support, add if needed
201  return self.getStep(flags, 'muEFLateRoI',[efLateMuRoISequenceGenCfg], is_probe_leg=is_probe_leg)
202 
203  #--------------------
204  def getLateMu(self, flags, is_probe_leg=False): # No T&P support, add if needed
205  return self.getStep(flags, 'muEFLate',[efLateMuSequenceGenCfg], is_probe_leg=is_probe_leg)
206 
207  #--------------------
208  def getmuRoiClu(self, flags, is_probe_leg=False):
209  return self.getStep(flags, 'muRoiClu',[muRoiClusterSequenceGenCfg])
210 
211 
212 def TrigMuonEFIdtpInvMassHypoToolCfg(flags, chainDict):
213  tool = TrigMuonEFIdtpInvMassHypoToolFromDict(flags, chainDict)
214  return tool
215 
216 
grepfile.info
info
Definition: grepfile.py:38
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getLateMu
def getLateMu(self, flags, is_probe_leg=False)
Definition: MuonChainConfiguration.py:204
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getmuMSEmpty
def getmuMSEmpty(self, flags, is_probe_leg=False)
Definition: MuonChainConfiguration.py:188
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.assembleChainImpl
def assembleChainImpl(self, flags)
Definition: MuonChainConfiguration.py:40
ChainConfigurationBase
Definition: ChainConfigurationBase.py:1
TrigMuonHypoConfig.TrigMuonEFIdtpInvMassHypoToolFromDict
def TrigMuonEFIdtpInvMassHypoToolFromDict(flags, chainDict)
Definition: TrigMuonHypoConfig.py:1048
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration
Class/function to configure muon chains.
Definition: MuonChainConfiguration.py:31
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getEFCBEmpty
def getEFCBEmpty(self, flags, is_probe_leg=False)
Definition: MuonChainConfiguration.py:196
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getStepDictionary
def getStepDictionary(self)
Definition: MuonChainConfiguration.py:58
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getmuEFIso
def getmuEFIso(self, flags, is_probe_leg=False)
Definition: MuonChainConfiguration.py:172
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getmuRoiClu
def getmuRoiClu(self, flags, is_probe_leg=False)
Definition: MuonChainConfiguration.py:208
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getmuFast
def getmuFast(self, flags, is_probe_leg=False)
Definition: MuonChainConfiguration.py:95
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getmuMSEmptyAll
def getmuMSEmptyAll(self, flags, stepID)
Definition: MuonChainConfiguration.py:184
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getmuEFCB
def getmuEFCB(self, flags, is_probe_leg=False)
Definition: MuonChainConfiguration.py:144
python.HLT.Muon.MuonChainConfiguration.TrigMuonEFIdtpInvMassHypoToolCfg
def TrigMuonEFIdtpInvMassHypoToolCfg(flags, chainDict)
Definition: MuonChainConfiguration.py:212
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getmuFastEmpty
def getmuFastEmpty(self, flags, is_probe_leg=False)
Definition: MuonChainConfiguration.py:192
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getmuCombIO
def getmuCombIO(self, flags, is_probe_leg=False)
Definition: MuonChainConfiguration.py:136
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getFSmuEFSA
def getFSmuEFSA(self, flags, is_probe_leg=False)
Definition: MuonChainConfiguration.py:161
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getmuEFSA
def getmuEFSA(self, flags, is_probe_leg=False)
Definition: MuonChainConfiguration.py:140
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getFSmuEFCB
def getFSmuEFCB(self, flags, is_probe_leg=False)
Definition: MuonChainConfiguration.py:165
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getLateMuRoI
def getLateMuRoI(self, flags, is_probe_leg=False)
Definition: MuonChainConfiguration.py:200
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.__init__
def __init__(self, chainDict)
Definition: MuonChainConfiguration.py:33
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getmuComb
def getmuComb(self, flags, is_probe_leg=False)
Definition: MuonChainConfiguration.py:106
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getmuEFMSIso
def getmuEFMSIso(self, flags, is_probe_leg=False)
Definition: MuonChainConfiguration.py:180