ATLAS Offline Software
Loading...
Searching...
No Matches
TrigMETMonitorAlgorithm.py
Go to the documentation of this file.
2# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3#
4
5'''@file TrigMETMonitoringAlgorithm.py
6@author K. Hamano
7@author G. Gallardo
8@date 2019-05-13
9@brief MET Trigger python configuration for Run 3 AthenaMonitoring package
10
11'''
12
13def TrigMETMonConfig(inputFlags):
14 '''Function to configures some algorithms in the monitoring system.'''
15
16 # The following class will make a sequence, configure algorithms, and link
17 # them to GenericMonitoringTools
18 from AthenaMonitoring import AthMonitorCfgHelper
19 helper = AthMonitorCfgHelper(inputFlags,'TrigMETAthMonitorCfg')
20
21
28
29 from AthenaConfiguration.ComponentFactory import CompFactory
30 TrigMETMonAlg = helper.addAlgorithm(CompFactory.TrigMETMonitorAlgorithm,'TrigMETMonAlg')
31
32 # You can actually make multiple instances of the same algorithm and give
33 # them different configurations
34 TrigMETMonChain1Alg = helper.addAlgorithm(CompFactory.TrigMETMonitorAlgorithm,'TrigMETMonChain1Alg')
35 TrigMETMonChain2Alg = helper.addAlgorithm(CompFactory.TrigMETMonitorAlgorithm,'TrigMETMonChain2Alg')
36 TrigMETMonChain3Alg = helper.addAlgorithm(CompFactory.TrigMETMonitorAlgorithm,'TrigMETMonChain3Alg')
37
38 # # If for some really obscure reason you need to instantiate an algorithm
39 # # yourself, the AddAlgorithm method will still configure the base
40 # # properties and add the algorithm to the monitoring sequence.
41 # helper.AddAlgorithm(myExistingAlg)
42
43
44
45 mt_chains = True
46 if ( inputFlags.Trigger.EDMVersion < 3 ) :
47 mt_chains = False
48
49
50
57 TrigMETMonChain1 = 'HLT_xe80_cell_xe115_tcpufit_L1jXE100'
58 TrigMETMonChain2 = 'HLT_xe65_cell_xe90_pfopufit_L1jXE100'
59 TrigMETMonChain3 = 'HLT_xe65_cell_xe105_nn_L1jXE100'
60 if mt_chains:
61 TrigMETMonChain1Alg.TriggerChain = TrigMETMonChain1
62 TrigMETMonChain2Alg.TriggerChain = TrigMETMonChain2
63 TrigMETMonChain3Alg.TriggerChain = TrigMETMonChain3
64 else:
65 TrigMETMonChain1Alg.TriggerChain = 'HLT_xe110_pufit_xe65_L1XE50'
66 TrigMETMonChain2Alg.TriggerChain = 'HLT_xe110_pufit_xe65_L1XE50'
67 TrigMETMonChain3Alg.TriggerChain = 'HLT_xe110_pufit_xe65_L1XE50'
68
69
70
71 from TrigConfigSvc.TriggerConfigAccess import getHLTMonitoringAccess
72 moniAccess=getHLTMonitoringAccess(inputFlags)
73 metChains=moniAccess.monitoredChains(signatures="metMon",monLevels=["shifter"])
74 metChainsVal=moniAccess.monitoredChains(signatures="metMon",monLevels=["val"])
75 metChainsT0=moniAccess.monitoredChains(signatures="metMon",monLevels=["t0"])
76
77
78 if mt_chains: # these are temporary, needs to be changed
79 TrigMETMonAlg.hlt_electron_key = 'HLT_egamma_Electrons'
80 TrigMETMonAlg.hlt_muon_key = 'HLT_MuonsCB_RoI'
81 TrigMETMonAlg.offline_met_key = 'MET_Reference_AntiKt4EMTopo' #this used to be 'MET_EMTopo'
82 TrigMETMonAlg.hlt_pfsum_key = 'HLT_MET_pfsum'
83 TrigMETMonAlg.l1_jFexMet_key = 'L1_jFexMETRoI'
84 TrigMETMonAlg.l1_jFexSumEt_key = 'L1_jFexSumETRoI'
85 TrigMETMonAlg.l1_gFexJwojScalar_key = 'L1_gScalarEJwoj'
86 TrigMETMonAlg.l1_gFexJwojMETComponents_key = 'L1_gMETComponentsJwoj'
87 TrigMETMonAlg.l1_gFexJwojMHTComponents_key = 'L1_gMHTComponentsJwoj'
88 TrigMETMonAlg.l1_gFexJwojMSTComponents_key = 'L1_gMSTComponentsJwoj'
89 TrigMETMonAlg.l1_gFexNCMETScalar_key = 'L1_gScalarENoiseCut'
90 TrigMETMonAlg.l1_gFexNCMETComponents_key = 'L1_gMETComponentsNoiseCut'
91 TrigMETMonAlg.l1_gFexRhoMETScalar_key = 'L1_gScalarERms'
92 TrigMETMonAlg.l1_gFexRhoMETComponents_key = 'L1_gMETComponentsRms'
93 else:
94 TrigMETMonAlg.hlt_electron_key = 'HLT_xAOD__ElectronContainer_egamma_Electrons'
95 TrigMETMonAlg.hlt_muon_key = 'HLT_xAOD__MuonContainer_MuonEFInfo'
96 TrigMETMonAlg.offline_met_key = 'MET_Reference_AntiKt4LCTopo'
97 TrigMETMonAlg.hlt_cell_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET'
98 TrigMETMonAlg.hlt_mht_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_mht'
99 TrigMETMonAlg.hlt_tc_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl'
100 TrigMETMonAlg.hlt_tc_em_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl'
101 TrigMETMonAlg.hlt_tcpufit_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl_PUC'
102 TrigMETMonAlg.hlt_trkmht_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl'
103 TrigMETMonAlg.hlt_pfsum_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl'
104 TrigMETMonAlg.hlt_pfsum_vssk_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl'
105 TrigMETMonAlg.hlt_pfsum_cssk_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl'
106 TrigMETMonAlg.hlt_pfopufit_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl'
107 TrigMETMonAlg.hlt_cvfpufit_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl'
108 TrigMETMonAlg.hlt_mhtpufit_pf_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl'
109 TrigMETMonAlg.hlt_mhtpufit_em_key = 'HLT_xAOD__TrigMissingETContainer_TrigEFMissingET_topocl'
110
111
112 L1Chains = ["L1_jXE100",
113 "L1_gXEJWOJ100"]
114 HLTChains = []
115 HLTChainsVal = []
116 HLTChainsT0 = []
117 if mt_chains == 0:
118 L1Chains = ["L1_XE50"]
119 HLTChains = ["HLT_xe70_mht",
120 "HLT_xe90_mht_L1XE50",
121 "HLT_xe100_mht_L1XE50",
122 "HLT_xe110_mht_L1XE50",
123 "HLT_xe90_pufit_L1XE50",
124 "HLT_xe100_pufit_L1XE50",
125 "HLT_xe100_pufit_L1XE55",
126 "HLT_xe110_pufit_L1XE50",
127 "HLT_xe110_pufit_L1XE55",
128 "HLT_xe110_pufit_xe65_L1XE50",
129 "HLT_xe110_pufit_xe65_L1XE60",
130 "HLT_xe110_pufit_xe70_L1XE50"]
131
132 if len(metChains) > 0:
133 HLTChains = metChains
134 if len(metChainsVal) > 0:
135 HLTChainsVal = metChainsVal
136 if len(metChainsT0) > 0:
137 HLTChainsT0 = metChainsT0
138
139
140 HLTChainEl = ["HLT_e26_lhtight_ivarloose_L1.*","HLT_e28_lhtight_ivarloose_L1.*"]
141 HLTChainMu = ["HLT_mu24_ivarmedium_L1.*"]
142
143 TrigMETMonAlg.L1Chains = L1Chains
144 TrigMETMonAlg.HLTChains = HLTChains
145 TrigMETMonAlg.HLTChainsVal = HLTChainsVal
146 TrigMETMonAlg.HLTChainsT0 = HLTChainsT0
147 TrigMETMonAlg.HLTChainEl = HLTChainEl
148 TrigMETMonAlg.HLTChainMu = HLTChainMu
149
150
151 algsL1 = ["roi"]
152 algsL1Fex = ["jFex",
153 "gFexJwoj",
154 "gFexNC",
155 "gFexRho"]
156 algsHLT = ["cell",
157 "tcpufit",
158 "pfopufit",
159 "met_nn"]
160 algsHLTChain1 = ["cell",
161 "tcpufit"]
162 algsHLTChain2 = ["cell",
163 "pfopufit"]
164 algsHLTChain3 = ["cell",
165 "met_nn"]
166 algsHLTPreSel = ["cell",
167 "tcpufit",
168 "tcpufit_sig30",
169 "pfsum_cssk",
170 "pfsum_vssk",
171 "pfopufit",
172 "pfopufit_sig30",
173 "mhtpufit_pf",
174 "mhtpufit_em",
175 "met_nn"]
176 algsHLT2d = ["cell",
177 "tcpufit",
178 "pfopufit"]
179 algsHLTExpert = ["mht",
180 "tc_em",
181 "cvfpufit",
182 "pfsum",
183 "trkmht",
184 "mhtpufit_pf",
185 "mhtpufit_em",
186 "tcpufit_sig30",
187 "pfopufit_sig30",
188 "pfsum_cssk",
189 "pfsum_vssk"]
190 algsMET2d_tcpufit = ["pfopufit",
191 "pfsum_cssk",
192 "mhtpufit_pf"]
193
194
195 TrigMETMonAlg.algsL1 = algsL1
196 TrigMETMonAlg.algsHLT = algsHLT
197 TrigMETMonAlg.algsHLTPreSel = algsHLTPreSel
198 TrigMETMonAlg.algsHLT2d = algsHLT2d
199 TrigMETMonAlg.algsHLTExpert = algsHLTExpert
200 TrigMETMonAlg.algsMET2d_tcpufit = algsMET2d_tcpufit
201 TrigMETMonChain1Alg.algsHLT = algsHLTChain1
202 TrigMETMonChain2Alg.algsHLT = algsHLTChain2
203 TrigMETMonChain3Alg.algsHLT = algsHLTChain3
204
205
206 l1MetAlg = 1 #0=legacy,1=jFex,2=gFexJWOJ
207 l1MetCut = 48.0 #50.0,48.0,?
208 TrigMETMonAlg.L1MetAlg = l1MetAlg
209 TrigMETMonAlg.L1MetCut = l1MetCut
210
211
212 comp_names = ["PreSamplB", "EMB1", "EMB2", "EMB3", # LAr barrel
213 "PreSamplE", "EME1", "EME2", "EME3", # LAr EM endcap
214 "HEC0", "HEC1", "HEC2", "HEC3", # Hadronic end cap cal.
215 "TileBar0", "TileBar1", "TileBar2", # Tile barrel
216 "TileGap1", "TileGap2", "TileGap3", # Tile gap (ITC & scint)
217 "TileExt0", "TileExt1", "TileExt2", # Tile extended barrel
218 "FCalEM", "FCalHad2", "FCalHad3"] # Forward cal endcap
219 #"Muons" ] # Muons
220 bit_names = [
221 "Processing", # bit 0
222 "ErrBSconv", # bit 1
223 "ErrMuon", # bit 2
224 "ErrFEB", # bit 3
225 "Skipped", # bit 4
226 "CompBigMEtSEtRatio", # bit 5
227 "BadCompEnergy", # bit 6
228 "BadEnergyRatio", # bit 7
229 "spare", # bit 8
230 "BadCellQuality", # bit 9
231 "BadCellEnergy", # bit 10
232 "BadCellTime", # bit 11
233 "NoMuonTrack", # bit 12
234 "spare", # bit 13
235 "Processed", # bit 14
236 "CompError", # bit 15
237 "EMB_A_Missing", # bit 16
238 "EMB_C_Missing", # bit 17
239 "EME_A_Missing", # bit 18
240 "EME_C_Missing", # bit 19
241 "HEC_A_Missing", # bit 20
242 "HEC_C_Missing", # bit 21
243 "FCAL_A_Missing", # bit 22
244 "FCAL_C_Missing", # bit 23
245 "TileB_A_Missing", # bit 24
246 "TileB_C_Missing", # bit 25
247 "TileE_A_Missing", # bit 26
248 "TileE_C_Missing", # bit 27
249 "BadEMfraction", # bit 28
250 "GlobBigMEtSEtRatio", # bit 29
251 "ObjInCrack", # bit 30
252 "GlobError" # bit 31
253 ]
254
255 TrigMETMonAlg.compNames = comp_names
256 TrigMETMonAlg.bitNames = bit_names
257
258 electronPtCut = 30.0
259 muonPtCut = 30.0
260 electronEtaCut = 2.5
261 muonEtaCut = 2.5
262 LArNoiseBurstVetoAlgs = [
263 "pfopufit",
264 "cell",
265 ]
266 signalLepAlgs = ["pfopufit",
267 "cell",
268 "tcpufit"]
269
270 TrigMETMonAlg.electronPtCut = electronPtCut
271 TrigMETMonAlg.electronEtaCut = electronEtaCut
272 TrigMETMonAlg.muonPtCut = muonPtCut
273 TrigMETMonAlg.muonEtaCut = muonEtaCut
274 TrigMETMonAlg.signalLepAlgs = signalLepAlgs
275 TrigMETMonAlg.LArNoiseBurstVetoAlgs = LArNoiseBurstVetoAlgs
276
277
280
281 # # Add a tool that doesn't have its own configuration function. In
282 # # this example, no accumulator is returned, so no merge is necessary.
283 # from MyDomainPackage.MyDomainPackageConf import MyDomainTool
284 # expertTrigMETMonAlg.MyDomainTool = MyDomainTool()
285
286 # Add a generic monitoring tool (a "group" in old language). The returned
287 # object here is the standard GenericMonitoringTool.
288 metGroup = helper.addGroup(TrigMETMonAlg,'TrigMETMonitor','HLT/METMon/')
289
290 # Add a GMT for the other example monitor algorithm
291 metChain1Group = helper.addGroup(TrigMETMonChain1Alg,'TrigMETMonitor','HLT/METMon/{}'.format(TrigMETMonChain1))
292 metChain2Group = helper.addGroup(TrigMETMonChain2Alg,'TrigMETMonitor','HLT/METMon/{}'.format(TrigMETMonChain2))
293 metChain3Group = helper.addGroup(TrigMETMonChain3Alg,'TrigMETMonitor','HLT/METMon/{}'.format(TrigMETMonChain3))
294
295
300 et_bins=205 #Et
301 et_min=-13.5
302 et_max=401.5
303 et_bins_log=20 #Et_log
304 et_min_log=-1.875
305 et_max_log=4.125
306 ec_bins=199 #Ex, Ey, Ez
307 ec_min=-298.5
308 ec_max=298.5
309 ec_bins_log=27 #Ex_log, Ey_log, Ez_log
310 ec_min_log=-4.125
311 ec_max_log=4.125
312 sumet_bins=305 #sumEt
313 sumet_min=-27.0
314 sumet_max=4203.0
315 sumet_bins_log=20 #sumEt_log
316 sumet_min_log=-1.875
317 sumet_max_log=4.125
318
326 phi_bins=64 # phi, used to be 100
327 phi_bins_2d=32 # phi, used to be 24
328 phi_min=-3.1416
329 phi_max=3.1416
330 eta_bins_2d=24# eta
331 eta_min=-4.8
332 eta_max=4.8
333 eff_bins=42 # efficiency
334 eff_min=-13.5
335 eff_max=401.5
336 # Histograms
337
338 metGroup.defineHistogram('offline_Ex',title='Offline Missing E_{x};E_{x} [GeV];Events',
339 path='Expert/Offline',xbins=ec_bins,xmin=ec_min,xmax=ec_max)
340 metGroup.defineHistogram('offline_Ey',title='Offline Missing E_{y};E_{y} [GeV];Events',
341 path='Expert/Offline',xbins=ec_bins,xmin=ec_min,xmax=ec_max)
342 metGroup.defineHistogram('offline_Et',title='Offline Missing E_{T};E_{T} [GeV];Events',
343 path='Expert/Offline',xbins=et_bins,xmin=et_min,xmax=et_max)
344 metGroup.defineHistogram('offline_sumEt',title='Offline sumE_{T};sumE_{T} [GeV];Events',
345 path='Expert/Offline',xbins=sumet_bins,xmin=sumet_min,xmax=sumet_max)
346 metGroup.defineHistogram('offline_NoMu_Ex',title='Offline (No Mu) Missing E_{x};E_{x} [GeV];Events',
347 path='Expert/Offline',xbins=ec_bins,xmin=ec_min,xmax=ec_max)
348 metGroup.defineHistogram('offline_NoMu_Ey',title='Offline (No Mu) Missing E_{y};E_{y} [GeV];Events',
349 path='Expert/Offline',xbins=ec_bins,xmin=ec_min,xmax=ec_max)
350 metGroup.defineHistogram('offline_NoMu_Et',title='Offline (No Mu) Missing E_{T};E_{T} [GeV];Events',
351 path='Expert/Offline',xbins=et_bins,xmin=et_min,xmax=et_max)
352 metGroup.defineHistogram('offline_NoMu_sumEt',title='Offline (No Mu) sumE_{T};sumE_{T} [GeV];Events',
353 path='Expert/Offline',xbins=sumet_bins,xmin=sumet_min,xmax=sumet_max)
354
355 metGroup.defineHistogram('hlt_el_mult',title='HLT Electron Multiplicity;Number of electrons;Events',
356 path='Expert/ElMu',xbins=10,xmin=0,xmax=10)
357 metGroup.defineHistogram('hlt_el_pt',title='HLT Electron p_{T};p_{T} [GeV];Events',
358 path='Expert/ElMu',xbins=100,xmin=0,xmax=100)
359 metGroup.defineHistogram('hlt_mu_mult',title='HLT Muon Multiplicity;Number of muons;Events',
360 path='Expert/ElMu',xbins=10,xmin=0,xmax=10)
361 metGroup.defineHistogram('hlt_mu_pt',title='HLT Muon p_{T};p_{T} [GeV];Events',
362 path='Expert/ElMu',xbins=100,xmin=0,xmax=100)
363
364 metGroup.defineHistogram('hlt_topoclusters_mult',title='HLT Topoclusters Multiplicity;Number of Clusters;Events',
365 path='Expert/Topoclusters',xbins=120,xmin=0,xmax=1200)
366 metGroup.defineHistogram('hlt_topoclusters_pt',title='HLT Topoclusters p_{T};p_{T} [GeV];Events',
367 path='Expert/Topoclusters',xbins=50,xmin=0,xmax=20)
368
369 metGroup.defineHistogram('hlt_tracks_mult',title='HLT Tracks Multiplicity;Number of Tracks;Events',
370 path='Expert/Tracks',xbins=120,xmin=0,xmax=1200)
371 metGroup.defineHistogram('hlt_tracks_pt',title='HLT Tracks p_{T};p_{T} [GeV];Events',
372 path='Expert/Tracks',xbins=50,xmin=0,xmax=20)
373 metGroup.defineHistogram('hlt_tracks_leading_pt',title='HLT Tracks Leading p_{T};p_{T} [GeV];Events',
374 path='Expert/Tracks',xbins=50,xmin=0,xmax=20)
375 metGroup.defineHistogram('hlt_tracks_vec_sumPt',title='HLT Tracks Vector Sum p_{T};p_{T} [GeV];Events',
376 path='Expert/Tracks',xbins=100,xmin=0,xmax=100)
377 metGroup.defineHistogram('hlt_tracks_sca_sumPt',title='HLT Tracks Scalar Sum p_{T};p_{T} [GeV];Events',
378 path='Expert/Tracks',xbins=100,xmin=0,xmax=1000)
379 metGroup.defineHistogram('hlt_tracks_eta,hlt_tracks_phi;hlt_tracks_eta_phi',
380 type='TH2F',
381 title='HLT Tracks #eta - #phi (p_{T} > 3 GeV);#eta;#phi',
382 path='Expert/Tracks',
383 xbins=eta_bins_2d,xmin=eta_min,xmax=eta_max,ybins=phi_bins_2d,ymin=phi_min,ymax=phi_max)
384
385 metGroup.defineHistogram('hlt_vertex_mult',title='HLT Vertex Multiplicity;Number of Vertexs;Events',
386 path='Expert/Vertex',xbins=55,xmin=-5,xmax=50)
387 metGroup.defineHistogram('hlt_vertex_z',title='HLT Vertex Z;Vertex Z [mm];Events',
388 path='Expert/Vertex',xbins=100,xmin=-200,xmax=200)
389 metGroup.defineHistogram('hlt_vertex_z_diff',title='(HLT-Offline) Vertex Z Diff;Vertex Z [mm];Events',
390 path='Expert/Vertex',xbins=100,xmin=-200,xmax=200)
391 metGroup.defineHistogram('hlt_vertex_mult_mu,act_IPBC;hlt_vertex_mult_mu',
392 type='TProfile',
393 title='Average Vertex Mult. per IPBC;Actual IPBC;Average Vertex Mult.',
394 path='Expert/Vertex',
395 xbins=55, xmin=-5, xmax=55)
396
397
398 for alg in algsL1:
399 metGroup.defineHistogram('L1_{}_Ex'.format(alg),
400 title='L1_{} Missing E_{{x}};E_{{x}} [GeV];Events'.format(alg),
401 path='Shifter/L1_{}'.format(alg),
402 xbins=ec_bins,xmin=ec_min,xmax=ec_max)
403 metGroup.defineHistogram('L1_{}_Ex_log'.format(alg),
404 title='L1_{} Missing E_{{x}} log;sgn(E_{{x}}) log(E_{{x}}/GeV);Events'.format(alg),
405 path='Shifter/L1_{}'.format(alg),
406 xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
407 metGroup.defineHistogram('L1_{}_Ey'.format(alg),
408 title='L1_{} Missing E_{{y}};E_{{y}} [GeV];Events'.format(alg),
409 path='Shifter/L1_{}'.format(alg),
410 xbins=ec_bins,xmin=ec_min,xmax=ec_max)
411 metGroup.defineHistogram('L1_{}_Ey_log'.format(alg),
412 title='L1_{} Missing E_{{y}} log;sgn(E_{{y}}) log(E_{{y}}/GeV);Events'.format(alg),
413 path='Shifter/L1_{}'.format(alg),
414 xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
415 metGroup.defineHistogram('L1_{}_Et'.format(alg),
416 title='L1_{} Missing E_{{T}};E_{{T}} [GeV];Events'.format(alg),
417 path='Shifter/L1_{}'.format(alg),
418 xbins=et_bins,xmin=et_min,xmax=et_max)
419 metGroup.defineHistogram('L1_{}_Et_log'.format(alg),
420 title='L1_{} Missing E_{{T}} log;log(E_{{T}}/GeV);Events'.format(alg),
421 path='Shifter/L1_{}'.format(alg),
422 xbins=et_bins_log,xmin=et_min_log,xmax=et_max_log)
423 metGroup.defineHistogram('L1_{}_sumEt'.format(alg),
424 title='L1_{} sumE_{{T}};sumE_{{T}} [GeV];Events'.format(alg),
425 path='Shifter/L1_{}'.format(alg),
426 xbins=sumet_bins,xmin=sumet_min,xmax=sumet_max)
427 metGroup.defineHistogram('L1_{}_sumEt_log'.format(alg),
428 title='L1_{} sumE_{{T}} log;log(sumE_{{T}}/GeV);Events'.format(alg),
429 path='Shifter/L1_{}'.format(alg),
430 xbins=sumet_bins_log,xmin=sumet_min_log,xmax=sumet_max_log)
431 metGroup.defineHistogram('L1_{}_phi'.format(alg),
432 title='L1_{} #phi;#phi;Events'.format(alg),
433 path='Shifter/L1_{}'.format(alg),
434 xbins=phi_bins,xmin=phi_min,xmax=phi_max)
435
436 for alg in algsL1Fex:
437 metGroup.defineHistogram('L1_{}_Ex'.format(alg),
438 title='L1_{} Missing E_{{x}};E_{{x}} [GeV];Events'.format(alg),
439 path='Shifter/L1_{}'.format(alg),
440 xbins=ec_bins,xmin=ec_min,xmax=ec_max)
441 metGroup.defineHistogram('L1_{}_HT_Ex'.format(alg),
442 title='L1_{} HT Missing E_{{x}};E_{{x}} [GeV];Events'.format(alg),
443 path='Shifter/L1_{}'.format(alg),
444 xbins=ec_bins,xmin=ec_min,xmax=ec_max)
445 metGroup.defineHistogram('L1_{}_ST_Ex'.format(alg),
446 title='L1_{} ST Missing E_{{x}};E_{{x}} [GeV];Events'.format(alg),
447 path='Shifter/L1_{}'.format(alg),
448 xbins=ec_bins,xmin=ec_min,xmax=ec_max)
449 metGroup.defineHistogram('L1_{}_Ex_log'.format(alg),
450 title='L1_{} Missing E_{{x}} log;sgn(E_{{x}}) log(E_{{x}}/GeV);Events'.format(alg),
451 path='Shifter/L1_{}'.format(alg),
452 xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
453 metGroup.defineHistogram('L1_{}_HT_Ex_log'.format(alg),
454 title='L1_{} HT Missing E_{{x}} log;sgn(E_{{x}}) log(E_{{x}}/GeV);Events'.format(alg),
455 path='Shifter/L1_{}'.format(alg),
456 xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
457 metGroup.defineHistogram('L1_{}_ST_Ex_log'.format(alg),
458 title='L1_{} ST Missing E_{{x}} log;sgn(E_{{x}}) log(E_{{x}}/GeV);Events'.format(alg),
459 path='Shifter/L1_{}'.format(alg),
460 xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
461 metGroup.defineHistogram('L1_{}_Ey'.format(alg),
462 title='L1_{} Missing E_{{y}};E_{{y}} [GeV];Events'.format(alg),
463 path='Shifter/L1_{}'.format(alg),
464 xbins=ec_bins,xmin=ec_min,xmax=ec_max)
465 metGroup.defineHistogram('L1_{}_HT_Ey'.format(alg),
466 title='L1_{} HT Missing E_{{y}};E_{{y}} [GeV];Events'.format(alg),
467 path='Shifter/L1_{}'.format(alg),
468 xbins=ec_bins,xmin=ec_min,xmax=ec_max)
469 metGroup.defineHistogram('L1_{}_ST_Ey'.format(alg),
470 title='L1_{} ST Missing E_{{y}};E_{{y}} [GeV];Events'.format(alg),
471 path='Shifter/L1_{}'.format(alg),
472 xbins=ec_bins,xmin=ec_min,xmax=ec_max)
473 metGroup.defineHistogram('L1_{}_Ey_log'.format(alg),
474 title='L1_{} Missing E_{{y}} log;sgn(E_{{y}}) log(E_{{y}}/GeV);Events'.format(alg),
475 path='Shifter/L1_{}'.format(alg),
476 xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
477 metGroup.defineHistogram('L1_{}_HT_Ey_log'.format(alg),
478 title='L1_{} HT Missing E_{{y}} log;sgn(E_{{y}}) log(E_{{y}}/GeV);Events'.format(alg),
479 path='Shifter/L1_{}'.format(alg),
480 xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
481 metGroup.defineHistogram('L1_{}_ST_Ey_log'.format(alg),
482 title='L1_{} ST Missing E_{{y}} log;sgn(E_{{y}}) log(E_{{y}}/GeV);Events'.format(alg),
483 path='Shifter/L1_{}'.format(alg),
484 xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
485 metGroup.defineHistogram('L1_{}_Et'.format(alg),
486 title='L1_{} Missing E_{{T}};E_{{T}} [GeV];Events'.format(alg),
487 path='Shifter/L1_{}'.format(alg),
488 xbins=et_bins,xmin=et_min,xmax=et_max)
489 metGroup.defineHistogram('L1_{}_Et_log'.format(alg),
490 title='L1_{} Missing E_{{T}} log;log(E_{{T}}/GeV);Events'.format(alg),
491 path='Shifter/L1_{}'.format(alg),
492 xbins=et_bins_log,xmin=et_min_log,xmax=et_max_log)
493 metGroup.defineHistogram('L1_{}_sumEt'.format(alg),
494 title='L1_{} sumE_{{T}};sumE_{{T}} [GeV];Events'.format(alg),
495 path='Shifter/L1_{}'.format(alg),
496 xbins=sumet_bins,xmin=sumet_min,xmax=sumet_max)
497 metGroup.defineHistogram('L1_{}_sumEt_log'.format(alg),
498 title='L1_{} sumE_{{T}} log;log(sumE_{{T}}/GeV);Events'.format(alg),
499 path='Shifter/L1_{}'.format(alg),
500 xbins=sumet_bins_log,xmin=sumet_min_log,xmax=sumet_max_log)
501 metGroup.defineHistogram('L1_{}_phi'.format(alg),
502 title='L1_{} #phi;#phi;Events'.format(alg),
503 path='Shifter/L1_{}'.format(alg),
504 xbins=phi_bins,xmin=phi_min,xmax=phi_max)
505 metGroup.defineHistogram('L1_{}_ST_phi'.format(alg),
506 title='L1_{} ST #phi;#phi;Events'.format(alg),
507 path='Shifter/L1_{}'.format(alg),
508 xbins=phi_bins,xmin=phi_min,xmax=phi_max)
509 metGroup.defineHistogram('L1_{}_HT_phi'.format(alg),
510 title='L1_{} HT #phi;#phi;Events'.format(alg),
511 path='Shifter/L1_{}'.format(alg),
512 xbins=phi_bins,xmin=phi_min,xmax=phi_max)
513
514 for alg in algsHLT:
515 metGroup.defineHistogram('{}_Ex'.format(alg),
516 title='{} Missing E_{{x}};E_{{x}} [GeV];Events'.format(alg),
517 path='Shifter/HLT_{}'.format(alg),
518 xbins=ec_bins,xmin=ec_min,xmax=ec_max)
519 metGroup.defineHistogram('{}_Ex_log'.format(alg),
520 title='{} Missing E_{{x}} log;sgn(E_{{x}}) log(E_{{x}}/GeV);Events'.format(alg),
521 path='Shifter/HLT_{}'.format(alg),
522 xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
523 metGroup.defineHistogram('{}_Ey'.format(alg),
524 title='{} Missing E_{{y}};E_{{y}} [GeV];Events'.format(alg),
525 path='Shifter/HLT_{}'.format(alg),
526 xbins=ec_bins,xmin=ec_min,xmax=ec_max)
527 metGroup.defineHistogram('{}_Ey_log'.format(alg),
528 title='{} Missing E_{{y}} log;sgn(E_{{y}}) log(E_{{y}}/GeV);Events'.format(alg),
529 path='Shifter/HLT_{}'.format(alg),
530 xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
531 metGroup.defineHistogram('{}_Et'.format(alg),
532 title='{} Missing E_{{T}};E_{{T}} [GeV];Events'.format(alg),
533 path='Shifter/HLT_{}'.format(alg),
534 xbins=et_bins,xmin=et_min,xmax=et_max)
535 metGroup.defineHistogram('{}_Et_log'.format(alg),
536 title='{} Missing E_{{T}} log;log(E_{{T}}/GeV);Events'.format(alg),
537 path='Shifter/HLT_{}'.format(alg),
538 xbins=et_bins_log,xmin=et_min_log,xmax=et_max_log)
539 metGroup.defineHistogram('{}_sumEt'.format(alg),
540 title='{} sumE_{{T}};sumE_{{T}} [GeV];Events'.format(alg),
541 path='Shifter/HLT_{}'.format(alg),
542 xbins=sumet_bins,xmin=sumet_min,xmax=sumet_max)
543 metGroup.defineHistogram('{}_sumEt_log'.format(alg),
544 title='{} sumE_{{T}} log;log(sumE_{{T}}/GeV);Events'.format(alg),
545 path='Shifter/HLT_{}'.format(alg),
546 xbins=sumet_bins_log,xmin=sumet_min_log,xmax=sumet_max_log)
547 metGroup.defineHistogram('{}_phi'.format(alg),
548 title='{} #phi;#phi;Events'.format(alg),
549 path='Shifter/HLT_{}'.format(alg),
550 xbins=phi_bins,xmin=phi_min,xmax=phi_max)
551 metGroup.defineHistogram('{0}_phi;{0}_phi_etweight'.format(alg),
552 title='{} #phi (etweighted);#phi;Et weighted events'.format(alg),
553 weight='{}_Et'.format(alg),
554 path='Shifter/HLT_{}'.format(alg),
555 xbins=phi_bins,xmin=phi_min,xmax=phi_max)
556
557 for alg in algsHLTPreSel:
558 metGroup.defineHistogram('{}_presel_Et'.format(alg),
559 title='{} Missing E_{{T}};E_{{T}} [GeV];Events'.format(alg),
560 path='Shifter/preSel',
561 xbins=et_bins,xmin=et_min,xmax=et_max)
562
563 for alg in LArNoiseBurstVetoAlgs:
564 metGroup.defineHistogram('{}_LArNoiseBurstVeto_Ex'.format(alg),
565 title='{} Missing E_{{x}};E_{{x}} [GeV];Events'.format(alg),
566 path='Shifter/LArNoiseBurstVetoed/{}'.format(alg),
567 xbins=ec_bins,xmin=ec_min,xmax=ec_max)
568 metGroup.defineHistogram('{}_LArNoiseBurstVeto_Ex_log'.format(alg),
569 title='{} Missing E_{{x}} log;sgn(E_{{x}}) log(E_{{x}}/GeV);Events'.format(alg),
570 path='Shifter/LArNoiseBurstVetoed/{}'.format(alg),
571 xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
572 metGroup.defineHistogram('{}_LArNoiseBurstVeto_Ey'.format(alg),
573 title='{} Missing E_{{y}};E_{{y}} [GeV];Events'.format(alg),
574 path='Shifter/LArNoiseBurstVetoed/{}'.format(alg),
575 xbins=ec_bins,xmin=ec_min,xmax=ec_max)
576 metGroup.defineHistogram('{}_LArNoiseBurstVeto_Ey_log'.format(alg),
577 title='{} Missing E_{{y}} log;sgn(E_{{y}}) log(E_{{y}}/GeV);Events'.format(alg),
578 path='Shifter/LArNoiseBurstVetoed/{}'.format(alg),
579 xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
580 metGroup.defineHistogram('{}_LArNoiseBurstVeto_Et'.format(alg),
581 title='{} Missing E_{{T}};E_{{T}} [GeV];Events'.format(alg),
582 path='Shifter/LArNoiseBurstVetoed/{}'.format(alg),
583 xbins=et_bins,xmin=et_min,xmax=et_max)
584 metGroup.defineHistogram('{}_LArNoiseBurstVeto_Et_log'.format(alg),
585 title='{} Missing E_{{T}} log;log(E_{{T}}/GeV);Events'.format(alg),
586 path='Shifter/LArNoiseBurstVetoed/{}'.format(alg),
587 xbins=et_bins_log,xmin=et_min_log,xmax=et_max_log)
588 metGroup.defineHistogram('{}_LArNoiseBurstVeto_sumEt'.format(alg),
589 title='{} sumE_{{T}};sumE_{{T}} [GeV];Events'.format(alg),
590 path='Shifter/LArNoiseBurstVetoed/{}'.format(alg),
591 xbins=sumet_bins,xmin=sumet_min,xmax=sumet_max)
592 metGroup.defineHistogram('{}_LArNoiseBurstVeto_sumEt_log'.format(alg),
593 title='{} sumE_{{T}} log;log(sumE_{{T}}/GeV);Events'.format(alg),
594 path='Shifter/LArNoiseBurstVetoed/{}'.format(alg),
595 xbins=sumet_bins_log,xmin=sumet_min_log,xmax=sumet_max_log)
596 metGroup.defineHistogram('{}_LArNoiseBurstVeto_phi'.format(alg),
597 title='{} #phi;#phi;Events'.format(alg),
598 path='Shifter/LArNoiseBurstVetoed/{}'.format(alg),
599 xbins=phi_bins,xmin=phi_min,xmax=phi_max)
600 metGroup.defineHistogram('{0}_LArNoiseBurstVeto_phi;{0}_phi_etweight'.format(alg),
601 title='{} #phi (etweighted);#phi;Et weighted events'.format(alg),
602 weight='{}_Et'.format(alg),
603 path='Shifter/LArNoiseBurstVetoed/{}'.format(alg),
604 xbins=phi_bins,xmin=phi_min,xmax=phi_max)
605 metGroup.defineHistogram('{0}_LArNoiseBurstVeto_eta,{0}_LArNoiseBurstVeto_phi;{0}_LArNoiseBurstVeto_eta_phi'.format(alg),
606 type='TH2F',
607 title='{} #eta - #phi;#eta;#phi'.format(alg),
608 path='Shifter/LArNoiseBurstVetoed/{}'.format(alg),
609 xbins=eta_bins_2d,xmin=eta_min,xmax=eta_max,ybins=phi_bins_2d,ymin=phi_min,ymax=phi_max)
610 metGroup.defineHistogram('{0}_LArNoiseBurstVeto_eta,{0}_LArNoiseBurstVeto_phi;{0}_LArNoiseBurstVeto_eta_phi_etweight'.format(alg),
611 type='TH2F',
612 title='{} #eta - #phi (etweighted);#eta;#phi'.format(alg),
613 weight='{}_LArNoiseBurstVeto_Et'.format(alg),
614 path='Shifter/LArNoiseBurstVetoed/{}'.format(alg),
615 xbins=eta_bins_2d,xmin=eta_min,xmax=eta_max,ybins=phi_bins_2d,ymin=phi_min,ymax=phi_max)
616 metGroup.defineHistogram('{0}_LArNoiseBurstVeto_phi;{0}_LArNoiseBurstVeto_phi_etweight'.format(alg),
617 title='{} #phi (etweighted);#phi;Events'.format(alg),
618 path='Shifter/LArNoiseBurstVetoed/{}'.format(alg),
619 weight='{}_LArNoiseBurstVeto_Et'.format(alg),
620 xbins=phi_bins,xmin=phi_min,xmax=phi_max)
621 # for alg in signalLepAlgs:
622 for alg in signalLepAlgs:
623 metGroup.defineHistogram('{}_SigEl_Ex'.format(alg),
624 title='{} Missing E_{{x}};E_{{x}} [GeV];Events'.format(alg),
625 path='Shifter/SignalEl/{}'.format(alg),
626 xbins=ec_bins,xmin=ec_min,xmax=ec_max)
627 metGroup.defineHistogram('{}_SigEl_Ex_log'.format(alg),
628 title='{} Missing E_{{x}} log;sgn(E_{{x}}) log(E_{{x}}/GeV);Events'.format(alg),
629 path='Shifter/SignalEl/{}'.format(alg),
630 xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
631 metGroup.defineHistogram('{}_SigEl_Ey'.format(alg),
632 title='{} Missing E_{{y}};E_{{y}} [GeV];Events'.format(alg),
633 path='Shifter/SignalEl/{}'.format(alg),
634 xbins=ec_bins,xmin=ec_min,xmax=ec_max)
635 metGroup.defineHistogram('{}_SigEl_Ey_log'.format(alg),
636 title='{} Missing E_{{y}} log;sgn(E_{{y}}) log(E_{{y}}/GeV);Events'.format(alg),
637 path='Shifter/SignalEl/{}'.format(alg),
638 xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
639 metGroup.defineHistogram('{}_SigEl_Et'.format(alg),
640 title='{} Missing E_{{T}};E_{{T}} [GeV];Events'.format(alg),
641 path='Shifter/SignalEl/{}'.format(alg),
642 xbins=et_bins,xmin=et_min,xmax=et_max)
643 metGroup.defineHistogram('{}_SigEl_Et_log'.format(alg),
644 title='{} Missing E_{{T}} log;log(E_{{T}}/GeV);Events'.format(alg),
645 path='Shifter/SignalEl/{}'.format(alg),
646 xbins=et_bins_log,xmin=et_min_log,xmax=et_max_log)
647 metGroup.defineHistogram('{}_SigEl_sumEt'.format(alg),
648 title='{} sumE_{{T}};sumE_{{T}} [GeV];Events'.format(alg),
649 path='Shifter/SignalEl/{}'.format(alg),
650 xbins=sumet_bins,xmin=sumet_min,xmax=sumet_max)
651 metGroup.defineHistogram('{}_SigEl_sumEt_log'.format(alg),
652 title='{} sumE_{{T}} log;log(sumE_{{T}}/GeV);Events'.format(alg),
653 path='Shifter/SignalEl/{}'.format(alg),
654 xbins=sumet_bins_log,xmin=sumet_min_log,xmax=sumet_max_log)
655 metGroup.defineHistogram('{}_SigEl_phi'.format(alg),
656 title='{} #phi;#phi;Events'.format(alg),
657 path='Shifter/SignalEl/{}'.format(alg),
658 xbins=phi_bins,xmin=phi_min,xmax=phi_max)
659 metGroup.defineHistogram('{0}_SigEl_phi;{0}_SigEl_phi_etweight'.format(alg),
660 title='{} #phi (etweighted);#phi;Et weighted events'.format(alg),
661 weight='{}_SigEl_Et'.format(alg),
662 path='Shifter/SignalEl/{}'.format(alg),
663 xbins=phi_bins,xmin=phi_min,xmax=phi_max)
664 metGroup.defineHistogram('{0}_SigEl_eta,{0}_SigEl_phi;{0}_SigEl_eta_phi'.format(alg),
665 type='TH2F',
666 title='{} #eta - #phi;#eta;#phi'.format(alg),
667 path='Shifter/SignalEl/{}'.format(alg),
668 xbins=eta_bins_2d,xmin=eta_min,xmax=eta_max,ybins=phi_bins_2d,ymin=phi_min,ymax=phi_max)
669 metGroup.defineHistogram('{0}_SigEl_eta,{0}_SigEl_phi;{0}_SigEl_eta_phi_etweight'.format(alg),
670 type='TH2F',
671 title='{} #eta - #phi (etweighted);#eta;#phi'.format(alg),
672 weight='{}_SigEl_Et'.format(alg),
673 path='Shifter/SignalEl/{}'.format(alg),
674 xbins=eta_bins_2d,xmin=eta_min,xmax=eta_max,ybins=phi_bins_2d,ymin=phi_min,ymax=phi_max)
675 metGroup.defineHistogram('{}_SigMu_Ex'.format(alg),
676 title='{} Missing E_{{x}};E_{{x}} [GeV];Events'.format(alg),
677 path='Shifter/SignalMu/{}'.format(alg),
678 xbins=ec_bins,xmin=ec_min,xmax=ec_max)
679 metGroup.defineHistogram('{}_SigMu_Ex_log'.format(alg),
680 title='{} Missing E_{{x}} log;sgn(E_{{x}}) log(E_{{x}}/GeV);Events'.format(alg),
681 path='Shifter/SignalMu/{}'.format(alg),
682 xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
683 metGroup.defineHistogram('{}_SigMu_Ey'.format(alg),
684 title='{} Missing E_{{y}};E_{{y}} [GeV];Events'.format(alg),
685 path='Shifter/SignalMu/{}'.format(alg),
686 xbins=ec_bins,xmin=ec_min,xmax=ec_max)
687 metGroup.defineHistogram('{}_SigMu_Ey_log'.format(alg),
688 title='{} Missing E_{{y}} log;sgn(E_{{y}}) log(E_{{y}}/GeV);Events'.format(alg),
689 path='Shifter/SignalMu/{}'.format(alg),
690 xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
691 metGroup.defineHistogram('{}_SigMu_Et'.format(alg),
692 title='{} Missing E_{{T}};E_{{T}} [GeV];Events'.format(alg),
693 path='Shifter/SignalMu/{}'.format(alg),
694 xbins=et_bins,xmin=et_min,xmax=et_max)
695 metGroup.defineHistogram('{}_SigMu_Et_log'.format(alg),
696 title='{} Missing E_{{T}} log;log(E_{{T}}/GeV);Events'.format(alg),
697 path='Shifter/SignalMu/{}'.format(alg),
698 xbins=et_bins_log,xmin=et_min_log,xmax=et_max_log)
699 metGroup.defineHistogram('{}_SigMu_sumEt'.format(alg),
700 title='{} sumE_{{T}};sumE_{{T}} [GeV];Events'.format(alg),
701 path='Shifter/SignalMu/{}'.format(alg),
702 xbins=sumet_bins,xmin=sumet_min,xmax=sumet_max)
703 metGroup.defineHistogram('{}_SigMu_sumEt_log'.format(alg),
704 title='{} sumE_{{T}} log;log(sumE_{{T}}/GeV);Events'.format(alg),
705 path='Shifter/SignalMu/{}'.format(alg),
706 xbins=sumet_bins_log,xmin=sumet_min_log,xmax=sumet_max_log)
707 metGroup.defineHistogram('{}_SigMu_phi'.format(alg),
708 title='{} #phi;#phi;Events'.format(alg),
709 path='Shifter/SignalMu/{}'.format(alg),
710 xbins=phi_bins,xmin=phi_min,xmax=phi_max)
711 metGroup.defineHistogram('{0}_SigMu_phi;{0}_SigMu_phi_etweight'.format(alg),
712 title='{} #phi (etweighted);#phi;Et weighted events'.format(alg),
713 weight='{}_SigMu_Et'.format(alg),
714 path='Shifter/SignalMu/{}'.format(alg),
715 xbins=phi_bins,xmin=phi_min,xmax=phi_max)
716 metGroup.defineHistogram('{0}_SigMu_eta,{0}_SigMu_phi;{0}_SigMu_eta_phi'.format(alg),
717 type='TH2F',
718 title='{} #eta - #phi;#eta;#phi'.format(alg),
719 path='Shifter/SignalMu/{}'.format(alg),
720 xbins=eta_bins_2d,xmin=eta_min,xmax=eta_max,ybins=phi_bins_2d,ymin=phi_min,ymax=phi_max)
721 metGroup.defineHistogram('{0}_SigMu_eta,{0}_SigMu_phi;{0}_SigMu_eta_phi_etweight'.format(alg),
722 type='TH2F',
723 title='{} #eta - #phi (etweighted);#eta;#phi'.format(alg),
724 weight='{}_SigMu_Et'.format(alg),
725 path='Shifter/SignalMu/{}'.format(alg),
726 xbins=eta_bins_2d,xmin=eta_min,xmax=eta_max,ybins=phi_bins_2d,ymin=phi_min,ymax=phi_max)
727
728
729 for alg in algsHLT2d:
730 metGroup.defineHistogram('{0}_eta,{0}_phi;{0}_eta_phi'.format(alg),
731 type='TH2F',
732 title='{} #eta - #phi;#eta;#phi'.format(alg),
733 path='Shifter/HLT_{}'.format(alg),
734 xbins=eta_bins_2d,xmin=eta_min,xmax=eta_max,ybins=phi_bins_2d,ymin=phi_min,ymax=phi_max)
735 metGroup.defineHistogram('{a}_eta,{a}_phi;{a}_eta_phi_etweight'.format(a=alg),
736 type='TH2F',
737 title='{} #eta - #phi (etweighted);#eta;#phi'.format(alg),
738 weight='{}_Et'.format(alg),
739 path='Shifter/HLT_{}'.format(alg),
740 xbins=eta_bins_2d,xmin=eta_min,xmax=eta_max,ybins=phi_bins_2d,ymin=phi_min,ymax=phi_max)
741
742
743 for chain in L1Chains:
744 metGroup.defineHistogram('offline_NoMu_Et_eff,pass_{};{}_eff'.format(chain,chain),
745 type='TProfile',
746 title='{} efficiency;offline E_{{T}} [GeV];Efficiency'.format(chain),
747 path='Shifter/eff',
748 xbins=eff_bins, xmin=eff_min, xmax=eff_max)
749
750 for chain in HLTChains:
751 metGroup.defineHistogram('offline_NoMu_Et_eff,pass_{};{}_eff'.format(chain,chain),
752 type='TProfile',
753 title='{} efficiency;offline E_{{T}} [GeV];Efficiency'.format(chain),
754 path='Shifter/eff',
755 xbins=eff_bins, xmin=eff_min, xmax=eff_max)
756
757 for chain in HLTChainsVal:
758 metGroup.defineHistogram('offline_NoMu_Et_eff,pass_{};{}_eff'.format(chain,chain),
759 type='TProfile',
760 title='{} efficiency;offline E_{{T}} [GeV];Efficiency'.format(chain),
761 path='Expert/eff',
762 xbins=eff_bins, xmin=eff_min, xmax=eff_max)
763 for chain in HLTChainsT0:
764 metGroup.defineHistogram('offline_NoMu_Et_eff,pass_{};{}_eff'.format(chain,chain),
765 type='TProfile',
766 title='{} efficiency;offline E_{{T}} [GeV];Efficiency'.format(chain),
767 path='Expert/eff',
768 xbins=eff_bins, xmin=eff_min, xmax=eff_max)
769
770
771 metGroup.defineHistogram('act_IPBC', type='TH1F',title='Actual IPBC;Actual IPBC;Events',
772 path='Shifter/Component',xbins=100,xmin=0,xmax=100)
773
774 metGroup.defineHistogram('HLT_MET_status',type='TH1F',title='HLT MET Status;;',
775 weight='MET_status',
776 path='Shifter/Component',
777 xbins=len(bit_names),xmin=-0.5,xmax=31.5, xlabels=bit_names)
778 metGroup.defineHistogram('HLT_MET_component,component_Et;compN_compEt',
779 type='TH2F',
780 title='HLT Missing E_{T} VS component;;Missing E_{T} [GeV]',
781 path='Shifter/Component',
782 xbins=len(comp_names),xmin=-0.5,xmax=24.5,ybins=et_bins,ymin=et_min,ymax=et_max,
783 xlabels=comp_names)
784 metGroup.defineHistogram('component,component_status;compN_HLT_MET_status',
785 type='TH2F',
786 title='HLT MET Status VS component;;',
787 weight='component_status_weight',
788 path='Shifter/Component',
789 xbins=len(comp_names),xmin=-0.5,xmax=24.5,ybins=len(comp_names),ymin=-0.5,ymax=31.5,
790 xlabels=comp_names, ylabels=bit_names)
791
792 for alg in algsHLTExpert:
793 metGroup.defineHistogram('{}_Ex'.format(alg),
794 title='{} Missing E_{{x}};E_{{x}} [GeV];Events'.format(alg),
795 path='Expert/HLT_{}'.format(alg),
796 xbins=ec_bins,xmin=ec_min,xmax=ec_max)
797 metGroup.defineHistogram('{}_Ey'.format(alg),
798 title='{} Missing E_{{y}};E_{{y}} [GeV];Events'.format(alg),
799 path='Expert/HLT_{}'.format(alg),
800 xbins=ec_bins,xmin=ec_min,xmax=ec_max)
801 metGroup.defineHistogram('{}_Et'.format(alg),
802 title='{} Missing E_{{T}};E_{{T}} [GeV];Events'.format(alg),
803 path='Expert/HLT_{}'.format(alg),
804 xbins=et_bins,xmin=et_min,xmax=et_max)
805 metGroup.defineHistogram('{}_sumEt'.format(alg),
806 title='{} sumE_{{T}};sumE_{{T}} [GeV];Events'.format(alg),
807 path='Expert/HLT_{}'.format(alg),
808 xbins=sumet_bins,xmin=sumet_min,xmax=sumet_max)
809 #2D MET tcpufit vs pfopufit, pfsum_cssk, trkmht
810 for alg in algsMET2d_tcpufit:
811 metGroup.defineHistogram('{}_2D_Et,tcpufit_2D_Et;hlt_tcpufit_Et_{}_Et'.format(alg, alg),
812 type='TH2F',
813 title='HLT tcpufit Missing E_{{T}} vs. HLT {} Missing Et;{} E_{{T}} [GeV];tcpufit E_{{T}} [GeV]'.format(alg, alg),
814 path='Expert/HLT_MET2D',
815 xbins=40,xmin=et_min,xmax=et_max,ybins=40,ymin=et_min,ymax=et_max)
816
817 for alg in algsHLTChain1:
818 metChain1Group.defineHistogram('{}_Ex'.format(alg),
819 title='{} Missing E_{{x}};E_{{x}} [GeV];Events'.format(alg),
820 path='HLT_{}'.format(alg),
821 xbins=ec_bins,xmin=ec_min,xmax=ec_max)
822 metChain1Group.defineHistogram('{}_Ex_log'.format(alg),
823 title='{} Missing E_{{x}} log;sgn(E_{{x}}) log(E_{{x}}/GeV);Events'.format(alg),
824 path='HLT_{}'.format(alg),
825 xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
826 metChain1Group.defineHistogram('{}_Ey'.format(alg),
827 title='{} Missing E_{{y}};E_{{y}} [GeV];Events'.format(alg),
828 path='HLT_{}'.format(alg),
829 xbins=ec_bins,xmin=ec_min,xmax=ec_max)
830 metChain1Group.defineHistogram('{}_Ey_log'.format(alg),
831 title='{} Missing E_{{y}} log;sgn(E_{{y}}) log(E_{{y}}/GeV);Events'.format(alg),
832 path='HLT_{}'.format(alg),
833 xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
834 metChain1Group.defineHistogram('{}_Et'.format(alg),
835 title='{} Missing E_{{T}};E_{{T}} [GeV];Events'.format(alg),
836 path='HLT_{}'.format(alg),
837 xbins=et_bins,xmin=et_min,xmax=et_max)
838 metChain1Group.defineHistogram('{}_Et_log'.format(alg),
839 title='{} Missing E_{{T}} log;log(E_{{T}}/GeV);Events'.format(alg),
840 path='HLT_{}'.format(alg),
841 xbins=et_bins_log,xmin=et_min_log,xmax=et_max_log)
842 metChain1Group.defineHistogram('{}_sumEt'.format(alg),
843 title='{} sumE_{{T}};sumE_{{T}} [GeV];Events'.format(alg),
844 path='HLT_{}'.format(alg),
845 xbins=sumet_bins,xmin=sumet_min,xmax=sumet_max)
846 metChain1Group.defineHistogram('{}_sumEt_log'.format(alg),
847 title='{} sumE_{{T}} log;log(sumE_{{T}}/GeV);Events'.format(alg),
848 path='HLT_{}'.format(alg),
849 xbins=sumet_bins_log,xmin=sumet_min_log,xmax=sumet_max_log)
850 metChain1Group.defineHistogram('{}_phi'.format(alg),
851 title='{} #phi;#phi;Events'.format(alg),
852 path='HLT_{}'.format(alg),
853 xbins=phi_bins,xmin=phi_min,xmax=phi_max)
854 metChain1Group.defineHistogram('{0}_phi;{0}_phi_etweight'.format(alg),
855 title='{} #phi (etweighted);#phi;Et weighted events'.format(alg),
856 weight='{}_Et'.format(alg),
857 path='HLT_{}'.format(alg),
858 xbins=phi_bins,xmin=phi_min,xmax=phi_max)
859
860 for alg in algsHLTChain2:
861 metChain2Group.defineHistogram('{}_Ex'.format(alg),
862 title='{} Missing E_{{x}};E_{{x}} [GeV];Events'.format(alg),
863 path='HLT_{}'.format(alg),
864 xbins=ec_bins,xmin=ec_min,xmax=ec_max)
865 metChain2Group.defineHistogram('{}_Ex_log'.format(alg),
866 title='{} Missing E_{{x}} log;sgn(E_{{x}}) log(E_{{x}}/GeV);Events'.format(alg),
867 path='HLT_{}'.format(alg),
868 xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
869 metChain2Group.defineHistogram('{}_Ey'.format(alg),
870 title='{} Missing E_{{y}};E_{{y}} [GeV];Events'.format(alg),
871 path='HLT_{}'.format(alg),
872 xbins=ec_bins,xmin=ec_min,xmax=ec_max)
873 metChain2Group.defineHistogram('{}_Ey_log'.format(alg),
874 title='{} Missing E_{{y}} log;sgn(E_{{y}}) log(E_{{y}}/GeV);Events'.format(alg),
875 path='HLT_{}'.format(alg),
876 xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
877 metChain2Group.defineHistogram('{}_Et'.format(alg),
878 title='{} Missing E_{{T}};E_{{T}} [GeV];Events'.format(alg),
879 path='HLT_{}'.format(alg),
880 xbins=et_bins,xmin=et_min,xmax=et_max)
881 metChain2Group.defineHistogram('{}_Et_log'.format(alg),
882 title='{} Missing E_{{T}} log;log(E_{{T}}/GeV);Events'.format(alg),
883 path='HLT_{}'.format(alg),
884 xbins=et_bins_log,xmin=et_min_log,xmax=et_max_log)
885 metChain2Group.defineHistogram('{}_sumEt'.format(alg),
886 title='{} sumE_{{T}};sumE_{{T}} [GeV];Events'.format(alg),
887 path='HLT_{}'.format(alg),
888 xbins=sumet_bins,xmin=sumet_min,xmax=sumet_max)
889 metChain2Group.defineHistogram('{}_sumEt_log'.format(alg),
890 title='{} sumE_{{T}} log;log(sumE_{{T}}/GeV);Events'.format(alg),
891 path='HLT_{}'.format(alg),
892 xbins=sumet_bins_log,xmin=sumet_min_log,xmax=sumet_max_log)
893 metChain2Group.defineHistogram('{}_phi'.format(alg),
894 title='{} #phi;#phi;Events'.format(alg),
895 path='HLT_{}'.format(alg),
896 xbins=phi_bins,xmin=phi_min,xmax=phi_max)
897 metChain2Group.defineHistogram('{0}_phi;{0}_phi_etweight'.format(alg),
898 title='{} #phi (etweighted);#phi;Et weighted events'.format(alg),
899 weight='{}_Et'.format(alg),
900 path='HLT_{}'.format(alg),
901 xbins=phi_bins,xmin=phi_min,xmax=phi_max)
902
903 for alg in algsHLTChain3:
904 metChain3Group.defineHistogram('{}_Ex'.format(alg),
905 title='{} Missing E_{{x}};E_{{x}} [GeV];Events'.format(alg),
906 path='HLT_{}'.format(alg),
907 xbins=ec_bins,xmin=ec_min,xmax=ec_max)
908 metChain3Group.defineHistogram('{}_Ex_log'.format(alg),
909 title='{} Missing E_{{x}} log;sgn(E_{{x}}) log(E_{{x}}/GeV);Events'.format(alg),
910 path='HLT_{}'.format(alg),
911 xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
912 metChain3Group.defineHistogram('{}_Ey'.format(alg),
913 title='{} Missing E_{{y}};E_{{y}} [GeV];Events'.format(alg),
914 path='HLT_{}'.format(alg),
915 xbins=ec_bins,xmin=ec_min,xmax=ec_max)
916 metChain3Group.defineHistogram('{}_Ey_log'.format(alg),
917 title='{} Missing E_{{y}} log;sgn(E_{{y}}) log(E_{{y}}/GeV);Events'.format(alg),
918 path='HLT_{}'.format(alg),
919 xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
920 metChain3Group.defineHistogram('{}_Et'.format(alg),
921 title='{} Missing E_{{T}};E_{{T}} [GeV];Events'.format(alg),
922 path='HLT_{}'.format(alg),
923 xbins=et_bins,xmin=et_min,xmax=et_max)
924 metChain3Group.defineHistogram('{}_Et_log'.format(alg),
925 title='{} Missing E_{{T}} log;log(E_{{T}}/GeV);Events'.format(alg),
926 path='HLT_{}'.format(alg),
927 xbins=et_bins_log,xmin=et_min_log,xmax=et_max_log)
928 metChain3Group.defineHistogram('{}_sumEt'.format(alg),
929 title='{} sumE_{{T}};sumE_{{T}} [GeV];Events'.format(alg),
930 path='HLT_{}'.format(alg),
931 xbins=sumet_bins,xmin=sumet_min,xmax=sumet_max)
932 metChain3Group.defineHistogram('{}_sumEt_log'.format(alg),
933 title='{} sumE_{{T}} log;log(sumE_{{T}}/GeV);Events'.format(alg),
934 path='HLT_{}'.format(alg),
935 xbins=sumet_bins_log,xmin=sumet_min_log,xmax=sumet_max_log)
936 metChain3Group.defineHistogram('{}_phi'.format(alg),
937 title='{} #phi;#phi;Events'.format(alg),
938 path='HLT_{}'.format(alg),
939 xbins=phi_bins,xmin=phi_min,xmax=phi_max)
940 metChain3Group.defineHistogram('{0}_phi;{0}_phi_etweight'.format(alg),
941 title='{} #phi (etweighted);#phi;Et weighted events'.format(alg),
942 weight='{}_Et'.format(alg),
943 path='HLT_{}'.format(alg),
944 xbins=phi_bins,xmin=phi_min,xmax=phi_max)
945
946
947
952 return helper.result()
953
954if __name__=='__main__':
955 # Setup logs
956 from AthenaCommon.Logging import log
957 from AthenaCommon.Constants import DEBUG
958 log.setLevel(DEBUG)
959
960 # Set the Athena configuration flags
961 from AthenaConfiguration.AllConfigFlags import initConfigFlags
962 nightly = '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs/'
963 file = 'data16_13TeV.00311321.physics_Main.recon.AOD.r9264/AOD.11038520._000001.pool.root.1'
964 flags = initConfigFlags()
965 flags.Input.Files = [nightly+file]
966 flags.Input.isMC = True
967 flags.Output.HISTFileName = 'TrigMETMonitorOutput.root'
968
969 flags.lock()
970
971 # Initialize configuration object, add accumulator, merge, and run.
972 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
973 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
974 cfg = MainServicesCfg(flags)
975 cfg.merge(PoolReadCfg(flags))
976
977 trigMETMonitorAcc = TrigMETMonConfig(flags)
978 cfg.merge(trigMETMonitorAcc)
979
980 # If you want to turn on more detailed messages ...
981 #trigMETMonitorAcc.getEventAlgo('TrigMETMonAlg').OutputLevel = 2 # DEBUG
982 cfg.printConfig(withDetails=True) # set True for exhaustive info
983
984 cfg.run() #use cfg.run(20) to only run on first 20 events