ATLAS Offline Software
generateCFChains.py
Go to the documentation of this file.
1 #
2 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 #
4 
5 
9 
10 import functools
11 
12 def generateCFChains(flags):
13  from TriggerMenuMT.HLT.Menu.SignatureDicts import ChainStore
14  from TriggerMenuMT.CFtest.TestUtils import makeChain, makeChainStep
15  from TriggerMenuMT.HLT.Config.GenerateMenuMT import GenerateMenuMT
16  menu = GenerateMenuMT()
17  menu.chainsInMenu = ChainStore()
18 
21  if 'Egamma' in flags.Trigger.enabledSignatures:
22  from TriggerMenuMT.HLT.CommonSequences.CaloSequences import fastCaloSequenceGenCfg
23  from TriggerMenuMT.HLT.Electron.FastElectronMenuSequences import fastElectronSequenceGenCfg
24  from TriggerMenuMT.HLT.Electron.PrecisionCaloMenuSequences import precisionCaloSequenceGenCfg
25 
26  fastCaloSeq = functools.partial(fastCaloSequenceGenCfg, flags, name='Electron' )
27  electronSeq = functools.partial(fastElectronSequenceGenCfg, flags )
28  precisionCaloSeq = functools.partial(precisionCaloSequenceGenCfg, flags )
29 
30  FastCaloStep = makeChainStep("ElectronFastCaloStep", [fastCaloSeq])
31  FastElectronStep = makeChainStep("ElectronFastTrackStep", [electronSeq])
32  PrecisionCaloStep = makeChainStep("ElectronPrecisionCaloStep", [precisionCaloSeq])
33 
34  electronChains = [
35  makeChain(flags, name='HLT_e3_etcut1step_L1EM3', L1Thresholds=["EM3"], ChainSteps=[FastCaloStep] ),
36  makeChain(flags, name='HLT_e3_etcut_L1EM3', L1Thresholds=["EM3"], ChainSteps=[FastCaloStep, FastElectronStep, PrecisionCaloStep] ),
37  makeChain(flags, name='HLT_e5_etcut_L1EM3', L1Thresholds=["EM3"], ChainSteps=[FastCaloStep, FastElectronStep, PrecisionCaloStep] ),
38  makeChain(flags, name='HLT_e7_etcut_L1EM3', L1Thresholds=["EM3"], ChainSteps=[FastCaloStep, FastElectronStep, PrecisionCaloStep] )
39  ]
40  menu.chainsInMenu['Egamma'] += electronChains
41 
42  from TriggerMenuMT.HLT.Photon.FastPhotonMenuSequences import fastPhotonSequenceGenCfg
43  from TriggerMenuMT.HLT.Photon.PrecisionCaloMenuSequences import precisionCaloSequenceGenCfg
44 
45  fastCaloSeq = functools.partial(fastCaloSequenceGenCfg, flags, name='Photon' )
46  fastPhotonSeq = functools.partial(fastPhotonSequenceGenCfg, flags )
47  precisionCaloPhotonSeq = functools.partial(precisionCaloSequenceGenCfg, flags )
48 
49  FastCaloStep = makeChainStep("PhotonFastCaloStep", [fastCaloSeq])
50  fastPhotonStep = makeChainStep("PhotonStep2", [fastPhotonSeq])
51  precisionCaloPhotonStep = makeChainStep("precisionCaloPhotonStep", [precisionCaloPhotonSeq])
52 
53  photonChains = [
54  makeChain(flags, name='HLT_g5_etcut_L1EM3', L1Thresholds=["EM3"], ChainSteps=[ FastCaloStep, fastPhotonStep, precisionCaloPhotonStep] )
55  ]
56  menu.chainsInMenu['Egamma'] += photonChains
57 
58 
61  if 'Muon' in flags.Trigger.enabledSignatures:
62  from TriggerMenuMT.HLT.Muon.MuonMenuSequences import (
63  muFastSequenceGenCfg, muCombSequenceGenCfg,
64  muEFSASequenceGenCfg, muEFCBSequenceGenCfg, muEFSAFSSequenceGenCfg, muEFCBFSSequenceGenCfg
65  )
66 
67  MuonChains = []
68  # step1
69  mufastS= functools.partial(muFastSequenceGenCfg,flags)
70  step1mufast=makeChainStep("Step1_muFast", [ mufastS ])
71  # step2
72  mucombS = functools.partial(muCombSequenceGenCfg,flags)
73  step2muComb=makeChainStep("Step2_muComb", [ mucombS ])
74  # step3
75  muEFSAS = functools.partial(muEFSASequenceGenCfg,flags)
76  step3muEFSA=makeChainStep("Step3_muEFSA", [ muEFSAS ])
77  #/step3muIso =makeChainStep("Step3_muIso", [ muIsoSequence() ])
78  # step4
79  muEFCBS = functools.partial(muEFCBSequenceGenCfg,flags)
80  step4muEFCB = makeChainStep("Step4_muEFCB", [ muEFCBS ])
81  emptyStep = makeChainStep("Step2_empty", multiplicity=[])
82 
83 
84  MuonChains += [ makeChain(flags, name='HLT_mu6fast_L1MU5VF', L1Thresholds=["MU5VF"], ChainSteps=[ step1mufast ])]
85  MuonChains += [ makeChain(flags, name='HLT_mu6Comb_L1MU5VF', L1Thresholds=["MU5VF"], ChainSteps=[ step1mufast, step2muComb ])]
86  MuonChains += [ makeChain(flags, name='HLT_mu6_L1MU5VF', L1Thresholds=["MU5VF"], ChainSteps=[ step1mufast, step2muComb, step3muEFSA, step4muEFCB ])]
87  MuonChains += [ makeChain(flags, name='HLT_mu6msonly_L1MU5VF', L1Thresholds=["MU5VF"], ChainSteps=[ step1mufast, emptyStep, step3muEFSA ])] # removed due to muEFSA isuue(?)
88 
89  # multi muon trigger
90  # 2muons symmetric
91  step1_2mufast_sym= makeChainStep("Step1_2muFast_sym", [ mufastS], multiplicity=[2])
92  step2_2muComb_sym= makeChainStep("Step2_2muComb_sym", [ mucombS], multiplicity=[2])
93 
94  MuonChains += [ makeChain(flags, name='HLT_2mu6Comb_L12MU5VF', L1Thresholds=["MU5VF"], ChainSteps=[ step1_2mufast_sym, step2_2muComb_sym ])]
95 
96  # 2muons asymmetric (this will change): 2 sequences, 2 seeds
97  step1_2mufast_asym= makeChainStep("Step1_2muFast_asym", [ mufastS, mufastS], multiplicity=[1,1])
98  step2_2muComb_asym= makeChainStep("Step1_2muComb_asym", [ mucombS, mucombS], multiplicity=[1,1])
99 
100  MuonChains += [ makeChain(flags, name='HLT_mu6_mu4_L12MU3V',
101  L1Thresholds=["MU3V", "MU3V"],
102  ChainSteps=[ step1_2mufast_asym, step2_2muComb_asym ])]
103 
104 
105  #FS Muon trigger
106  # Full scan MS tracking step
107  muEFSAFSS = functools.partial(muEFSAFSSequenceGenCfg,flags)
108  muEFCBFSS = functools.partial(muEFCBFSSequenceGenCfg,flags)
109  stepFSmuEFSA=makeChainStep("Step_FSmuEFSA", [muEFSAFSS])
110  stepFSmuEFCB=makeChainStep("Step_FSmuEFCB", [muEFCBFSS])
111  MuonChains += [ makeChain(flags, name='HLT_mu6noL1_L1MU5VF', L1Thresholds=["FSNOSEED"], ChainSteps=[stepFSmuEFSA, stepFSmuEFCB])]
112 
113  menu.chainsInMenu['Muon'] += MuonChains
114 
115 
116 
119 
120  from TriggerMenuMT.HLT.Jet.JetRecoCommon import jetRecoDictFromString
121  def jetCaloHypoMenuSequenceFromString(jet_def_str):
122  jetRecoDict = jetRecoDictFromString(jet_def_str)
123  from TriggerMenuMT.HLT.Jet.JetRecoSequencesConfig import JetRecoDataDeps
124  jetDefDict = JetRecoDataDeps(flags, **jetRecoDict)
125  from TriggerMenuMT.HLT.Jet.JetMenuSequencesConfig import jetCaloHypoMenuSequenceGenCfg
126  return functools.partial(jetCaloHypoMenuSequenceGenCfg, flags, isPerf=False, **jetDefDict)
127 
128  def jetCaloPreselMenuSequenceFromString(jet_def_str):
129  jetRecoDict = jetRecoDictFromString(jet_def_str)
130  from TriggerMenuMT.HLT.Jet.JetRecoSequencesConfig import JetRecoDataDeps
131  jetDefDict = JetRecoDataDeps(flags, **jetRecoDict)
132  from TriggerMenuMT.HLT.Jet.JetMenuSequencesConfig import jetCaloPreselMenuSequenceGenCfg
133  return functools.partial(jetCaloPreselMenuSequenceGenCfg, flags, **jetDefDict)
134 
135  def jetTrackingHypoMenuSequenceFromString(jet_def_str):
136  jetRecoDict = jetRecoDictFromString(jet_def_str)
137  from TriggerMenuMT.HLT.Jet.JetRecoSequencesConfig import JetRecoDataDeps
138  jetDefDict = JetRecoDataDeps(flags, **jetRecoDict)
139  from TriggerMenuMT.HLT.Jet.JetMenuSequencesConfig import jetFSTrackingHypoMenuSequenceGenCfg
140  return functools.partial(jetFSTrackingHypoMenuSequenceGenCfg, flags, isPerf=False, **jetDefDict)
141 
142  if 'Jet' in flags.Trigger.enabledSignatures:
143 
144  # small-R jets
145  jetSeq_a4_tc_em = jetCaloHypoMenuSequenceFromString("a4_tc_em_subjesIS")
146  step_a4_tc_em = makeChainStep("Step_jet_a4_tc_em", [jetSeq_a4_tc_em])
147 
148  # large-R jets
149  jetSeq_a10_tc_lcw_subjes = jetCaloHypoMenuSequenceFromString("a10_tc_lcw_subjes")
150  step_a10_tc_lcw_subjes = makeChainStep("Step_jet_a10_subjes_tc_lcw", [jetSeq_a10_tc_lcw_subjes])
151 
152  jetSeq_a10r = jetCaloHypoMenuSequenceFromString("a10r_tc_em_subjesIS")
153  step_a10r = makeChainStep("Step_jet_a10r", [jetSeq_a10r])
154 
155  jetSeq_a10t = jetCaloHypoMenuSequenceFromString("a10t_tc_lcw_jes")
156  step_a10t = makeChainStep("Step_jet_a10t", [jetSeq_a10t])
157 
158  # Jet chains with tracking
159  jetSeq_a4_tc_em_presel = jetCaloPreselMenuSequenceFromString("a4_tc_em_subjesIS")
160  step_a4_tc_em_presel = makeChainStep("Step_jet_a4_tc_em_presel", [jetSeq_a4_tc_em_presel])
161  jetSeq_a4_pf_em_ftf = jetTrackingHypoMenuSequenceFromString("a4_tc_em_subresjesgscIS_ftf")
162  step_a4_pf_em_ftf = makeChainStep("Step_jet_a4_pf_em_ftf", [jetSeq_a4_pf_em_ftf])
163 
164  menu.chainsInMenu['Jet'] = [
165  makeChain(flags, name='HLT_j45_L1J20', L1Thresholds=["FSNOSEED"], ChainSteps=[step_a4_tc_em] ),
166  makeChain(flags, name='HLT_j85_L1J20', L1Thresholds=["FSNOSEED"], ChainSteps=[step_a4_tc_em] ),
167  makeChain(flags, name='HLT_j420_L1J20', L1Thresholds=["FSNOSEED"], ChainSteps=[step_a4_tc_em] ),
168  makeChain(flags, name='HLT_j260f_L1J20', L1Thresholds=["FSNOSEED"], ChainSteps=[step_a4_tc_em] ),
169  makeChain(flags, name='HLT_j460_a10_lcw_subjes_L1J20', L1Thresholds=["FSNOSEED"], ChainSteps=[step_a10_tc_lcw_subjes] ),
170  makeChain(flags, name='HLT_j460_a10r_L1J20', L1Thresholds=["FSNOSEED"], ChainSteps=[step_a10r] ),
171  makeChain(flags, name='HLT_j460_a10t_L1J20', L1Thresholds=["FSNOSEED"], ChainSteps=[step_a10t] ),
172  makeChain(flags, name='HLT_3j200_L1J20', L1Thresholds=["FSNOSEED"], ChainSteps=[step_a4_tc_em] ),
173  makeChain(flags, name='HLT_5j70c_L1J20', L1Thresholds=["FSNOSEED"], ChainSteps=[step_a4_tc_em] ), # 5j70_0eta240_L14J15 (J20 until multi-object L1 seeds supported)
174  makeChain(flags, name='HLT_j45_pf_subresjesgscIS_ftf_preselj20_L1J20', L1Thresholds=["FSNOSEED"], ChainSteps=[step_a4_tc_em_presel,step_a4_pf_em_ftf] ),
175  ]
176 
177 
178 
181  if 'Bjet' in flags.Trigger.enabledSignatures:
182  from TriggerMenuMT.HLT.Bjet.BjetMenuSequences import getBJetSequenceGenCfg
183 
184  jetSeq_a4_tc_em_presel = jetCaloPreselMenuSequenceFromString("a4_tc_em_subjesIS")
185  jetSeq_a4_tc_em_gsc_ftf = jetTrackingHypoMenuSequenceFromString("a4_tc_em_subjesgscIS_ftf")
186  jc_name = "HLT_AntiKt4EMPFlowJets_subresjesgscIS_ftf"
187 
188  bjet_sec= functools.partial(getBJetSequenceGenCfg, flags, jc_name)
189 
190  step1 = makeChainStep("Step_jet_a4_tc_em_presel", [jetSeq_a4_tc_em_presel])
191  step2 = makeChainStep("Step_jet_a4_tc_em_gsc_ftf", [jetSeq_a4_tc_em_gsc_ftf])
192  step3 = makeChainStep("Step3_bjet", [bjet_sec])
193 
194  menu.chainsInMenu['Bjet'] = [
195  makeChain(flags, name='HLT_j45_boffperf_ftf_subjesgscIS_preselj20_L1J20', L1Thresholds=["FSNOSEED"], ChainSteps=[step1,step2,step3] ),
196  makeChain(flags, name='HLT_j45_bdl1d70_ftf_subjesgscIS_preselj20_L1J20', L1Thresholds=["FSNOSEED"], ChainSteps=[step1,step2,step3] ),
197  ]
198 
199 
200 
203  if 'Tau' in flags.Trigger.enabledSignatures and False: # not working at the moment
204  from TriggerMenuMT.HLT.Tau.TauMenuSequences import getTauSequence
205 
206  step1=makeChainStep("Step1_tau", [getTauSequence('calo')])
207  step1MVA=makeChainStep("Step1MVA_tau", [getTauSequence('calo_mva')])
208 
209  #This runs the tau-preselection(TP) step
210  step2TP=makeChainStep("Step2TP_tau", [getTauSequence('track_core')])
211 
212  #This runs the EFTauMV hypo on top of fast tracks
213  step2PT=makeChainStep("Step2PT_tau", [getTauSequence('precision')])
214 
215  menu.chainsInMenu['Tau'] = [
216  makeChain(flags, name='HLT_tau0_perf_ptonly_L1TAU8', L1Thresholds=["TAU8"], ChainSteps=[step1, step2] ),
217  makeChain(flags, name='HLT_tau25_medium1_tracktwo_L1TAU12IM', L1Thresholds=["TAU12IM"], ChainSteps=[step1, step2TP] ),
218  makeChain(flags, name='HLT_tau35_mediumRNN_tracktwoMVA_L1TAU12IM', L1Thresholds=["TAU20IM"], ChainSteps=[step1MVA, step2PT])
219  ]
220 
221 
224  if 'Bphysics' in flags.Trigger.enabledSignatures:
225  from TriggerMenuMT.HLT.Muon.MuonMenuSequences import muFastSequenceGenCfg, muCombSequenceGenCfg, muEFSASequenceGenCfg, muEFCBSequenceGenCfg
226  from TrigBphysHypo.TrigMultiTrkComboHypoConfig import StreamerDimuL2ComboHypoCfg, DimuEFComboHypoCfg
227 
228  muFast = functools.partial(muFastSequenceGenCfg, flags)
229  step1_dimufast=makeChainStep("Step1_dimuFast", [muFast], multiplicity=[2])
230  mucombS = functools.partial(muCombSequenceGenCfg, flags)
231  step2_dimuComb=makeChainStep("Step2_dimuComb", [mucombS], multiplicity=[2], comboHypoCfg=functools.partial(StreamerDimuL2ComboHypoCfg,flags))
232  muEFSAS = functools.partial(muEFSASequenceGenCfg, flags)
233  muEFCBS = functools.partial(muEFCBSequenceGenCfg, flags)
234 
235  step3_dimuEFSA=makeChainStep("Step3_dimuEFSA", [muEFSAS], multiplicity=[2])
236  step4_dimuEFCB=makeChainStep("Step4_dimuEFCB", [muEFCBS], multiplicity=[2], comboHypoCfg=functools.partial(DimuEFComboHypoCfg,flags))
237  steps = [step1_dimufast, step2_dimuComb, step3_dimuEFSA, step4_dimuEFCB]
238 
239  menu.chainsInMenu['Bphysics'] = [
240  makeChain(flags, name='HLT_2mu4_bBmumu_L12MU3V', L1Thresholds=["MU3V"], ChainSteps=steps),
241  makeChain(flags, name='HLT_2mu4_bDimu_L12MU3V', L1Thresholds=["MU3V"], ChainSteps=steps),
242  makeChain(flags, name='HLT_2mu4_bJpsimumu_L12MU3V', L1Thresholds=["MU3V"], ChainSteps=steps),
243  makeChain(flags, name='HLT_2mu6_bJpsimumu_L12MU5VF', L1Thresholds=["MU5VF"], ChainSteps=steps),
244  makeChain(flags, name='HLT_2mu4_bUpsimumu_L12MU3V', L1Thresholds=["MU3V"], ChainSteps=steps)
245  ]
246 
247 
250  doCombinedSlice = True
251  if doCombinedSlice:
252  from TriggerMenuMT.HLT.CommonSequences.CaloSequences import fastCaloSequenceGenCfg
253  fastCaloSeq = functools.partial(fastCaloSequenceGenCfg,flags, name='Electron')
254 
255  from TriggerMenuMT.HLT.Muon.MuonMenuSequences import muFastSequenceGenCfg
256  muFast = functools.partial(muFastSequenceGenCfg,flags)
257 
258  comboStep_et_mufast = makeChainStep("Step1_et_mufast", [fastCaloSeq, muFast], multiplicity=[1,1])
259 
260  menu.chainsInMenu['Combined'] = [
261  makeChain(flags, name='HLT_e3_etcut_mu6_L12eEM10L_MU8F', L1Thresholds=["eEM10L", "MU8F"], ChainSteps=[comboStep_et_mufast ])
262  ]
263 
264  return menu
TestUtils.makeChain
def makeChain(flags, name, L1Thresholds, ChainSteps, Streams="physics:Main", Groups=["RATE:TestRateGroup", "BW:TestBW"])
Definition: TestUtils.py:34
GenerateMenuMT
Definition: GenerateMenuMT.py:1
python.HLT.Jet.JetRecoSequencesConfig.JetRecoDataDeps
def JetRecoDataDeps(flags, **jetRecoDict)
Data dependency generation for the stages of jet reconstruction This is used to precompute the collec...
Definition: JetRecoSequencesConfig.py:56
generateCFChains.generateCFChains
def generateCFChains(flags)
Definition: generateCFChains.py:12
python.HLT.Jet.JetRecoCommon.jetRecoDictFromString
def jetRecoDictFromString(jet_def_string)
Definition: JetRecoCommon.py:79