ATLAS Offline Software
Loading...
Searching...
No Matches
TrigIDR4Monitoring.py
Go to the documentation of this file.
2# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3#
4# create all the histograms for each analysis - this will get called once for each
5# configured chain - we can set the HistPath either already here, or from the c++
6# code
7
8
9# actual code to configure al;l the different algorithm instances for
10# the different slices
11
12
13def TrigIDR4Monitoring( flags=None, name=None, monlevel=None ) :
14
15 tools = []
16
17 from AthenaCommon.Logging import logging
18 log = logging.getLogger("TIDAMonitoring")
19
20 log.info( "Creating TIDA monitoring: " + name )
21
22 key = "All"
23 toolkey = ""
24
25 if monlevel is not None:
26 log.info( "TIDA monitoring not None: monlevel: " + monlevel )
27 if "t0" in monlevel:
28 key = "Expert"
29 toolkey = "Expert"
30 elif "shifter" in monlevel:
31 key = "Shifter"
32 toolkey = "Shifter"
33
34 print( " R4Mon: toolkey: ", toolkey )
35 print( " R4Mon: key: ", key )
36
37 # each signature has it's own function now so it makes it easier to disable
38 # any of them is need be
39
40# TIDR4MonElectron( flags, key, toolkey, tools, monlevel )
41# TIDR4MonElectronLRT( flags, key, toolkey, tools, monlevel )
42 TIDR4MonMuon( flags, key, toolkey+name, tools, monlevel )
43# TIDR4MonMuonLRT( flags, key, toolkey, tools, monlevel )
44# TIDR4MonTau( flags, key, toolkey, tools, monlevel )
45# TIDR4MonBjet( flags, key, toolkey, tools, monlevel )
46# TIDR4MonMinbias( flags, key, toolkey, tools, monlevel )
47# TIDR4MonCosmic( flags, key, toolkey, tools, monlevel )
48# TIDR4MonBphys( flags, key, toolkey, tools, monlevel )
49# TIDR4MonUtt( flags, key, toolkey, tools, monlevel )
50
51 return tools
52
53
54# could we maybe eventually replace by a single creator function, as below, if we can find a way to
55# pass in all the custom variables, such as d0 etc, with out resorting to an egregious kwargs pattern
56# like this ...
57
58# TIDAsignature( flags, "Egamma", key, toolkey, tools, monlevel,
59# [ "HLT_e.(?!.*lrtloose.*).*idperf(?!.*lrtloose.*).*:key=HLT_IDTrack_Electron_FTF:roi=HLT_Roi_FastElectron",
60# "HLT_e.(?!.*lrtloose.*).*idperf(?!.*lrtloose.*).*:key=HLT_IDTrack_Electron_IDTrig",
61# "HLT_e.(?!.*lrtloose.*).*idperf(?!.*lrtloose.*)(?!.*nogsf.*).*:key=HLT_IDTrack_Electron_GSF",
62# "HLT_e.*_lhtight.*_e.*_idperf_tight_nogsf_probe_.*inv.*:key=HLT_IDTrack_Electron_FTF:roi=HLT_Roi_FastElectron:te=1",
63# "HLT_e.*_lhtight.*_e.*_idperf_tight_nogsf_probe_.*inv.*:key=HLT_IDTrack_Electron_FTF:extra=el_tag:roi=HLT_Roi_FastElectron:te=0",
64# "HLT_e.*_lhtight.*_e.*_idperf_tight_nogsf_probe_.*inv.*:key=HLT_IDTrack_Electron_FTF:extra=el_probe:roi=HLT_Roi_FastElectron:te=1",
65# "HLT_e.*_lhtight.*_e.*_idperf_tight_nogsf_probe_.*inv.*:key=HLT_IDTrack_Electron_IDTrig:te=1",
66# "HLT_e.*_lhtight.*_e.*_idperf_tight_nogsf_probe_.*inv.*:key=HLT_IDTrack_Electron_IDTrig:extra=el_tag:te=0",
67# "HLT_e.*_lhtight.*_e.*_idperf_tight_nogsf_probe_.*inv.*:key=HLT_IDTrack_Electron_IDTrig:extra=el_probe:te=1",
68# "HLT_e.*_lhtight.*_e.*_idperf_tight_probe_.*inv.*:key=HLT_IDTrack_Electron_GSF:te=1",
69# "HLT_e.*_lhtight.*_e.*_idperf_tight_probe_.*inv.*:key=HLT_IDTrack_Electron_GSF:extra=el_tag:te=0",
70# "HLT_e.*_lhtight.*_e.*_idperf_tight_probe_.*inv.*:key=HLT_IDTrack_Electron_GSF:extra=el_probe:te=1" ] )
71
72
73def TrigIDR4Monsignature( flags, signature, key, toolkey, tools, monlevel, chain_regex ) :
74
75 tida = TrigIDR4Mon_builder( flags, name = "ID"+signature+toolkey+"Tool", useHighestPT=True )
76 tida.SliceTag = "HLT/TRIDT/"+signature+"/"+key
77
78 tida.AnalysisConfig = "Tier0"
79
80 from TrigInDetMonitoring.TIDAChains import getchains
81
82 chains = getchains( flags, chain_regex, monlevel )
83
84
85 if len(chains)>0 :
86
87 tida.ntupleChainNames = chains
88
89 tida.MonTools = createMonTools( flags, tida.SliceTag, chains )
90
91 tools += [ tida ]
92
93
94
95
96
97
98
99def TIDR4MonElectron( flags, key, toolkey, tools, monlevel ) :
100
101
102
103 tidaegamma = TrigIDR4Mon_builder( flags, name = "IDEgamma"+toolkey+"Tool", useHighestPT=True )
104 tidaegamma.SliceTag = "HLT/TRIDT/Egamma/"+key
105
106 tidaegamma.AnalysisConfig = "Tier0"
107
108 from TrigInDetMonitoring.TIDAChains import getchains
109
110 chains = getchains( flags,
111 [ "HLT_e.(?!.*lrtloose.*).*idperf(?!.*lrtloose.*).*:key=HLT_IDTrack_Electron_FTF:roi=HLT_Roi_FastElectron",
112 "HLT_e.(?!.*lrtloose.*).*idperf(?!.*lrtloose.*).*:key=HLT_IDTrack_Electron_IDTrig",
113 "HLT_e.(?!.*lrtloose.*).*idperf(?!.*lrtloose.*)(?!.*nogsf.*).*:key=HLT_IDTrack_Electron_GSF",
114 "HLT_e.*_lhtight.*_e.*_idperf_tight_nogsf_probe_.*inv.*:key=HLT_IDTrack_Electron_FTF:roi=HLT_Roi_FastElectron:te=1",
115 "HLT_e.*_lhtight.*_e.*_idperf_tight_nogsf_probe_.*inv.*:key=HLT_IDTrack_Electron_FTF:extra=el_tag:roi=HLT_Roi_FastElectron:te=0",
116 "HLT_e.*_lhtight.*_e.*_idperf_tight_nogsf_probe_.*inv.*:key=HLT_IDTrack_Electron_FTF:extra=el_probe:roi=HLT_Roi_FastElectron:te=1",
117 "HLT_e.*_lhtight.*_e.*_idperf_tight_nogsf_probe_.*inv.*:key=HLT_IDTrack_Electron_IDTrig:te=1",
118 "HLT_e.*_lhtight.*_e.*_idperf_tight_nogsf_probe_.*inv.*:key=HLT_IDTrack_Electron_IDTrig:extra=el_tag:te=0",
119 "HLT_e.*_lhtight.*_e.*_idperf_tight_nogsf_probe_.*inv.*:key=HLT_IDTrack_Electron_IDTrig:extra=el_probe:te=1",
120 "HLT_e.*_lhtight.*_e.*_idperf_tight_probe_.*inv.*:key=HLT_IDTrack_Electron_GSF:te=1",
121 "HLT_e.*_lhtight.*_e.*_idperf_tight_probe_.*inv.*:key=HLT_IDTrack_Electron_GSF:extra=el_tag:te=0",
122 "HLT_e.*_lhtight.*_e.*_idperf_tight_probe_.*inv.*:key=HLT_IDTrack_Electron_GSF:extra=el_probe:te=1" ], monlevel )
123
124 if len(chains)>0 :
125
126 tidaegamma.ntupleChainNames = chains
127
128 tidaegamma.MonTools = createMonTools( flags, tidaegamma.SliceTag, chains )
129
130 tools += [ tidaegamma ]
131
132
133
134def TIDR4MonElectronLRT( flags, key, toolkey, tools, monlevel ) :
135
136
137
138
139 tidaegammalrt = TrigIDR4Mon_builder( flags, name = "IDEgammaLRT"+toolkey+"Tool", useHighestPT=True )
140 tidaegammalrt.SliceTag = "HLT/TRIDT/EgammaLRT/"+key
141
142 tidaegammalrt.AnalysisConfig = "Tier0"
143 tidaegammalrt.mind0CutOffline = 2.
144
145 from TrigInDetMonitoring.TIDAChains import getchains
146
147 chains = getchains( flags,
148 [ "HLT_e.*idperf_loose_lrtloose.*:key=HLT_IDTrack_ElecLRT_FTF:roi=HLT_Roi_FastElectron_LRT",
149 "HLT_e.*idperf_loose_lrtloose.*:key=HLT_IDTrack_ElecLRT_IDTrig:roi=HLT_Roi_FastElectron_LRT",
150 "HLT_e.*lrtloose_idperf.*:key=HLT_IDTrack_ElecLRT_FTF:roi=HLT_Roi_FastElectron_FTF",
151 "HLT_e.*lrtloose_idperf.*:key=HLT_IDTrack_ElecLRT_IDTrig:roi=HLT_Roi_FastElectron_LRT",
152 ], monlevel )
153
154 if len(chains)>0 :
155
156 tidaegammalrt.ntupleChainNames = chains
157 tidaegammalrt.ntupleChainNames += [ "Offline", "Offline:+InDetLargeD0TrackParticles" ]
158
159 tidaegammalrt.MonTools = createMonTools( flags, tidaegammalrt.SliceTag, chains )
160
161 tools += [ tidaegammalrt ]
162
163
164
165
166def TIDR4MonMuon( flags, key, toolkey, tools, monlevel ) :
167
168
169
170
171 name = "IDMuon"+toolkey+"Tool"
172
173 print( " name: ", name )
174 print( " key: ", key )
175
176
177 tidamuon = TrigIDR4Mon_builder( flags, name = name, useHighestPT=True )
178 tidamuon.SliceTag = "HLT/TRIDT/Muon/"+key
179
180 tidamuon.AnalysisConfig = "Tier0"
181
182 from TrigInDetMonitoring.TIDAChains import getchains
183
184 chains = getchains( flags,
185 [ "HLT_mu(?!.*LRT.*)(?!.*tau.*).*_idperf.*:key=HLT_IDTrack_Muon_FTF:roi=HLT_Roi_L2SAMuon",
186 "HLT_mu(?!.*LRT.*)(?!.*tau.*).*_idperf.*:key=HLT_IDTrack_Muon_IDTrig:roi=HLT_Roi_L2SAMuon",
187 "HLT_mu.*ivarperf.*:key=HLT_IDTrack_MuonIso_FTF:roi=HLT_Roi_MuonIso",
188 "HLT_mu.*ivarperf.*:key=HLT_IDTrack_MuonIso_IDTrig:roi=HLT_Roi_MuonIso",
189 "HLT_mu.*_mu.*_idperf.*:key=HLT_IDTrack_Muon_FTF:roi=HLT_Roi_L2SAMuon",
190 "HLT_mu.*_mu.*_idperf.*:key=HLT_IDTrack_Muon_IDTrig:roi=HLT_Roi_L2SAMuon",
191 "HLT_mu.*_mu.*idtp.*:key=HLT_IDTrack_Muon_FTF:roi=HLT_Roi_L2SAMuon",
192 "HLT_mu.*_mu.*idtp.*:key=HLT_IDTrack_Muon_IDTrig:roi=HLT_Roi_L2SAMuon",
193 "HLT_mu.*_mu.*idtp.*:key=HLT_IDTrack_Muon_FTF:roi=HLT_Roi_L2SAMuon:te=1",
194 "HLT_mu.*_mu.*idtp.*:key=HLT_IDTrack_Muon_IDTrig:roi=HLT_Roi_L2SAMuon:te=1",
195 "HLT_mu.*_mu.*idtp.*:key=HLT_IDTrack_Muon_FTF:roi=HLT_Roi_L2SAMuon:extra=mu_tag:te=0",
196 "HLT_mu.*_mu.*idtp.*:key=HLT_IDTrack_Muon_FTF:roi=HLT_Roi_L2SAMuon:extra=mu_probe:te=1",
197 "HLT_mu.*_mu.*idtp.*:key=HLT_IDTrack_Muon_IDTrig:roi=HLT_Roi_L2SAMuon:extra=mu_tag:te=0",
198 "HLT_mu.*_mu.*idtp.*:key=HLT_IDTrack_Muon_IDTrig:roi=HLT_Roi_L2SAMuon:extra=mu_probe:te=1",
199 "HLT_mu.*_mu.*_idperf.*:key=HLT_IDTrack_Muon_FTF:roi=HLT_Roi_L2SAMuon:te=1",
200 "HLT_mu.*_mu.*_idperf.*:key=HLT_IDTrack_Muon_IDTrig:roi=HLT_Roi_L2SAMuon:te=1",
201 "HLT_mu.*_mu.*_idperf.*:key=HLT_IDTrack_Muon_FTF:roi=HLT_Roi_L2SAMuon:extra=mu_tag:te=0",
202 "HLT_mu.*_mu.*_idperf.*:key=HLT_IDTrack_Muon_FTF:roi=HLT_Roi_L2SAMuon:extra=mu_probe:te=1",
203 "HLT_mu.*_mu.*_idperf.*:key=HLT_IDTrack_Muon_IDTrig:roi=HLT_Roi_L2SAMuon:extra=mu_tag:te=0",
204 "HLT_mu.*_mu.*_idperf.*:key=HLT_IDTrack_Muon_IDTrig:roi=HLT_Roi_L2SAMuon:extra=mu_probe:te=1" ], monlevel )
205
206 if len(chains)>0 :
207
208 tidamuon.ntupleChainNames = chains
209
210 tidamuon.MonTools = createMonTools( flags, tidamuon.SliceTag, chains )
211
212 tools += [ tidamuon ]
213
214
215def TIDR4MonMuonLRT( flags, key, toolkey, tools, monlevel ) :
216
217
218
219 tidamuonlrt = TrigIDR4Mon_builder( flags, name = "IDMuonLRT"+toolkey+"Tool", useHighestPT=True )
220 tidamuonlrt.SliceTag = "HLT/TRIDT/MuonLRT/"+key
221
222 tidamuonlrt.AnalysisConfig = "Tier0"
223 tidamuonlrt.mind0CutOffline = 2.
224
225 from TrigInDetMonitoring.TIDAChains import getchains
226
227 chains = getchains( flags,
228 [ "HLT_mu.*_LRT_idperf.*:key=HLT_IDTrack_MuonLRT_FTF:roi=HLT_Roi_L2SAMuon_LRT",
229 "HLT_mu.*_LRT_idperf.*:key=HLT_IDTrack_MuonLRT_IDTrig:roi=HLT_Roi_L2SAMuon_LRT"], monlevel )
230
231 if len(chains)>0 :
232
233 tidamuonlrt.ntupleChainNames = chains
234 tidamuonlrt.ntupleChainNames += [ "Offline", "Offline:+InDetLargeD0TrackParticles" ]
235
236 tidamuonlrt.MonTools = createMonTools( flags, tidamuonlrt.SliceTag, chains )
237
238 tools += [ tidamuonlrt ]
239
240
241
242
243
244def TIDR4MonTau( flags, key, toolkey, tools, monlevel ) :
245
246
247
248 tidatau = TrigIDR4Mon_builder( flags, name = "IDTau"+toolkey+"Tool", useHighestPT=True )
249 tidatau.SliceTag = "HLT/TRIDT/Tau/"+key
250
251 tidatau.AnalysisConfig = "Tier0"
252
253 from TrigInDetMonitoring.TIDAChains import getchains
254
255 chains = getchains( flags,
256 [ "HLT_tau.*idperf.*tracktwoMVA_.*:key=HLT_IDTrack_TauCore_FTF:roi=HLT_Roi_TauCore",
257 "HLT_tau.*idperf.*tracktwoMVA_.*:key=HLT_IDTrack_TauIso_FTF:roi=HLT_Roi_TauIso",
258 "HLT_tau.*idperf.*tracktwoMVA_.*:key=HLT_IDTrack_Tau_IDTrig:roi=HLT_Roi_TauIso",
259 "HLT_mu.*tau.*idperf.*:key=HLT_IDTrack_TauCore_FTF:roi=HLT_Roi_TauCore",
260 "HLT_mu.*tau.*idperf.*:key=HLT_IDTrack_TauIso_FTF:roi=HLT_Roi_TauIso",
261 "HLT_mu.*tau.*idperf.*:key=HLT_IDTrack_Tau_IDTrig:roi=HLT_Roi_TauIso",
262 "HLT_mu.*tau.*idperf.*:key=HLT_IDTrack_Muon_FTF:roi=HLT_Roi_L2SAMuon:extra=tau1_tag:te=0",
263 "HLT_mu.*tau.*idperf.*:key=HLT_IDTrack_TauCore_FTF:roi=HLT_Roi_TauCore:extra=tau1_probe:te=1",
264 "HLT_mu.*tau.*idperf.*:key=HLT_IDTrack_Muon_FTF:roi=HLT_Roi_L2SAMuon:extra=tau0_tag:te=0",
265 "HLT_mu.*tau.*idperf.*:key=HLT_IDTrack_TauIso_FTF:roi=HLT_Roi_TauIso:extra=tau0_probe:te=1",
266 "HLT_mu.*tau.*idperf.*:key=HLT_IDTrack_Muon_IDTrig:roi=HLT_Roi_L2SAMuon:extra=tau_tag:te=0",
267 "HLT_mu.*tau.*idperf.*:key=HLT_IDTrack_Tau_IDTrig:roi=HLT_Roi_TauIso:extra=tau_probe:te=1" ], monlevel )
268
269 if len(chains)>0 :
270
271 tidatau.ntupleChainNames = chains
272
273 tidatau.MonTools = createMonTools( flags, tidatau.SliceTag, chains )
274
275 tools += [ tidatau ]
276
277
278
279
280 tidataulrt = TrigIDR4Mon_builder( flags, name = "IDTauLRT"+toolkey+"Tool", useHighestPT=True )
281 tidataulrt.SliceTag = "HLT/TRIDT/TauLRT/"+key
282
283 tidataulrt.AnalysisConfig = "Tier0"
284 tidataulrt.mind0CutOffline = 2.
285
286 from TrigInDetMonitoring.TIDAChains import getchains
287
288 chains = getchains( flags,
289 [ "HLT_tau.*_idperf.*_trackLRT.*:key=HLT_IDTrack_TauLRT_FTF:roi=HLT_Roi_LRT",
290 "HLT_tau.*_idperf.*_trackLRT.*:key=HLT_IDTrack_TauLRT_IDTrig:roi=HLT_Roi_TauLRT"], monlevel )
291
292 if len(chains)>0 :
293
294 tidataulrt.ntupleChainNames = chains
295 tidataulrt.ntupleChainNames += [ "Offline", "Offline:+InDetLargeD0TrackParticles" ]
296
297 tidataulrt.MonTools = createMonTools( flags, tidataulrt.SliceTag, chains )
298
299 tools += [ tidataulrt ]
300
301
302
303
304
305def TIDR4MonBjet( flags, key, toolkey, tools, monlevel ) :
306
307
308
309 tidabjet = TrigIDR4Mon_builder( flags, name = "IDBjet"+toolkey+"Tool" )
310 tidabjet.SliceTag = "HLT/TRIDT/Bjet/"+key
311
312 tidabjet.AnalysisConfig = "Tier0"
313
314 from TrigInDetMonitoring.TIDAChains import getchains
315
316 chains = getchains( flags,
317 [ "HLT_j.*presel.*b.*:key=HLT_IDTrack_JetSuper_FTF:roi=HLT_Roi_JetSuper:vtx=HLT_IDVertex_JetSuper",
318 "HLT_j.*roiftf.*:key=HLT_IDTrack_JetSuper_FTF:roi=HLT_Roi_JetSuper:vtx=HLT_IDVertex_JetSuper",
319 "HLT_j.*presel.*b.*:key=HLT_IDTrack_FS_FTF:roi=HLT_FSRoI:vtx=HLT_IDVertex_FS",
320 "HLT_j.*boffperf.*:key=HLT_IDTrack_Bjet_FTF:roi=HLT_Roi_Bjet",
321 "HLT_j.*boffperf.*:key=HLT_IDTrack_Bjet_IDTrig:roi=HLT_Roi_Bjet",
322 "HLT_j45_pf_ftf_preselj20_L1J15:key=HLT_IDTrack_FS_FTF:roi=HLT_FSRoI:vtx=HLT_IDVertex_FS",
323 "HLT_j.*_ftf.*boffperf.*:key=HLT_IDTrack_FS_FTF:roi=HLT_FSRoI:vtx=HLT_IDVertex_FS",
324 "HLT_j.*boffperf.*_ftf.*:key=HLT_IDTrack_FS_FTF:roi=HLT_FSRoI:vtx=HLT_IDVertex_FS"
325 ], monlevel )
326
327 # if we find no chains, try to get more generic chains
328
329 if len(chains)==0 :
330 chains = getchains( flags,
331 [
332# "HLT_j(?!0).*:key=HLT_IDTrack_Bjet_FTF",
333# "HLT_j(?!0).*:key=HLT_IDTrack_Bjet_IDTrig",
334 "HLT_j(?!0).*:key=HLT_IDTrack_FS_FTF:roi=HLT_FSRoI:vtx=HLT_IDVertex_FS",
335 ], None )
336
337
338 if len(chains)>0 :
339
340 tidabjet.ntupleChainNames += chains
341
342 tidabjet.MonTools = createMonTools( flags, tidabjet.SliceTag, chains )
343
344 tools += [ tidabjet ]
345
346
347
348
349
350def TIDR4MonMinbias( flags, key, toolkey, tools, monlevel ) :
351
352
353
354 tidaminbias = TrigIDR4Mon_builder( flags, name = "IDMinbias"+toolkey+"Tool" )
355 tidaminbias.SliceTag = "HLT/TRIDT/Minbias/"+key
356
357 tidaminbias.AnalysisConfig = "Tier0"
358 tidaminbias.z0CutOffline = 120
359 tidaminbias.pTCutOffline = 200
360
361 from TrigInDetMonitoring.TIDAChains import getchains
362
363 chains = getchains( flags,
364 [ "HLT_mb_sptrk.*:key=HLT_IDTrack_MinBias_IDTrig",
365 "HLT_mb_.*pix.*:key=HLT_IDTrack_MinBiasPixel_IDTrig" ], monlevel )
366
367 if len(chains)>0 :
368
369 tidaminbias.ntupleChainNames += chains
370
371 tidaminbias.MonTools = createMonTools( flags, tidaminbias.SliceTag, chains )
372
373 tools += [ tidaminbias ]
374
375
376
377
378def TIDR4MonCosmic( flags, key, toolkey, tools, monlevel ) :
379
380
381
382 tidacosmic = TrigIDR4Mon_builder( flags, name = "IDCosmic"+toolkey+"Tool" )
383 tidacosmic.SliceTag = "HLT/TRIDT/Cosmic/"+key
384
385 tidacosmic.AnalysisConfig = "Tier0"
386
387 from TrigInDetMonitoring.TIDAChains import getchains
388
389 chains = getchains( flags,
390 [ "HLT_.*cosmic.*:key=HLT_IDTrack_Cosmic_IDTrig" ], monlevel )
391
392 if len(chains)>0 :
393
394 tidacosmic.ntupleChainNames += chains
395
396 tidacosmic.MonTools = createMonTools( flags, tidacosmic.SliceTag, chains )
397
398 tools += [ tidacosmic ]
399
400
401
402
403
404def TIDR4MonBphys( flags, key, toolkey, tools, monlevel ) :
405
406
407
408 tidabphysics = TrigIDR4Mon_builder( flags, name = "IDBphysics"+toolkey+"Tool", useHighestPT=True )
409 tidabphysics.SliceTag = "HLT/TRIDT/Bphysics/"+key
410
411 tidabphysics.AnalysisConfig = "Tier0"
412
413 from TrigInDetMonitoring.TIDAChains import getchains
414
415 chains = getchains( flags,
416 [ "HLT_mu.*_bBmumux_BsmumuPhi.*:key=HLT_IDTrack_Bmumux_FTF",
417 "HLT_mu.*_bBmumux_BsmumuPhi.*:key=HLT_IDTrack_Bmumux_IDTrig",
418 "HLT_mu.*_bBmumux_Bidperf.*:key=HLT_IDTrack_Bmumux_FTF",
419 "HLT_mu.*_bBmumux_Bidperf.*:key=HLT_IDTrack_Bmumux_IDTrig"], monlevel )
420
421 if len(chains)>0 :
422
423 tidabphysics.ntupleChainNames += chains
424
425 tidabphysics.MonTools = createMonTools( flags, tidabphysics.SliceTag, chains )
426
427 tools += [ tidabphysics ]
428
429
430
431
432def TIDR4MonUtt( flags, key, toolkey, tools, monlevel ) :
433
434
435
436 tidautt = TrigIDR4Mon_builder( flags, name = "IDUtt"+toolkey+"Tool" )
437 tidautt.SliceTag = "HLT/TRIDT/UTT/"+key
438
439 tidautt.AnalysisConfig = "Tier0"
440
441 from TrigInDetMonitoring.TIDAChains import getchains
442
443 chains = getchains( flags,
444 [ "HLT_j180_.*dispjet.*_L1J100:key=HLT_IDTrack_DJLRT_FTF:roi=HLT_Roi_DJ", "HLT_j180_.*dispjet.*_L1jJ160:key=HLT_IDTrack_DJLRT_FTF:roi=HLT_Roi_DJ" ], monlevel )
445
446 if len(chains)>0 :
447
448 tidautt.ntupleChainNames += chains
449
450 tidautt.MonTools = createMonTools( flags, tidautt.SliceTag, chains )
451
452 tools += [ tidautt ]
453
454
455
456
457
458
459
460# get this from the TIDAMonitoring
461
462# # create a separate specific monTool for each analysis chain
463# # - simplifies the overall analysis configuration
464
465# def createMonTools( flags, label, chains, excludeTagChains=True ):
466# tools = []
467# from TrigInDetAnalysisExample.chainString import chainString
468# from TrigInDetAnalysisExample.TIDAMonTool import createMonTool
469# for mt in chains :
470# if excludeTagChains and "tag" in chainString(mt).extra:
471# continue
472# tool = createMonTool( flags, label, mt )
473# tools += [ tool ]
474# return tools
475
476from TrigInDetMonitoring.TIDAMonitoring import createMonTools
477
478
479# create the actual algorithm - calling with this wrapper lets us use the same
480# code for the old, or new configuration
481def TrigIDR4Mon_builder( flags=None, name="NoName", useHighestPT=False, pdgID=0 ):
482
483 if flags is None:
484 from TrigIDR4Monitoring.TrigIDR4MonitoringConf import TrigIDR4Mon
485 alg = TrigIDR4Mon( name = name )
486 else:
487 from AthenaConfiguration.ComponentFactory import CompFactory
488 alg = CompFactory.TrigIDR4Mon( name=name )
489
490 alg.UseHighestPT = useHighestPT
491
492 return alg
493
494
495
496
497# wrapper function for the central monitoring configuration
498
499def TrigIDR4MonConfig( flags, monlevels=None ):
500 return TrigIDR4MonitoringCA( flags, monlevels )
501
502
503
504# component accumulator wrapper around the overall monitoring functiom
505
506def TrigIDR4MonitoringCA( flags, monlevels=None ):
507
508 from AthenaMonitoring import AthMonitorCfgHelper
509 monConfig = AthMonitorCfgHelper(flags, "TrigIDR4Mon")
510
511 print( "monlevel: ", monlevels )
512
513 algs = TrigIDR4Monitoring(flags, "Tier0", monlevel="idMon:t0:shifter" )
514 algs += TrigIDR4Monitoring(flags, "Shifter", monlevel="idMon:shifter" )
515
516 if flags.Input.isMC:
517 algs += TrigIDR4Monitoring( flags, name="PhysVal", monlevel="idMon:t0" )
518 algs += TrigIDR4Monitoring( flags, name="PhysValShifter", monlevel="idMon:shifter" )
519
520
521 for a in algs:
522 monConfig.addAlgorithm(a)
523
524 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
525 ca = ComponentAccumulator()
526 ca.merge(monConfig.result())
527 return ca
528
529
530
531
532
533
534def histsvc( flags ):
535
536 from AthenaCommon.Logging import log
537
538 if flags.Output.HISTFileName:
539 log.info( "histsvc: Create THistSvc with file name: "+flags.Output.HISTFileName )
540
541 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
542 ca = ComponentAccumulator()
543
544 from AthenaConfiguration.ComponentFactory import CompFactory
545 THistSvc = CompFactory.THistSvc
546
547 histsvc = THistSvc()
548 if flags.Output.HISTFileName:
549 histsvc.Output += ["%s DATAFILE='%s' OPT='RECREATE'" % (flags.DQ.FileKey, flags.Output.HISTFileName)]
550 log.info( "histsvc: "+histsvc.Output[-1] )
551
552 ca.addService(histsvc)
553
554 return ca
555
556
557
558if __name__=='__main__':
559
560 # Setup logs
561 from AthenaCommon.Logging import log
562 log.info( "test running" )
563
564 # Set the Athena configuration flags
565 from AthenaConfiguration.AllConfigFlags import initConfigFlags
566
567 flags = initConfigFlags()
568
569 # Input files
570 # AOD file to be run w/ MT access and Mon Groups implemented
571 file = 'AOD.pool.root'
572
573 flags.Input.Files = [file]
574 flags.Input.isMC = False
575
576 flags.Output.HISTFileName = 'duff.root'
577
578 flags.lock()
579
580 # Initialize configuration object, add accumulator, merge, and run.
581 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
582 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
583 cfg = MainServicesCfg(flags)
584
585 cfg.merge( PoolReadCfg(flags) )
586
587 cfg.merge( histsvc(flags) )
588
589 cfg.merge( TrigIDR4MonConfig( flags ) )
590
591 # If you want to turn on more detailed messages ...
592 cfg.printConfig(withDetails=False) # set True for exhaustive info
593
594 Nevents = 10
595 cfg.run(Nevents)
596
597
598
void print(char *figname, TCanvas *c1)
TIDR4MonUtt(flags, key, toolkey, tools, monlevel)
TrigIDR4MonitoringCA(flags, monlevels=None)
TIDR4MonCosmic(flags, key, toolkey, tools, monlevel)
TrigIDR4MonConfig(flags, monlevels=None)
TIDR4MonMinbias(flags, key, toolkey, tools, monlevel)
TIDR4MonMuonLRT(flags, key, toolkey, tools, monlevel)
TIDR4MonElectron(flags, key, toolkey, tools, monlevel)
TIDR4MonElectronLRT(flags, key, toolkey, tools, monlevel)
TIDR4MonTau(flags, key, toolkey, tools, monlevel)
TrigIDR4Mon_builder(flags=None, name="NoName", useHighestPT=False, pdgID=0)
TIDR4MonBjet(flags, key, toolkey, tools, monlevel)
TIDR4MonMuon(flags, key, toolkey, tools, monlevel)
TrigIDR4Monsignature(flags, signature, key, toolkey, tools, monlevel, chain_regex)
TIDR4MonBphys(flags, key, toolkey, tools, monlevel)