ATLAS Offline Software
Loading...
Searching...
No Matches
generateCFChains.py
Go to the documentation of this file.
2# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3#
4
5
9
10import functools
11
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", isEmpty=True)
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])
92 step2_2muComb_sym= makeChainStep("Step2_2muComb_sym", [ mucombS])
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])
98 step2_2muComb_asym= makeChainStep("Step1_2muComb_asym", [ mucombS, mucombS])
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_bgn270_ftf_subjesgscIS_preselj20_L1J20', L1Thresholds=["FSNOSEED"], ChainSteps=[step1,step2,step3] ),
197 ]
198
199
202 if 'Tau' in flags.Trigger.enabledSignatures and False: # not working at the moment
203 from TriggerMenuMT.HLT.Tau.TauMenuSequences import getTauSequence
204
205 step1=makeChainStep("Step1_tau", [getTauSequence('calo')])
206 step1MVA=makeChainStep("Step1MVA_tau", [getTauSequence('calo_mva')])
207
208 #This runs the tau-preselection(TP) step
209 step2TP=makeChainStep("Step2TP_tau", [getTauSequence('track_core')])
210
211 #This runs the EFTauMV hypo on top of fast tracks
212 step2PT=makeChainStep("Step2PT_tau", [getTauSequence('precision')])
213
214 menu.chainsInMenu['Tau'] = [
215 makeChain(flags, name='HLT_tau0_perf_ptonly_L1TAU8', L1Thresholds=["TAU8"], ChainSteps=[step1, step2] ),
216 makeChain(flags, name='HLT_tau25_medium1_tracktwo_L1TAU12IM', L1Thresholds=["TAU12IM"], ChainSteps=[step1, step2TP] ),
217 makeChain(flags, name='HLT_tau35_mediumRNN_tracktwoMVA_L1TAU12IM', L1Thresholds=["TAU20IM"], ChainSteps=[step1MVA, step2PT])
218 ]
219
220
223 if 'Bphysics' in flags.Trigger.enabledSignatures:
224 from TriggerMenuMT.HLT.Muon.MuonMenuSequences import muFastSequenceGenCfg, muCombSequenceGenCfg, muEFSASequenceGenCfg, muEFCBSequenceGenCfg
225 from TrigBphysHypo.TrigMultiTrkComboHypoConfig import StreamerDimuL2ComboHypoCfg, DimuEFComboHypoCfg
226
227 muFast = functools.partial(muFastSequenceGenCfg, flags)
228 step1_dimufast=makeChainStep("Step1_dimuFast", [muFast])
229 mucombS = functools.partial(muCombSequenceGenCfg, flags)
230 step2_dimuComb=makeChainStep("Step2_dimuComb", [mucombS], comboHypoCfg=functools.partial(StreamerDimuL2ComboHypoCfg,flags))
231 muEFSAS = functools.partial(muEFSASequenceGenCfg, flags)
232 muEFCBS = functools.partial(muEFCBSequenceGenCfg, flags)
233
234 step3_dimuEFSA=makeChainStep("Step3_dimuEFSA", [muEFSAS])
235 step4_dimuEFCB=makeChainStep("Step4_dimuEFCB", [muEFCBS], comboHypoCfg=functools.partial(DimuEFComboHypoCfg,flags))
236 steps = [step1_dimufast, step2_dimuComb, step3_dimuEFSA, step4_dimuEFCB]
237
238 menu.chainsInMenu['Bphysics'] = [
239 makeChain(flags, name='HLT_2mu4_bBmumu_L12MU3V', L1Thresholds=["MU3V"], ChainSteps=steps),
240 makeChain(flags, name='HLT_2mu4_bDimu_L12MU3V', L1Thresholds=["MU3V"], ChainSteps=steps),
241 makeChain(flags, name='HLT_2mu4_bJpsimumu_L12MU3V', L1Thresholds=["MU3V"], ChainSteps=steps),
242 makeChain(flags, name='HLT_2mu6_bJpsimumu_L12MU5VF', L1Thresholds=["MU5VF"], ChainSteps=steps),
243 makeChain(flags, name='HLT_2mu4_bUpsimumu_L12MU3V', L1Thresholds=["MU3V"], ChainSteps=steps)
244 ]
245
246
249 doCombinedSlice = True
250 if doCombinedSlice:
251 from TriggerMenuMT.HLT.CommonSequences.CaloSequences import fastCaloSequenceGenCfg
252 fastCaloSeq = functools.partial(fastCaloSequenceGenCfg,flags, name='Electron')
253
254 from TriggerMenuMT.HLT.Muon.MuonMenuSequences import muFastSequenceGenCfg
255 muFast = functools.partial(muFastSequenceGenCfg,flags)
256
257 comboStep_et_mufast = makeChainStep("Step1_et_mufast", [fastCaloSeq, muFast])
258
259 menu.chainsInMenu['Combined'] = [
260 makeChain(flags, name='HLT_e3_etcut_mu6_L12eEM10L_MU8F', L1Thresholds=["eEM10L", "MU8F"], ChainSteps=[comboStep_et_mufast ])
261 ]
262
263 return menu