ATLAS Offline Software
JfexMonitorAlgorithm.py
Go to the documentation of this file.
1 #
2 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 #
5  '''Function to configure LVL1 Jfex algorithm in the monitoring system.'''
6 
7  import math
8  # get the component factory - used for getting the algorithms
9  from AthenaConfiguration.ComponentFactory import CompFactory
10  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
11  result = ComponentAccumulator()
12 
13  from TrigT1CaloMonitoring.LVL1CaloMonitoringConfig import L1CaloMonitorCfgHelper
14  helper = L1CaloMonitorCfgHelper(flags,CompFactory.JfexMonitorAlgorithm,'JfexMonAlg')
15  JfexMonAlg = helper.alg
16 
17  # add any steering
18  groupName = 'JfexMonitor' # the monitoring group name is also used for the package name
19  mapGroupName = 'jFEXMaps'
20  mapHighPtGroupName = 'jFEXMapsHighPt'
21  JfexMonAlg.Grouphist = groupName
22 
23  # mainDir = 'L1Calo'
24  developerPath = 'Developer/Jfex/'
25  expertPath = 'Expert/Outputs/'
26 
27 
28  # define jfex histograms
29 
30  FPGA_names = ["U1","U2","U4","U3"]
31  Modules_names = ["jFEX 0","jFEX 1","jFEX 2","jFEX 3","jFEX 4","jFEX 5"]
32 
33  from ROOT import TMath
34 
35  x_phi = []
36  for i in range(67):
37  phi = (-TMath.Pi()- TMath.Pi()/32) + TMath.Pi()/32*i
38  x_phi.append(phi)
39  x_phi = sorted(x_phi)
40 
41  phi_bins = {
42  'xbins': x_phi
43  }
44 
45  # C-side irregular region
46  eta_bins = [-4.8 + 0.1*i for i in range(16)]
47  eta_bins_jets = [-4.8 + 0.1*i for i in range(16)]
48  # C-side coarse region
49  eta_bins += [-3.2,-3.1,-2.9,-2.7]
50  eta_bins_jets += [-3.2,-3.15,-3.1,-2.9,-2.7]
51  # central region
52  eta_bins += [-2.5 + 0.1*i for i in range(51)]
53  eta_bins_jets += [-2.5 + 0.1*i for i in range(51)]
54  # A-side coarse region
55  eta_bins += [2.7,2.9,3.1,3.2]
56  eta_bins_jets += [2.7,2.9,3.1,3.15,3.2]
57  # A-side irregular region
58  eta_bins += [3.3 + 0.1*i for i in range(16)]
59  eta_bins_jets += [3.3 + 0.1*i for i in range(16)]
60 
61  eta_phi_bins = {
62  'xbins': eta_bins,
63  'ybins': 64, 'ymin': -TMath.Pi(), 'ymax': TMath.Pi()
64  }
65 
66  eta_phi_bins_jets = {
67  'xbins': eta_bins_jets,
68  'ybins': 64, 'ymin': -TMath.Pi(), 'ymax': TMath.Pi()
69  }
70 
71  eta_phi_bins_central = {
72  'xbins': 50, 'xmin': -2.5, 'xmax': 2.5,
73  'ybins': 64, 'ymin': -TMath.Pi(), 'ymax': TMath.Pi()
74  }
75 
76  n_bins_total = len(eta_bins) * 64
77  n_bins_total_jets = len(eta_bins_jets) * 64
78  n_bins_eta_2p5 = len(eta_phi_bins_central) * 64
79  n_bins_eta_2p3 = 46 * 64
80  # number of bins above |eta| = 3.2 that will never be filled with TOBs
81  # due to the low granularity and irregular structure of the FCAL
82  # (given by the length of the list of empty bin in JfexMapForwardEmptyBins.h)
83  n_empty_bins_fcal = 2036
84  # number of bins in 3.15 < |eta| < 3.2 where no jets are produced
85  n_empty_bins_fcal_overlap = 96
86 
87  # all bins should be filled with jets, except the always empty ones in FCAL
88  n_expected_filled_bins_jJ = n_bins_total_jets - n_empty_bins_fcal - n_empty_bins_fcal_overlap
89  # taus are only produced for |eta| < 2.5
90  n_expected_filled_bins_jTAU = n_bins_eta_2p5
91  # forward electrons are produced for |eta| > 2.3
92  n_expected_filled_bins_jEM = n_bins_total - n_empty_bins_fcal - n_bins_eta_2p3
93 
94  helper.defineDQAlgorithm("Jfex_etaPhiMapFilled",
95  hanConfig={"libname":"libdqm_summaries.so","name":"Bins_LessThanAbs_Threshold","BinThreshold":"1"}, # counts bins with |value|<1
96  thresholdConfig={"NBins":[0,n_expected_filled_bins_jJ]}, # 0 bins expected empty, warning above that, error if entirely empty (save for known empties)
97  )
98  helper.defineDQAlgorithm("Jfex_etaPhiMapFilled_EM",
99  hanConfig={"libname":"libdqm_summaries.so","name":"Bins_LessThanAbs_Threshold","BinThreshold":"1"}, # counts bins with |value|<1
100  thresholdConfig={"NBins":[0,n_expected_filled_bins_jEM]}, # 0 bins expected empty, warning above that, error if entirely empty (save for known empties)
101  )
102  helper.defineDQAlgorithm("Jfex_etaPhiMapFilled_TAU",
103  hanConfig={"libname":"libdqm_summaries.so","name":"Bins_LessThanAbs_Threshold","BinThreshold":"1"}, # counts bins with |value|<1
104  thresholdConfig={"NBins":[0,n_expected_filled_bins_jTAU]}, # 0 bins expected empty, warning above that, error if entirely empty (save for known empties)
105  )
106 
107 
108  helper.defineHistogram('jJ_jFexNumber;h_jJ_jFexNumber', title='jFex SRJet Module;Module number;Counts',
109  fillGroup=groupName,
110  type='TH1I', path=developerPath+'jJ/', xbins=6,xmin=0,xmax=6)
111 
112  helper.defineHistogram('jJ_fpgaNumber;h_jJ_fpgaNumber', title='jFex SRJet FPGA;FPGA number;Counts',
113  fillGroup=groupName,
114  type='TH1F', path=developerPath+'jJ/',xbins=4,xmin=0,xmax=4)
115 
116  helper.defineHistogram('jJ_jFexNumber,jJ_fpgaNumber;h_jJ_DetectorMap', title="jFex SRJet module vs FPGA; jFEX module; FPGA",
117  fillGroup=groupName,
118  type='TH2I',path=developerPath+'jJ/', xbins=6,xmin=0,xmax=6,ybins=4,ymin=0,ymax=4,xlabels=Modules_names,ylabels=FPGA_names)
119 
120  helper.defineHistogram('jJ_Et;h_jJ_Et', title='jFex SRJet Transverse Energy;tobEt [200 MeV Scale];Counts',
121  fillGroup=groupName,
122  type='TH1I', path=developerPath+'jJ/', xbins=512,xmin=0,xmax=2048)
123 
124  helper.defineHistogram('jJ_Eta;h_jJ_Eta', title='jFex SRJet #eta;#eta;Counts',
125  fillGroup=groupName,
126  type='TH1F', path=developerPath+'jJ/',xbins=100,xmin=-5.0,xmax=5.0)
127 
128  helper.defineHistogram('jJ_Phi;h_jJ_Phi', title='jFex SRJet #phi;#phi;Counts',
129  fillGroup=groupName,
130  type='TH1F', path=developerPath+'jJ/',**phi_bins)
131 
132  helper.defineHistogram('jJ_Eta,jJ_Phi;h_jJ_EtaPhiMap', title="jFex SRJet #eta vs #phi;#eta;#phi",
133  fillGroup=mapGroupName,
134  type='TH2I',path=expertPath+'jJ/',
135  hanConfig={
136  "algorithm": "Jfex_etaPhiMapFilled",
137  "description": "Bins with negative number of entries (in the FCAL) signify that no TOBs can be produced at that position. In the region 3.1 < |eta| < 3.2 seeded in EMEC and FCAL1 are displayed next to each other, though in reality have similar eta coordinates. Inspect for hot/cold spots - check help for list of known hot/coldspots",
138  "display":"SetPalette(55),Draw=COL1Z"
139  },
140  weight="weight",opt=['kAlwaysCreate'],
141  **eta_phi_bins_jets)
142 
143  helper.defineHistogram('jJ_Eta,jJ_Phi;h_jJ_EtaPhiMap_HighPt', title="jFex SRJet #geq 20 GeV #eta vs #phi;#eta;#phi",
144  fillGroup=mapHighPtGroupName,
145  type='TH2I',path=expertPath+'jJ/',
146  hanConfig={
147  "algorithm": "Jfex_etaPhiMapFilled",
148  "description": "Bins with negative number of entries (in the FCAL) signify that no TOBs can be produced at that position. In the region 3.1 < |eta| < 3.2 seeded in EMEC and FCAL1 are displayed next to each other, though in reality have similar eta coordinates. Inspect for hot/cold spots - check help for list of known hot/coldspots",
149  "display":"SetPalette(55),Draw=COL1Z"
150  },
151  weight="weight",opt=['kAlwaysCreate'],
152  **eta_phi_bins_jets)
153 
154  helper.defineHistogram('jJ_GlobalEta;h_jJ_GlobalEta', title='jFex SRJet Global #eta;#eta;Counts',
155  fillGroup=groupName,
156  type='TH1F', path=developerPath+'jJ/',xbins=100,xmin=-50,xmax=50)
157 
158  helper.defineHistogram('jJ_GlobalPhi;h_jJ_GlobalPhi', title='jFex SRJet Global #phi;#phi;Counts',
159  fillGroup=groupName,
160  type='TH1F', path=developerPath+'jJ/',xbins=67,xmin=-1,xmax=65)
161 
162  helper.defineHistogram('jJ_GlobalEta,jJ_GlobalPhi;h_jJ_GlobalEtaPhiMap', title="jFex SRJet Global #eta vs #phi;(int) #eta;(int) #phi",
163  fillGroup=groupName,
164  type='TH2F',path=developerPath+'jJ/', xbins=100,xmin=-50,xmax=50,ybins=67,ymin=-1,ymax=65)
165 
166 
167  helper.defineHistogram('jLJ_jFexNumber;h_jLJ_jFexNumber', title='jFex LRJet Module;Module number;Counts',
168  fillGroup=groupName,
169  type='TH1I', path=developerPath+'jLJ/', xbins=6,xmin=0,xmax=6)
170 
171  helper.defineHistogram('jLJ_fpgaNumber;h_jLJ_fpgaNumber', title='jFex LRJet FPGA;FPGA number;Counts',
172  fillGroup=groupName,
173  type='TH1F', path=developerPath+'jLJ/',xbins=4,xmin=0,xmax=4)
174 
175  helper.defineHistogram('jLJ_jFexNumber,jLJ_fpgaNumber;h_jLJ_DetectorMap', title="jFex LRJet module vs FPGA; jFEX module; FPGA",
176  fillGroup=groupName,
177  type='TH2I',path=developerPath+'jLJ/', xbins=6,xmin=0,xmax=6,ybins=4,ymin=0,ymax=4,xlabels=Modules_names,ylabels=FPGA_names)
178 
179  helper.defineHistogram('jLJ_Et;h_jLJ_Et', title='jFex LRJet Transverse Energy;tobEt [200 MeV Scale];Counts',
180  fillGroup=groupName,
181  type='TH1I', path=developerPath+'jLJ/',xbins=512,xmin=0,xmax=2048)
182 
183  helper.defineHistogram('jLJ_Eta;h_jLJ_Eta', title='jFex LRJet #eta;#eta;Counts',
184  fillGroup=groupName,
185  type='TH1F', path=developerPath+'jLJ/',xbins=100,xmin=-5.0,xmax=5.0)
186 
187  helper.defineHistogram('jLJ_Phi;h_jLJ_Phi', title='jFex LRJet #phi;#phi;Counts',
188  fillGroup=groupName,
189  type='TH1F', path=developerPath+'jLJ/',**phi_bins)
190 
191  helper.defineHistogram('jLJ_Eta,jLJ_Phi;h_jLJ_EtaPhiMap', title="jFEX LRJet #eta vs #phi;#eta;#phi",
192  fillGroup=groupName,
193  type='TH2F',path=developerPath+'jLJ/', **eta_phi_bins)
194 
195  helper.defineHistogram('jLJ_GlobalEta;h_jLJ_GlobalEta', title='jFex LRJet Global #eta;#eta;Counts',
196  fillGroup=groupName,
197  type='TH1F', path=developerPath+'jLJ/',xbins=100,xmin=-50,xmax=50)
198 
199  helper.defineHistogram('jLJ_GlobalPhi;h_jLJ_GlobalPhi', title='jFex LRJet Global #phi;#phi;Counts',
200  fillGroup=groupName,
201  type='TH1F', path=developerPath+'jLJ/',xbins=67,xmin=-1,xmax=65)
202 
203  helper.defineHistogram('jLJ_GlobalEta,jLJ_GlobalPhi;h_jLJ_GlobalEtaPhiMap', title="jFex LRJet #eta vs #phi;(int) #eta; (int) #phi",
204  fillGroup=groupName,
205  type='TH2F',path=developerPath+'jLJ/', xbins=100,xmin=-50,xmax=50,ybins=67,ymin=-1,ymax=65)
206 
207  helper.defineHistogram('jTau_jFexNumber;h_jTau_jFexNumber', title='jFex Tau Module;Module number;Counts',
208  fillGroup=groupName,
209  type='TH1I', path=developerPath+'jTau/', xbins=6,xmin=0,xmax=6)
210 
211  helper.defineHistogram('jTau_fpgaNumber;h_jTau_fpgaNumber', title='jFex Tau FPGA;FPGA number;Counts',
212  fillGroup=groupName,
213  type='TH1F', path=developerPath+'jTau/',xbins=4,xmin=0,xmax=4)
214 
215  helper.defineHistogram('jTau_jFexNumber,jTau_fpgaNumber;h_jTau_DetectorMap', title="jFex Tau module vs FPGA; jFEX module; FPGA",
216  fillGroup=groupName,
217  type='TH2I',path=developerPath+'jTau/', xbins=6,xmin=0,xmax=6,ybins=4,ymin=0,ymax=4,xlabels=Modules_names,ylabels=FPGA_names)
218 
219  helper.defineHistogram('jTau_Et;h_jTau_Et', title='jFex Tau Transverse Energy;tobEt [200 MeV Scale];Counts',
220  fillGroup=groupName,
221  type='TH1I', path=developerPath+'jTau/',xbins=512,xmin=0,xmax=2048)
222 
223  helper.defineHistogram('jTau_Iso;h_jTau_Iso', title='jFex Tau Isolation;tobIso [200 MeV Scale];Counts',
224  fillGroup=groupName,
225  type='TH1I', path=developerPath+'jTau/',xbins=512,xmin=0,xmax=2048)
226 
227  helper.defineHistogram('jTau_Eta;h_jTau_Eta', title='jFex Tau #eta;#eta;Counts',
228  fillGroup=groupName,
229  type='TH1F', path=developerPath+'jTau/',xbins=100,xmin=-5.0,xmax=5.0)
230 
231  helper.defineHistogram('jTau_Phi;h_jTau_Phi', title='jFex Tau #phi;#phi;Counts',
232  fillGroup=groupName,
233  type='TH1F', path=developerPath+'jTau/',**phi_bins)
234 
235  helper.defineHistogram('jTau_Eta,jTau_Phi;h_jTau_EtaPhiMap', title="jFex Tau #eta vs #phi;#eta;#phi",
236  fillGroup=groupName,
237  hanConfig={
238  "algorithm": "Jfex_etaPhiMapFilled_TAU",
239  "description": "Inspect for hot/cold spots - check help for list of known hot/coldspots",
240  "display": "SetPalette(87)"
241  },
242  type='TH2I',path=expertPath+'jTau/',opt=['kAlwaysCreate'], **eta_phi_bins_central)
243 
244  helper.defineHistogram('jTau_Eta,jTau_Phi;h_jTau_EtaPhiMap_HighPt', title="jFex Tau #geq 10 GeV #eta vs #phi;#eta;#phi",
245  fillGroup=mapHighPtGroupName,
246  hanConfig={
247  "algorithm": "Jfex_etaPhiMapFilled_TAU",
248  "description": "Inspect for hot/cold spots - check help for list of known hot/coldspots",
249  "display": "SetPalette(87)"
250  },
251  type='TH2I',path=expertPath+'jTau/',opt=['kAlwaysCreate'], **eta_phi_bins_central)
252 
253  helper.defineHistogram('jTau_GlobalEta;h_jTau_GlobalEta', title='jFex Tau Global #eta;#eta;Counts',
254  fillGroup=groupName,
255  type='TH1F', path=developerPath+'jTau/',xbins=100,xmin=-50,xmax=50)
256 
257  helper.defineHistogram('jTau_GlobalPhi;h_jTau_GlobalPhi', title='jFex Tau Global #phi;#phi;Counts',
258  fillGroup=groupName,
259  type='TH1F', path=developerPath+'jTau/',xbins=67,xmin=-1,xmax=65)
260 
261  helper.defineHistogram('jTau_GlobalEta,jTau_GlobalPhi;h_jTau_GlobalEtaPhiMap', title="jFex Tau Global #eta vs #phi;(int) #eta; (int) #phi",
262  fillGroup=groupName,
263  type='TH2F',path=developerPath+'jTau/', xbins=100,xmin=-50,xmax=50,ybins=67,ymin=-1,ymax=65)
264 
265  helper.defineHistogram('jEM_jFexNumber;h_jEM_jFexNumber', title='jFex EM Module;Module number;Counts',
266  fillGroup=groupName,
267  type='TH1I', path=developerPath+'jEM/', xbins=6,xmin=0,xmax=6)
268 
269  helper.defineHistogram('jEM_fpgaNumber;h_jEM_fpgaNumber', title='jFex EM FPGA;FPGA number;Counts',
270  fillGroup=groupName,
271  type='TH1F', path=developerPath+'jEM/',xbins=4,xmin=0,xmax=4)
272 
273  helper.defineHistogram('jEM_jFexNumber,jEM_fpgaNumber;h_jTau_DetectorMap', title="jFex EM module vs FPGA; jFEX module; FPGA",
274  fillGroup=groupName,
275  type='TH2I',path=developerPath+'jEM/', xbins=6,xmin=0,xmax=6,ybins=4,ymin=0,ymax=4,xlabels=Modules_names,ylabels=FPGA_names)
276 
277  helper.defineHistogram('jEM_Et;h_jEM_Et', title='jFex EM Transverse Energy;tobEt [200 MeV Scale];Counts',
278  fillGroup=groupName,
279  type='TH1I', path=developerPath+'jEM/',xbins=512,xmin=0,xmax=2048)
280 
281  helper.defineHistogram('jEM_Eta;h_jEM_Eta', title='jFex EM #eta;#eta;Counts',
282  fillGroup=groupName,
283  type='TH1F', path=developerPath+'jEM/',xbins=100,xmin=-5.0,xmax=5.0)
284 
285  helper.defineHistogram('jEM_Phi;h_jEM_Phi', title='jFex EM #phi;#phi;Counts',
286  fillGroup=groupName,
287  type='TH1F', path=developerPath+'jEM/',**phi_bins)
288 
289  em_labels = ['None','loose','medium','tight']
290  helper.defineHistogram('jEM_Iso;h_jEM_Iso', title='jFex EM Isolation;tobIso;Counts',
291  fillGroup=groupName,
292  type='TH1I', path=developerPath+'jEM/',xbins=4,xmin=0,xmax=4,xlabels=em_labels)
293 
294  helper.defineHistogram('jEM_f1;h_jEM_f1', title='jFex EM Frac1;EM Frac1;Counts',
295  fillGroup=groupName,
296  type='TH1I', path=developerPath+'jEM/',xbins=4,xmin=0,xmax=4,xlabels=em_labels)
297 
298  helper.defineHistogram('jEM_f2;h_jEM_f2', title='jFex EM Frac2;EM Frac2;Counts',
299  fillGroup=groupName,
300  type='TH1I', path=developerPath+'jEM/',xbins=4,xmin=0,xmax=4,xlabels=em_labels)
301 
302  helper.defineHistogram('jEM_Eta,jEM_Phi;h_jEM_EtaPhiMap', title="jFex EM #eta vs #phi;#eta;#phi",
303  fillGroup=mapGroupName,
304  hanConfig={
305  "algorithm":"Jfex_etaPhiMapFilled_EM",
306  "description": "Bins with negative number of entries (in the FCAL and central region) signify that no TOBs can be produced at that position. Inspect for hot/cold spots, note that there are no jEM TOBs for |eta| < 2.3 - check help for list of known hot/coldspots",
307  "display":"SetPalette(87),Draw=COL1Z"
308  },
309  weight="weight",
310  type='TH2I',path=expertPath+'jEM/',opt=['kAlwaysCreate'], **eta_phi_bins)
311 
312  helper.defineHistogram('jEM_Eta,jEM_Phi;h_jEM_EtaPhiMap_HighPt', title="jFex EM #geq 10 GeV #eta vs #phi;#eta;#phi",
313  fillGroup=mapHighPtGroupName,
314  hanConfig={
315  "algorithm":"Jfex_etaPhiMapFilled_EM",
316  "description": "Bins with negative number of entries (in the FCAL and central region) signify that no TOBs can be produced at that position. Inspect for hot/cold spots, note that there are no jEM TOBs for |eta| < 2.3 - check help for list of known hot/coldspots",
317  "display":"SetPalette(87),Draw=COL1Z"
318  },
319  weight="weight",
320  type='TH2I',path=expertPath+'jEM/',opt=['kAlwaysCreate'], **eta_phi_bins)
321 
322  helper.defineHistogram('jEM_GlobalEta;h_jEM_GlobalEta', title='jFex EM Global #eta;#eta;Counts',
323  fillGroup=groupName,
324  type='TH1F', path=developerPath+'jEM/',xbins=100,xmin=-50,xmax=50)
325 
326  helper.defineHistogram('jEM_GlobalPhi;h_jEM_GlobalPhi', title='jFex EM Global #phi;#phi;Counts',
327  fillGroup=groupName,
328  type='TH1F', path=developerPath+'jEM/',xbins=67,xmin=-1,xmax=65)
329 
330  helper.defineHistogram('jEM_GlobalEta,jEM_GlobalPhi;h_jEM_GlobalEtaPhiMap', title="jFex EM Global #eta vs #phi;(int) #eta; (int) #phi",
331  fillGroup=groupName,
332  type='TH2F',path=developerPath+'jEM/', xbins=100,xmin=-50,xmax=50,ybins=67,ymin=-1,ymax=65)
333 
334  helper.defineHistogram('jXE_X;h_jXE_X', title='jFex MET X component (tobEx);tobEx [200 MeV Scale];Counts',
335  fillGroup=groupName,
336  type='TH1I', path=developerPath+'jXE/',xbins=1000,xmin=-500,xmax=500)
337 
338  helper.defineHistogram('jXE_Y;h_jXE_Y', title='jFex MET Y component (tobEy);tobEy [200 MeV Scale];Counts',
339  fillGroup=groupName,
340  type='TH1I', path=developerPath+'jXE/',xbins=1000,xmin=-500,xmax=500)
341 
342  helper.defineHistogram('jXE_MET;h_jXE_MET', title='jFex MET ;Total jXE [200 MeV Scale];Counts',
343  fillGroup=groupName,
344  type='TH1F', path=developerPath+'jXE/',xbins=500,xmin=0,xmax=1000)
345 
346  helper.defineHistogram('jXE_phi;h_jXE_phi', title='jFex MET phi ;#phi=atan(Ey/Ex) values;Counts',
347  fillGroup=groupName,
348  type='TH1F', path=developerPath+'jXE/',xbins=66,xmin=-math.pi,xmax=math.pi)
349 
350 
351 
352  helper.defineHistogram('jTE_low;h_jTE_low', title='jFex SumEt low #eta;tob Et_lower [200 MeV Scale];Counts',
353  fillGroup=groupName,
354  type='TH1I', path=developerPath+'jTE/',xbins=700,xmin=0,xmax=700)
355 
356  helper.defineHistogram('jTE_high;h_jTE_high', title='jFex SumEt high #eta;tob Et_upper [200 MeV Scale];Counts',
357  fillGroup=groupName,
358  type='TH1I', path=developerPath+'jTE/',xbins=700,xmin=0,xmax=700)
359 
360  helper.defineHistogram('jTE_SumEt;h_jTE_SumEt', title='jFex SumEt total ;Total jTE [200 MeV Scale];Counts',
361  fillGroup=groupName,
362  type='TH1F', path=developerPath+'jTE/',xbins=1000,xmin=0,xmax=4000)
363 
364 
365  acc = helper.result()
366  result.merge(acc)
367  return result
368 
369 
370 if __name__=='__main__':
371  # set input file and config options
372  from AthenaConfiguration.AllConfigFlags import initConfigFlags
373  import glob
374 
375  import argparse
376  parser = argparse.ArgumentParser(prog='python -m TrigT1CaloMonitoring.JfexMonitorAlgorithm',
377  description="""Used to run jFEX Monitoring\n\n
378  Example: python -m TrigT1CaloMonitoring.JfexMonitorAlgorithm --filesInput file.root --skipEvents 0 --evtMax 100""")
379 
380  parser.add_argument('--evtMax',type=int,default=-1,help="number of events")
381  parser.add_argument('--filesInput',nargs='+',help="input files",required=True)
382  parser.add_argument('--skipEvents',type=int,default=0,help="number of events to skip")
383  args = parser.parse_args()
384 
385 
386  flags = initConfigFlags()
387  flags.Input.Files = [file for x in args.filesInput for file in glob.glob(x)]
388  flags.Output.HISTFileName = 'jFexTOB_Monitoring.root'
389 
390  flags.Exec.MaxEvents = args.evtMax
391  flags.Exec.SkipEvents = args.skipEvents
392 
393  flags.lock()
394  flags.dump() # print all the configs
395 
396  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
397  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
398  cfg = MainServicesCfg(flags)
399  cfg.merge(PoolReadCfg(flags))
400 
401  JfexMonitorCfg = JfexMonitoringConfig(flags)
402  cfg.merge(JfexMonitorCfg)
403 
404  cfg.run()
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69
JfexMonitorAlgorithm.JfexMonitoringConfig
def JfexMonitoringConfig(flags)
Definition: JfexMonitorAlgorithm.py:4