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)]
48 eta_bins += [-3.2,-3.1,-2.9,-2.7]
50 eta_bins += [-2.5 + 0.1*i
for i
in range(51)]
52 eta_bins += [2.7,2.9,3.1,3.2]
54 eta_bins += [3.3 + 0.1*i
for i
in range(16)]
58 'ybins': 64,
'ymin': -TMath.Pi(),
'ymax': TMath.Pi()
61 eta_phi_bins_central = {
62 'xbins': 50,
'xmin': -2.5,
'xmax': 2.5,
63 'ybins': 64,
'ymin': -TMath.Pi(),
'ymax': TMath.Pi()
66 n_bins_total = len(eta_bins) * 64
67 n_bins_eta_2p5 = len(eta_phi_bins_central) * 64
68 n_bins_eta_2p3 = 46 * 64
72 n_empty_bins_fcal = 2036
75 n_expected_filled_bins_jJ = n_bins_total - n_empty_bins_fcal
77 n_expected_filled_bins_jTAU = n_bins_eta_2p5
79 n_expected_filled_bins_jEM = n_bins_total - n_empty_bins_fcal - n_bins_eta_2p3
81 helper.defineDQAlgorithm(
"Jfex_etaPhiMapFilled",
82 hanConfig={
"libname":
"libdqm_summaries.so",
"name":
"Bins_LessThanAbs_Threshold",
"BinThreshold":
"1"},
83 thresholdConfig={
"NBins":[0,n_expected_filled_bins_jJ]},
85 helper.defineDQAlgorithm(
"Jfex_etaPhiMapFilled_EM",
86 hanConfig={
"libname":
"libdqm_summaries.so",
"name":
"Bins_LessThanAbs_Threshold",
"BinThreshold":
"1"},
87 thresholdConfig={
"NBins":[0,n_expected_filled_bins_jEM]},
89 helper.defineDQAlgorithm(
"Jfex_etaPhiMapFilled_TAU",
90 hanConfig={
"libname":
"libdqm_summaries.so",
"name":
"Bins_LessThanAbs_Threshold",
"BinThreshold":
"1"},
91 thresholdConfig={
"NBins":[0,n_expected_filled_bins_jTAU]},
95 helper.defineHistogram(
'jJ_jFexNumber;h_jJ_jFexNumber', title=
'jFex SRJet Module;Module number;Counts',
97 type=
'TH1I', path=developerPath+
'jJ/', xbins=6,xmin=0,xmax=6)
99 helper.defineHistogram(
'jJ_fpgaNumber;h_jJ_fpgaNumber', title=
'jFex SRJet FPGA;FPGA number;Counts',
101 type=
'TH1F', path=developerPath+
'jJ/',xbins=4,xmin=0,xmax=4)
103 helper.defineHistogram(
'jJ_jFexNumber,jJ_fpgaNumber;h_jJ_DetectorMap', title=
"jFex SRJet module vs FPGA; jFEX module; FPGA",
105 type=
'TH2I',path=developerPath+
'jJ/', xbins=6,xmin=0,xmax=6,ybins=4,ymin=0,ymax=4,xlabels=Modules_names,ylabels=FPGA_names)
107 helper.defineHistogram(
'jJ_Et;h_jJ_Et', title=
'jFex SRJet Transverse Energy;tobEt [200 MeV Scale];Counts',
109 type=
'TH1I', path=developerPath+
'jJ/', xbins=512,xmin=0,xmax=2048)
111 helper.defineHistogram(
'jJ_Eta;h_jJ_Eta', title=
'jFex SRJet #eta;#eta;Counts',
113 type=
'TH1F', path=developerPath+
'jJ/',xbins=100,xmin=-5.0,xmax=5.0)
115 helper.defineHistogram(
'jJ_Phi;h_jJ_Phi', title=
'jFex SRJet #phi;#phi;Counts',
117 type=
'TH1F', path=developerPath+
'jJ/',**phi_bins)
119 helper.defineHistogram(
'jJ_Eta,jJ_Phi;h_jJ_EtaPhiMap', title=
"jFex SRJet #eta vs #phi;#eta;#phi",
120 fillGroup=mapGroupName,
121 type=
'TH2I',path=expertPath+
'jJ/',
123 "algorithm":
"Jfex_etaPhiMapFilled",
124 "description":
"Bins with negative number of entries (in the FCAL) signify that no TOBs can be produced at that position. Inspect for hot/cold spots - check help for list of known hot/coldspots",
125 "display":
"SetPalette(55),Draw=COL1Z"
127 weight=
"weight",opt=[
'kAlwaysCreate'],
130 helper.defineHistogram(
'jJ_Eta,jJ_Phi;h_jJ_EtaPhiMap_HighPt', title=
"jFex SRJet #geq 20 GeV #eta vs #phi;#eta;#phi",
131 fillGroup=mapHighPtGroupName,
132 type=
'TH2I',path=expertPath+
'jJ/',
134 "algorithm":
"Jfex_etaPhiMapFilled",
135 "description":
"Bins with negative number of entries (in the FCAL) signify that no TOBs can be produced at that position. Inspect for hot/cold spots - check help for list of known hot/coldspots",
136 "display":
"SetPalette(55),Draw=COL1Z"
138 weight=
"weight",opt=[
'kAlwaysCreate'],
141 helper.defineHistogram(
'jJ_GlobalEta;h_jJ_GlobalEta', title=
'jFex SRJet Global #eta;#eta;Counts',
143 type=
'TH1F', path=developerPath+
'jJ/',xbins=100,xmin=-50,xmax=50)
145 helper.defineHistogram(
'jJ_GlobalPhi;h_jJ_GlobalPhi', title=
'jFex SRJet Global #phi;#phi;Counts',
147 type=
'TH1F', path=developerPath+
'jJ/',xbins=67,xmin=-1,xmax=65)
149 helper.defineHistogram(
'jJ_GlobalEta,jJ_GlobalPhi;h_jJ_GlobalEtaPhiMap', title=
"jFex SRJet Global #eta vs #phi;(int) #eta;(int) #phi",
151 type=
'TH2F',path=developerPath+
'jJ/', xbins=100,xmin=-50,xmax=50,ybins=67,ymin=-1,ymax=65)
154 helper.defineHistogram(
'jLJ_jFexNumber;h_jLJ_jFexNumber', title=
'jFex LRJet Module;Module number;Counts',
156 type=
'TH1I', path=developerPath+
'jLJ/', xbins=6,xmin=0,xmax=6)
158 helper.defineHistogram(
'jLJ_fpgaNumber;h_jLJ_fpgaNumber', title=
'jFex LRJet FPGA;FPGA number;Counts',
160 type=
'TH1F', path=developerPath+
'jLJ/',xbins=4,xmin=0,xmax=4)
162 helper.defineHistogram(
'jLJ_jFexNumber,jLJ_fpgaNumber;h_jLJ_DetectorMap', title=
"jFex LRJet module vs FPGA; jFEX module; FPGA",
164 type=
'TH2I',path=developerPath+
'jLJ/', xbins=6,xmin=0,xmax=6,ybins=4,ymin=0,ymax=4,xlabels=Modules_names,ylabels=FPGA_names)
166 helper.defineHistogram(
'jLJ_Et;h_jLJ_Et', title=
'jFex LRJet Transverse Energy;tobEt [200 MeV Scale];Counts',
168 type=
'TH1I', path=developerPath+
'jLJ/',xbins=512,xmin=0,xmax=2048)
170 helper.defineHistogram(
'jLJ_Eta;h_jLJ_Eta', title=
'jFex LRJet #eta;#eta;Counts',
172 type=
'TH1F', path=developerPath+
'jLJ/',xbins=100,xmin=-5.0,xmax=5.0)
174 helper.defineHistogram(
'jLJ_Phi;h_jLJ_Phi', title=
'jFex LRJet #phi;#phi;Counts',
176 type=
'TH1F', path=developerPath+
'jLJ/',**phi_bins)
178 helper.defineHistogram(
'jLJ_Eta,jLJ_Phi;h_jLJ_EtaPhiMap', title=
"jFEX LRJet #eta vs #phi;#eta;#phi",
180 type=
'TH2F',path=developerPath+
'jLJ/', **eta_phi_bins)
182 helper.defineHistogram(
'jLJ_GlobalEta;h_jLJ_GlobalEta', title=
'jFex LRJet Global #eta;#eta;Counts',
184 type=
'TH1F', path=developerPath+
'jLJ/',xbins=100,xmin=-50,xmax=50)
186 helper.defineHistogram(
'jLJ_GlobalPhi;h_jLJ_GlobalPhi', title=
'jFex LRJet Global #phi;#phi;Counts',
188 type=
'TH1F', path=developerPath+
'jLJ/',xbins=67,xmin=-1,xmax=65)
190 helper.defineHistogram(
'jLJ_GlobalEta,jLJ_GlobalPhi;h_jLJ_GlobalEtaPhiMap', title=
"jFex LRJet #eta vs #phi;(int) #eta; (int) #phi",
192 type=
'TH2F',path=developerPath+
'jLJ/', xbins=100,xmin=-50,xmax=50,ybins=67,ymin=-1,ymax=65)
194 helper.defineHistogram(
'jTau_jFexNumber;h_jTau_jFexNumber', title=
'jFex Tau Module;Module number;Counts',
196 type=
'TH1I', path=developerPath+
'jTau/', xbins=6,xmin=0,xmax=6)
198 helper.defineHistogram(
'jTau_fpgaNumber;h_jTau_fpgaNumber', title=
'jFex Tau FPGA;FPGA number;Counts',
200 type=
'TH1F', path=developerPath+
'jTau/',xbins=4,xmin=0,xmax=4)
202 helper.defineHistogram(
'jTau_jFexNumber,jTau_fpgaNumber;h_jTau_DetectorMap', title=
"jFex Tau module vs FPGA; jFEX module; FPGA",
204 type=
'TH2I',path=developerPath+
'jTau/', xbins=6,xmin=0,xmax=6,ybins=4,ymin=0,ymax=4,xlabels=Modules_names,ylabels=FPGA_names)
206 helper.defineHistogram(
'jTau_Et;h_jTau_Et', title=
'jFex Tau Transverse Energy;tobEt [200 MeV Scale];Counts',
208 type=
'TH1I', path=developerPath+
'jTau/',xbins=512,xmin=0,xmax=2048)
210 helper.defineHistogram(
'jTau_Iso;h_jTau_Iso', title=
'jFex Tau Isolation;tobIso [200 MeV Scale];Counts',
212 type=
'TH1I', path=developerPath+
'jTau/',xbins=512,xmin=0,xmax=2048)
214 helper.defineHistogram(
'jTau_Eta;h_jTau_Eta', title=
'jFex Tau #eta;#eta;Counts',
216 type=
'TH1F', path=developerPath+
'jTau/',xbins=100,xmin=-5.0,xmax=5.0)
218 helper.defineHistogram(
'jTau_Phi;h_jTau_Phi', title=
'jFex Tau #phi;#phi;Counts',
220 type=
'TH1F', path=developerPath+
'jTau/',**phi_bins)
222 helper.defineHistogram(
'jTau_Eta,jTau_Phi;h_jTau_EtaPhiMap', title=
"jFex Tau #eta vs #phi;#eta;#phi",
225 "algorithm":
"Jfex_etaPhiMapFilled_TAU",
226 "description":
"Inspect for hot/cold spots - check help for list of known hot/coldspots",
227 "display":
"SetPalette(87)"
229 type=
'TH2I',path=expertPath+
'jTau/',opt=[
'kAlwaysCreate'], **eta_phi_bins_central)
231 helper.defineHistogram(
'jTau_Eta,jTau_Phi;h_jTau_EtaPhiMap_HighPt', title=
"jFex Tau #geq 10 GeV #eta vs #phi;#eta;#phi",
232 fillGroup=mapHighPtGroupName,
234 "algorithm":
"Jfex_etaPhiMapFilled_TAU",
235 "description":
"Inspect for hot/cold spots - check help for list of known hot/coldspots",
236 "display":
"SetPalette(87)"
238 type=
'TH2I',path=expertPath+
'jTau/',opt=[
'kAlwaysCreate'], **eta_phi_bins_central)
240 helper.defineHistogram(
'jTau_GlobalEta;h_jTau_GlobalEta', title=
'jFex Tau Global #eta;#eta;Counts',
242 type=
'TH1F', path=developerPath+
'jTau/',xbins=100,xmin=-50,xmax=50)
244 helper.defineHistogram(
'jTau_GlobalPhi;h_jTau_GlobalPhi', title=
'jFex Tau Global #phi;#phi;Counts',
246 type=
'TH1F', path=developerPath+
'jTau/',xbins=67,xmin=-1,xmax=65)
248 helper.defineHistogram(
'jTau_GlobalEta,jTau_GlobalPhi;h_jTau_GlobalEtaPhiMap', title=
"jFex Tau Global #eta vs #phi;(int) #eta; (int) #phi",
250 type=
'TH2F',path=developerPath+
'jTau/', xbins=100,xmin=-50,xmax=50,ybins=67,ymin=-1,ymax=65)
252 helper.defineHistogram(
'jEM_jFexNumber;h_jEM_jFexNumber', title=
'jFex EM Module;Module number;Counts',
254 type=
'TH1I', path=developerPath+
'jEM/', xbins=6,xmin=0,xmax=6)
256 helper.defineHistogram(
'jEM_fpgaNumber;h_jEM_fpgaNumber', title=
'jFex EM FPGA;FPGA number;Counts',
258 type=
'TH1F', path=developerPath+
'jEM/',xbins=4,xmin=0,xmax=4)
260 helper.defineHistogram(
'jEM_jFexNumber,jEM_fpgaNumber;h_jTau_DetectorMap', title=
"jFex EM module vs FPGA; jFEX module; FPGA",
262 type=
'TH2I',path=developerPath+
'jEM/', xbins=6,xmin=0,xmax=6,ybins=4,ymin=0,ymax=4,xlabels=Modules_names,ylabels=FPGA_names)
264 helper.defineHistogram(
'jEM_Et;h_jEM_Et', title=
'jFex EM Transverse Energy;tobEt [200 MeV Scale];Counts',
266 type=
'TH1I', path=developerPath+
'jEM/',xbins=512,xmin=0,xmax=2048)
268 helper.defineHistogram(
'jEM_Eta;h_jEM_Eta', title=
'jFex EM #eta;#eta;Counts',
270 type=
'TH1F', path=developerPath+
'jEM/',xbins=100,xmin=-5.0,xmax=5.0)
272 helper.defineHistogram(
'jEM_Phi;h_jEM_Phi', title=
'jFex EM #phi;#phi;Counts',
274 type=
'TH1F', path=developerPath+
'jEM/',**phi_bins)
276 em_labels = [
'None',
'loose',
'medium',
'tight']
277 helper.defineHistogram(
'jEM_Iso;h_jEM_Iso', title=
'jFex EM Isolation;tobIso;Counts',
279 type=
'TH1I', path=developerPath+
'jEM/',xbins=4,xmin=0,xmax=4,xlabels=em_labels)
281 helper.defineHistogram(
'jEM_f1;h_jEM_f1', title=
'jFex EM Frac1;EM Frac1;Counts',
283 type=
'TH1I', path=developerPath+
'jEM/',xbins=4,xmin=0,xmax=4,xlabels=em_labels)
285 helper.defineHistogram(
'jEM_f2;h_jEM_f2', title=
'jFex EM Frac2;EM Frac2;Counts',
287 type=
'TH1I', path=developerPath+
'jEM/',xbins=4,xmin=0,xmax=4,xlabels=em_labels)
289 helper.defineHistogram(
'jEM_Eta,jEM_Phi;h_jEM_EtaPhiMap', title=
"jFex EM #eta vs #phi;#eta;#phi",
290 fillGroup=mapGroupName,
292 "algorithm":
"Jfex_etaPhiMapFilled_EM",
293 "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",
294 "display":
"SetPalette(87),Draw=COL1Z"
297 type=
'TH2I',path=expertPath+
'jEM/',opt=[
'kAlwaysCreate'], **eta_phi_bins)
299 helper.defineHistogram(
'jEM_Eta,jEM_Phi;h_jEM_EtaPhiMap_HighPt', title=
"jFex EM #geq 10 GeV #eta vs #phi;#eta;#phi",
300 fillGroup=mapHighPtGroupName,
302 "algorithm":
"Jfex_etaPhiMapFilled_EM",
303 "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",
304 "display":
"SetPalette(87),Draw=COL1Z"
307 type=
'TH2I',path=expertPath+
'jEM/',opt=[
'kAlwaysCreate'], **eta_phi_bins)
309 helper.defineHistogram(
'jEM_GlobalEta;h_jEM_GlobalEta', title=
'jFex EM Global #eta;#eta;Counts',
311 type=
'TH1F', path=developerPath+
'jEM/',xbins=100,xmin=-50,xmax=50)
313 helper.defineHistogram(
'jEM_GlobalPhi;h_jEM_GlobalPhi', title=
'jFex EM Global #phi;#phi;Counts',
315 type=
'TH1F', path=developerPath+
'jEM/',xbins=67,xmin=-1,xmax=65)
317 helper.defineHistogram(
'jEM_GlobalEta,jEM_GlobalPhi;h_jEM_GlobalEtaPhiMap', title=
"jFex EM Global #eta vs #phi;(int) #eta; (int) #phi",
319 type=
'TH2F',path=developerPath+
'jEM/', xbins=100,xmin=-50,xmax=50,ybins=67,ymin=-1,ymax=65)
321 helper.defineHistogram(
'jXE_X;h_jXE_X', title=
'jFex MET X component (tobEx);tobEx [200 MeV Scale];Counts',
323 type=
'TH1I', path=developerPath+
'jXE/',xbins=1000,xmin=-500,xmax=500)
325 helper.defineHistogram(
'jXE_Y;h_jXE_Y', title=
'jFex MET Y component (tobEy);tobEy [200 MeV Scale];Counts',
327 type=
'TH1I', path=developerPath+
'jXE/',xbins=1000,xmin=-500,xmax=500)
329 helper.defineHistogram(
'jXE_MET;h_jXE_MET', title=
'jFex MET ;Total jXE [200 MeV Scale];Counts',
331 type=
'TH1F', path=developerPath+
'jXE/',xbins=500,xmin=0,xmax=1000)
333 helper.defineHistogram(
'jXE_phi;h_jXE_phi', title=
'jFex MET phi ;#phi=atan(Ey/Ex) values;Counts',
335 type=
'TH1F', path=developerPath+
'jXE/',xbins=66,xmin=-math.pi,xmax=math.pi)
339 helper.defineHistogram(
'jTE_low;h_jTE_low', title=
'jFex SumEt low #eta;tob Et_lower [200 MeV Scale];Counts',
341 type=
'TH1I', path=developerPath+
'jTE/',xbins=700,xmin=0,xmax=700)
343 helper.defineHistogram(
'jTE_high;h_jTE_high', title=
'jFex SumEt high #eta;tob Et_upper [200 MeV Scale];Counts',
345 type=
'TH1I', path=developerPath+
'jTE/',xbins=700,xmin=0,xmax=700)
347 helper.defineHistogram(
'jTE_SumEt;h_jTE_SumEt', title=
'jFex SumEt total ;Total jTE [200 MeV Scale];Counts',
349 type=
'TH1F', path=developerPath+
'jTE/',xbins=1000,xmin=0,xmax=4000)
352 acc = helper.result()
357 if __name__==
'__main__':
359 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
363 parser = argparse.ArgumentParser(prog=
'python -m TrigT1CaloMonitoring.JfexMonitorAlgorithm',
364 description=
"""Used to run jFEX Monitoring\n\n
365 Example: python -m TrigT1CaloMonitoring.JfexMonitorAlgorithm --filesInput file.root --skipEvents 0 --evtMax 100""")
367 parser.add_argument(
'--evtMax',type=int,default=-1,help=
"number of events")
368 parser.add_argument(
'--filesInput',nargs=
'+',help=
"input files",required=
True)
369 parser.add_argument(
'--skipEvents',type=int,default=0,help=
"number of events to skip")
370 args = parser.parse_args()
374 flags.Input.Files = [file
for x
in args.filesInput
for file
in glob.glob(x)]
375 flags.Output.HISTFileName =
'jFexTOB_Monitoring.root'
377 flags.Exec.MaxEvents = args.evtMax
378 flags.Exec.SkipEvents = args.skipEvents
383 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
384 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
389 cfg.merge(JfexMonitorCfg)