ATLAS Offline Software
TrigMETMonitorAlgorithm.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 '''@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 
13 def 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 = ["pfopufit",
263  "cell"]
264  signalLepAlgs = ["pfopufit",
265  "cell",
266  "tcpufit"]
267 
268  TrigMETMonAlg.electronPtCut = electronPtCut
269  TrigMETMonAlg.electronEtaCut = electronEtaCut
270  TrigMETMonAlg.muonPtCut = muonPtCut
271  TrigMETMonAlg.muonEtaCut = muonEtaCut
272  TrigMETMonAlg.signalLepAlgs = signalLepAlgs
273  TrigMETMonAlg.LArNoiseBurstVetoAlgs = LArNoiseBurstVetoAlgs
274 
275 
278 
279  # # Add a tool that doesn't have its own configuration function. In
280  # # this example, no accumulator is returned, so no merge is necessary.
281  # from MyDomainPackage.MyDomainPackageConf import MyDomainTool
282  # expertTrigMETMonAlg.MyDomainTool = MyDomainTool()
283 
284  # Add a generic monitoring tool (a "group" in old language). The returned
285  # object here is the standard GenericMonitoringTool.
286  metGroup = helper.addGroup(TrigMETMonAlg,'TrigMETMonitor','HLT/METMon/')
287 
288  # Add a GMT for the other example monitor algorithm
289  metChain1Group = helper.addGroup(TrigMETMonChain1Alg,'TrigMETMonitor','HLT/METMon/{}'.format(TrigMETMonChain1))
290  metChain2Group = helper.addGroup(TrigMETMonChain2Alg,'TrigMETMonitor','HLT/METMon/{}'.format(TrigMETMonChain2))
291  metChain3Group = helper.addGroup(TrigMETMonChain3Alg,'TrigMETMonitor','HLT/METMon/{}'.format(TrigMETMonChain3))
292 
293 
298  et_bins=205 #Et
299  et_min=-13.5
300  et_max=401.5
301  et_bins_log=20 #Et_log
302  et_min_log=-1.875
303  et_max_log=4.125
304  ec_bins=199 #Ex, Ey, Ez
305  ec_min=-298.5
306  ec_max=298.5
307  ec_bins_log=27 #Ex_log, Ey_log, Ez_log
308  ec_min_log=-4.125
309  ec_max_log=4.125
310  sumet_bins=305 #sumEt
311  sumet_min=-27.0
312  sumet_max=4203.0
313  sumet_bins_log=20 #sumEt_log
314  sumet_min_log=-1.875
315  sumet_max_log=4.125
316 
324  phi_bins=64 # phi, used to be 100
325  phi_bins_2d=32 # phi, used to be 24
326  phi_min=-3.1416
327  phi_max=3.1416
328  eta_bins_2d=24# eta
329  eta_min=-4.8
330  eta_max=4.8
331  eff_bins=42 # efficiency
332  eff_min=-13.5
333  eff_max=401.5
334  # Histograms
335 
336  metGroup.defineHistogram('offline_Ex',title='Offline Missing E_{x};E_{x} [GeV];Events',
337  path='Expert/Offline',xbins=ec_bins,xmin=ec_min,xmax=ec_max)
338  metGroup.defineHistogram('offline_Ey',title='Offline Missing E_{y};E_{y} [GeV];Events',
339  path='Expert/Offline',xbins=ec_bins,xmin=ec_min,xmax=ec_max)
340  metGroup.defineHistogram('offline_Et',title='Offline Missing E_{T};E_{T} [GeV];Events',
341  path='Expert/Offline',xbins=et_bins,xmin=et_min,xmax=et_max)
342  metGroup.defineHistogram('offline_sumEt',title='Offline sumE_{T};sumE_{T} [GeV];Events',
343  path='Expert/Offline',xbins=sumet_bins,xmin=sumet_min,xmax=sumet_max)
344  metGroup.defineHistogram('offline_NoMu_Ex',title='Offline (No Mu) Missing E_{x};E_{x} [GeV];Events',
345  path='Expert/Offline',xbins=ec_bins,xmin=ec_min,xmax=ec_max)
346  metGroup.defineHistogram('offline_NoMu_Ey',title='Offline (No Mu) Missing E_{y};E_{y} [GeV];Events',
347  path='Expert/Offline',xbins=ec_bins,xmin=ec_min,xmax=ec_max)
348  metGroup.defineHistogram('offline_NoMu_Et',title='Offline (No Mu) Missing E_{T};E_{T} [GeV];Events',
349  path='Expert/Offline',xbins=et_bins,xmin=et_min,xmax=et_max)
350  metGroup.defineHistogram('offline_NoMu_sumEt',title='Offline (No Mu) sumE_{T};sumE_{T} [GeV];Events',
351  path='Expert/Offline',xbins=sumet_bins,xmin=sumet_min,xmax=sumet_max)
352 
353  metGroup.defineHistogram('hlt_el_mult',title='HLT Electron Multiplicity;Number of electrons;Events',
354  path='Expert/ElMu',xbins=10,xmin=0,xmax=10)
355  metGroup.defineHistogram('hlt_el_pt',title='HLT Electron p_{T};p_{T} [GeV];Events',
356  path='Expert/ElMu',xbins=100,xmin=0,xmax=100)
357  metGroup.defineHistogram('hlt_mu_mult',title='HLT Muon Multiplicity;Number of muons;Events',
358  path='Expert/ElMu',xbins=10,xmin=0,xmax=10)
359  metGroup.defineHistogram('hlt_mu_pt',title='HLT Muon p_{T};p_{T} [GeV];Events',
360  path='Expert/ElMu',xbins=100,xmin=0,xmax=100)
361 
362  metGroup.defineHistogram('hlt_topoclusters_mult',title='HLT Topoclusters Multiplicity;Number of Clusters;Events',
363  path='Expert/Topoclusters',xbins=120,xmin=0,xmax=1200)
364  metGroup.defineHistogram('hlt_topoclusters_pt',title='HLT Topoclusters p_{T};p_{T} [GeV];Events',
365  path='Expert/Topoclusters',xbins=50,xmin=0,xmax=20)
366 
367  metGroup.defineHistogram('hlt_tracks_mult',title='HLT Tracks Multiplicity;Number of Tracks;Events',
368  path='Expert/Tracks',xbins=120,xmin=0,xmax=1200)
369  metGroup.defineHistogram('hlt_tracks_pt',title='HLT Tracks p_{T};p_{T} [GeV];Events',
370  path='Expert/Tracks',xbins=50,xmin=0,xmax=20)
371  metGroup.defineHistogram('hlt_tracks_leading_pt',title='HLT Tracks Leading p_{T};p_{T} [GeV];Events',
372  path='Expert/Tracks',xbins=50,xmin=0,xmax=20)
373  metGroup.defineHistogram('hlt_tracks_vec_sumPt',title='HLT Tracks Vector Sum p_{T};p_{T} [GeV];Events',
374  path='Expert/Tracks',xbins=100,xmin=0,xmax=100)
375  metGroup.defineHistogram('hlt_tracks_sca_sumPt',title='HLT Tracks Scalar Sum p_{T};p_{T} [GeV];Events',
376  path='Expert/Tracks',xbins=100,xmin=0,xmax=1000)
377  metGroup.defineHistogram('hlt_tracks_eta,hlt_tracks_phi;hlt_tracks_eta_phi',
378  type='TH2F',
379  title='HLT Tracks #eta - #phi (p_{T} > 3 GeV);#eta;#phi',
380  path='Expert/Tracks',
381  xbins=eta_bins_2d,xmin=eta_min,xmax=eta_max,ybins=phi_bins_2d,ymin=phi_min,ymax=phi_max)
382 
383  metGroup.defineHistogram('hlt_vertex_mult',title='HLT Vertex Multiplicity;Number of Vertexs;Events',
384  path='Expert/Vertex',xbins=55,xmin=-5,xmax=50)
385  metGroup.defineHistogram('hlt_vertex_z',title='HLT Vertex Z;Vertex Z [mm];Events',
386  path='Expert/Vertex',xbins=100,xmin=-200,xmax=200)
387  metGroup.defineHistogram('hlt_vertex_z_diff',title='(HLT-Offline) Vertex Z Diff;Vertex Z [mm];Events',
388  path='Expert/Vertex',xbins=100,xmin=-200,xmax=200)
389  metGroup.defineHistogram('hlt_vertex_mult_mu,act_IPBC;hlt_vertex_mult_mu',
390  type='TProfile',
391  title='Average Vertex Mult. per IPBC;Actual IPBC;Average Vertex Mult.',
392  path='Expert/Vertex',
393  xbins=55, xmin=-5, xmax=55)
394 
395 
396  for alg in algsL1:
397  metGroup.defineHistogram('L1_{}_Ex'.format(alg),
398  title='L1_{} Missing E_{{x}};E_{{x}} [GeV];Events'.format(alg),
399  path='Shifter/L1_{}'.format(alg),
400  xbins=ec_bins,xmin=ec_min,xmax=ec_max)
401  metGroup.defineHistogram('L1_{}_Ex_log'.format(alg),
402  title='L1_{} Missing E_{{x}} log;sgn(E_{{x}}) log(E_{{x}}/GeV);Events'.format(alg),
403  path='Shifter/L1_{}'.format(alg),
404  xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
405  metGroup.defineHistogram('L1_{}_Ey'.format(alg),
406  title='L1_{} Missing E_{{y}};E_{{y}} [GeV];Events'.format(alg),
407  path='Shifter/L1_{}'.format(alg),
408  xbins=ec_bins,xmin=ec_min,xmax=ec_max)
409  metGroup.defineHistogram('L1_{}_Ey_log'.format(alg),
410  title='L1_{} Missing E_{{y}} log;sgn(E_{{y}}) log(E_{{y}}/GeV);Events'.format(alg),
411  path='Shifter/L1_{}'.format(alg),
412  xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
413  metGroup.defineHistogram('L1_{}_Et'.format(alg),
414  title='L1_{} Missing E_{{T}};E_{{T}} [GeV];Events'.format(alg),
415  path='Shifter/L1_{}'.format(alg),
416  xbins=et_bins,xmin=et_min,xmax=et_max)
417  metGroup.defineHistogram('L1_{}_Et_log'.format(alg),
418  title='L1_{} Missing E_{{T}} log;log(E_{{T}}/GeV);Events'.format(alg),
419  path='Shifter/L1_{}'.format(alg),
420  xbins=et_bins_log,xmin=et_min_log,xmax=et_max_log)
421  metGroup.defineHistogram('L1_{}_sumEt'.format(alg),
422  title='L1_{} sumE_{{T}};sumE_{{T}} [GeV];Events'.format(alg),
423  path='Shifter/L1_{}'.format(alg),
424  xbins=sumet_bins,xmin=sumet_min,xmax=sumet_max)
425  metGroup.defineHistogram('L1_{}_sumEt_log'.format(alg),
426  title='L1_{} sumE_{{T}} log;log(sumE_{{T}}/GeV);Events'.format(alg),
427  path='Shifter/L1_{}'.format(alg),
428  xbins=sumet_bins_log,xmin=sumet_min_log,xmax=sumet_max_log)
429  metGroup.defineHistogram('L1_{}_phi'.format(alg),
430  title='L1_{} #phi;#phi;Events'.format(alg),
431  path='Shifter/L1_{}'.format(alg),
432  xbins=phi_bins,xmin=phi_min,xmax=phi_max)
433 
434  for alg in algsL1Fex:
435  metGroup.defineHistogram('L1_{}_Ex'.format(alg),
436  title='L1_{} Missing E_{{x}};E_{{x}} [GeV];Events'.format(alg),
437  path='Shifter/L1_{}'.format(alg),
438  xbins=ec_bins,xmin=ec_min,xmax=ec_max)
439  metGroup.defineHistogram('L1_{}_HT_Ex'.format(alg),
440  title='L1_{} HT Missing E_{{x}};E_{{x}} [GeV];Events'.format(alg),
441  path='Shifter/L1_{}'.format(alg),
442  xbins=ec_bins,xmin=ec_min,xmax=ec_max)
443  metGroup.defineHistogram('L1_{}_ST_Ex'.format(alg),
444  title='L1_{} ST Missing E_{{x}};E_{{x}} [GeV];Events'.format(alg),
445  path='Shifter/L1_{}'.format(alg),
446  xbins=ec_bins,xmin=ec_min,xmax=ec_max)
447  metGroup.defineHistogram('L1_{}_Ex_log'.format(alg),
448  title='L1_{} Missing E_{{x}} log;sgn(E_{{x}}) log(E_{{x}}/GeV);Events'.format(alg),
449  path='Shifter/L1_{}'.format(alg),
450  xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
451  metGroup.defineHistogram('L1_{}_HT_Ex_log'.format(alg),
452  title='L1_{} HT Missing E_{{x}} log;sgn(E_{{x}}) log(E_{{x}}/GeV);Events'.format(alg),
453  path='Shifter/L1_{}'.format(alg),
454  xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
455  metGroup.defineHistogram('L1_{}_ST_Ex_log'.format(alg),
456  title='L1_{} ST Missing E_{{x}} log;sgn(E_{{x}}) log(E_{{x}}/GeV);Events'.format(alg),
457  path='Shifter/L1_{}'.format(alg),
458  xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
459  metGroup.defineHistogram('L1_{}_Ey'.format(alg),
460  title='L1_{} Missing E_{{y}};E_{{y}} [GeV];Events'.format(alg),
461  path='Shifter/L1_{}'.format(alg),
462  xbins=ec_bins,xmin=ec_min,xmax=ec_max)
463  metGroup.defineHistogram('L1_{}_HT_Ey'.format(alg),
464  title='L1_{} HT Missing E_{{y}};E_{{y}} [GeV];Events'.format(alg),
465  path='Shifter/L1_{}'.format(alg),
466  xbins=ec_bins,xmin=ec_min,xmax=ec_max)
467  metGroup.defineHistogram('L1_{}_ST_Ey'.format(alg),
468  title='L1_{} ST Missing E_{{y}};E_{{y}} [GeV];Events'.format(alg),
469  path='Shifter/L1_{}'.format(alg),
470  xbins=ec_bins,xmin=ec_min,xmax=ec_max)
471  metGroup.defineHistogram('L1_{}_Ey_log'.format(alg),
472  title='L1_{} Missing E_{{y}} log;sgn(E_{{y}}) log(E_{{y}}/GeV);Events'.format(alg),
473  path='Shifter/L1_{}'.format(alg),
474  xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
475  metGroup.defineHistogram('L1_{}_HT_Ey_log'.format(alg),
476  title='L1_{} HT Missing E_{{y}} log;sgn(E_{{y}}) log(E_{{y}}/GeV);Events'.format(alg),
477  path='Shifter/L1_{}'.format(alg),
478  xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
479  metGroup.defineHistogram('L1_{}_ST_Ey_log'.format(alg),
480  title='L1_{} ST Missing E_{{y}} log;sgn(E_{{y}}) log(E_{{y}}/GeV);Events'.format(alg),
481  path='Shifter/L1_{}'.format(alg),
482  xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
483  metGroup.defineHistogram('L1_{}_Et'.format(alg),
484  title='L1_{} Missing E_{{T}};E_{{T}} [GeV];Events'.format(alg),
485  path='Shifter/L1_{}'.format(alg),
486  xbins=et_bins,xmin=et_min,xmax=et_max)
487  metGroup.defineHistogram('L1_{}_Et_log'.format(alg),
488  title='L1_{} Missing E_{{T}} log;log(E_{{T}}/GeV);Events'.format(alg),
489  path='Shifter/L1_{}'.format(alg),
490  xbins=et_bins_log,xmin=et_min_log,xmax=et_max_log)
491  metGroup.defineHistogram('L1_{}_sumEt'.format(alg),
492  title='L1_{} sumE_{{T}};sumE_{{T}} [GeV];Events'.format(alg),
493  path='Shifter/L1_{}'.format(alg),
494  xbins=sumet_bins,xmin=sumet_min,xmax=sumet_max)
495  metGroup.defineHistogram('L1_{}_sumEt_log'.format(alg),
496  title='L1_{} sumE_{{T}} log;log(sumE_{{T}}/GeV);Events'.format(alg),
497  path='Shifter/L1_{}'.format(alg),
498  xbins=sumet_bins_log,xmin=sumet_min_log,xmax=sumet_max_log)
499  metGroup.defineHistogram('L1_{}_phi'.format(alg),
500  title='L1_{} #phi;#phi;Events'.format(alg),
501  path='Shifter/L1_{}'.format(alg),
502  xbins=phi_bins,xmin=phi_min,xmax=phi_max)
503  metGroup.defineHistogram('L1_{}_ST_phi'.format(alg),
504  title='L1_{} ST #phi;#phi;Events'.format(alg),
505  path='Shifter/L1_{}'.format(alg),
506  xbins=phi_bins,xmin=phi_min,xmax=phi_max)
507  metGroup.defineHistogram('L1_{}_HT_phi'.format(alg),
508  title='L1_{} HT #phi;#phi;Events'.format(alg),
509  path='Shifter/L1_{}'.format(alg),
510  xbins=phi_bins,xmin=phi_min,xmax=phi_max)
511 
512  for alg in algsHLT:
513  metGroup.defineHistogram('{}_Ex'.format(alg),
514  title='{} Missing E_{{x}};E_{{x}} [GeV];Events'.format(alg),
515  path='Shifter/HLT_{}'.format(alg),
516  xbins=ec_bins,xmin=ec_min,xmax=ec_max)
517  metGroup.defineHistogram('{}_Ex_log'.format(alg),
518  title='{} Missing E_{{x}} log;sgn(E_{{x}}) log(E_{{x}}/GeV);Events'.format(alg),
519  path='Shifter/HLT_{}'.format(alg),
520  xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
521  metGroup.defineHistogram('{}_Ey'.format(alg),
522  title='{} Missing E_{{y}};E_{{y}} [GeV];Events'.format(alg),
523  path='Shifter/HLT_{}'.format(alg),
524  xbins=ec_bins,xmin=ec_min,xmax=ec_max)
525  metGroup.defineHistogram('{}_Ey_log'.format(alg),
526  title='{} Missing E_{{y}} log;sgn(E_{{y}}) log(E_{{y}}/GeV);Events'.format(alg),
527  path='Shifter/HLT_{}'.format(alg),
528  xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
529  metGroup.defineHistogram('{}_Et'.format(alg),
530  title='{} Missing E_{{T}};E_{{T}} [GeV];Events'.format(alg),
531  path='Shifter/HLT_{}'.format(alg),
532  xbins=et_bins,xmin=et_min,xmax=et_max)
533  metGroup.defineHistogram('{}_Et_log'.format(alg),
534  title='{} Missing E_{{T}} log;log(E_{{T}}/GeV);Events'.format(alg),
535  path='Shifter/HLT_{}'.format(alg),
536  xbins=et_bins_log,xmin=et_min_log,xmax=et_max_log)
537  metGroup.defineHistogram('{}_sumEt'.format(alg),
538  title='{} sumE_{{T}};sumE_{{T}} [GeV];Events'.format(alg),
539  path='Shifter/HLT_{}'.format(alg),
540  xbins=sumet_bins,xmin=sumet_min,xmax=sumet_max)
541  metGroup.defineHistogram('{}_sumEt_log'.format(alg),
542  title='{} sumE_{{T}} log;log(sumE_{{T}}/GeV);Events'.format(alg),
543  path='Shifter/HLT_{}'.format(alg),
544  xbins=sumet_bins_log,xmin=sumet_min_log,xmax=sumet_max_log)
545  metGroup.defineHistogram('{}_phi'.format(alg),
546  title='{} #phi;#phi;Events'.format(alg),
547  path='Shifter/HLT_{}'.format(alg),
548  xbins=phi_bins,xmin=phi_min,xmax=phi_max)
549  metGroup.defineHistogram('{0}_phi;{0}_phi_etweight'.format(alg),
550  title='{} #phi (etweighted);#phi;Et weighted events'.format(alg),
551  weight='{}_Et'.format(alg),
552  path='Shifter/HLT_{}'.format(alg),
553  xbins=phi_bins,xmin=phi_min,xmax=phi_max)
554 
555  for alg in algsHLTPreSel:
556  metGroup.defineHistogram('{}_presel_Et'.format(alg),
557  title='{} Missing E_{{T}};E_{{T}} [GeV];Events'.format(alg),
558  path='Shifter/preSel',
559  xbins=et_bins,xmin=et_min,xmax=et_max)
560 
561  for alg in LArNoiseBurstVetoAlgs:
562  metGroup.defineHistogram('{}_LArNoiseBurstVeto_Ex'.format(alg),
563  title='{} Missing E_{{x}};E_{{x}} [GeV];Events'.format(alg),
564  path='Shifter/LArNoiseBurstVetoed/{}'.format(alg),
565  xbins=ec_bins,xmin=ec_min,xmax=ec_max)
566  metGroup.defineHistogram('{}_LArNoiseBurstVeto_Ex_log'.format(alg),
567  title='{} Missing E_{{x}} log;sgn(E_{{x}}) log(E_{{x}}/GeV);Events'.format(alg),
568  path='Shifter/LArNoiseBurstVetoed/{}'.format(alg),
569  xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
570  metGroup.defineHistogram('{}_LArNoiseBurstVeto_Ey'.format(alg),
571  title='{} Missing E_{{y}};E_{{y}} [GeV];Events'.format(alg),
572  path='Shifter/LArNoiseBurstVetoed/{}'.format(alg),
573  xbins=ec_bins,xmin=ec_min,xmax=ec_max)
574  metGroup.defineHistogram('{}_LArNoiseBurstVeto_Ey_log'.format(alg),
575  title='{} Missing E_{{y}} log;sgn(E_{{y}}) log(E_{{y}}/GeV);Events'.format(alg),
576  path='Shifter/LArNoiseBurstVetoed/{}'.format(alg),
577  xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
578  metGroup.defineHistogram('{}_LArNoiseBurstVeto_Et'.format(alg),
579  title='{} Missing E_{{T}};E_{{T}} [GeV];Events'.format(alg),
580  path='Shifter/LArNoiseBurstVetoed/{}'.format(alg),
581  xbins=et_bins,xmin=et_min,xmax=et_max)
582  metGroup.defineHistogram('{}_LArNoiseBurstVeto_Et_log'.format(alg),
583  title='{} Missing E_{{T}} log;log(E_{{T}}/GeV);Events'.format(alg),
584  path='Shifter/LArNoiseBurstVetoed/{}'.format(alg),
585  xbins=et_bins_log,xmin=et_min_log,xmax=et_max_log)
586  metGroup.defineHistogram('{}_LArNoiseBurstVeto_sumEt'.format(alg),
587  title='{} sumE_{{T}};sumE_{{T}} [GeV];Events'.format(alg),
588  path='Shifter/LArNoiseBurstVetoed/{}'.format(alg),
589  xbins=sumet_bins,xmin=sumet_min,xmax=sumet_max)
590  metGroup.defineHistogram('{}_LArNoiseBurstVeto_sumEt_log'.format(alg),
591  title='{} sumE_{{T}} log;log(sumE_{{T}}/GeV);Events'.format(alg),
592  path='Shifter/LArNoiseBurstVetoed/{}'.format(alg),
593  xbins=sumet_bins_log,xmin=sumet_min_log,xmax=sumet_max_log)
594  metGroup.defineHistogram('{}_LArNoiseBurstVeto_phi'.format(alg),
595  title='{} #phi;#phi;Events'.format(alg),
596  path='Shifter/LArNoiseBurstVetoed/{}'.format(alg),
597  xbins=phi_bins,xmin=phi_min,xmax=phi_max)
598  metGroup.defineHistogram('{0}_LArNoiseBurstVeto_phi;{0}_phi_etweight'.format(alg),
599  title='{} #phi (etweighted);#phi;Et weighted events'.format(alg),
600  weight='{}_Et'.format(alg),
601  path='Shifter/LArNoiseBurstVetoed/{}'.format(alg),
602  xbins=phi_bins,xmin=phi_min,xmax=phi_max)
603  metGroup.defineHistogram('{0}_LArNoiseBurstVeto_eta,{0}_LArNoiseBurstVeto_phi;{0}_LArNoiseBurstVeto_eta_phi'.format(alg),
604  type='TH2F',
605  title='{} #eta - #phi;#eta;#phi'.format(alg),
606  path='Shifter/LArNoiseBurstVetoed/{}'.format(alg),
607  xbins=eta_bins_2d,xmin=eta_min,xmax=eta_max,ybins=phi_bins_2d,ymin=phi_min,ymax=phi_max)
608  metGroup.defineHistogram('{0}_LArNoiseBurstVeto_eta,{0}_LArNoiseBurstVeto_phi;{0}_LArNoiseBurstVeto_eta_phi_etweight'.format(alg),
609  type='TH2F',
610  title='{} #eta - #phi (etweighted);#eta;#phi'.format(alg),
611  weight='{}_LArNoiseBurstVeto_Et'.format(alg),
612  path='Shifter/LArNoiseBurstVetoed/{}'.format(alg),
613  xbins=eta_bins_2d,xmin=eta_min,xmax=eta_max,ybins=phi_bins_2d,ymin=phi_min,ymax=phi_max)
614  # for alg in signalLepAlgs:
615  for alg in signalLepAlgs:
616  metGroup.defineHistogram('{}_SigEl_Ex'.format(alg),
617  title='{} Missing E_{{x}};E_{{x}} [GeV];Events'.format(alg),
618  path='Shifter/SignalEl/{}'.format(alg),
619  xbins=ec_bins,xmin=ec_min,xmax=ec_max)
620  metGroup.defineHistogram('{}_SigEl_Ex_log'.format(alg),
621  title='{} Missing E_{{x}} log;sgn(E_{{x}}) log(E_{{x}}/GeV);Events'.format(alg),
622  path='Shifter/SignalEl/{}'.format(alg),
623  xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
624  metGroup.defineHistogram('{}_SigEl_Ey'.format(alg),
625  title='{} Missing E_{{y}};E_{{y}} [GeV];Events'.format(alg),
626  path='Shifter/SignalEl/{}'.format(alg),
627  xbins=ec_bins,xmin=ec_min,xmax=ec_max)
628  metGroup.defineHistogram('{}_SigEl_Ey_log'.format(alg),
629  title='{} Missing E_{{y}} log;sgn(E_{{y}}) log(E_{{y}}/GeV);Events'.format(alg),
630  path='Shifter/SignalEl/{}'.format(alg),
631  xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
632  metGroup.defineHistogram('{}_SigEl_Et'.format(alg),
633  title='{} Missing E_{{T}};E_{{T}} [GeV];Events'.format(alg),
634  path='Shifter/SignalEl/{}'.format(alg),
635  xbins=et_bins,xmin=et_min,xmax=et_max)
636  metGroup.defineHistogram('{}_SigEl_Et_log'.format(alg),
637  title='{} Missing E_{{T}} log;log(E_{{T}}/GeV);Events'.format(alg),
638  path='Shifter/SignalEl/{}'.format(alg),
639  xbins=et_bins_log,xmin=et_min_log,xmax=et_max_log)
640  metGroup.defineHistogram('{}_SigEl_sumEt'.format(alg),
641  title='{} sumE_{{T}};sumE_{{T}} [GeV];Events'.format(alg),
642  path='Shifter/SignalEl/{}'.format(alg),
643  xbins=sumet_bins,xmin=sumet_min,xmax=sumet_max)
644  metGroup.defineHistogram('{}_SigEl_sumEt_log'.format(alg),
645  title='{} sumE_{{T}} log;log(sumE_{{T}}/GeV);Events'.format(alg),
646  path='Shifter/SignalEl/{}'.format(alg),
647  xbins=sumet_bins_log,xmin=sumet_min_log,xmax=sumet_max_log)
648  metGroup.defineHistogram('{}_SigEl_phi'.format(alg),
649  title='{} #phi;#phi;Events'.format(alg),
650  path='Shifter/SignalEl/{}'.format(alg),
651  xbins=phi_bins,xmin=phi_min,xmax=phi_max)
652  metGroup.defineHistogram('{0}_SigEl_phi;{0}_SigEl_phi_etweight'.format(alg),
653  title='{} #phi (etweighted);#phi;Et weighted events'.format(alg),
654  weight='{}_SigEl_Et'.format(alg),
655  path='Shifter/SignalEl/{}'.format(alg),
656  xbins=phi_bins,xmin=phi_min,xmax=phi_max)
657  metGroup.defineHistogram('{0}_SigEl_eta,{0}_SigEl_phi;{0}_SigEl_eta_phi'.format(alg),
658  type='TH2F',
659  title='{} #eta - #phi;#eta;#phi'.format(alg),
660  path='Shifter/SignalEl/{}'.format(alg),
661  xbins=eta_bins_2d,xmin=eta_min,xmax=eta_max,ybins=phi_bins_2d,ymin=phi_min,ymax=phi_max)
662  metGroup.defineHistogram('{0}_SigEl_eta,{0}_SigEl_phi;{0}_SigEl_eta_phi_etweight'.format(alg),
663  type='TH2F',
664  title='{} #eta - #phi (etweighted);#eta;#phi'.format(alg),
665  weight='{}_SigEl_Et'.format(alg),
666  path='Shifter/SignalEl/{}'.format(alg),
667  xbins=eta_bins_2d,xmin=eta_min,xmax=eta_max,ybins=phi_bins_2d,ymin=phi_min,ymax=phi_max)
668  metGroup.defineHistogram('{}_SigMu_Ex'.format(alg),
669  title='{} Missing E_{{x}};E_{{x}} [GeV];Events'.format(alg),
670  path='Shifter/SignalMu/{}'.format(alg),
671  xbins=ec_bins,xmin=ec_min,xmax=ec_max)
672  metGroup.defineHistogram('{}_SigMu_Ex_log'.format(alg),
673  title='{} Missing E_{{x}} log;sgn(E_{{x}}) log(E_{{x}}/GeV);Events'.format(alg),
674  path='Shifter/SignalMu/{}'.format(alg),
675  xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
676  metGroup.defineHistogram('{}_SigMu_Ey'.format(alg),
677  title='{} Missing E_{{y}};E_{{y}} [GeV];Events'.format(alg),
678  path='Shifter/SignalMu/{}'.format(alg),
679  xbins=ec_bins,xmin=ec_min,xmax=ec_max)
680  metGroup.defineHistogram('{}_SigMu_Ey_log'.format(alg),
681  title='{} Missing E_{{y}} log;sgn(E_{{y}}) log(E_{{y}}/GeV);Events'.format(alg),
682  path='Shifter/SignalMu/{}'.format(alg),
683  xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
684  metGroup.defineHistogram('{}_SigMu_Et'.format(alg),
685  title='{} Missing E_{{T}};E_{{T}} [GeV];Events'.format(alg),
686  path='Shifter/SignalMu/{}'.format(alg),
687  xbins=et_bins,xmin=et_min,xmax=et_max)
688  metGroup.defineHistogram('{}_SigMu_Et_log'.format(alg),
689  title='{} Missing E_{{T}} log;log(E_{{T}}/GeV);Events'.format(alg),
690  path='Shifter/SignalMu/{}'.format(alg),
691  xbins=et_bins_log,xmin=et_min_log,xmax=et_max_log)
692  metGroup.defineHistogram('{}_SigMu_sumEt'.format(alg),
693  title='{} sumE_{{T}};sumE_{{T}} [GeV];Events'.format(alg),
694  path='Shifter/SignalMu/{}'.format(alg),
695  xbins=sumet_bins,xmin=sumet_min,xmax=sumet_max)
696  metGroup.defineHistogram('{}_SigMu_sumEt_log'.format(alg),
697  title='{} sumE_{{T}} log;log(sumE_{{T}}/GeV);Events'.format(alg),
698  path='Shifter/SignalMu/{}'.format(alg),
699  xbins=sumet_bins_log,xmin=sumet_min_log,xmax=sumet_max_log)
700  metGroup.defineHistogram('{}_SigMu_phi'.format(alg),
701  title='{} #phi;#phi;Events'.format(alg),
702  path='Shifter/SignalMu/{}'.format(alg),
703  xbins=phi_bins,xmin=phi_min,xmax=phi_max)
704  metGroup.defineHistogram('{0}_SigMu_phi;{0}_SigMu_phi_etweight'.format(alg),
705  title='{} #phi (etweighted);#phi;Et weighted events'.format(alg),
706  weight='{}_SigMu_Et'.format(alg),
707  path='Shifter/SignalMu/{}'.format(alg),
708  xbins=phi_bins,xmin=phi_min,xmax=phi_max)
709  metGroup.defineHistogram('{0}_SigMu_eta,{0}_SigMu_phi;{0}_SigMu_eta_phi'.format(alg),
710  type='TH2F',
711  title='{} #eta - #phi;#eta;#phi'.format(alg),
712  path='Shifter/SignalMu/{}'.format(alg),
713  xbins=eta_bins_2d,xmin=eta_min,xmax=eta_max,ybins=phi_bins_2d,ymin=phi_min,ymax=phi_max)
714  metGroup.defineHistogram('{0}_SigMu_eta,{0}_SigMu_phi;{0}_SigMu_eta_phi_etweight'.format(alg),
715  type='TH2F',
716  title='{} #eta - #phi (etweighted);#eta;#phi'.format(alg),
717  weight='{}_SigMu_Et'.format(alg),
718  path='Shifter/SignalMu/{}'.format(alg),
719  xbins=eta_bins_2d,xmin=eta_min,xmax=eta_max,ybins=phi_bins_2d,ymin=phi_min,ymax=phi_max)
720 
721 
722  for alg in algsHLT2d:
723  metGroup.defineHistogram('{0}_eta,{0}_phi;{0}_eta_phi'.format(alg),
724  type='TH2F',
725  title='{} #eta - #phi;#eta;#phi'.format(alg),
726  path='Shifter/HLT_{}'.format(alg),
727  xbins=eta_bins_2d,xmin=eta_min,xmax=eta_max,ybins=phi_bins_2d,ymin=phi_min,ymax=phi_max)
728  metGroup.defineHistogram('{a}_eta,{a}_phi;{a}_eta_phi_etweight'.format(a=alg),
729  type='TH2F',
730  title='{} #eta - #phi (etweighted);#eta;#phi'.format(alg),
731  weight='{}_Et'.format(alg),
732  path='Shifter/HLT_{}'.format(alg),
733  xbins=eta_bins_2d,xmin=eta_min,xmax=eta_max,ybins=phi_bins_2d,ymin=phi_min,ymax=phi_max)
734 
735 
736  for chain in L1Chains:
737  metGroup.defineHistogram('offline_NoMu_Et_eff,pass_{};{}_eff'.format(chain,chain),
738  type='TProfile',
739  title='{} efficiency;offline E_{{T}} [GeV];Efficiency'.format(chain),
740  path='Shifter/eff',
741  xbins=eff_bins, xmin=eff_min, xmax=eff_max)
742 
743  for chain in HLTChains:
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 HLTChainsVal:
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='Expert/eff',
755  xbins=eff_bins, xmin=eff_min, xmax=eff_max)
756  for chain in HLTChainsT0:
757  metGroup.defineHistogram('offline_NoMu_Et_eff,pass_{};{}_eff'.format(chain,chain),
758  type='TProfile',
759  title='{} efficiency;offline E_{{T}} [GeV];Efficiency'.format(chain),
760  path='Expert/eff',
761  xbins=eff_bins, xmin=eff_min, xmax=eff_max)
762 
763 
764  metGroup.defineHistogram('act_IPBC', type='TH1F',title='Actual IPBC;Actual IPBC;Events',
765  path='Shifter/Component',xbins=100,xmin=0,xmax=100)
766 
767  metGroup.defineHistogram('HLT_MET_status',type='TH1F',title='HLT MET Status;;',
768  weight='MET_status',
769  path='Shifter/Component',
770  xbins=len(bit_names),xmin=-0.5,xmax=31.5, xlabels=bit_names)
771  metGroup.defineHistogram('HLT_MET_component,component_Et;compN_compEt',
772  type='TH2F',
773  title='HLT Missing E_{T} VS component;;Missing E_{T} [GeV]',
774  path='Shifter/Component',
775  xbins=len(comp_names),xmin=-0.5,xmax=24.5,ybins=et_bins,ymin=et_min,ymax=et_max,
776  xlabels=comp_names)
777  metGroup.defineHistogram('component,component_status;compN_HLT_MET_status',
778  type='TH2F',
779  title='HLT MET Status VS component;;',
780  weight='component_status_weight',
781  path='Shifter/Component',
782  xbins=len(comp_names),xmin=-0.5,xmax=24.5,ybins=len(comp_names),ymin=-0.5,ymax=31.5,
783  xlabels=comp_names, ylabels=bit_names)
784 
785  for alg in algsHLTExpert:
786  metGroup.defineHistogram('{}_Ex'.format(alg),
787  title='{} Missing E_{{x}};E_{{x}} [GeV];Events'.format(alg),
788  path='Expert/HLT_{}'.format(alg),
789  xbins=ec_bins,xmin=ec_min,xmax=ec_max)
790  metGroup.defineHistogram('{}_Ey'.format(alg),
791  title='{} Missing E_{{y}};E_{{y}} [GeV];Events'.format(alg),
792  path='Expert/HLT_{}'.format(alg),
793  xbins=ec_bins,xmin=ec_min,xmax=ec_max)
794  metGroup.defineHistogram('{}_Et'.format(alg),
795  title='{} Missing E_{{T}};E_{{T}} [GeV];Events'.format(alg),
796  path='Expert/HLT_{}'.format(alg),
797  xbins=et_bins,xmin=et_min,xmax=et_max)
798  metGroup.defineHistogram('{}_sumEt'.format(alg),
799  title='{} sumE_{{T}};sumE_{{T}} [GeV];Events'.format(alg),
800  path='Expert/HLT_{}'.format(alg),
801  xbins=sumet_bins,xmin=sumet_min,xmax=sumet_max)
802  #2D MET tcpufit vs pfopufit, pfsum_cssk, trkmht
803  for alg in algsMET2d_tcpufit:
804  metGroup.defineHistogram('{}_2D_Et,tcpufit_2D_Et;hlt_tcpufit_Et_{}_Et'.format(alg, alg),
805  type='TH2F',
806  title='HLT tcpufit Missing E_{{T}} vs. HLT {} Missing Et;{} E_{{T}} [GeV];tcpufit E_{{T}} [GeV]'.format(alg, alg),
807  path='Expert/HLT_MET2D',
808  xbins=40,xmin=et_min,xmax=et_max,ybins=40,ymin=et_min,ymax=et_max)
809 
810  for alg in algsHLTChain1:
811  metChain1Group.defineHistogram('{}_Ex'.format(alg),
812  title='{} Missing E_{{x}};E_{{x}} [GeV];Events'.format(alg),
813  path='HLT_{}'.format(alg),
814  xbins=ec_bins,xmin=ec_min,xmax=ec_max)
815  metChain1Group.defineHistogram('{}_Ex_log'.format(alg),
816  title='{} Missing E_{{x}} log;sgn(E_{{x}}) log(E_{{x}}/GeV);Events'.format(alg),
817  path='HLT_{}'.format(alg),
818  xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
819  metChain1Group.defineHistogram('{}_Ey'.format(alg),
820  title='{} Missing E_{{y}};E_{{y}} [GeV];Events'.format(alg),
821  path='HLT_{}'.format(alg),
822  xbins=ec_bins,xmin=ec_min,xmax=ec_max)
823  metChain1Group.defineHistogram('{}_Ey_log'.format(alg),
824  title='{} Missing E_{{y}} log;sgn(E_{{y}}) log(E_{{y}}/GeV);Events'.format(alg),
825  path='HLT_{}'.format(alg),
826  xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
827  metChain1Group.defineHistogram('{}_Et'.format(alg),
828  title='{} Missing E_{{T}};E_{{T}} [GeV];Events'.format(alg),
829  path='HLT_{}'.format(alg),
830  xbins=et_bins,xmin=et_min,xmax=et_max)
831  metChain1Group.defineHistogram('{}_Et_log'.format(alg),
832  title='{} Missing E_{{T}} log;log(E_{{T}}/GeV);Events'.format(alg),
833  path='HLT_{}'.format(alg),
834  xbins=et_bins_log,xmin=et_min_log,xmax=et_max_log)
835  metChain1Group.defineHistogram('{}_sumEt'.format(alg),
836  title='{} sumE_{{T}};sumE_{{T}} [GeV];Events'.format(alg),
837  path='HLT_{}'.format(alg),
838  xbins=sumet_bins,xmin=sumet_min,xmax=sumet_max)
839  metChain1Group.defineHistogram('{}_sumEt_log'.format(alg),
840  title='{} sumE_{{T}} log;log(sumE_{{T}}/GeV);Events'.format(alg),
841  path='HLT_{}'.format(alg),
842  xbins=sumet_bins_log,xmin=sumet_min_log,xmax=sumet_max_log)
843  metChain1Group.defineHistogram('{}_phi'.format(alg),
844  title='{} #phi;#phi;Events'.format(alg),
845  path='HLT_{}'.format(alg),
846  xbins=phi_bins,xmin=phi_min,xmax=phi_max)
847  metChain1Group.defineHistogram('{0}_phi;{0}_phi_etweight'.format(alg),
848  title='{} #phi (etweighted);#phi;Et weighted events'.format(alg),
849  weight='{}_Et'.format(alg),
850  path='HLT_{}'.format(alg),
851  xbins=phi_bins,xmin=phi_min,xmax=phi_max)
852 
853  for alg in algsHLTChain2:
854  metChain2Group.defineHistogram('{}_Ex'.format(alg),
855  title='{} Missing E_{{x}};E_{{x}} [GeV];Events'.format(alg),
856  path='HLT_{}'.format(alg),
857  xbins=ec_bins,xmin=ec_min,xmax=ec_max)
858  metChain2Group.defineHistogram('{}_Ex_log'.format(alg),
859  title='{} Missing E_{{x}} log;sgn(E_{{x}}) log(E_{{x}}/GeV);Events'.format(alg),
860  path='HLT_{}'.format(alg),
861  xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
862  metChain2Group.defineHistogram('{}_Ey'.format(alg),
863  title='{} Missing E_{{y}};E_{{y}} [GeV];Events'.format(alg),
864  path='HLT_{}'.format(alg),
865  xbins=ec_bins,xmin=ec_min,xmax=ec_max)
866  metChain2Group.defineHistogram('{}_Ey_log'.format(alg),
867  title='{} Missing E_{{y}} log;sgn(E_{{y}}) log(E_{{y}}/GeV);Events'.format(alg),
868  path='HLT_{}'.format(alg),
869  xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
870  metChain2Group.defineHistogram('{}_Et'.format(alg),
871  title='{} Missing E_{{T}};E_{{T}} [GeV];Events'.format(alg),
872  path='HLT_{}'.format(alg),
873  xbins=et_bins,xmin=et_min,xmax=et_max)
874  metChain2Group.defineHistogram('{}_Et_log'.format(alg),
875  title='{} Missing E_{{T}} log;log(E_{{T}}/GeV);Events'.format(alg),
876  path='HLT_{}'.format(alg),
877  xbins=et_bins_log,xmin=et_min_log,xmax=et_max_log)
878  metChain2Group.defineHistogram('{}_sumEt'.format(alg),
879  title='{} sumE_{{T}};sumE_{{T}} [GeV];Events'.format(alg),
880  path='HLT_{}'.format(alg),
881  xbins=sumet_bins,xmin=sumet_min,xmax=sumet_max)
882  metChain2Group.defineHistogram('{}_sumEt_log'.format(alg),
883  title='{} sumE_{{T}} log;log(sumE_{{T}}/GeV);Events'.format(alg),
884  path='HLT_{}'.format(alg),
885  xbins=sumet_bins_log,xmin=sumet_min_log,xmax=sumet_max_log)
886  metChain2Group.defineHistogram('{}_phi'.format(alg),
887  title='{} #phi;#phi;Events'.format(alg),
888  path='HLT_{}'.format(alg),
889  xbins=phi_bins,xmin=phi_min,xmax=phi_max)
890  metChain2Group.defineHistogram('{0}_phi;{0}_phi_etweight'.format(alg),
891  title='{} #phi (etweighted);#phi;Et weighted events'.format(alg),
892  weight='{}_Et'.format(alg),
893  path='HLT_{}'.format(alg),
894  xbins=phi_bins,xmin=phi_min,xmax=phi_max)
895 
896  for alg in algsHLTChain3:
897  metChain3Group.defineHistogram('{}_Ex'.format(alg),
898  title='{} Missing E_{{x}};E_{{x}} [GeV];Events'.format(alg),
899  path='HLT_{}'.format(alg),
900  xbins=ec_bins,xmin=ec_min,xmax=ec_max)
901  metChain3Group.defineHistogram('{}_Ex_log'.format(alg),
902  title='{} Missing E_{{x}} log;sgn(E_{{x}}) log(E_{{x}}/GeV);Events'.format(alg),
903  path='HLT_{}'.format(alg),
904  xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
905  metChain3Group.defineHistogram('{}_Ey'.format(alg),
906  title='{} Missing E_{{y}};E_{{y}} [GeV];Events'.format(alg),
907  path='HLT_{}'.format(alg),
908  xbins=ec_bins,xmin=ec_min,xmax=ec_max)
909  metChain3Group.defineHistogram('{}_Ey_log'.format(alg),
910  title='{} Missing E_{{y}} log;sgn(E_{{y}}) log(E_{{y}}/GeV);Events'.format(alg),
911  path='HLT_{}'.format(alg),
912  xbins=ec_bins_log,xmin=ec_min_log,xmax=ec_max_log)
913  metChain3Group.defineHistogram('{}_Et'.format(alg),
914  title='{} Missing E_{{T}};E_{{T}} [GeV];Events'.format(alg),
915  path='HLT_{}'.format(alg),
916  xbins=et_bins,xmin=et_min,xmax=et_max)
917  metChain3Group.defineHistogram('{}_Et_log'.format(alg),
918  title='{} Missing E_{{T}} log;log(E_{{T}}/GeV);Events'.format(alg),
919  path='HLT_{}'.format(alg),
920  xbins=et_bins_log,xmin=et_min_log,xmax=et_max_log)
921  metChain3Group.defineHistogram('{}_sumEt'.format(alg),
922  title='{} sumE_{{T}};sumE_{{T}} [GeV];Events'.format(alg),
923  path='HLT_{}'.format(alg),
924  xbins=sumet_bins,xmin=sumet_min,xmax=sumet_max)
925  metChain3Group.defineHistogram('{}_sumEt_log'.format(alg),
926  title='{} sumE_{{T}} log;log(sumE_{{T}}/GeV);Events'.format(alg),
927  path='HLT_{}'.format(alg),
928  xbins=sumet_bins_log,xmin=sumet_min_log,xmax=sumet_max_log)
929  metChain3Group.defineHistogram('{}_phi'.format(alg),
930  title='{} #phi;#phi;Events'.format(alg),
931  path='HLT_{}'.format(alg),
932  xbins=phi_bins,xmin=phi_min,xmax=phi_max)
933  metChain3Group.defineHistogram('{0}_phi;{0}_phi_etweight'.format(alg),
934  title='{} #phi (etweighted);#phi;Et weighted events'.format(alg),
935  weight='{}_Et'.format(alg),
936  path='HLT_{}'.format(alg),
937  xbins=phi_bins,xmin=phi_min,xmax=phi_max)
938 
939 
940 
945  return helper.result()
946 
947 if __name__=='__main__':
948  # Setup logs
949  from AthenaCommon.Logging import log
950  from AthenaCommon.Constants import DEBUG
951  log.setLevel(DEBUG)
952 
953  # Set the Athena configuration flags
954  from AthenaConfiguration.AllConfigFlags import initConfigFlags
955  nightly = '/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/CommonInputs/'
956  file = 'data16_13TeV.00311321.physics_Main.recon.AOD.r9264/AOD.11038520._000001.pool.root.1'
957  flags = initConfigFlags()
958  flags.Input.Files = [nightly+file]
959  flags.Input.isMC = True
960  flags.Output.HISTFileName = 'TrigMETMonitorOutput.root'
961 
962  flags.lock()
963 
964  # Initialize configuration object, add accumulator, merge, and run.
965  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
966  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
967  cfg = MainServicesCfg(flags)
968  cfg.merge(PoolReadCfg(flags))
969 
970  trigMETMonitorAcc = TrigMETMonConfig(flags)
971  cfg.merge(trigMETMonitorAcc)
972 
973  # If you want to turn on more detailed messages ...
974  #trigMETMonitorAcc.getEventAlgo('TrigMETMonAlg').OutputLevel = 2 # DEBUG
975  cfg.printConfig(withDetails=True) # set True for exhaustive info
976 
977  cfg.run() #use cfg.run(20) to only run on first 20 events
vtune_athena.format
format
Definition: vtune_athena.py:14
python.TriggerConfigAccess.getHLTMonitoringAccess
HLTMonitoringAccess getHLTMonitoringAccess(flags=None)
Definition: TriggerConfigAccess.py:256
TrigMETMonitorAlgorithm.TrigMETMonConfig
def TrigMETMonConfig(inputFlags)
Definition: TrigMETMonitorAlgorithm.py:13
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
Constants
some useful constants -------------------------------------------------—
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69