6 @file PixelAthClusterMonAlgCfg.py
7 @brief Configuration of Pixel Monitoring Clusters, Tracks and Status Histograms for Run 3
10 from PixelMonitoring.PixelAthMonitoringBase
import define2DProfHist, define2DProfPerFEHist, definePP0Histos
11 from PixelMonitoring.PixelAthMonitoringBase
import define1DLayers, defineMapVsLumiLayers
12 from PixelMonitoring.PixelAthMonitoringBase
import define1DProfLumiLayers, baselayers
13 from PixelMonitoring.PixelAthMonitoringBase
import layers, totcuts, xbinsem, xminsem, lumibinsx, ztotbinsy, ztotminsy
14 from PixelMonitoring.PixelAthMonitoringBase
import addOnTrackTxt, addOnTrackToPath, fullDressTitle
15 from PixelMonitoring.PixelAthMonitoringBase
import runtext, ReadingDataErrLabels
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)
27 path =
'/Pixel/Status/'
28 pathLowStat =
'/Pixel/LumiBlock/'
30 histoGroupName =
'MapOfModulesStatus'
31 title =
'Modules Status (0=Active+Good, 1=Active+Bad, 2=Inactive)'
32 define2DProfHist(helper, alg, histoGroupName, title, path, type=
'TProfile2D')
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')
39 histoGroupName =
'MapOfFEsStatus'
40 title =
'FEs Status (0=Active+Good, 1=Active+Bad, 2=Inactive)'
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')
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')
53 histoGroupName =
'BadModulesPerLumi'
54 title =
'Fraction of bad modules (bad+active) per event per LB'
55 yaxistext =
';# modules/event'
58 histoGroupName =
'DisabledModulesPerLumi'
59 title =
'Fraction of disabled modules per event per LB'
60 yaxistext =
';# modules/event'
63 histoGroupName =
'BadAndDisabledModulesPerLumi'
64 title =
'Fraction of bad and disabled modules per event per LB'
65 yaxistext =
';# modules/event'
70 path =
'/Pixel/TrackOnTrack/'
71 pathLowStat =
'/Pixel/LumiBlockOnTrack/'
73 histoGroupName =
'TSOSMeasurement'
74 title =
'TSOS of type Measurement'
77 histoGroupName =
'TSOSHole'
78 title =
'TSOS of type Hole'
81 histoGroupName =
'TSOSOutlier'
82 title =
'TSOS of type Outlier'
85 if doFEPlots
and not doOnline:
86 histoGroupName =
'TSOSMeasurementFE'
87 title =
'TSOS of type Measurement per FE'
90 histoGroupName =
'TSOSHoleFE'
91 title =
'TSOS of type Hole per FE'
94 histoGroupName =
'TSOSOutlierFE'
95 title =
'TSOS of type Outlier per FE'
98 histoGroupName =
'HitEffAll'
99 title =
'hit efficiency'
100 yaxistext =
';hit efficiency'
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')
108 histoGroupName =
'HolesRatio'
109 title =
'Holes per track'
110 define2DProfHist(helper, alg, histoGroupName, title, path, type=
'TProfile2D')
112 histoGroupName =
'MissIBLhit'
113 title =
'Expected but missing IBL hits (pT>1GeV)'
116 histoGroupName =
'MissIBLpresentBLhit'
117 title =
'Expected but missing IBL hits, BL_on_track hit present (pT>1GeV)'
120 histoGroupName =
'MissHitsRatio'
121 title =
'Hole+Outlier per track'
122 define2DProfHist(helper, alg, histoGroupName, title, path, type=
'TProfile2D')
124 trackGroup = helper.addGroup(alg,
'Track')
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)
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)
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)
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)
156 varName =
'pixclusmontool_lb,ntrks_per_event'
157 title =
fullDressTitle(
'Number of tracks per event per LB',
False,
';lumi block',
';tracks/event')
159 varName +=
';TracksPerEvtPerLumi'
160 trackGroup.defineHistogram(varName,
161 type=
'TProfile', path=path, title=title,
162 xbins=lumibinsx, xmin=-0.5, xmax=-0.5+lumibinsx)
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)
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)
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')
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)
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)
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)
205 path =
'/Pixel/Clusters'
206 pathLowStat =
'/Pixel/LumiBlock'
207 pathTiming =
'/Pixel/Timing'
211 clusterGroup = {
True: helper.addGroup(alg,
"Cluster_OnTrack" ),
212 False: helper.addGroup(alg,
"Cluster") }
213 for ontrack
in True,
False:
215 varName =
'Cluster_LVL1A_lvl1a'
216 title =
fullDressTitle(
'Cluster Level 1 Accept', ontrack,
';LVL1A',
';# clusters')
219 type=
'TH1F', path=pathGroup, title=title,
220 xbins=14, xmin=-1.5, xmax=12.5)
223 title =
addOnTrackTxt(
'Average cluster Level 1 Accept', ontrack,
True)
224 define2DProfHist(helper, alg, histoGroupName, title, pathGroup, type=
'TProfile2D')
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')
230 varName =
'Cluster_LVL1A_lvl1a'
231 histoGroupName =
addOnTrackTxt(
'ClusterLVL1AToTCut', ontrack)
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)
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])
265 title =
addOnTrackTxt(
'Average cluster size map', ontrack,
True)
266 define2DProfHist(helper, alg, histoGroupName, title, pathGroup, type=
'TProfile2D')
274 varName =
addOnTrackTxt(
'ClustersPerEvent', ontrack) +
'_val'
275 title =
fullDressTitle(
'Number of pixel clusters in an event', ontrack,
';# pixel clusters',
';# events')
278 xmax1D = 20000
if ontrack
else 80000
281 xmax1D = 50
if ontrack
else 200
284 xmax1D = 10000
if ontrack
else 40000
287 type=
'TH1I', path=pathGroup, title=title,
288 xbins=xbins1D, xmin=0, xmax=xmax1D)
291 title =
addOnTrackTxt(
'Number of pixel clusters in an event', ontrack,
True)
294 binsizes1D = 25
if ontrack
else 100
296 xbins1D = 20
if ontrack
else 50
300 binsizes1D = 10
if ontrack
else 40
301 define1DLayers(helper, alg, histoGroupName, title, pathGroup,
';# pixel clusters',
';# events', xbins=[xbins1D], xmins=[0], binsizes=[binsizes1D])
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')
307 type=
'TProfile', path=pathGroup, title=title,
308 xbins=lumibinsx, xmin=-0.5, xmax=-0.5+lumibinsx)
311 title =
addOnTrackTxt(
'Average number of pixel clusters per event per LB', ontrack,
True)
312 yaxistext =
';# clusters/event'
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'
320 type=
'TProfile', path=pathGroup, title=title,
321 xbins=lumibinsx, xmin=-0.5, xmax=-0.5+lumibinsx)
324 histoGroupName =
'NumClustersPerTrackPerLumi'
325 title =
addOnTrackTxt(
'Number of pixel clusters per track per event', ontrack,
True)
326 yaxistext =
';avg #clusters/track/event'
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')
342 define2DProfHist(helper, alg, histoGroupName, title, pathGroup, type=
'TH2D')
345 title =
addOnTrackTxt(
'Size>1 Cluster occupancy', ontrack,
True)
346 define2DProfHist(helper, alg, histoGroupName, title, pathGroup, type=
'TH2D')
348 histoGroupName =
addOnTrackTxt(
'ClusterOccupancyPP0', ontrack)
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')
353 title =
addOnTrackTxt(
'Average per module(FE) cluster occupancy per PP0', ontrack,
True)
358 histoGroupName =
addOnTrackTxt(
'ClusterFEOccupancy', ontrack)
359 title =
addOnTrackTxt(
'Cluster occupancy per FE', ontrack,
True)
365 histoGroupName =
addOnTrackTxt(
'ClusterOccupancyLB', ontrack)
369 histoGroupName =
addOnTrackTxt(
'ClusterFEOccupancyLB', ontrack)
370 title =
addOnTrackTxt(
'Cluster occupancy per FE', ontrack,
True)
380 histoGroupName =
addOnTrackTxt(
'ClusterToTxCosAlpha', ontrack)
382 define1DLayers(helper, alg, histoGroupName, title, pathGroup,
';ToT [BC]',
';# clusters', xbins=[300], xmins=[-0.5])
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')
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')
392 define1DLayers(helper, alg, histoGroupName, title, pathGroup,
';Charge [e]',
';# clusters', xbins=[70], xmins=[-0.5], binsizes=[3000.])
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)