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