ATLAS Offline Software
Loading...
Searching...
No Matches
MDTMonitorAlgorithm.py
Go to the documentation of this file.
2#Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3#
4
5from AthenaConfiguration.ComponentFactory import CompFactory
6from AthenaConfiguration.Enums import LHCPeriod
7from MdtRawDataMonitoring.MdtMonUtils import getMDTLabel, getMDTLabelx
8from MdtRawDataMonitoring.MDTTubeMax import tubeMax, tubeMax_smdt
9from MdtRawDataMonitoring.MDTChambers import mdtBA,mdtBC,mdtEA,mdtEC
10
11
12def MdtMonitoringConfig(inputFlags):
13 '''Function to configures some algorithms in the monitoring system.'''
14
15
18 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
19 result = ComponentAccumulator()
20
21 # Make sure muon geometry is configured
22 from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
23 result.merge(MuonGeoModelCfg(inputFlags))
24
25 # Fixup for R21 ESD
26 from MuonConfig.MuonSegmentNameFixConfig import MuonSegmentNameFixCfg
27 result.merge(MuonSegmentNameFixCfg(inputFlags))
28
29 # The following class will make a sequence, configure algorithms, and link
30 # them to GenericMonitoringTools
31 from AthenaMonitoring import AthMonitorCfgHelper
32 helper = AthMonitorCfgHelper(inputFlags,'MdtAthMonitorCfg')
33
34
40 mdtMonAlg = helper.addAlgorithm(CompFactory.MdtRawDataMonAlg,'MdtMonAlg')
41 mdtMonAlg.DoMdtEsd = True
42 mdtMonAlg.DoChamberHist=True
43 mdtMonAlg.maskNoisyTubes = True
44 mdtMonAlg.ADCCut = 80.
45 mdtMonAlg.do_mdtChamberHits=True
46 mdtMonAlg.do_mdttdccut_sector=True
47 mdtMonAlg.do_mdtchamberstatphislice=True
48 if (inputFlags.GeoModel.Run == LHCPeriod.Run3):
49 mdtMonAlg.do_Run3Geometry=True
50
51
52 if inputFlags.Input.Release and inputFlags.Input.Release.find("21.") != -1:
53 mdtMonAlg.SegmentKey = [ "TrackMuonSegments"]
54
55 if not inputFlags.DQ.triggerDataAvailable:
56 mdtMonAlg.L1RoiKey=''
57 # Add a generic monitoring tool (a "group" in old language). The returned
58 # object here is the standard GenericMonitoringTool.
59 mdtGroup = helper.addGroup(mdtMonAlg,'MdtMonitor','Muon/MuonRawDataMonitoring/MDT/')
60
61 # Add a GMT for the other example monitor algorithm
62
64
65 mdtGroup.defineHistogram('run3geo;GeometryFlag', type='TH1F', cutmask='firstEvent',
66 title='GeometryFlag;flag;',
67 path='Overview', xbins=5, xmin=0., xmax=5)
68
69 mdtGroup.defineHistogram('mdt_tube_z_barrel,mdt_tube_perp_barrel;Number_of_BarrelMDTHits_inRZView_Global_ADCCut', type='TH2F',
70 title='Number_of_BarrelMDTHits_inRZView_Global_ADCCut;MDT-GlobalZ(mm);MDT-GlobalR(mm)',
71 path='Overview/Expert/Geometry', xbins=250,xmin=-25000.,xmax=25000., ybins=120, ymin=0., ymax=12000.
72 )
73
74 mdtGroup.defineHistogram('mdt_tube_x_barrel,mdt_tube_y_barrel;Number_of_BarrelMDTHits_inXYView_Global_ADCCut', type='TH2F',
75 title='Number_of_BarrelMDTHits_inXYView_Global_ADCCut;MDT-GlobalX(mm);MDT-GlobalY(mm)',
76 path='Overview/Expert/Geometry', xbins=150, xmin=-15000., xmax=15000., ybins=150, ymin=-15000., ymax=15000.
77 )
78
79 mdtGroup.defineHistogram('mdt_tube_z_ovl,mdt_tube_perp_ovl;Number_of_OverlapMDTHits_inRZView_Global_ADCCut', type='TH2F',
80 title='Number_of_OverlapMDTHits_inRZView_Global_ADCCut;MDT-GlobalZ(mm);MDT-GlobalR(mm)',
81 path='Overview/Expert/Geometry', xbins=250,xmin=-25000.,xmax=25000., ybins=120, ymin=0., ymax=12000.
82 )
83
84 mdtGroup.defineHistogram('mdt_tube_x_ovl,mdt_tube_y_ovl;Number_of_OverlapMDTHits_inXYView_Global_ADCCut', type='TH2F',
85 title='Number_of_OverlapMDTHits_inXYView_Global_ADCCut;MDT-GlobalX(mm);MDT-GlobalY(mm)',
86 path='Overview/Expert/Geometry', xbins=150, xmin=-15000., xmax=15000., ybins=150, ymin=-15000., ymax=15000.
87 )
88
89 mdtGroup.defineHistogram('mdt_tube_z_endcap,mdt_tube_perp_endcap;Number_of_EndcapMDTHits_inRZView_Global_ADCCut', type='TH2F',
90 title='Number_of_EndcapMDTHits_inRZView_Global_ADCCut;MDT-GlobalZ(mm);MDT-GlobalR(mm)',
91 path='Overview/Expert/Geometry', xbins=250,xmin=-25000.,xmax=25000., ybins=120, ymin=0., ymax=12000.
92 )
93
94 mdtGroup.defineHistogram('mdt_tube_x_endcap,mdt_tube_y_endcap;Number_of_EndcapMDTHits_inXYView_Global_ADCCut', type='TH2F',
95 title='Number_of_EndcapMDTHits_inXYView_Global_ADCCut;MDT-GlobalX(mm);MDT-GlobalY(mm)',
96 path='Overview/Expert/Geometry', xbins=150, xmin=-15000., xmax=15000., ybins=150, ymin=-15000., ymax=15000.
97 )
98
99 mdtGroup.defineHistogram('tdc_mon,adc_mon;Overall_TDCADC_spectrum', type='TH2F',
100 title='Overall_TDCADC_spectrum;[nsec];[adc counts]',
101 path='Overview', xbins=50, xmin=0., xmax=2000., ybins=20, ymin=0., ymax=400.
102 )
103
104 labels_allSec=list()
105 for phi in range(0, 16):
106 sectPhi=str(phi+1)
107 if phi+1 < 10:
108 sectPhi="0"+sectPhi
109
110 if mdtMonAlg.do_Run3Geometry :
111 thisLabelx=getMDTLabelx("run3_labels_sectorPhi"+sectPhi)
112 else:
113 thisLabelx=getMDTLabelx("labels_sectorPhi"+sectPhi)
114 labels_allSec=labels_allSec+thisLabelx
115 title="MDTHitsOccup_ADCCut_Sector"+sectPhi
116 maxbin=len(thisLabelx)
117 nbins=maxbin
118 mdtGroup.defineHistogram('hits_phi_'+sectPhi+';'+title, type='TH1F',
119 title=title+';;Number of hits',
120 path='Overview/HitOccupancies_Sectors', xbins=nbins, xmin=0., xmax=maxbin, xlabels=thisLabelx
121 )
122 maxbin=len(labels_allSec)
123 nbins=maxbin
124 mdtGroup.defineHistogram('hits_allphi;Number_of_MDT_hits_per_chamber_ADCCut', type='TH1F',
125 title='Number_of_MDT_hits_per_chamber_ADCCut;;Number of hits',
126 path='Overview', xbins=nbins, xmin=0., xmax=maxbin, xlabels=labels_allSec
127 )
128
129 mdtGroup.defineHistogram('adc_mon_nosel;Overall_ADC_spectrum', type='TH1F',
130 title='Overall_ADC_spectrum;[adc counts];Number of Entries',
131 path='Overview', xbins=100, xmin=0., xmax=400.
132 )
133
134 mdtGroup.defineHistogram('adc_mon_nosel;Overall_ADC_spectrum_NoiseBursts', type='TH1F',
135 cutmask='noiseBurst',
136 title='Overall_ADC_spectrum_NoiseBursts;[adc counts];Number of Entries',
137 path='Overview', xbins=100, xmin=0., xmax=400.
138 )
139
140
141 mdtGroup.defineHistogram('adc_segs_overall_mon;Overall_ADC_OnSegm_spectrum', type='TH1F',
142 title='Overall_ADC_spectrum;[adc counts];Number of Entries',
143 path='Overview', xbins=100, xmin=0., xmax=400.)
144
145
146 mdtGroup.defineHistogram('tdc_mon_nosel,adc_mon_nosel;Overall_TDCADC_spectrum_NoiseBursts', type='TH2F',
147 cutmask='noiseBurst',
148 title='Overall_TDCADC_spectrum_NoiseBursts;[nsec];[adc counts]',
149 path='Overview', xbins=50, xmin=0., xmax=2000., ybins=20, ymin=0., ymax=400.
150 )
151
152 mdtGroup.defineHistogram('tdc_mon_nosel;Overall_TDC_spectrum_NoiseBursts', type='TH1F',
153 cutmask='noiseBurst',
154 title='Overall_TDC_spectrum_NoiseBursts;[nsec];Number of Entries',
155 path='Overview', xbins=120, xmin=0., xmax=2000.
156 )
157
158
159 mdtGroup.defineHistogram('tdc_mon_noiseBurst_adcCut;Overall_TDC_spectrum_NoiseBursts_ADCCut', type='TH1F',
160 title='Overall_TDC_spectrum_NoiseBursts_ADCCut;[nsec];Number of Entries',
161 path='Overview', xbins=120, xmin=0., xmax=2000.
162 )
163
164 mdtGroup.defineHistogram('tdc_mon_adcCut;Overall_TDC_ADCCUT_spectrum', type='TH1F',
165 title='Overall_TDC_spectrum_ADCCut;[nsec];Number of Entries',
166 path='Overview', xbins=120, xmin=0., xmax=2000.
167 )
168
169 mdtGroup.defineHistogram('tdc_segs_overall_mon;Overall_TDC_onSegm_ADCCut_spectrum', type='TH1F',
170 title='Overall_TDC_onSegm_ADCCut_spectrum;[nsec];Number of Entries',
171 path='Overview', xbins=120, xmin=0., xmax=2000.
172 )
173
174 mdtGroup.defineHistogram('nHighOccChambers_mon;number_of_Chambers_with_high_occupancy_per_event', type='TH1F',
175 title='number_of_Chambers_with_high_occupancy_per_event;[Number_of_MDT_chambers_with_high_occupancy];Number of Entries',
176 path='Overview', xbins=200, xmin=0., xmax=800.
177 )
178 mdtGroup.defineHistogram('nPrd_mon,Nhitsrpc_mon;MdtNHitsvsRpcNHits', type='TH2F',
179 title='MdtNHitsvsRpcNHits;[Number of MDT hits];[Number of RPC hits]',
180 path='Overview', xbins=1000, xmin=0., xmax=100000., ybins=100, ymin=0., ymax=10000.
181 )
182 mdtGroup.defineHistogram('nPrdcut_mon;TotalNumber_of_MDT_hits_per_event_ADCCut', type='TH1F',
183 title='TotalNumber_of_MDT_hits_per_event_ADCCut;[counts];Number of Event',
184 path='Overview', xbins=400, xmin=0., xmax=10000.
185 )
186
187 mdtGroup.defineHistogram('nPrdcut_mon;TotalNumber_of_MDT_hits_per_event_ADCCut_big', type='TH1F',
188 title='TotalNumber_of_MDT_hits_per_event_ADCCut_big;[counts];Number of Event',
189 path='Overview/Expert', xbins=200, xmin=0., xmax=100000.
190 )
191
192 mdtGroup.defineHistogram('nPrd_mon;TotalNumber_of_MDT_hits_per_event', type='TH1F',
193 title='TotalNumber_of_MDT_hits_per_event;[counts];Number of Event',
194 path='Overview', xbins=500, xmin=0., xmax=20000.
195 )
196
197 mdtGroup.defineHistogram('nPrd_mon;TotalNumber_of_MDT_hits_per_event_big', type='TH1F',
198 title='TotalNumber_of_MDT_hits_per_event_big;[counts];Number of Event',
199 path='Overview/Expert', xbins=200, xmin=0., xmax=100000.
200 )
201
202 mdtGroup.defineHistogram('nColl_mon;number_of_Chambers_with_hits_per_event', type='TH1F',
203 title='number_of_Chambers_with_hits_per_event;[Number_of_MDT_chambers_with_hits];Number of Entries',
204 path='Overview/Expert', xbins=400, xmin=0., xmax=1600.
205 )
206
207 mdtGroup.defineHistogram('nColl_ADCCut_mon;number_of_Chambers_with_hits_per_event_ADCCut', type='TH1F',
208 title='number_of_Chambers_with_hits_per_event_ADCCut;[Number_of_MDT_chambers_with_hits];Number of Entries',
209 path='Overview/Expert', xbins=400, xmin=0., xmax=1600.
210 )
211
212 bigRegions = ["Barrel","EndCap"]
213 regions = ["BA","BC","EA","EC"]
214 layers = ["Inner","Middle","Outer","Extra"]
215 crates = ["01","02","03","04"]
216
217 for iregion in bigRegions:
218 theTitle = "NumberOfHitsIn"+iregion+"PerChamber_ADCCut_forpp"
219 theTitle_noise = "NumberOfHitsIn"+iregion+"PerChamber_ADCCutt_NoiseBurst"
220 theTitle_segs = "NumberOfHitsIn"+iregion+"PerChamber_onSegms_ADCCut_forpp"
221 theTitle_eff = "effsIn"+iregion+"PerChamber_ADCCut"
222 thisLabelx,thisLabely=getMDTLabel(theTitle+"_labelx",theTitle+"_labely")
223 if iregion=="Barrel":
224 etamin=-8.
225 etamax=9.
226 etabins=17
227 phimin=0.
228 phimax=58. #as defined in binMdtGlobal() c++ function
229 phibins=58
230 hits="x_mon_barrel,y_mon_barrel;"
231 hits_noise="x_mon_barrel_noise,y_mon_barrel_noise;"
232 hits_segs="x_segs_mon_barrel,y_segs_mon_barrel;"
233 hits_eff="x_eff_mon_barrel,y_eff_mon_barrel;"
234 if iregion=="EndCap":
235 etamin=-6.
236 etamax=6.
237 etabins=12
238 phimin=0.
239 phimax=64. #as defined in binMdtGlobal() c++ function
240 phibins=64
241 hits="x_mon_endcap,y_mon_endcap;"
242 hits_noise="x_mon_endcap_noise,y_mon_endcap_noise;"
243 hits_segs="x_segs_mon_endcap,y_segs_mon_endcap;"
244 hits_eff="x_eff_mon_endcap,y_eff_mon_endcap;"
245
246 mdtGroup.defineHistogram(hits+theTitle, type='TH2F', title=theTitle+";Eta;LayerPhi", path='Overview',
247 xbins=etabins, xmin=etamin, xmax=etamax, ybins=phibins, ymin=phimin, ymax=phimax, xlabels=thisLabelx, ylabels=thisLabely)
248
249 mdtGroup.defineHistogram(hits_noise+theTitle_noise, type='TH2F', title=theTitle_noise+";Eta;LayerPhi", path='Overview',
250 xbins=etabins, xmin=etamin, xmax=etamax, ybins=phibins, ymin=phimin, ymax=phimax, xlabels=thisLabelx, ylabels=thisLabely)
251
252 mdtGroup.defineHistogram(hits_segs+theTitle_segs, type='TH2F', title=theTitle_segs+";Eta;LayerPhi", path='Overview/Expert/RecoMonitoring',
253 xbins=etabins, xmin=etamin, xmax=etamax, ybins=phibins, ymin=phimin, ymax=phimax, xlabels=thisLabelx, ylabels=thisLabely)
254
255 mdtGroup.defineHistogram(hits_eff+theTitle_eff, type='TH2F', title=theTitle_eff+";Eta;LayerPhi", path='Overview/Expert/RecoMonitoring',
256 xbins=etabins, xmin=etamin, xmax=etamax, ybins=phibins, ymin=phimin, ymax=phimax, xlabels=thisLabelx, ylabels=thisLabely)
257
258
259
260 for ilayer in layers:
261 if(ilayer=="Extra"):
262 continue
263 hits="x_mon_"+ilayer+",y_mon_"+ilayer+";"
264 theTitle = "NumberOfHitsInMDT"+ilayer+"_ADCCut"
265 thisLabelx,thisLabely=getMDTLabel(theTitle+"_labelx",theTitle+"_labely")
266 if(ilayer=="Inner"):
267 etabins=38
268 phibins=36
269 if(ilayer=="Middle"):
270 etabins=24
271 phibins=32
272 if(ilayer=="Outer"):
273 etabins=31
274 phibins=32
275 mdtGroup.defineHistogram(hits+theTitle, type='TH2F', title=theTitle+";Eta station;Phi station", path='Overview',
276 xbins=etabins, xmin=0, xmax=etabins, ybins=phibins, ymin=0, ymax=phibins, xlabels=thisLabelx, ylabels=thisLabely)
277
278
279
280 phimax = 16
281 for iregion in regions:
282 MDT_regionGroup="MDT_regionGroup{0}".format(iregion)
283 mdtRegionGroup=helper.addGroup(mdtMonAlg, MDT_regionGroup, "Muon/MuonRawDataMonitoring/MDT/MDT"+iregion)
284 MDT_regionGroup_bycrate="MDT_regionGroup_bycrate{0}".format(iregion)
285 mdtRegionGroup_bycrate=helper.addGroup(mdtMonAlg, MDT_regionGroup_bycrate, "Muon/MuonRawDataMonitoring/MDT/MDT"+iregion)
286
287 #histograms from segments
288
289 title_ADC_segs_spectrum="MDTADC_segm_Summary_"+iregion
290 mdtRegionGroup.defineHistogram("adc_segs_mon;"+title_ADC_segs_spectrum, title=title_ADC_segs_spectrum+";[adc counts];Number of Entries", type='TH1F',
291 path='Overview', xbins=100, xmin=0.5, xmax=400.5)
292
293 title_TDCADC_spectrum="Overall_TDCADC_spectrum_"+iregion
294 title_TDCADC_spectrum_noiseBurst="Overall_TDCADC_spectrum_"+iregion+"_NoiseBurst"
295 mdtRegionGroup.defineHistogram("tdc_mon,adc_mon;"+title_TDCADC_spectrum, title=title_TDCADC_spectrum+";[nsec];[adc counts]", type='TH2F',
296 path='Overview', xbins=50, xmin=0., xmax=2000., ybins=20, ymin=0., ymax=400.)
297 mdtRegionGroup.defineHistogram("tdc_mon_nb2,adc_mon_nb2;"+title_TDCADC_spectrum_noiseBurst, title=title_TDCADC_spectrum_noiseBurst+";[nsec];[adc counts]",
298 type='TH2F', path='Overview', xbins=50, xmin=0., xmax=2000., ybins=20, ymin=0., ymax=400.)
299 title_ADCSummaryRegion="MDTADC_Summary_"+iregion
300 mdtRegionGroup.defineHistogram("adc_mon;"+title_ADCSummaryRegion, type='TH1F',
301 title=title_ADCSummaryRegion+";[adc counts];Number of Entries",
302 path='Overview', xbins=100, xmin=0., xmax=400.)
303
304 title_ADCSummaryRegion="MDTADC_Summary_ADCCUT_"+iregion
305 mdtRegionGroup.defineHistogram("adc_mon_adccut;"+title_ADCSummaryRegion, type='TH1F',
306 title=title_ADCSummaryRegion+";[adc counts];Number of Entries",
307 path='Overview', xbins=100, xmin=0., xmax=400.)
308
309 title_TDCSummaryRegion="MDTTDC_Summary_ADCCut_"+iregion
310 mdtRegionGroup.defineHistogram("tdc_mon_adccut;"+title_TDCSummaryRegion, type='TH1F',
311 title=title_TDCSummaryRegion+";[nsec];Number of Entries",
312 path='Overview', xbins=120, xmin=0., xmax=2000.)
313
314 title_TDCSummaryRegion_segs="MDTTDC_segm_Summary_ADCCut_"+iregion
315 mdtRegionGroup.defineHistogram("tdc_segs_region_mon;"+title_TDCSummaryRegion_segs, type='TH1F',
316 title=title_TDCSummaryRegion_segs+";[nsec];Number of Entries",
317 path='Overview', xbins=120, xmin=0., xmax=2000.)
318
319 title_TDC_NoiseBursts = "MDTTDC_NoiseBursts_"+iregion
320 mdtRegionGroup.defineHistogram("tdc_mon_nb1;"+title_TDC_NoiseBursts, type='TH1F',
321 title=title_TDC_NoiseBursts+";[nsec];Number of Entries",
322 path='Overview', xbins=120, xmin=0., xmax=2000.)
323
324 title_TDC_NoiseBursts = "MDTTDC_NoiseBursts_ADCCUT_"+iregion
325 mdtRegionGroup.defineHistogram("tdc_mon_nb3;"+title_TDC_NoiseBursts, type='TH1F',
326 title=title_TDC_NoiseBursts+";[nsec];Number of Entries",
327 path='Overview', xbins=120, xmin=0., xmax=2000.)
328
329 title_ADC_NoiseBursts = "MDTADC_NoiseBursts_"+iregion
330 mdtRegionGroup.defineHistogram("adc_mon_nb1;"+title_ADC_NoiseBursts, type='TH1F',
331 title=title_ADC_NoiseBursts+";[adc counts];Number of Entries",
332 path='Overview', xbins=100, xmin=0., xmax=400.)
333
334 title_TDC_RPCtrig = "MDTTDC_Summary_ADCCut_"+iregion+"_RPC"
335 mdtRegionGroup.defineHistogram("tdc_mon_rpc;"+title_TDC_RPCtrig, type='TH1F',
336 title=title_TDC_RPCtrig+";[nsec];Number of Entries",
337 path='Overview', xbins=120, xmin=0., xmax=2000.)
338
339 title_TDC_TGCtrig = "MDTTDC_Summary_ADCCut_"+iregion+"_TGC"
340 mdtRegionGroup.defineHistogram("tdc_mon_tgc;"+title_TDC_TGCtrig, type='TH1F',
341 title=title_TDC_TGCtrig+";[nsec];Number of Entries",
342 path='Overview', xbins=120, xmin=0., xmax=2000.)
343
344 for ilayer in layers:
345 title_MDTNumberOfHitsPerML="NumberOfHitsIn"+iregion+ilayer+"PerMultiLayer_ADCCut_forpp"
346 thisLabelx,thisLabely=getMDTLabel(title_MDTNumberOfHitsPerML+"_labelx",title_MDTNumberOfHitsPerML+"_labely")
347 phimaxML=phimax*2
348 if (iregion=="BA" or iregion=="BC") and ilayer=="Extra": phimaxML=phimax//2
349 if (iregion=="BA" or iregion=="BC") and ilayer=="Inner": phimaxML=phimax*2+4
350 etamax=2 #extra layer
351 if (iregion=="BA" or iregion=="BC") and ilayer=="Inner": etamax=8
352 if (iregion=="BA" or iregion=="BC") and ilayer=="Middle": etamax=6
353 if iregion=="BA" and ilayer=="Outer": etamax=9
354 if iregion=="BC" and ilayer=="Outer": etamax=8
355 if (iregion=="EA" or iregion=="EC") and ilayer=="Inner": etamax=5
356 if (iregion=="EA" or iregion=="EC") and ilayer=="Middle": etamax=5
357 if (iregion=="EA" or iregion=="EC") and ilayer=="Outer": etamax=6
358 var="x_mon_"+iregion+"_"+ilayer+",y_mon_"+iregion+"_"+ilayer+";"
359 mdtRegionGroup.defineHistogram(var+title_MDTNumberOfHitsPerML, title=title_MDTNumberOfHitsPerML+";[Eta];[Phi - Multilayer]", type='TH2F',
360 path='Overview', xbins=etamax, xmin=0, xmax=etamax, ybins=phimaxML, ymin=0., ymax=phimaxML, xlabels=thisLabelx, ylabels=thisLabely)
361
362 for phi in range(1, phimax+1):
363 if not (mdtMonAlg.do_Run3Geometry and (iregion=="EA" or iregion=="EC") and (phi%2==0)):
364 if not ((iregion=="BA" or iregion=="BC") and ilayer=="Extra" and (phi%2!=0)):
365 var="stEta_"+iregion+"_"+ilayer+"_phi"+str(phi)+";"
366 title_MDTHitSummary="MDTHits_ADCCut_"+iregion+"_"+ilayer+"_StPhi"+str(phi)
367
368 max=7
369 if ilayer=="Inner" and (iregion=="BA" or iregion=="BC"):
370 max=11
371
372 mdtRegionGroup.defineHistogram(var+title_MDTHitSummary, title=title_MDTHitSummary+";StationEta;Number of Entries", type='TH1F',
373 path='Overview/Hits', xbins=max-1, xmin=1., xmax=max)
374
375
376 vartdc="tdc_segs_"+iregion+"_"+ilayer+"_phi"+str(phi)+";"
377 title_MDTTDCSummary="MDTTDC_ADCCut_"+iregion+"_"+ilayer+"_StPhi"+str(phi)
378 mdtRegionGroup.defineHistogram(vartdc+title_MDTTDCSummary, title=title_MDTTDCSummary+";[nsec];Number of Entries", type='TH1F',
379 path='Overview/TDC', xbins=100, xmin=0, xmax=2000)
380
381
382 if(ilayer=="Outer"):
383 labelsY=getMDTLabelx("labelY_OccupancyVsLB_"+iregion+"_OuterExtra")
384 titleOccvsLbPerRegionPerLayer = "OccupancyVsLB_"+iregion+"OuterPlusExtra"
385 var="lb_mon,y_mon_bin_"+iregion+"_OuterPlusExtra;"+titleOccvsLbPerRegionPerLayer
386 if(iregion=="BA"):
387 maxy=118 # outer sideA
388 if(iregion=="BC"):
389 maxy=116 # outer sideC
390 if(iregion=="EA"):
391 maxy=103 # outer sideA
392 if(iregion=="EC"):
393 maxy=127 # outer sideA
394 elif(ilayer=="Middle" or ilayer=="Inner"):
395 labelsY=getMDTLabelx("labelY_OccupancyVsLB_"+iregion+"_"+ilayer)
396 titleOccvsLbPerRegionPerLayer = "OccupancyVsLB_"+iregion+ilayer
397 var="lb_mon,y_mon_bin_"+iregion+"_"+ilayer+";"+titleOccvsLbPerRegionPerLayer
398 if(ilayer=="Inner"):
399 if(iregion=="BA" or iregion=="BC"):
400 maxy=122
401 if (mdtMonAlg.do_Run3Geometry and iregion=="BA"):
402 labelsY=getMDTLabelx("run3_labelY_OccupancyVsLB_"+iregion+"_"+ilayer)
403 maxy=114
404 if(iregion=="EA" or iregion=="EC"):
405 maxy=50
406 if (mdtMonAlg.do_Run3Geometry):
407 maxy=10
408 labelsY=getMDTLabelx("run3_labelY_OccupancyVsLB_"+iregion+"_"+ilayer)
409 elif (ilayer=="Middle"):
410 if(iregion=="BA" or iregion=="BC"):
411 maxy=95
412 if(iregion=="EA" or iregion=="EC"):
413 maxy=80
414
415 if ilayer != 'Extra':
416 mdtRegionGroup.defineHistogram(var, title=titleOccvsLbPerRegionPerLayer+";LB;[Eta - Phi]", type='TH2F',
417 path='Overview', xbins=834, xmin=1, xmax=2502, ybins=maxy, ymin=0, ymax=maxy, ylabels=labelsY, opt='kAddBinsDynamically', merge='merge')
418
419 for icrate in crates:
420 maxy=122
421 labelsY=getMDTLabelx("labelY_OccupancyVsLB_"+iregion+icrate)
422 if(iregion=="BA" or iregion=="BC"):
423 if(icrate=="01"):
424 maxy=73
425 elif(icrate=="02"):
426 maxy=72
427 elif(icrate=="03"):
428 maxy= 80
429 elif(icrate=="04"):
430 maxy= 79
431 if(iregion=="BA"):
432 maxy= 80
433 elif(iregion=="EA" or iregion=="EC"):
434 if mdtMonAlg.do_Run3Geometry:
435 labelsY=getMDTLabelx("run3_labelY_OccupancyVsLB_"+iregion+icrate)
436 if(icrate=="01"):
437 maxy=73
438 if(mdtMonAlg.do_Run3Geometry and iregion=="EA"):
439 maxy=61
440 if(mdtMonAlg.do_Run3Geometry and iregion=="EC"):
441 maxy=63
442 elif(icrate=="02"):
443 maxy=71
444 if(mdtMonAlg.do_Run3Geometry and iregion=="EA"):
445 maxy=59
446 if(mdtMonAlg.do_Run3Geometry and iregion=="EC"):
447 maxy=61
448 elif(icrate=="03"):
449 maxy= 73
450 if(mdtMonAlg.do_Run3Geometry and iregion=="EA"):
451 maxy=61
452 if(mdtMonAlg.do_Run3Geometry and iregion=="EC"):
453 maxy=63
454 elif(icrate=="04"):
455 maxy= 72
456 if(mdtMonAlg.do_Run3Geometry and iregion=="EA"):
457 maxy=60
458 if(mdtMonAlg.do_Run3Geometry and iregion=="EC"):
459 maxy=62
460
461 titleOccvsLbPerRegionPerCrate = "OccupancyVsLB_"+iregion+icrate
462 var="lb_mon,y_mon_bin_bycrate_"+iregion+"_"+icrate+";"+titleOccvsLbPerRegionPerCrate
463 mdtRegionGroup_bycrate.defineHistogram(var, type='TH2F', title=titleOccvsLbPerRegionPerCrate+";LB;[Eta-Phi]",
464 path='Overview', xbins=33, xmin=-0.5, xmax=98.5, ybins=maxy, ymin=0, ymax=maxy, ylabels=labelsY, opt='kAddBinsDynamically', merge='merge')
465
466 titleOccvsLbPerRegionPerCrate_ontrack = "OccupancyVsLB_ontrack_"+iregion+icrate
467 var="lb_mon,y_mon_bin_bycrate_ontrack_"+iregion+"_"+icrate+";"+titleOccvsLbPerRegionPerCrate_ontrack
468 mdtRegionGroup_bycrate.defineHistogram(var, title=titleOccvsLbPerRegionPerCrate_ontrack+";LB;[Eta - Phi]", type='TH2F',
469 path='Overview', xbins=33, xmin=-0.5, xmax=98.5, ybins=maxy, ymin=0, ymax=maxy, ylabels=labelsY, opt='kAddBinsDynamically', merge='merge')
470
471 labelsY=getMDTLabelx("labelY_OccupancyVsLB")
472 mdtGroup.defineHistogram('lb_mon,sector;OccupancyPerSectorVsLB', type='TH2F',
473 title='OccupancyPerSectorVsLB;LB;[Phi]',
474 path='Overview', xbins=33, xmin= -0.5, xmax=98.5, ybins=64, ymin=0., ymax=64., ylabels=labelsY, opt='kAddBinsDynamically', merge='merge')
475
476
477 #histograms per chambers
478 mdtPerChamberBAGroup=helper.addGroup(mdtMonAlg,"MdtMonPerChamberBA", "Muon/MuonRawDataMonitoring/MDT/MDTBA/Chambers")
479 for ch in mdtBA:
480 title_mdttdc= ch+"_MDT_Station_TDC"
481 var="tdc_perch_"+ch+";"+title_mdttdc
482 mdtPerChamberBAGroup.defineHistogram(var, title=title_mdttdc+";[nsec];Number of Entries",
483 type='TH1F', path=ch, xbins=100, xmin=0., xmax=2000.)
484 title_mdttdc_ml1_adccut=ch+"_MDT_Station_TDC_ML1_ADCCut"
485 var="tdc_perch_"+ch+";"+title_mdttdc_ml1_adccut
486 mdtPerChamberBAGroup.defineHistogram(var, title=title_mdttdc_ml1_adccut+";[nsec];Number of Entries",
487 cutmask='ml1_adccut',
488 type='TH1F', path=ch, xbins=100, xmin=0., xmax=2000.)
489 title_mdttdc_ml2_adccut=ch+"_MDT_Station_TDC_ML2_ADCCut"
490 var="tdc_perch_"+ch+";"+title_mdttdc_ml2_adccut
491 mdtPerChamberBAGroup.defineHistogram(var, title=title_mdttdc_ml2_adccut+";[nsec];Number of Entries",
492 cutmask='ml2_adccut',
493 type='TH1F', path=ch, xbins=100, xmin=0., xmax=2000.)
494 title_mdtadc= ch+"_MDT_Station_ADC"
495 var="adc_perch_"+ch+";"+title_mdtadc
496 mdtPerChamberBAGroup.defineHistogram(var, type='TH1F',
497 title=title_mdtadc+";[adc counts];Number of Entries",
498 path=ch, xbins=100, xmin=0., xmax=400.)
499
500 title_mdtadc_segs_ml1= ch+"_MDT_Station_ADC_onSegm_ML1"
501 var="adc_segs_perch_"+ch+";"+title_mdtadc_segs_ml1
502 mdtPerChamberBAGroup.defineHistogram(var, type='TH1F',
503 cutmask='adc_ml1',
504 title=title_mdtadc_segs_ml1+";[adc counts];Number of Entries",
505 path=ch, xbins=100, xmin=0., xmax=400.)
506 title_mdtadc_segs_ml2= ch+"_MDT_Station_ADC_onSegm_ML2"
507 var="adc_segs_perch_"+ch+";"+title_mdtadc_segs_ml2
508 mdtPerChamberBAGroup.defineHistogram(var, type='TH1F',
509 cutmask='adc_ml2',
510 title=title_mdtadc_segs_ml2+";[adc counts];Number of Entries",
511 path=ch, xbins=100, xmin=0., xmax=400.)
512
513 title_mdtdcadc= ch+"_MDT_Station_TDCADC"
514 var="tdc_perch_"+ch+",adc_perch_"+ch+";"+title_mdtdcadc
515 mdtPerChamberBAGroup.defineHistogram(var, type='TH2F',
516 title=title_mdtdcadc+';[nsec];[adc counts]',
517 path=ch, xbins=50, xmin=0., xmax=2000., ybins=20, ymin=0., ymax=400.)
518
519
520 title_mdtlayer= ch+"_MDT_Station_LAYER_ADCCut"
521 var="layer_perch_"+ch+";"+title_mdtlayer
522 mdtPerChamberBAGroup.defineHistogram(var, type='TH1F',
523 cutmask='adccut_nonoise',
524 title=title_mdtlayer+";layerID;Number of Entries",
525 path=ch, xbins=10, xmin=0., xmax=10.)
526
527 title_mdttube= ch+"_MDT_Station_TUBE_ADCCut"
528 var="tube_perch_"+ch+";"+title_mdttube
529 binmax=tubeMax[ch]
530 if mdtMonAlg.do_Run3Geometry and ch[0:5]=="BIS7A":
531 binmax=tubeMax_smdt[ch]
532 mdtPerChamberBAGroup.defineHistogram(var, type='TH1F',
533 cutmask='adccut',
534 title=title_mdttube+";tubeID;Number of Entries",
535 path=ch, xbins=binmax, xmin=1., xmax=binmax+1)
536
537 title_effentries=ch+"_MDT_Station_EFFENTRIES"
538 var="tube_perch_segs_"+ch+";"+title_effentries
539 mdtPerChamberBAGroup.defineHistogram(var, type='TH1F',
540 title=title_effentries+";tubeID;Number of Entries",
541 path=ch, xbins=binmax, xmin=1., xmax=binmax+1)
542
543 title_effcounts=ch+"_MDT_Station_EFFCOUNTS"
544 var="tube_perch_segs_"+ch+";"+title_effcounts
545 mdtPerChamberBAGroup.defineHistogram(var, type='TH1F',
546 cutmask='hitcut',
547 title=title_effcounts+";tubeID;Number of Entries",
548 path=ch, xbins=binmax, xmin=1., xmax=binmax+1)
549
550 title_eff=ch+"_MDT_Station_EFFPERTUBE"
551 var_eff="hitcut,tube_perch_segs_"+ch+";"+title_eff
552 mdtPerChamberBAGroup.defineHistogram(var_eff,
553 title=title_eff+";tubeID;Efficiency",
554 type='TEfficiency',
555 path=ch, xbins=binmax, xmin=1., xmax=binmax+1)
556
557
558
559 title_mdtmezz= ch+"_MDT_Station_MEZZ_ADCCut"
560 mdtPerChamberBAGroup.defineHistogram("mezz_perch_"+ch+";"+title_mdtmezz, type='TH1F',
561 title=title_mdtmezz+";mezzID;Number of Entries",
562 path=ch, xbins=20, xmin=0., xmax=20.)
563
564 mdtPerChamberBCGroup=helper.addGroup(mdtMonAlg, "MdtMonPerChamberBC", "Muon/MuonRawDataMonitoring/MDT/MDTBC/Chambers")
565 for ch in mdtBC:
566 title_mdttdc=ch+"_MDT_Station_TDC"
567 var="tdc_perch_"+ch+";"+title_mdttdc
568 mdtPerChamberBCGroup.defineHistogram(var, title=title_mdttdc+";[nsec];Number of Entries",
569 type='TH1F', path=ch, xbins=100, xmin=0., xmax=2000.)
570 title_mdttdc_ml1_adccut=ch+"_MDT_Station_TDC_ML1_ADCCut"
571 var="tdc_perch_"+ch+";"+title_mdttdc_ml1_adccut
572 mdtPerChamberBCGroup.defineHistogram(var, title=title_mdttdc_ml1_adccut+";[nsec];Number of Entries",
573 cutmask='ml1_adccut',
574 type='TH1F', path=ch, xbins=100, xmin=0., xmax=2000.)
575 title_mdttdc_ml2_adccut=ch+"_MDT_Station_TDC_ML2_ADCCut"
576 var="tdc_perch_"+ch+";"+title_mdttdc_ml2_adccut
577 mdtPerChamberBCGroup.defineHistogram(var, title=title_mdttdc_ml2_adccut+";[nsec];Number of Entries",
578 cutmask='ml2_adccut',
579 type='TH1F', path=ch, xbins=100, xmin=0., xmax=2000.)
580 title_mdtadc= ch+"_MDT_Station_ADC"
581 var="adc_perch_"+ch+";"+title_mdtadc
582 mdtPerChamberBCGroup.defineHistogram(var, title=title_mdtadc+";[adc counts];Number of Entries",
583 path=ch, xbins=100, xmin=0., xmax=400.)
584
585 title_mdtadc_segs_ml1= ch+"_MDT_Station_ADC_onSegm_ML1"
586 var="adc_segs_perch_"+ch+";"+title_mdtadc_segs_ml1
587 mdtPerChamberBCGroup.defineHistogram(var, type='TH1F',
588 cutmask='adc_ml1',
589 title=title_mdtadc_segs_ml1+";[adc counts];Number of Entries",
590 path=ch, xbins=100, xmin=0., xmax=400.)
591 title_mdtadc_segs_ml2= ch+"_MDT_Station_ADC_onSegm_ML2"
592 var="adc_segs_perch_"+ch+";"+title_mdtadc_segs_ml2
593 mdtPerChamberBCGroup.defineHistogram(var, type='TH1F',
594 cutmask='adc_ml2',
595 title=title_mdtadc_segs_ml2+";[adc counts];Number of Entries",
596 path=ch, xbins=100, xmin=0., xmax=400.)
597
598
599 title_mdtdcadc= ch+"_MDT_Station_TDCADC"
600 var="tdc_perch_"+ch+",adc_perch_"+ch+";"+title_mdtdcadc
601 mdtPerChamberBCGroup.defineHistogram(var, type='TH2F',
602 title=title_mdtdcadc+';[nsec];[adc counts]',
603 path=ch, xbins=50, xmin=0., xmax=2000., ybins=20, ymin=0., ymax=400.)
604 title_mdtlayer= ch+"_MDT_Station_LAYER_DCCut"
605 var="layer_perch_"+ch+";"+title_mdtlayer
606 mdtPerChamberBCGroup.defineHistogram(var, type='TH1F',
607 cutmask='adccut_nonoise',
608 title=title_mdtlayer+";layerID;Number of Entries",
609 path=ch, xbins=10, xmin=0., xmax=10.)
610 title_mdttube= ch+"_MDT_Station_TUBE_ADCCut"
611 var="tube_perch_"+ch+";"+title_mdttube
612 binmax=tubeMax[ch]
613 mdtPerChamberBCGroup.defineHistogram(var, type='TH1F',
614 cutmask='adccut',
615 title=title_mdttube+";tubeID;Number of Entries",
616 path=ch, xbins=binmax, xmin=1., xmax=binmax+1)
617
618 title_effentries=ch+"_MDT_Station_EFFENTRIES"
619 var="tube_perch_segs_"+ch+";"+title_effentries
620 mdtPerChamberBCGroup.defineHistogram(var, type='TH1F',
621 title=title_effentries+";tubeID;Number of Entries",
622 path=ch, xbins=binmax, xmin=1., xmax=binmax+1)
623
624 title_effcounts=ch+"_MDT_Station_EFFCOUNTS"
625 var="tube_perch_segs_"+ch+";"+title_effcounts
626 mdtPerChamberBCGroup.defineHistogram(var, type='TH1F',
627 cutmask='hitcut',
628 title=title_effcounts+";tubeID;Number of Entries",
629 path=ch, xbins=binmax, xmin=1., xmax=binmax+1)
630 title_eff=ch+"_MDT_Station_EFFPERTUBE"
631 var_eff="hitcut,tube_perch_segs_"+ch+";"+title_eff
632 mdtPerChamberBCGroup.defineHistogram(var_eff,
633 title=title_eff+";tubeID;Efficiency",
634 type='TEfficiency',
635 path=ch, xbins=binmax, xmin=1., xmax=binmax+1)
636
637 title_mdtmezz= ch+"_MDT_Station_MEZZ_ADCCut"
638 mdtPerChamberBCGroup.defineHistogram("mezz_perch_"+ch+";"+title_mdtmezz, type='TH1F',
639 title=title_mdtmezz+";mezzID;Number of Entries",
640 path=ch, xbins=20, xmin=0., xmax=20.)
641
642 mdtPerChamberEAGroup=helper.addGroup(mdtMonAlg, "MdtMonPerChamberEA", "Muon/MuonRawDataMonitoring/MDT/MDTEA/Chambers")
643 for ch in mdtEA:
644 title_mdttdc=ch+"_MDT_Station_TDC"
645 var="tdc_perch_"+ch+";"+title_mdttdc
646 mdtPerChamberEAGroup.defineHistogram(var, title=title_mdttdc+";[nsec];Number of Entries",
647 type='TH1F', path=ch, xbins=100, xmin=0., xmax=2000.)
648 title_mdttdc_ml1_adccut=ch+"_MDT_Station_TDC_ML1_ADCCut"
649 var="tdc_perch_"+ch+";"+title_mdttdc_ml1_adccut
650 mdtPerChamberEAGroup.defineHistogram(var, title=title_mdttdc_ml1_adccut+";[nsec];Number of Entries",
651 cutmask='ml1_adccut',
652 type='TH1F', path=ch, xbins=100, xmin=0., xmax=2000.)
653 title_mdttdc_ml2_adccut=ch+"_MDT_Station_TDC_ML2_ADCCut"
654 var="tdc_perch_"+ch+";"+title_mdttdc_ml2_adccut
655 mdtPerChamberEAGroup.defineHistogram(var, title=title_mdttdc_ml2_adccut+";[nsec];Number of Entries",
656 cutmask='ml2_adccut',
657 type='TH1F', path=ch, xbins=100, xmin=0., xmax=2000.)
658 title_mdtadc= ch+"_MDT_Station_ADC"
659 var="adc_perch_"+ch+";"+title_mdtadc
660 mdtPerChamberEAGroup.defineHistogram(var, type='TH1F',
661 title=title_mdtadc+";[adc counts];Number of Entries",
662 path=ch, xbins=100, xmin=0., xmax=400.)
663
664 title_mdtadc_segs_ml1= ch+"_MDT_Station_ADC_onSegm_ML1"
665 var="adc_segs_perch_"+ch+";"+title_mdtadc_segs_ml1
666 mdtPerChamberEAGroup.defineHistogram(var, type='TH1F',
667 cutmask='adc_ml1',
668 title=title_mdtadc_segs_ml1+";[adc counts];Number of Entries",
669 path=ch, xbins=100, xmin=0., xmax=400.)
670 title_mdtadc_segs_ml2= ch+"_MDT_Station_ADC_onSegm_ML2"
671 var="adc_segs_perch_"+ch+";"+title_mdtadc_segs_ml2
672 mdtPerChamberEAGroup.defineHistogram(var, type='TH1F',
673 cutmask='adc_ml2',
674 title=title_mdtadc_segs_ml2+";[adc counts];Number of Entries",
675 path=ch, xbins=100, xmin=0., xmax=400.)
676
677
678
679 title_mdtdcadc= ch+"_MDT_Station_TDCADC"
680 var="tdc_perch_"+ch+",adc_perch_"+ch+";"+title_mdtdcadc
681 mdtPerChamberEAGroup.defineHistogram(var, type='TH2F',
682 title=title_mdtdcadc+";[nsec];[adc counts]",
683 path=ch, xbins=50, xmin=0., xmax=2000., ybins=20, ymin=0., ymax=400.)
684
685 title_mdtlayer= ch+"_MDT_Station_LAYER_DCCut"
686 var="layer_perch_"+ch+";"+title_mdtlayer
687 mdtPerChamberEAGroup.defineHistogram(var, type='TH1F',
688 cutmask='adccut_nonoise',
689 title=title_mdtlayer+";layerID;Number of Entries",
690 path=ch, xbins=10, xmin=0., xmax=10.)
691
692 title_mdttube= ch+"_MDT_Station_TUBE_ADCCut"
693 var="tube_perch_"+ch+";"+title_mdttube
694 binmax=tubeMax[ch]
695 mdtPerChamberEAGroup.defineHistogram(var, type='TH1F',
696 cutmask='adccut',
697 title=title_mdttube+";tubeID;Number of Entries",
698 path=ch, xbins=binmax, xmin=1., xmax=binmax+1)
699
700 title_effentries=ch+"_MDT_Station_EFFENTRIES"
701 var="tube_perch_segs_"+ch+";"+title_effentries
702 mdtPerChamberEAGroup.defineHistogram(var, type='TH1F',
703 title=title_effentries+";tubeID;Number of Entries",
704 path=ch, xbins=binmax, xmin=1., xmax=binmax+1)
705
706 title_effcounts=ch+"_MDT_Station_EFFCOUNTS"
707 var="tube_perch_segs_"+ch+";"+title_effcounts
708 mdtPerChamberEAGroup.defineHistogram(var, type='TH1F',
709 cutmask='hitcut',
710 title=title_effcounts+";tubeID;Number of Entries",
711 path=ch, xbins=binmax, xmin=1., xmax=binmax+1)
712
713 title_eff=ch+"_MDT_Station_EFFPERTUBE"
714 var_eff="hitcut,tube_perch_segs_"+ch+";"+title_eff
715 mdtPerChamberEAGroup.defineHistogram(var_eff,
716 title=title_eff+";tubeID;Efficiency",
717 type='TEfficiency',
718 path=ch, xbins=binmax, xmin=1., xmax=binmax+1)
719
720 title_mdtmezz= ch+"_MDT_Station_MEZZ_ADCCut"
721 mdtPerChamberEAGroup.defineHistogram("mezz_perch_"+ch+";"+title_mdtmezz, type='TH1F',
722 cutmask='adccut',
723 title=title_mdtmezz+";mezzID;Number of Entries",
724 path=ch, xbins=20, xmin=0., xmax=20.)
725
726 mdtPerChamberECGroup=helper.addGroup(mdtMonAlg, "MdtMonPerChamberEC", "Muon/MuonRawDataMonitoring/MDT/MDTEC/Chambers")
727 for ch in mdtEC:
728 title_mdttdc=ch+"_MDT_Station_TDC"
729 var="tdc_perch_"+ch+";"+title_mdttdc
730 mdtPerChamberECGroup.defineHistogram(var, title=title_mdttdc+";[nsec];Number of Entries",
731 type='TH1F', path=ch, xbins=100, xmin=0., xmax=2000.)
732 title_mdttdc_ml1_adccut=ch+"_MDT_Station_TDC_ML1_ADCCut"
733 var="tdc_perch_"+ch+";"+title_mdttdc_ml1_adccut
734 mdtPerChamberECGroup.defineHistogram(var, title=title_mdttdc_ml1_adccut+";[nsec];Number of Entries",
735 cutmask='ml1_adccut',
736 type='TH1F', path=ch, xbins=100, xmin=0., xmax=2000.)
737 title_mdttdc_ml2_adccut=ch+"_MDT_Station_TDC_ML2_ADCCut"
738 var="tdc_perch_"+ch+";"+title_mdttdc_ml2_adccut
739 mdtPerChamberECGroup.defineHistogram(var, title=title_mdttdc_ml2_adccut+";[nsec];Number of Entries",
740 cutmask='ml2_adccut',
741 type='TH1F', path=ch, xbins=100, xmin=0., xmax=2000.)
742 title_mdtadc= ch+"_MDT_Station_ADC"
743 var="adc_perch_"+ch+";"+title_mdtadc
744 mdtPerChamberECGroup.defineHistogram(var, type='TH1F',
745 title=title_mdtadc+";[adc counts];Number of Entries",
746 path=ch, xbins=100, xmin=0., xmax=400.)
747 title_mdtadc_segs_ml1= ch+"_MDT_Station_ADC_onSegm_ML1"
748 var="adc_segs_perch_"+ch+";"+title_mdtadc_segs_ml1
749 mdtPerChamberECGroup.defineHistogram(var, type='TH1F',
750 cutmask='adc_ml1',
751 title=title_mdtadc_segs_ml1+";[adc counts];Number of Entries",
752 path=ch, xbins=100, xmin=0., xmax=400.)
753 title_mdtadc_segs_ml2= ch+"_MDT_Station_ADC_onSegm_ML2"
754 var="adc_segs_perch_"+ch+";"+title_mdtadc_segs_ml2
755 mdtPerChamberECGroup.defineHistogram(var, type='TH1F',
756 cutmask='adc_ml2',
757 title=title_mdtadc_segs_ml2+";[adc counts];Number of Entries",
758 path=ch, xbins=100, xmin=0., xmax=400.)
759
760
761
762 title_mdtdcadc= ch+"_MDT_Station_TDCADC"
763 var="tdc_perch_"+ch+",adc_perch_"+ch+";"+title_mdtdcadc
764 mdtPerChamberECGroup.defineHistogram(var, type='TH2F',
765 title=title_mdtdcadc+';[nsec];[adc counts]',
766 path=ch, xbins=50, xmin=0., xmax=2000., ybins=20, ymin=0., ymax=400.)
767 #to do
768 title_mdtlayer= ch+"_MDT_Station_LAYER_ADCCut"
769 var="layer_perch_"+ch+";"+title_mdtlayer
770 mdtPerChamberECGroup.defineHistogram(var, type='TH1F',
771 cutmask='adccut_nonoise',
772 title=title_mdtlayer+";layerID;Number of Entries",
773 path=ch, xbins=10, xmin=0., xmax=10.)
774 title_mdttube= ch+"_MDT_Station_TUBE_ADCCut"
775 var="tube_perch_"+ch+";"+title_mdttube
776 binmax=tubeMax[ch]
777 mdtPerChamberECGroup.defineHistogram(var, type='TH1F',
778 cutmask='adccut',
779 title=title_mdttube+";tubeID;Number of Entries",
780 path=ch, xbins=binmax, xmin=0., xmax=binmax)
781
782 title_effentries=ch+"_MDT_Station_EFFENTRIES"
783 var="tube_perch_segs_"+ch+";"+title_effentries
784 mdtPerChamberECGroup.defineHistogram(var, type='TH1F',
785 title=title_effentries+";tubeID;Number of Entries",
786 path=ch, xbins=binmax, xmin=1., xmax=binmax+1)
787
788 title_effcounts=ch+"_MDT_Station_EFFCOUNTS"
789 var="tube_perch_segs_"+ch+";"+title_effcounts
790 mdtPerChamberECGroup.defineHistogram(var, type='TH1F',
791 cutmask='hitcut',
792 title=title_effcounts+";tubeID;Number of Entries",
793 path=ch, xbins=binmax, xmin=1., xmax=binmax+1)
794
795 title_eff=ch+"_MDT_Station_EFFPERTUBE"
796 var_eff="hitcut,tube_perch_segs_"+ch+";"+title_eff
797 mdtPerChamberECGroup.defineHistogram(var_eff,
798 title=title_eff+";tubeID;Efficiency",
799 type='TEfficiency',
800 path=ch, xbins=binmax, xmin=1., xmax=binmax+1)
801
802
803 title_mdtmezz= ch+"_MDT_Station_MEZZ_ADCCut"
804 mdtPerChamberECGroup.defineHistogram("mezz_perch_"+ch+";"+title_mdtmezz, type='TH1F',
805 title=title_mdtmezz+";mezzID;Number of Entries",
806 path=ch, xbins=20, xmin=0., xmax=20.)
807
808
809
810
811
812
818
819
820
821 # # Otherwise, merge with result object and return
822 #acc, seq = helper.result()
823 acc = helper.result()
824 result.merge(acc)
825 return result
826
827
828if __name__=='__main__':
829
830 # Set the Athena configuration flags
831 from AthenaConfiguration.AllConfigFlags import initConfigFlags
832 from AthenaConfiguration.TestDefaults import defaultTestFiles
833 flags = initConfigFlags()
834 flags.Input.Files = defaultTestFiles.ESD
835
836 #flags.Input.isMC = True
837 #flags.Common.isOnline = True
838 flags.Output.HISTFileName = 'MdtMonitorOutput.root'
839 #flags.Output.AODFileName='aod.root'
840
841 #flags.IOVDb.GlobalTag = "CONDBR2-BLKPA-2018-12"
842 #flags.IOVDb.GlobalTag = "CONDBR2-BLKPA-2018-10"
843 #flags.GeoModel.AtlasVersion = "ATLAS-R2-2016-01-00-01"
844 #flags.IOVDb.DatabaseInstance=""
845 #flags.GeoModel.AtlasVersion = "ATLAS-R2-2016-01-00-01 "
846
847 flags.Detector.GeometryMuon = False
848 flags.Detector.GeometryCSC = False
849 flags.Detector.GeometryRPC = False
850 flags.Detector.GeometryTGC = False
851 flags.Detector.GeometrysTGC = False
852 flags.Detector.GeometryMM = False
853
854 flags.Detector.GeometryMDT = True
855
856 flags.Muon.Align.UseILines = False
857 flags.Muon.Align.UseALines = False
858 flags.Muon.Align.UseBLines = False
859
860 flags.DQ.useTrigger=False
861
862
863 flags.lock()
864 flags.dump()
865
866 # Initialize configuration object, add accumulator, merge, and run.
867 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
868 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
869 cfg = MainServicesCfg(flags)
870
871 cfg.merge(PoolReadCfg(flags))
872
873
874 #mdtMonitorAcc,mdtMonitorAlg = MdtMonitoringConfig(flags)
875 mdtMonitorAcc = MdtMonitoringConfig(flags)
876
877 #mdtMonitorAcc.OutputLevel=DEBUG
878
879 cfg.merge(mdtMonitorAcc)
880
881 #cfg.printConfig(withDetails=True, summariseProps = True)
882
883 cfg.run(5000)
884
if(febId1==febId2)