5 '''Function to configure LVL1 Jfex algorithm in the monitoring system.'''
9 from AthenaConfiguration.ComponentFactory
import CompFactory
10 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
13 from TrigT1CaloMonitoring.LVL1CaloMonitoringConfig
import L1CaloMonitorCfgHelper
14 helper = L1CaloMonitorCfgHelper(flags,CompFactory.JfexMonitorAlgorithm,
'JfexMonAlg')
15 JfexMonAlg = helper.alg
18 groupName =
'JfexMonitor'
19 mapGroupName =
'jFEXMaps'
20 mapHighPtGroupName =
'jFEXMapsHighPt'
21 JfexMonAlg.Grouphist = groupName
24 developerPath =
'Developer/Jfex/'
25 expertPath =
'Expert/Outputs/'
30 FPGA_names = [
"U1",
"U2",
"U4",
"U3"]
31 Modules_names = [
"jFEX 0",
"jFEX 1",
"jFEX 2",
"jFEX 3",
"jFEX 4",
"jFEX 5"]
33 from ROOT
import TMath
37 phi = (-TMath.Pi()- TMath.Pi()/32) + TMath.Pi()/32*i
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)]
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]
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)]
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]
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)]
63 'ybins': 64,
'ymin': -TMath.Pi(),
'ymax': TMath.Pi()
67 'xbins': eta_bins_jets,
68 'ybins': 64,
'ymin': -TMath.Pi(),
'ymax': TMath.Pi()
71 eta_phi_bins_central = {
72 'xbins': 50,
'xmin': -2.5,
'xmax': 2.5,
73 'ybins': 64,
'ymin': -TMath.Pi(),
'ymax': TMath.Pi()
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
83 n_empty_bins_fcal = 2036
85 n_empty_bins_fcal_overlap = 96
88 n_expected_filled_bins_jJ = n_bins_total_jets - n_empty_bins_fcal - n_empty_bins_fcal_overlap
90 n_expected_filled_bins_jTAU = n_bins_eta_2p5
92 n_expected_filled_bins_jEM = n_bins_total - n_empty_bins_fcal - n_bins_eta_2p3
94 helper.defineDQAlgorithm(
"Jfex_etaPhiMapFilled",
95 hanConfig={
"libname":
"libdqm_summaries.so",
"name":
"Bins_LessThanAbs_Threshold",
"BinThreshold":
"1"},
96 thresholdConfig={
"NBins":[0,n_expected_filled_bins_jJ]},
98 helper.defineDQAlgorithm(
"Jfex_etaPhiMapFilled_EM",
99 hanConfig={
"libname":
"libdqm_summaries.so",
"name":
"Bins_LessThanAbs_Threshold",
"BinThreshold":
"1"},
100 thresholdConfig={
"NBins":[0,n_expected_filled_bins_jEM]},
102 helper.defineDQAlgorithm(
"Jfex_etaPhiMapFilled_TAU",
103 hanConfig={
"libname":
"libdqm_summaries.so",
"name":
"Bins_LessThanAbs_Threshold",
"BinThreshold":
"1"},
104 thresholdConfig={
"NBins":[0,n_expected_filled_bins_jTAU]},
108 helper.defineHistogram(
'jJ_jFexNumber;h_jJ_jFexNumber', title=
'jFex SRJet Module;Module number;Counts',
110 type=
'TH1I', path=developerPath+
'jJ/', xbins=6,xmin=0,xmax=6)
112 helper.defineHistogram(
'jJ_fpgaNumber;h_jJ_fpgaNumber', title=
'jFex SRJet FPGA;FPGA number;Counts',
114 type=
'TH1F', path=developerPath+
'jJ/',xbins=4,xmin=0,xmax=4)
116 helper.defineHistogram(
'jJ_jFexNumber,jJ_fpgaNumber;h_jJ_DetectorMap', title=
"jFex SRJet module vs FPGA; jFEX module; FPGA",
118 type=
'TH2I',path=developerPath+
'jJ/', xbins=6,xmin=0,xmax=6,ybins=4,ymin=0,ymax=4,xlabels=Modules_names,ylabels=FPGA_names)
120 helper.defineHistogram(
'jJ_Et;h_jJ_Et', title=
'jFex SRJet Transverse Energy;tobEt [200 MeV Scale];Counts',
122 type=
'TH1I', path=developerPath+
'jJ/', xbins=512,xmin=0,xmax=2048)
124 helper.defineHistogram(
'jJ_Eta;h_jJ_Eta', title=
'jFex SRJet #eta;#eta;Counts',
126 type=
'TH1F', path=developerPath+
'jJ/',xbins=100,xmin=-5.0,xmax=5.0)
128 helper.defineHistogram(
'jJ_Phi;h_jJ_Phi', title=
'jFex SRJet #phi;#phi;Counts',
130 type=
'TH1F', path=developerPath+
'jJ/',**phi_bins)
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/',
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"
140 weight=
"weight",opt=[
'kAlwaysCreate'],
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/',
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"
151 weight=
"weight",opt=[
'kAlwaysCreate'],
154 helper.defineHistogram(
'jJ_GlobalEta;h_jJ_GlobalEta', title=
'jFex SRJet Global #eta;#eta;Counts',
156 type=
'TH1F', path=developerPath+
'jJ/',xbins=100,xmin=-50,xmax=50)
158 helper.defineHistogram(
'jJ_GlobalPhi;h_jJ_GlobalPhi', title=
'jFex SRJet Global #phi;#phi;Counts',
160 type=
'TH1F', path=developerPath+
'jJ/',xbins=67,xmin=-1,xmax=65)
162 helper.defineHistogram(
'jJ_GlobalEta,jJ_GlobalPhi;h_jJ_GlobalEtaPhiMap', title=
"jFex SRJet Global #eta vs #phi;(int) #eta;(int) #phi",
164 type=
'TH2F',path=developerPath+
'jJ/', xbins=100,xmin=-50,xmax=50,ybins=67,ymin=-1,ymax=65)
167 helper.defineHistogram(
'jLJ_jFexNumber;h_jLJ_jFexNumber', title=
'jFex LRJet Module;Module number;Counts',
169 type=
'TH1I', path=developerPath+
'jLJ/', xbins=6,xmin=0,xmax=6)
171 helper.defineHistogram(
'jLJ_fpgaNumber;h_jLJ_fpgaNumber', title=
'jFex LRJet FPGA;FPGA number;Counts',
173 type=
'TH1F', path=developerPath+
'jLJ/',xbins=4,xmin=0,xmax=4)
175 helper.defineHistogram(
'jLJ_jFexNumber,jLJ_fpgaNumber;h_jLJ_DetectorMap', title=
"jFex LRJet module vs FPGA; jFEX module; FPGA",
177 type=
'TH2I',path=developerPath+
'jLJ/', xbins=6,xmin=0,xmax=6,ybins=4,ymin=0,ymax=4,xlabels=Modules_names,ylabels=FPGA_names)
179 helper.defineHistogram(
'jLJ_Et;h_jLJ_Et', title=
'jFex LRJet Transverse Energy;tobEt [200 MeV Scale];Counts',
181 type=
'TH1I', path=developerPath+
'jLJ/',xbins=512,xmin=0,xmax=2048)
183 helper.defineHistogram(
'jLJ_Eta;h_jLJ_Eta', title=
'jFex LRJet #eta;#eta;Counts',
185 type=
'TH1F', path=developerPath+
'jLJ/',xbins=100,xmin=-5.0,xmax=5.0)
187 helper.defineHistogram(
'jLJ_Phi;h_jLJ_Phi', title=
'jFex LRJet #phi;#phi;Counts',
189 type=
'TH1F', path=developerPath+
'jLJ/',**phi_bins)
191 helper.defineHistogram(
'jLJ_Eta,jLJ_Phi;h_jLJ_EtaPhiMap', title=
"jFEX LRJet #eta vs #phi;#eta;#phi",
193 type=
'TH2F',path=developerPath+
'jLJ/', **eta_phi_bins)
195 helper.defineHistogram(
'jLJ_GlobalEta;h_jLJ_GlobalEta', title=
'jFex LRJet Global #eta;#eta;Counts',
197 type=
'TH1F', path=developerPath+
'jLJ/',xbins=100,xmin=-50,xmax=50)
199 helper.defineHistogram(
'jLJ_GlobalPhi;h_jLJ_GlobalPhi', title=
'jFex LRJet Global #phi;#phi;Counts',
201 type=
'TH1F', path=developerPath+
'jLJ/',xbins=67,xmin=-1,xmax=65)
203 helper.defineHistogram(
'jLJ_GlobalEta,jLJ_GlobalPhi;h_jLJ_GlobalEtaPhiMap', title=
"jFex LRJet #eta vs #phi;(int) #eta; (int) #phi",
205 type=
'TH2F',path=developerPath+
'jLJ/', xbins=100,xmin=-50,xmax=50,ybins=67,ymin=-1,ymax=65)
207 helper.defineHistogram(
'jTau_jFexNumber;h_jTau_jFexNumber', title=
'jFex Tau Module;Module number;Counts',
209 type=
'TH1I', path=developerPath+
'jTau/', xbins=6,xmin=0,xmax=6)
211 helper.defineHistogram(
'jTau_fpgaNumber;h_jTau_fpgaNumber', title=
'jFex Tau FPGA;FPGA number;Counts',
213 type=
'TH1F', path=developerPath+
'jTau/',xbins=4,xmin=0,xmax=4)
215 helper.defineHistogram(
'jTau_jFexNumber,jTau_fpgaNumber;h_jTau_DetectorMap', title=
"jFex Tau module vs FPGA; jFEX module; FPGA",
217 type=
'TH2I',path=developerPath+
'jTau/', xbins=6,xmin=0,xmax=6,ybins=4,ymin=0,ymax=4,xlabels=Modules_names,ylabels=FPGA_names)
219 helper.defineHistogram(
'jTau_Et;h_jTau_Et', title=
'jFex Tau Transverse Energy;tobEt [200 MeV Scale];Counts',
221 type=
'TH1I', path=developerPath+
'jTau/',xbins=512,xmin=0,xmax=2048)
223 helper.defineHistogram(
'jTau_Iso;h_jTau_Iso', title=
'jFex Tau Isolation;tobIso [200 MeV Scale];Counts',
225 type=
'TH1I', path=developerPath+
'jTau/',xbins=512,xmin=0,xmax=2048)
227 helper.defineHistogram(
'jTau_Eta;h_jTau_Eta', title=
'jFex Tau #eta;#eta;Counts',
229 type=
'TH1F', path=developerPath+
'jTau/',xbins=100,xmin=-5.0,xmax=5.0)
231 helper.defineHistogram(
'jTau_Phi;h_jTau_Phi', title=
'jFex Tau #phi;#phi;Counts',
233 type=
'TH1F', path=developerPath+
'jTau/',**phi_bins)
235 helper.defineHistogram(
'jTau_Eta,jTau_Phi;h_jTau_EtaPhiMap', title=
"jFex Tau #eta vs #phi;#eta;#phi",
238 "algorithm":
"Jfex_etaPhiMapFilled_TAU",
239 "description":
"Inspect for hot/cold spots - check help for list of known hot/coldspots",
240 "display":
"SetPalette(87)"
242 type=
'TH2I',path=expertPath+
'jTau/',opt=[
'kAlwaysCreate'], **eta_phi_bins_central)
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,
247 "algorithm":
"Jfex_etaPhiMapFilled_TAU",
248 "description":
"Inspect for hot/cold spots - check help for list of known hot/coldspots",
249 "display":
"SetPalette(87)"
251 type=
'TH2I',path=expertPath+
'jTau/',opt=[
'kAlwaysCreate'], **eta_phi_bins_central)
253 helper.defineHistogram(
'jTau_GlobalEta;h_jTau_GlobalEta', title=
'jFex Tau Global #eta;#eta;Counts',
255 type=
'TH1F', path=developerPath+
'jTau/',xbins=100,xmin=-50,xmax=50)
257 helper.defineHistogram(
'jTau_GlobalPhi;h_jTau_GlobalPhi', title=
'jFex Tau Global #phi;#phi;Counts',
259 type=
'TH1F', path=developerPath+
'jTau/',xbins=67,xmin=-1,xmax=65)
261 helper.defineHistogram(
'jTau_GlobalEta,jTau_GlobalPhi;h_jTau_GlobalEtaPhiMap', title=
"jFex Tau Global #eta vs #phi;(int) #eta; (int) #phi",
263 type=
'TH2F',path=developerPath+
'jTau/', xbins=100,xmin=-50,xmax=50,ybins=67,ymin=-1,ymax=65)
265 helper.defineHistogram(
'jEM_jFexNumber;h_jEM_jFexNumber', title=
'jFex EM Module;Module number;Counts',
267 type=
'TH1I', path=developerPath+
'jEM/', xbins=6,xmin=0,xmax=6)
269 helper.defineHistogram(
'jEM_fpgaNumber;h_jEM_fpgaNumber', title=
'jFex EM FPGA;FPGA number;Counts',
271 type=
'TH1F', path=developerPath+
'jEM/',xbins=4,xmin=0,xmax=4)
273 helper.defineHistogram(
'jEM_jFexNumber,jEM_fpgaNumber;h_jTau_DetectorMap', title=
"jFex EM module vs FPGA; jFEX module; FPGA",
275 type=
'TH2I',path=developerPath+
'jEM/', xbins=6,xmin=0,xmax=6,ybins=4,ymin=0,ymax=4,xlabels=Modules_names,ylabels=FPGA_names)
277 helper.defineHistogram(
'jEM_Et;h_jEM_Et', title=
'jFex EM Transverse Energy;tobEt [200 MeV Scale];Counts',
279 type=
'TH1I', path=developerPath+
'jEM/',xbins=512,xmin=0,xmax=2048)
281 helper.defineHistogram(
'jEM_Eta;h_jEM_Eta', title=
'jFex EM #eta;#eta;Counts',
283 type=
'TH1F', path=developerPath+
'jEM/',xbins=100,xmin=-5.0,xmax=5.0)
285 helper.defineHistogram(
'jEM_Phi;h_jEM_Phi', title=
'jFex EM #phi;#phi;Counts',
287 type=
'TH1F', path=developerPath+
'jEM/',**phi_bins)
289 em_labels = [
'None',
'loose',
'medium',
'tight']
290 helper.defineHistogram(
'jEM_Iso;h_jEM_Iso', title=
'jFex EM Isolation;tobIso;Counts',
292 type=
'TH1I', path=developerPath+
'jEM/',xbins=4,xmin=0,xmax=4,xlabels=em_labels)
294 helper.defineHistogram(
'jEM_f1;h_jEM_f1', title=
'jFex EM Frac1;EM Frac1;Counts',
296 type=
'TH1I', path=developerPath+
'jEM/',xbins=4,xmin=0,xmax=4,xlabels=em_labels)
298 helper.defineHistogram(
'jEM_f2;h_jEM_f2', title=
'jFex EM Frac2;EM Frac2;Counts',
300 type=
'TH1I', path=developerPath+
'jEM/',xbins=4,xmin=0,xmax=4,xlabels=em_labels)
302 helper.defineHistogram(
'jEM_Eta,jEM_Phi;h_jEM_EtaPhiMap', title=
"jFex EM #eta vs #phi;#eta;#phi",
303 fillGroup=mapGroupName,
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"
310 type=
'TH2I',path=expertPath+
'jEM/',opt=[
'kAlwaysCreate'], **eta_phi_bins)
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,
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"
320 type=
'TH2I',path=expertPath+
'jEM/',opt=[
'kAlwaysCreate'], **eta_phi_bins)
322 helper.defineHistogram(
'jEM_GlobalEta;h_jEM_GlobalEta', title=
'jFex EM Global #eta;#eta;Counts',
324 type=
'TH1F', path=developerPath+
'jEM/',xbins=100,xmin=-50,xmax=50)
326 helper.defineHistogram(
'jEM_GlobalPhi;h_jEM_GlobalPhi', title=
'jFex EM Global #phi;#phi;Counts',
328 type=
'TH1F', path=developerPath+
'jEM/',xbins=67,xmin=-1,xmax=65)
330 helper.defineHistogram(
'jEM_GlobalEta,jEM_GlobalPhi;h_jEM_GlobalEtaPhiMap', title=
"jFex EM Global #eta vs #phi;(int) #eta; (int) #phi",
332 type=
'TH2F',path=developerPath+
'jEM/', xbins=100,xmin=-50,xmax=50,ybins=67,ymin=-1,ymax=65)
334 helper.defineHistogram(
'jXE_X;h_jXE_X', title=
'jFex MET X component (tobEx);tobEx [200 MeV Scale];Counts',
336 type=
'TH1I', path=developerPath+
'jXE/',xbins=1000,xmin=-500,xmax=500)
338 helper.defineHistogram(
'jXE_Y;h_jXE_Y', title=
'jFex MET Y component (tobEy);tobEy [200 MeV Scale];Counts',
340 type=
'TH1I', path=developerPath+
'jXE/',xbins=1000,xmin=-500,xmax=500)
342 helper.defineHistogram(
'jXE_MET;h_jXE_MET', title=
'jFex MET ;Total jXE [200 MeV Scale];Counts',
344 type=
'TH1F', path=developerPath+
'jXE/',xbins=500,xmin=0,xmax=1000)
346 helper.defineHistogram(
'jXE_phi;h_jXE_phi', title=
'jFex MET phi ;#phi=atan(Ey/Ex) values;Counts',
348 type=
'TH1F', path=developerPath+
'jXE/',xbins=66,xmin=-math.pi,xmax=math.pi)
352 helper.defineHistogram(
'jTE_low;h_jTE_low', title=
'jFex SumEt low #eta;tob Et_lower [200 MeV Scale];Counts',
354 type=
'TH1I', path=developerPath+
'jTE/',xbins=700,xmin=0,xmax=700)
356 helper.defineHistogram(
'jTE_high;h_jTE_high', title=
'jFex SumEt high #eta;tob Et_upper [200 MeV Scale];Counts',
358 type=
'TH1I', path=developerPath+
'jTE/',xbins=700,xmin=0,xmax=700)
360 helper.defineHistogram(
'jTE_SumEt;h_jTE_SumEt', title=
'jFex SumEt total ;Total jTE [200 MeV Scale];Counts',
362 type=
'TH1F', path=developerPath+
'jTE/',xbins=1000,xmin=0,xmax=4000)
365 acc = helper.result()
370 if __name__==
'__main__':
372 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
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""")
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()
387 flags.Input.Files = [file
for x
in args.filesInput
for file
in glob.glob(x)]
388 flags.Output.HISTFileName =
'jFexTOB_Monitoring.root'
390 flags.Exec.MaxEvents = args.evtMax
391 flags.Exec.SkipEvents = args.skipEvents
396 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
397 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
402 cfg.merge(JfexMonitorCfg)