ATLAS Offline Software
Loading...
Searching...
No Matches
PixelAthClusterMonAlgCfg.py
Go to the documentation of this file.
2# Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3#
4
5'''
6@file PixelAthClusterMonAlgCfg.py
7@brief Configuration of Pixel Monitoring Clusters, Tracks and Status Histograms for Run 3
8'''
9
10from PixelMonitoring.PixelAthMonitoringBase import define2DProfHist, define2DProfPerFEHist, definePP0Histos
11from PixelMonitoring.PixelAthMonitoringBase import define1DLayers, defineMapVsLumiLayers
12from PixelMonitoring.PixelAthMonitoringBase import define1DProfLumiLayers, baselayers
13from PixelMonitoring.PixelAthMonitoringBase import layers, totcuts, xbinsem, xminsem, lumibinsx, ztotbinsy, ztotminsy
14from PixelMonitoring.PixelAthMonitoringBase import addOnTrackTxt, addOnTrackToPath, fullDressTitle
15from PixelMonitoring.PixelAthMonitoringBase import runtext, ReadingDataErrLabels
16
17def PixelAthClusterMonAlgCfg(helper, alg, **kwargs):
18
19 doOnline = kwargs.get('doOnline', False)
20 doLumiBlock = kwargs.get('doLumiBlock', False)
21 doLowOccupancy = kwargs.get('doLowOccupancy', False)
22 doHeavyIonMon = kwargs.get('doHeavyIonMon', False)
23 doFEPlots = kwargs.get('doFEPlots', False)
24
25
26
27 path = '/Pixel/Status/'
28 pathLowStat = '/Pixel/LumiBlock/'
29
30 histoGroupName = 'MapOfModulesStatus'
31 title = 'Modules Status (0=Active+Good, 1=Active+Bad, 2=Inactive)'
32 define2DProfHist(helper, alg, histoGroupName, title, path, type='TProfile2D')
33
34 if doOnline:
35 title = 'Modules Status (0=Active+Good, 1=Active+Bad, 2=Inactive) reset every 2 LBs'
36 define2DProfHist(helper, alg, histoGroupName, title, path, type='TProfile2D', zmin=0, zmax=2, opt='kLBNHistoryDepth=2', histname='MapOfModulesStatusMon')
37
38 if doFEPlots:
39 histoGroupName = 'MapOfFEsStatus'
40 title = 'FEs Status (0=Active+Good, 1=Active+Bad, 2=Inactive)'
41 define2DProfPerFEHist(helper, alg, histoGroupName, title, path, type='TProfile2D')
42
43 if doLumiBlock:
44 if not doFEPlots:
45 histoGroupName = 'MapOfModulesStatus'
46 title = 'Modules Status (0=Active+Good, 1=Active+Bad, 2=Inactive)'
47 define2DProfHist(helper, alg, histoGroupName, title, pathLowStat, type='TProfile2D', lifecycle='lumiblock', histname='MapOfModulesStatusLB')
48 else:
49 histoGroupName = 'MapOfFEsStatus'
50 title = 'FEs Status (0=Active+Good, 1=Active+Bad, 2=Inactive)'
51 define2DProfPerFEHist(helper, alg, histoGroupName, title, pathLowStat, type='TProfile2D', lifecycle='lumiblock', histname='MapOfFEsStatusLB')
52
53 histoGroupName = 'BadModulesPerLumi'
54 title = 'Fraction of bad modules (bad+active) per event per LB'
55 yaxistext = ';# modules/event'
56 define1DProfLumiLayers(helper, alg, histoGroupName, title, path, yaxistext, type='TProfile')
57
58 histoGroupName = 'DisabledModulesPerLumi'
59 title = 'Fraction of disabled modules per event per LB'
60 yaxistext = ';# modules/event'
61 define1DProfLumiLayers(helper, alg, histoGroupName, title, path, yaxistext, type='TProfile')
62
63 histoGroupName = 'BadAndDisabledModulesPerLumi'
64 title = 'Fraction of bad and disabled modules per event per LB'
65 yaxistext = ';# modules/event'
66 define1DProfLumiLayers(helper, alg, histoGroupName, title, path, yaxistext, type='TProfile')
67
68
70 path = '/Pixel/TrackOnTrack/'
71 pathLowStat = '/Pixel/LumiBlockOnTrack/'
72
73 histoGroupName = 'TSOSMeasurement'
74 title = 'TSOS of type Measurement'
75 define2DProfHist(helper, alg, histoGroupName, title, path, type='TH2F')
76
77 histoGroupName = 'TSOSHole'
78 title = 'TSOS of type Hole'
79 define2DProfHist(helper, alg, histoGroupName, title, path, type='TH2F')
80
81 histoGroupName = 'TSOSOutlier'
82 title = 'TSOS of type Outlier'
83 define2DProfHist(helper, alg, histoGroupName, title, path, type='TH2F')
84
85 if doFEPlots and not doOnline:
86 histoGroupName = 'TSOSMeasurementFE'
87 title = 'TSOS of type Measurement per FE'
88 define2DProfPerFEHist(helper, alg, histoGroupName, title, path, type='TH2F')
89
90 histoGroupName = 'TSOSHoleFE'
91 title = 'TSOS of type Hole per FE'
92 define2DProfPerFEHist(helper, alg, histoGroupName, title, path, type='TH2F')
93
94 histoGroupName = 'TSOSOutlierFE'
95 title = 'TSOS of type Outlier per FE'
96 define2DProfPerFEHist(helper, alg, histoGroupName, title, path, type='TH2F')
97
98 histoGroupName = 'HitEffAll'
99 title = 'hit efficiency'
100 yaxistext = ';hit efficiency'
101 define1DProfLumiLayers(helper, alg, histoGroupName, title, path, yaxistext, type='TProfile')
102
103 if doOnline:
104 histoGroupName = 'HitEffAll'
105 title = 'hit efficiency per LB for last 100LB'
106 define1DProfLumiLayers(helper, alg, histoGroupName, title, path, ';hit efficiency', type='TProfile', opt='kLive=100', histname='HitEffAllLast100LB')
107
108 histoGroupName = 'HolesRatio'
109 title = 'Holes per track'
110 define2DProfHist(helper, alg, histoGroupName, title, path, type='TProfile2D')
111
112 histoGroupName = 'MissIBLhit'
113 title = 'Expected but missing IBL hits (pT>1GeV)'
114 define2DProfPerFEHist(helper, alg, histoGroupName, title, path, type='TH2F', onlylayers=['IBL'])
115
116 histoGroupName = 'MissIBLpresentBLhit'
117 title = 'Expected but missing IBL hits, BL_on_track hit present (pT>1GeV)'
118 define2DProfPerFEHist(helper, alg, histoGroupName, title, path, type='TH2F', onlylayers=['IBL'])
119
120 histoGroupName = 'MissHitsRatio'
121 title = 'Hole+Outlier per track'
122 define2DProfHist(helper, alg, histoGroupName, title, path, type='TProfile2D')
123
124 trackGroup = helper.addGroup(alg, 'Track')
125 varName = 'res_phi'
126 title = fullDressTitle('Pixel Residual LocX(phi)', False, ';Residual LocX(phi)',';# measurements on track')
127 varName += ';TrackResPhi'
128 trackGroup.defineHistogram(varName,
129 type='TH1F', path=path, title=title,
130 xbins=100, xmin=-0.1, xmax=0.1)
131 varName = 'res_eta'
132 title = fullDressTitle('Pixel Residual LocY(eta)', False, ';Residual LocY(eta)',';# measurements on track')
133 varName += ';TrackResEta'
134 trackGroup.defineHistogram(varName,
135 type='TH1F', path=path, title=title,
136 xbins=100, xmin=-0.3, xmax=0.3)
137 varName = 'pull_phi'
138 title = fullDressTitle('Pixel Pull LocX(phi)', False, ';Pull LocX(phi)',';# measurements on track')
139 varName += ';TrackPullsPhi'
140 trackGroup.defineHistogram(varName,
141 type='TH1F', path=path, title=title,
142 xbins=100, xmin=-1.2, xmax=1.2)
143 varName = 'pull_eta'
144 title = fullDressTitle('Pixel Pull LocY(eta)', False, ';Pull LocY(eta)',';# measurements on track')
145 varName += ';TrackPullsEta'
146 trackGroup.defineHistogram(varName,
147 type='TH1F', path=path, title=title,
148 xbins=100, xmin=-2.0, xmax=2.0)
149 varName = 'fit_chi2byndf'
150 title = fullDressTitle('chi2/ndf of track', False, ';#chi^{2}/DoF',';# of tracks')
151 varName += ';TrackChi2byNDF'
152 trackGroup.defineHistogram(varName,
153 type='TH1F', path=path, title=title,
154 xbins=50, xmin=-0., xmax=10.0)
155
156 varName = 'pixclusmontool_lb,ntrks_per_event'
157 title = fullDressTitle('Number of tracks per event per LB', False, ';lumi block', ';tracks/event')
158
159 varName += ';TracksPerEvtPerLumi'
160 trackGroup.defineHistogram(varName,
161 type='TProfile', path=path, title=title,
162 xbins=lumibinsx, xmin=-0.5, xmax=-0.5+lumibinsx)
163
164 varName = 'eta_noibl,phi_noibl,missIBLhit'
165 title = fullDressTitle('Eta-phi of tracks with an absent expected IBL hit, ratio to total tracks', False, ';eta', ';phi')
166 varName += ';MissIBLhitsEtaPhi'
167 trackGroup.defineHistogram(varName,
168 type='TProfile2D', path=path, title=title,
169 xbins=50, xmin=-2.5, xmax=2.5,ybins=25, ymin=-3.1416, ymax=3.1416, zmin=0., zmax=1.5)
170
171 if not doOnline:
172 varName = 'pixclusmontool_lb,npixhits_per_track'
173 title = fullDressTitle('Number of pixhits per track per LB', False, ';lumi block', ';number of hits')
174 varName += ';NPixHitsPerTrackPerLumi'
175 trackGroup.defineHistogram(varName,
176 type='TH2F', path=path, title=title, weight='npixhits_per_track_wgt',
177 xbins=lumibinsx, xmin=-0.5, xmax=-0.5+lumibinsx,
178 ybins=10, ymin=-0.5, ymax=9.5)
179
180 if doOnline:
181 varName = 'pixclusmontool_lb,npixhits_per_track'
182 title = fullDressTitle('Number of pixhits per track per LB for last 100LB', False, ';lumi block', ';number of hits')
183 varName += ';NPixHitsPerTrackPerLumiLast100LB'
184 trackGroup.defineHistogram(varName,
185 type='TH2F', path=path, title=title, weight='npixhits_per_track_wgt',
186 xbins=100, xmin=-0.5, xmax=-0.5+100,
187 ybins=10, ymin=-0.5, ymax=9.5, opt='kLive=100')
188
189 histoGroupName = 'HolesRatio5min'
190 title = 'Holes per track reset every 5 LBs'
191 define2DProfHist(helper, alg, 'HolesRatio', title, path, type='TProfile2D', zmin=0, zmax=1.1, opt='kLBNHistoryDepth=5', histname=histoGroupName)
192
193 histoGroupName = 'MissHitsRatio5min'
194 title = 'Hole+Outlier per track reset every 5 LBs'
195 define2DProfHist(helper, alg, 'MissHitsRatio', title, path, type='TProfile2D', zmin=0, zmax=1.1, opt='kLBNHistoryDepth=5', histname=histoGroupName)
196
197 varName = 'trkdataread_err;ReadingTrackDataErr'
198 title = 'Number of Track data reading errors;error type;# events'
199 trackGroup.defineHistogram(varName,
200 type='TH1I', path=path, title=title,
201 xbins=len(ReadingDataErrLabels), xmin=-0.5, xmax=-0.5+len(ReadingDataErrLabels), xlabels=ReadingDataErrLabels)
202
203
205 path = '/Pixel/Clusters'
206 pathLowStat = '/Pixel/LumiBlock'
207 pathTiming = '/Pixel/Timing'
208
209
211 clusterGroup = { True: helper.addGroup(alg, "Cluster_OnTrack" ),
212 False: helper.addGroup(alg, "Cluster") }
213 for ontrack in True,False:
214 pathGroup = addOnTrackToPath(pathTiming, ontrack)
215 varName = 'Cluster_LVL1A_lvl1a'
216 title = fullDressTitle('Cluster Level 1 Accept', ontrack, ';LVL1A',';# clusters')
217 varName += ';'+ addOnTrackTxt('ClusterLVL1A', ontrack)
218 clusterGroup[ontrack].defineHistogram(varName,
219 type='TH1F', path=pathGroup, title=title,
220 xbins=14, xmin=-1.5, xmax=12.5)
221
222 histoGroupName = addOnTrackTxt('ClusterLVL1AMod', ontrack)
223 title = addOnTrackTxt('Average cluster Level 1 Accept', ontrack, True)
224 define2DProfHist(helper, alg, histoGroupName, title, pathGroup, type='TProfile2D')
225
226 histoGroupName = addOnTrackTxt('ClusterLVL1ASizeCut', ontrack)
227 title = addOnTrackTxt('Average Size>1 Cluster Level 1 Accept', ontrack, True)
228 define2DProfHist(helper, alg, histoGroupName, title, pathGroup, type='TProfile2D')
229
230 varName = 'Cluster_LVL1A_lvl1a' # re-using same variable
231 histoGroupName = addOnTrackTxt('ClusterLVL1AToTCut', ontrack)
232 xaxistext = ';LVL1A'
233 yaxistext = ';# clusters/event'
234 for idx, layer in enumerate(layers):
235 groupname = histoGroupName + '_{0}'.format(layer)
236 title = addOnTrackTxt('Cluster Level 1 Accept with ToT > {0}'.format(totcuts[idx]), ontrack, True)
237 fulltitle = title + ', {0}'.format(layer) + runtext + xaxistext + yaxistext
238 layerGroup = helper.addGroup(alg, groupname)
239 fullvarstring = varName + ';' + groupname
240 layerGroup.defineHistogram(fullvarstring,
241 type='TH1F', path=pathGroup, title=fulltitle,
242 xbins=14, xmin=-1.5, xmax=12.5)
243
247 if ontrack:
248 pathGroup = addOnTrackToPath(path, ontrack)
249 var1Name = addOnTrackTxt('ClusterSize', ontrack) + '_em'
250 var2Name = addOnTrackTxt('ClusterSize', ontrack) + '_clsize'
251 histoGroupName = addOnTrackTxt('ClusterGroupsizeVsEta', ontrack)
252 xaxistext = ';Module eta index'
253 yaxistext = ';# pixels/cluster'
254 title = addOnTrackTxt('Number of pixels per cluster vs eta', ontrack, True)
255 for idx, layer in enumerate(baselayers):
256 groupname = histoGroupName + '_{0}'.format(layer)
257 fulltitle = title + ', {0}'.format(layer) + runtext + xaxistext + yaxistext
258 layerGroup = helper.addGroup(alg, groupname)
259 fullvarstring = var1Name + ',' + var2Name + ';' + groupname
260 layerGroup.defineHistogram(fullvarstring,
261 type='TProfile', path=pathGroup, title=fulltitle,
262 xbins=xbinsem[idx], xmin=xminsem[idx], xmax=xminsem[idx]+xbinsem[idx])
263
264 histoGroupName = addOnTrackTxt('ClusterSizeMap', ontrack)
265 title = addOnTrackTxt('Average cluster size map', ontrack, True)
266 define2DProfHist(helper, alg, histoGroupName, title, pathGroup, type='TProfile2D')
267
268
272 pathGroup = addOnTrackToPath(path, ontrack)
273
274 varName = addOnTrackTxt('ClustersPerEvent', ontrack) + '_val'
275 title = fullDressTitle('Number of pixel clusters in an event', ontrack, ';# pixel clusters', ';# events')
276 varName += ';'+ addOnTrackTxt('ClustersPerEvent', ontrack)
277 if doHeavyIonMon:
278 xmax1D = 20000 if ontrack else 80000
279 xbins1D = 2000
280 elif doLowOccupancy:
281 xmax1D = 50 if ontrack else 200
282 xbins1D = 200
283 else:
284 xmax1D = 10000 if ontrack else 40000
285 xbins1D = 1000
286 clusterGroup[ontrack].defineHistogram(varName,
287 type='TH1I', path=pathGroup, title=title,
288 xbins=xbins1D, xmin=0, xmax=xmax1D)
289
290 histoGroupName = addOnTrackTxt('ClustersPerEvent', ontrack)
291 title = addOnTrackTxt('Number of pixel clusters in an event', ontrack, True)
292 if doHeavyIonMon:
293 xbins1D = 200
294 binsizes1D = 25 if ontrack else 100
295 elif doLowOccupancy:
296 xbins1D = 20 if ontrack else 50
297 binsizes1D = 1
298 else:
299 xbins1D = 200
300 binsizes1D = 10 if ontrack else 40
301 define1DLayers(helper, alg, histoGroupName, title, pathGroup, ';# pixel clusters', ';# events', xbins=[xbins1D], xmins=[0], binsizes=[binsizes1D])
302
303 varName = 'pixclusmontool_lb,' + addOnTrackTxt('ClustersPerEvent', ontrack) + '_val'
304 title = fullDressTitle('Average number of pixel clusters per event per LB', ontrack, ';lumi block', ';# clusters/event')
305 varName += ';'+ addOnTrackTxt('ClustersPerLumi', ontrack)
306 clusterGroup[ontrack].defineHistogram(varName,
307 type='TProfile', path=pathGroup, title=title,
308 xbins=lumibinsx, xmin=-0.5, xmax=-0.5+lumibinsx)
309
310 histoGroupName = addOnTrackTxt('ClustersPerLumi', ontrack)
311 title = addOnTrackTxt('Average number of pixel clusters per event per LB', ontrack, True)
312 yaxistext = ';# clusters/event'
313 define1DProfLumiLayers(helper, alg, histoGroupName, title, pathGroup, yaxistext, type='TProfile')
314
315 if ontrack:
316 varName = 'pixclusmontool_lb,cls_frac_ontrack'
317 title = fullDressTitle('Fraction pixel clusters on track per event per LB', False, ';lumi block', ';fraction clusters/event')
318 varName += ';ClustersOnOffTrackPerLumi'
319 clusterGroup[ontrack].defineHistogram(varName,
320 type='TProfile', path=pathGroup, title=title,
321 xbins=lumibinsx, xmin=-0.5, xmax=-0.5+lumibinsx)
322
323
324 histoGroupName = 'NumClustersPerTrackPerLumi'
325 title = addOnTrackTxt('Number of pixel clusters per track per event', ontrack, True)
326 yaxistext = ';avg #clusters/track/event'
327 define1DProfLumiLayers(helper, alg, histoGroupName, title, pathGroup, yaxistext, type='TProfile')
328
329 if doOnline:
330 histoGroupName = addOnTrackTxt('ClusterMapMon', ontrack)
331 title = addOnTrackTxt('Cluster map reset every 2 LBs', ontrack, True)
332 define2DProfHist(helper, alg, histoGroupName, title, pathGroup, type='TH2D', zmin=0, zmax=1e4, opt='kLBNHistoryDepth=2') #FIXME zmax value w/ high stat
333
334
338 pathGroup = addOnTrackToPath(path, ontrack)
339
340 histoGroupName = addOnTrackTxt('ClusterOccupancy', ontrack)
341 title = addOnTrackTxt('Cluster occupancy', ontrack, True)
342 define2DProfHist(helper, alg, histoGroupName, title, pathGroup, type='TH2D')
343
344 histoGroupName = addOnTrackTxt('ClusOccSizeCut', ontrack)
345 title = addOnTrackTxt('Size>1 Cluster occupancy', ontrack, True)
346 define2DProfHist(helper, alg, histoGroupName, title, pathGroup, type='TH2D')
347 if ontrack:
348 histoGroupName = addOnTrackTxt('ClusterOccupancyPP0', ontrack)
349 if doOnline:
350 title = addOnTrackTxt('Average per module(FE) cluster occupancy per PP0 reset every 5 LBs', ontrack, True)
351 definePP0Histos(helper, alg, histoGroupName, title, pathGroup, opt='kLBNHistoryDepth=5')
352 else:
353 title = addOnTrackTxt('Average per module(FE) cluster occupancy per PP0', ontrack, True)
354 definePP0Histos(helper, alg, histoGroupName, title, pathGroup)
355
356
357 if doFEPlots:
358 histoGroupName = addOnTrackTxt('ClusterFEOccupancy', ontrack)
359 title = addOnTrackTxt('Cluster occupancy per FE', ontrack, True)
360 define2DProfPerFEHist(helper, alg, histoGroupName, title, pathGroup, type='TH2F')
361
362 if doLumiBlock:
363 pathGroup = addOnTrackToPath(pathLowStat, ontrack)
364 if not doFEPlots:
365 histoGroupName = addOnTrackTxt('ClusterOccupancyLB', ontrack)
366 title = addOnTrackTxt('Cluster occupancy', ontrack, True)
367 define2DProfHist(helper, alg, addOnTrackTxt('ClusterOccupancy', ontrack), title, pathGroup, type='TH2D', lifecycle='lumiblock', histname=histoGroupName)
368 else:
369 histoGroupName = addOnTrackTxt('ClusterFEOccupancyLB', ontrack)
370 title = addOnTrackTxt('Cluster occupancy per FE', ontrack, True)
371 define2DProfPerFEHist(helper, alg, addOnTrackTxt('ClusterFEOccupancy', ontrack), title, pathGroup, type='TH2F', lifecycle='lumiblock', histname=histoGroupName)
372
373
374
378 if ontrack:
379 pathGroup = addOnTrackToPath(path, ontrack)
380 histoGroupName = addOnTrackTxt('ClusterToTxCosAlpha', ontrack)
381 title = addOnTrackTxt('Cluster ToTxCosAlpha', ontrack, True)
382 define1DLayers(helper, alg, histoGroupName, title, pathGroup, ';ToT [BC]', ';# clusters', xbins=[300], xmins=[-0.5])
383 if doOnline:
384 title = addOnTrackTxt('Zoomed Cluster ToTxCosAlpha per LB for last 100LB', ontrack, True)
385 defineMapVsLumiLayers(helper, alg, histoGroupName, title, pathGroup, ';lumi block', ';ToT [BC]', ybins=ztotbinsy, ymins=ztotminsy, opt='kLive=100', histname='ZoomedClusterToTxCosAlphaOnTrackPerLumiLast100LB')
386 else:
387 title = addOnTrackTxt('Zoomed Cluster ToTxCosAlpha per LB', ontrack, True)
388 defineMapVsLumiLayers(helper, alg, histoGroupName, title, pathGroup, ';lumi block', ';ToT [BC]', ybins=ztotbinsy, ymins=ztotminsy, histname='ZoomedClusterToTxCosAlphaOnTrackPerLumi')
389
390 histoGroupName = addOnTrackTxt('ClusterQxCosAlpha', ontrack)
391 title = addOnTrackTxt('Cluster Q normalized', ontrack, True)
392 define1DLayers(helper, alg, histoGroupName, title, pathGroup, ';Charge [e]', ';# clusters', xbins=[70], xmins=[-0.5], binsizes=[3000.])
393
394
396
397 if not ontrack:
398 varName = 'clsdataread_err;ReadingClusterDataErr'
399 title = 'Number of Cluster data reading errors;error type;# events'
400 trackGroup.defineHistogram(varName,
401 type='TH1I', path=pathGroup, title=title,
402 xbins=len(ReadingDataErrLabels), xmin=-0.5, xmax=-0.5+len(ReadingDataErrLabels), xlabels=ReadingDataErrLabels)
403
404