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  if 'l2mt' in self.chainPart['l2AlgInfo']:
119  return self.getStep(flags, "muCombl2mt", [mul2mtCBOvlpRmSequenceGenCfg], is_probe_leg=is_probe_leg )
120  elif 'l2io' in self.chainPart['l2AlgInfo']:
121  return self.getStep(flags, 'muCombIO', [mul2IOOvlpRmSequenceGenCfg], is_probe_leg=is_probe_leg )
122  elif doOvlpRm:
123  return self.getStep(flags, 'muCombOVR', [muCombOvlpRmSequenceGenCfg], is_probe_leg=is_probe_leg )
124  elif "LRT" in self.chainPart['addInfo']:
125  return self.getStep(flags, 'muCombLRT', [muCombLRTSequenceGenCfg], is_probe_leg=is_probe_leg )
126  else:
127  return self.getStep(flags, 'muComb', [muCombSequenceGenCfg], is_probe_leg=is_probe_leg )
128 
129  # --------------------
130  def getmuCombIO(self, flags, is_probe_leg=False):
131  return self.getStep(flags, 'muCombIO', [mul2IOOvlpRmSequenceGenCfg], is_probe_leg=is_probe_leg )
132 
133  # --------------------
134  def getmuEFSA(self, flags, is_probe_leg=False):
135  return self.getStep(flags, 'muEFSA',[ muEFSASequenceGenCfg], is_probe_leg=is_probe_leg)
136 
137  # --------------------
138  def getmuEFCB(self, flags, is_probe_leg=False):
139 
140  if 'invm' in self.chainPart['invMassInfo']: # No T&P support, add if needed
141  return self.getStep(flags, 'EFCB', [muEFCBSequenceGenCfg], comboTools=[TrigMuonEFInvMassHypoToolFromDict], is_probe_leg=is_probe_leg)
142  elif "LRT" in self.chainPart['addInfo']:
143  if "idperf" in self.chainPart['addInfo']:
144  return self.getStep(flags, 'EFCBLRTIDPERF', [muEFCBLRTIDperfSequenceGenCfg], is_probe_leg=is_probe_leg)
145  else:
146  return self.getStep(flags, 'EFCBLRT', [muEFCBLRTSequenceGenCfg], is_probe_leg=is_probe_leg)
147  elif "idperf" in self.chainPart['addInfo']:
148  return self.getStep(flags, 'EFCBIDPERF', [muEFCBIDperfSequenceGenCfg], is_probe_leg=is_probe_leg)
149  elif "idtp" in self.chainPart['addInfo']:
150  return self.getStep(flags, 'EFIDTP', [muEFIDtpSequenceGenCfg], is_probe_leg=is_probe_leg)
151  else:
152  return self.getStep(flags, 'EFCB', [muEFCBSequenceGenCfg], is_probe_leg=is_probe_leg)
153 
154  # --------------------
155  def getFSmuEFSA(self, flags, is_probe_leg=False):
156  return self.getStep(flags, 'FSmuEFSA', [muEFSAFSSequenceGenCfg], is_probe_leg=is_probe_leg)
157 
158  # --------------------
159  def getFSmuEFCB(self, flags, is_probe_leg=False):
160  if 'invm' in self.chainPart['invMassInfo']:
161  return self.getStep(flags, 'FSmuEFCB', [muEFCBFSSequenceGenCfg],comboTools=[TrigMuonEFInvMassHypoToolFromDict], is_probe_leg=is_probe_leg)
162  else:
163  return self.getStep(flags, 'FSmuEFCB', [muEFCBFSSequenceGenCfg], is_probe_leg=is_probe_leg)
164 
165  #---------------------
166  def getmuEFIso(self, flags, is_probe_leg=False):
167  if any(x in self.dict['topo'] for x in ['b7invmAB9vtx20', 'b11invmAB60vtx20', 'b11invmAB24vtx20', 'b24invmAB60vtx20']):
168  from TrigBphysHypo.TrigMultiTrkComboHypoConfig import DrellYanComboHypoCfg, TrigMultiTrkComboHypoToolFromDict
169  return self.getStep(flags, 'muEFIsoDY', [muEFIsoSequenceGenCfg], comboHypoCfg=DrellYanComboHypoCfg, comboTools=[TrigMultiTrkComboHypoToolFromDict], is_probe_leg=is_probe_leg)
170  else:
171  return self.getStep(flags, 'muEFIso', [muEFIsoSequenceGenCfg], is_probe_leg=is_probe_leg)
172 
173  #---------------------
174  def getmuEFMSIso(self, flags, is_probe_leg=False):
175  return self.getStep(flags, 'muEFMSIso',[ muEFMSIsoSequenceGenCfg], is_probe_leg=is_probe_leg)
176 
177  #--------------------
178  def getmuMSEmptyAll(self, flags, stepID): # No T&P info needed for empty step?
179  return self.getEmptyStep(stepID,'muMS_empty')
180 
181  #--------------------
182  def getmuMSEmpty(self, flags, is_probe_leg=False): # No T&P info needed for empty step?
183  return self.getmuMSEmptyAll(flags, 2)
184 
185  #--------------------
186  def getmuFastEmpty(self, flags, is_probe_leg=False): # No T&P info needed for empty step?
187  return self.getEmptyStep(1,'muFast_empty')
188 
189  #--------------------
190  def getEFCBEmpty(self, flags, is_probe_leg=False): # No T&P info needed for empty step?
191  return self.getEmptyStep(4,'muefCB_Empty')
192 
193  #--------------------
194  def getLateMuRoI(self, flags, is_probe_leg=False): # No T&P support, add if needed
195  return self.getStep(flags, 'muEFLateRoI',[efLateMuRoISequenceGenCfg], is_probe_leg=is_probe_leg)
196 
197  #--------------------
198  def getLateMu(self, flags, is_probe_leg=False): # No T&P support, add if needed
199  return self.getStep(flags, 'muEFLate',[efLateMuSequenceGenCfg], is_probe_leg=is_probe_leg)
200 
201  #--------------------
202  def getmuRoiClu(self, flags, is_probe_leg=False):
203  return self.getStep(flags, 'muRoiClu',[muRoiClusterSequenceGenCfg])
204 
205 
206 def TrigMuonEFIdtpInvMassHypoToolCfg(flags, chainDict):
207  tool = TrigMuonEFIdtpInvMassHypoToolFromDict(flags, chainDict)
208  return tool
209 
210 
grepfile.info
info
Definition: grepfile.py:38
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getLateMu
def getLateMu(self, flags, is_probe_leg=False)
Definition: MuonChainConfiguration.py:198
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getmuMSEmpty
def getmuMSEmpty(self, flags, is_probe_leg=False)
Definition: MuonChainConfiguration.py:182
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:190
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:166
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getmuRoiClu
def getmuRoiClu(self, flags, is_probe_leg=False)
Definition: MuonChainConfiguration.py:202
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:178
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getmuEFCB
def getmuEFCB(self, flags, is_probe_leg=False)
Definition: MuonChainConfiguration.py:138
python.HLT.Muon.MuonChainConfiguration.TrigMuonEFIdtpInvMassHypoToolCfg
def TrigMuonEFIdtpInvMassHypoToolCfg(flags, chainDict)
Definition: MuonChainConfiguration.py:206
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getmuFastEmpty
def getmuFastEmpty(self, flags, is_probe_leg=False)
Definition: MuonChainConfiguration.py:186
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getmuCombIO
def getmuCombIO(self, flags, is_probe_leg=False)
Definition: MuonChainConfiguration.py:130
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getFSmuEFSA
def getFSmuEFSA(self, flags, is_probe_leg=False)
Definition: MuonChainConfiguration.py:155
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getmuEFSA
def getmuEFSA(self, flags, is_probe_leg=False)
Definition: MuonChainConfiguration.py:134
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getFSmuEFCB
def getFSmuEFCB(self, flags, is_probe_leg=False)
Definition: MuonChainConfiguration.py:159
python.HLT.Muon.MuonChainConfiguration.MuonChainConfiguration.getLateMuRoI
def getLateMuRoI(self, flags, is_probe_leg=False)
Definition: MuonChainConfiguration.py:194
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:174