Belle II Software development
EventInspectorPocketDAQ Class Reference

Public Member Functions

 __init__ (self, exp, run, histName, pdfName)
 
 makeGraph (self, x, y)
 
 makeText (self, x, y, s)
 
 initialize (self)
 
 terminate (self)
 
 beginRun (self)
 
 endRun (self)
 
 event (self, eventHits, tt_ctime, raw_time)
 

Public Attributes

 exp = exp
 internal copy of experiment number
 
 run = run
 internal copy of run number
 
 histName = histName
 internal copy of the pathname of the output histogram ROOT file
 
 pdfName = pdfName
 internal copy of the pathname of the output histogram PDF file
 
 histogramFile = ROOT.TFile.Open(self.histName, "RECREATE")
 Output ROOT TFile that will contain the histograms/scatterplots.
 
 hist_ttc_trigtime
 histogram of the tt_ctime relative to triggertime
 
 hist_rawKLMlane
 histogram of the hit's lane
 
 hist_rawKLMsizeMultihit
 histogram of number of hits, including multiple entries on one readout channel
 
 hist_rawKLMsize
 histogram of number of hits, at most one entry per readout channel
 
 hist_PerChannelMultiplicity
 scatterplot of multiplicity of entries in one readout channel vs lane/axis
 
 hist_RPCLaneAxisOccupancy
 scatterplot of number of mapped RPC hits by lane/axis vs sector, at most one entry per readout channel
 
 hist_ScintLaneAxisOccupancy
 scatterplot of number of mapped scint hits by lane/axis vs sector, at most one entry per readout channel
 
list hist_ChannelOccupancy = [0, 0]
 scatterplots of channel occupancy (1 hit per readout channel) for each axis
 
list hist_ChannelOccupancyAL
 histograms of channel occupancy (1 hit per readout channel), indexed by axis/lane
 
 hist_RPCTimeLowBitsBySector
 scatterplot of RPC TDC low-order bits vs sector (should be 0 since granularity is 4 ns)
 
 hist_RPCTime
 histogram of RPC TDC value relative to event's REVO9 trigger time in last word of event
 
 hist_RPCTime2
 histogram of RPC TDC value relative to event's ctime in event header
 
list hist_RPCTimePerLayerA0 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
 histograms of RPC TDC value relative to event's trigger time for axis 0, indexed by lane
 
list hist_RPCTimePerLayerA1 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
 histograms of RPC TDC value relative to event's trigger time for axis 1, indexed by lane
 
list hist_RPCTime2PerLayerA0 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
 histograms of RPC TDC value relative to event's ctime for axis 0, indexed by lane
 
list hist_RPCTime2PerLayerA1 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
 histograms of RPC TDC value relative to event's ctime for axis 1, indexed by lane
 
 hist_RPCTdcRange = ROOT.TH1F('RPCTdcRange', expRun + 'RPC TDC-range in event;TDCMax - TDCMin (ns)', 512, -0.5, 2047.5)
 histogram of RPC TDC range in event
 
 hist_RPCRevotimeRange
 histogram of RPC REVO9 range in event
 
 hist_revotimeRPCtdc
 scatterplot of RPC REVO9 range vs TDC value in event
 
 hist_revotimeRPCtdc2
 scatterplot of RPC REVO9 range vs TDC value corrected for DC-processing delay in event
 
 hist_jRPCtdc
 scatterplot of RPC calibrated time vs hit's index
 
 hist_jRPCtdc2
 scatterplot of RPC calibrated time vs hit's index, corrected for DC-processing delay
 
 hist_ScintTimeLowBitsBySector
 scatterplot of scint TDC low-order bits vs sector
 
 hist_ScintTime
 histogram of scint TDC value relative to event's trigger time
 
 hist_ScintCtime
 histogram of scint CTIME value relative to event's ctime
 
 hist_ScintCtime0
 histogram of scint CTIME value relative to event's trigger time
 
 hist_ScintCtimeRange
 histogram of scint CTIME range in event
 

Static Public Attributes

int BKLM_ID = 0x07000000
 COPPER base identifier for BKLM readout.
 
int EKLM_ID = 0x08000000
 COPPER base identifier for EKLM readout.
 
int BKLM_STRIP_BIT = 0
 bit position for strip-1 [0..47]
 
int BKLM_PLANE_BIT = 6
 bit position for plane-1 [0..1]; 0 is inner-plane
 
int BKLM_LAYER_BIT = 7
 bit position for layer-1 [0..14]; 0 is innermost
 
int BKLM_SECTOR_BIT = 11
 bit position for sector-1 [0..7]; 0 is on the +x axis and 2 is on the +y axis
 
int BKLM_SECTION_BIT = 14
 bit position for section [0..1]; forward is 0
 
int BKLM_MAXSTRIP_BIT = 15
 bit position for maxStrip-1 [0..47]
 
int BKLM_STRIP_MASK = 0x3f
 bit mask for strip-1 [0..47]
 
tuple BKLM_PLANE_MASK = (1 << BKLM_PLANE_BIT)
 bit mask for plane-1 [0..1]; 0 is inner-plane
 
tuple BKLM_LAYER_MASK = (15 << BKLM_LAYER_BIT)
 bit mask for layer-1 [0..15]; 0 is innermost and 14 is outermost
 
tuple BKLM_SECTOR_MASK = (7 << BKLM_SECTOR_BIT)
 bit mask for sector-1 [0..7]; 0 is on the +x axis and 2 is on the +y axis
 
tuple BKLM_SECTION_MASK = (1 << BKLM_SECTION_BIT)
 bit mask for section [0..1]; forward is 0
 
tuple BKLM_MAXSTRIP_MASK = (63 << BKLM_MAXSTRIP_BIT)
 bit mask for maxStrip-1 [0..47]
 
tuple BKLM_MODULEID_MASK = (BKLM_SECTION_MASK | BKLM_SECTOR_MASK | BKLM_LAYER_MASK)
 bit mask for unique module identifier (end, sector, layer)
 

Detailed Description

Fill BKLM histograms of values from RawKLMs, KLMDigits, BKLMHit1ds, and BKLMHit2ds;
(optionally) draw event displays from these data-objects.

Definition at line 18 of file EventInspectorPocketDAQ.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
exp,
run,
histName,
pdfName )
Constructor

Arguments:
    exp (str): formatted experiment number
    run (str): formatter run number
    histName (str): path name of the output histogram ROOT file
    pdfName (str): path name of the output histogram PDF file
    eventPdfName (str): path name of the output event-display PDF file
    maxDisplays (int): max # of events displays to write
    minRPCHits (int): min # of RPC BKLMHit2ds in any sector for event display

Definition at line 53 of file EventInspectorPocketDAQ.py.

53 def __init__(self, exp, run, histName, pdfName):
54 """Constructor
55
56 Arguments:
57 exp (str): formatted experiment number
58 run (str): formatter run number
59 histName (str): path name of the output histogram ROOT file
60 pdfName (str): path name of the output histogram PDF file
61 eventPdfName (str): path name of the output event-display PDF file
62 maxDisplays (int): max # of events displays to write
63 minRPCHits (int): min # of RPC BKLMHit2ds in any sector for event display
64 """
65 super().__init__()
66
67 self.exp = exp
68
69 self.run = run
70
71 self.histName = histName
72
73 self.pdfName = pdfName
74

Member Function Documentation

◆ beginRun()

beginRun ( self)
Handle begin of run: print diagnostic message

Definition at line 341 of file EventInspectorPocketDAQ.py.

341 def beginRun(self):
342 """Handle begin of run: print diagnostic message"""
343 print('beginRun', self.run)
344

◆ endRun()

endRun ( self)
Handle end of run: print diagnostic message

Definition at line 345 of file EventInspectorPocketDAQ.py.

345 def endRun(self):
346 """Handle end of run: print diagnostic message"""
347 print('endRun', self.run)
348

◆ event()

event ( self,
eventHits,
tt_ctime,
raw_time )
Process one event: fill histograms

Definition at line 349 of file EventInspectorPocketDAQ.py.

349 def event(self, eventHits, tt_ctime, raw_time):
350 """Process one event: fill histograms"""
351
352 sectorFB = 0
353 n = len(eventHits)
354 countAllMultihit = 2 * n + 1 if (n > 0) else 0
355 countAll = 1
356 channelMultiplicity = {}
357 minCtime = 99999
358 minRPCTdc = 99999
359 maxRPCTdc = 0
360 minRPCCtime = 99999
361 maxRPCCtime = 0
362 minScintCtime = 99999
363 maxScintCtime = 0
364 self.hist_ttc_trigtime.Fill((tt_ctime - raw_time) & 0x0fff)
365 for j in range(0, n):
366 items = eventHits[j]
367 lane = items[0]
368 channel = items[1]
369 axis = items[2]
370 ctime = items[3] # this is revo9 time for RPCs, ctime for scintillators
371 flag = 1 if (lane > 2) else 2
372 isRPC = (flag == 1)
373 isScint = (flag == 2) # noqa (F841) kept for completeness
374 laneAxisChannel = (((lane << 1) + axis) << 7) + channel
375 if laneAxisChannel not in channelMultiplicity:
376 countAll = countAll + 2
377 channelMultiplicity[laneAxisChannel] = 0
378 channelMultiplicity[laneAxisChannel] = channelMultiplicity[laneAxisChannel] + 1
379 if ctime < minCtime:
380 minCtime = ctime
381 self.hist_rawKLMlane.Fill(lane)
382 for j in range(0, n):
383 items = eventHits[j]
384 lane = items[0]
385 channel = items[1]
386 axis = items[2]
387 ctime = items[3] # this is revo9 time for RPCs, ctime for scintillators
388 tdc = items[4]
389 charge = items[5] # noqa (F841) kept for completeness
390 flag = 1 if (lane > 2) else 2
391 isRPC = (flag == 1)
392 isScint = (flag == 2) # noqa (F841) kept for completeness
393 laneAxisChannel = (((lane << 1) + axis) << 7) + channel
394 laneAxis = axis if ((lane < 1) or (lane > 20)) else ((lane << 1) + axis)
395 if laneAxisChannel in channelMultiplicity:
396 if channelMultiplicity[laneAxisChannel] > 1:
397 self.hist_PerChannelMultiplicity.Fill(channelMultiplicity[laneAxisChannel], laneAxis)
398 # DIVOT del channelMultiplicity[laneAxisChannel] # consider only first hit in the channel/axis/lane of this dc
399 t = (tdc - raw_time) & 0x03ff # in ns, range is 0..1023
400 t2 = (tdc - tt_ctime) & 0x03ff # in ns, range is 0..1023
401 ct = ((ctime << 3) - tt_ctime) & 0x3ff
402 if isRPC:
403 if tdc < minRPCTdc:
404 minRPCTdc = tdc
405 if tdc > maxRPCTdc:
406 maxRPCTdc = tdc
407 if ctime < minRPCCtime:
408 minRPCCtime = ctime
409 if ctime > maxRPCCtime:
410 maxRPCCtime = ctime
411 self.hist_RPCTimeLowBitsBySector.Fill(sectorFB, (tdc & 3))
412 self.hist_RPCLaneAxisOccupancy.Fill(sectorFB, laneAxis)
413 self.hist_RPCTime.Fill(t)
414 self.hist_RPCTime2.Fill(t2)
415 if axis == 0:
416 self.hist_RPCTimePerLayerA0[lane].Fill(t)
417 self.hist_RPCTime2PerLayerA0[lane].Fill(t2)
418 else:
419 self.hist_RPCTimePerLayerA1[lane].Fill(t)
420 self.hist_RPCTime2PerLayerA1[lane].Fill(t2)
421 if n > 0:
422 t0j = 0.75 * j
423 self.hist_revotimeRPCtdc.Fill(t, ctime - minCtime)
424 self.hist_revotimeRPCtdc2.Fill(t - t0j, ctime - minCtime)
425 self.hist_jRPCtdc.Fill(t, j)
426 self.hist_jRPCtdc2.Fill(t - t0j, j)
427 else:
428 if ctime < minScintCtime:
429 minScintCtime = ctime
430 if ctime > maxScintCtime:
431 maxScintCtime = ctime
432 self.hist_ScintTimeLowBitsBySector.Fill(sectorFB, (tdc & 3))
433 self.hist_ScintLaneAxisOccupancy.Fill(sectorFB, laneAxis)
434 self.hist_ScintTime.Fill(t)
435 self.hist_ScintCtime.Fill(ct)
436 self.hist_ScintCtime0.Fill(((ctime << 3) - raw_time) & 0x3ff)
437 self.hist_ChannelOccupancy[axis].Fill(lane, channel)
438 self.hist_ChannelOccupancyAL[lane][axis].Fill(channel)
439 if n > 1:
440 if maxRPCTdc > 0:
441 self.hist_RPCTdcRange.Fill(maxRPCTdc - minRPCTdc)
442 if maxRPCCtime > 0:
443 self.hist_RPCRevotimeRange.Fill((maxRPCCtime - minRPCCtime) << 3)
444 if maxScintCtime > 0:
445 self.hist_ScintCtimeRange.Fill((maxScintCtime - minScintCtime) << 3)
446 self.hist_rawKLMsizeMultihit.Fill(countAllMultihit)
447 self.hist_rawKLMsize.Fill(countAll)

◆ initialize()

initialize ( self)
Handle job initialization: create histograms

Definition at line 105 of file EventInspectorPocketDAQ.py.

105 def initialize(self):
106 """Handle job initialization: create histograms"""
107
108 expRun = f'e{int(self.exp):02d}r{int(self.run)}: '
109
110
111 self.histogramFile = ROOT.TFile.Open(self.histName, "RECREATE")
112
113 # create the rawKLM histograms
114
115
116 self.hist_ttc_trigtime = ROOT.TH1F('ttc_trigtime',
117 expRun + 'tt_ctime relative to triggertime;' +
118 'tt_ctime - triggertime (ns)',
119 256, -0.5, 2047.5)
120
121 self.hist_rawKLMlane = ROOT.TH1F('rawKLMlane',
122 expRun + 'RawKLM lane;Lane (scint: 1..7, RPC: 8..20)',
123 21, -0.5, 20.5)
124
125 self.hist_rawKLMsizeMultihit = ROOT.TH1F('rawKLMsizeMultihit',
126 expRun + 'RawKLM word count (N/channel)',
127 200, -0.5, 199.5)
128
129 self.hist_rawKLMsize = ROOT.TH1F('rawKLMsize',
130 expRun + 'RawKLM word count (1/channel)',
131 200, -0.5, 199.5)
132
133 self.hist_PerChannelMultiplicity = ROOT.TH2F(
134 'PerChannelMultiplicity',
135 expRun + 'Per-channel multiplicity (N/channel > 1);' +
136 'Per-channel multiplicity;' +
137 '(Lane #) * 2 + (Axis #)',
138 30, -0.5, 29.5, 42, -0.5, 41.5)
139
140 self.hist_RPCLaneAxisOccupancy = ROOT.TH2F(
141 'RPCLaneAxisOccupancy',
142 expRun + 'Lane/axis occupancy of RPC channels (1/channel);' +
143 'Sector # (always 0);' +
144 '(Lane #) * 2 + (Axis #)',
145 3, -1.5, 1.5, 42, -0.5, 41.5)
146
147 self.hist_ScintLaneAxisOccupancy = ROOT.TH2F(
148 'ScintLaneAxisOccupancy',
149 expRun + 'Lane/axis occupancy of scint channels (1/channel);' +
150 'Sector # (always 0);' +
151 '(Lane #) * 2 + (Axis #)',
152 3, -1.5, 1.5, 42, -0.5, 41.5)
153
154 self.hist_ChannelOccupancy = [0, 0]
155 self.hist_ChannelOccupancy[0] = ROOT.TH2F('ChannelOccupancy_a0',
156 expRun + 'Channel occupancy for axis 0;lane;channel',
157 42, -0.25, 20.75, 128, -0.25, 63.75)
158 self.hist_ChannelOccupancy[1] = ROOT.TH2F('ChannelOccupancy_a1',
159 expRun + 'Channel occupancy for axis 1;lane;channel',
160 42, -0.25, 20.75, 128, -0.25, 63.75)
161
162 self.hist_ChannelOccupancyAL = [
163 [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
164 [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
165 [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]]
166 for lane in range(0, 21):
167 nChannels = 64 if (lane > 2) else 128
168 label = f'ChannelOccupancy_A0L{lane}'
169 title = f'{expRun}Channel occupancy for axis 0 lane {lane};channel'
170 self.hist_ChannelOccupancyAL[lane][0] = ROOT.TH1F(label, title, nChannels, -0.5, nChannels - 0.5)
171 label = f'ChannelOccupancy_A1L{lane}'
172 title = f'{expRun}Channel occupancy for axis 1 lane {lane};channel'
173 self.hist_ChannelOccupancyAL[lane][1] = ROOT.TH1F(label, title, nChannels, -0.5, nChannels - 0.5)
174
175 self.hist_RPCTimeLowBitsBySector = ROOT.TH2F('RPCTimeLowBitsBySector',
176 expRun + 'RPC TDC lowest-order bits;' +
177 'Sector # (always 0);' +
178 'TDC % 4 (ns) [should be 0]',
179 3, -1.5, 1.5, 8, -0.25, 3.75)
180
181 self.hist_RPCTime = ROOT.TH1F('RPCTime',
182 expRun + 'RPC tdc relative to event trigtime;tdc - triggerTime (ns)',
183 256, -0.5, 1023.5)
184
185 self.hist_RPCTime2 = ROOT.TH1F('RPCTime_Ctime',
186 expRun + 'RPC tdc relative to event ctime;tdc - trigCtime (ns)',
187 256, -0.5, 1023.5)
188
189 self.hist_RPCTimePerLayerA0 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
190 for lane in range(0, 21):
191 label = f'RPCTimeA0L{lane:02d}'
192 title = f'{expRun}RPC axis 0 lane {lane} time relative to trigtime;t - triggerTime (ns)'
193 self.hist_RPCTimePerLayerA0[lane] = ROOT.TH1F(label, title, 256, -0.5, 1023.5)
194
195 self.hist_RPCTimePerLayerA1 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
196 for lane in range(0, 21):
197 label = f'RPCTimeA1L{lane:02d}'
198 title = f'{expRun}RPC axis 1 lane {lane} time relative to trigtime;t - triggerTime (ns)'
199 self.hist_RPCTimePerLayerA1[lane] = ROOT.TH1F(label, title, 256, -0.5, 1023.5)
200
201 self.hist_RPCTime2PerLayerA0 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
202 for lane in range(0, 21):
203 label = f'RPCTime2A0L{lane:02d}'
204 title = f'{expRun}RPC axis 0 lane {lane} time relative to trigCtime;t - trigCtime (ns)'
205 self.hist_RPCTime2PerLayerA0[lane] = ROOT.TH1F(label, title, 256, -0.5, 1023.5)
206
207 self.hist_RPCTime2PerLayerA1 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
208 for lane in range(0, 21):
209 label = f'RPCTime2A1L{lane:02d}'
210 title = f'{expRun}RPC axis 1 lane {lane} time relative to trigCtime;t - trigCtime (ns)'
211 self.hist_RPCTime2PerLayerA1[lane] = ROOT.TH1F(label, title, 256, -0.5, 1023.5)
212
213 self.hist_RPCTdcRange = ROOT.TH1F('RPCTdcRange', expRun + 'RPC TDC-range in event;TDCMax - TDCMin (ns)', 512, -0.5, 2047.5)
214
215 self.hist_RPCRevotimeRange = ROOT.TH1F('RPCRevotimeRange',
216 expRun + 'RPC revotime-range in event;revotimeMax - revotimeMin (ns)',
217 128, -0.5, 8191.5)
218
219 self.hist_revotimeRPCtdc = ROOT.TH2F('revotimeRPCtdc',
220 expRun + 'RPC TDC vs revotime;tdc (ns);revotime - minRevotime',
221 64, 767.5, 1023.5, 10, -0.5, 159.5)
222
223 self.hist_revotimeRPCtdc2 = ROOT.TH2F(
224 'revotimeRPCtdc2',
225 expRun + 'RPC TDC vs revotime;' +
226 'tdc - dt(index) (ns);' +
227 'revotime - minRevotime',
228 64, 767.5, 1023.5, 10, -0.5, 159.5)
229
230 self.hist_jRPCtdc = ROOT.TH2F('jRPCtdc',
231 expRun + 'RPC TDC vs hit index;tdc (ns);Hit index',
232 64, 767.5, 1023.5, 60, -0.5, 59.5)
233
234 self.hist_jRPCtdc2 = ROOT.TH2F('jRPCtdc2',
235 expRun + 'RPC TDC vs hit index;tdc - dt(index) (ns);Hit index',
236 64, 767.5, 1023.5, 60, -0.5, 59.5)
237
238 self.hist_ScintTimeLowBitsBySector = ROOT.TH2F(
239 'ScintTimeLowBitsBySector',
240 expRun + 'Scint TDC lowest-order bits;' +
241 'Sector # (always 0);' +
242 'TDC % 4 (ns)',
243 3, -1.5, 1.5, 8, -0.25, 3.75)
244
245 self.hist_ScintTime = ROOT.TH1F('ScintTime',
246 expRun + 'Scint tdc distribution;tdc - triggerTime (ns)',
247 256, -0.5, 1023.5)
248
249 self.hist_ScintCtime = ROOT.TH1F('ScintCtime',
250 expRun + 'Scint ctime distribution;ctime - triggerCtime (ns)',
251 32, -0.5, 1023.5)
252
253 self.hist_ScintCtime0 = ROOT.TH1F('ScintCtime0',
254 expRun + 'Scint ctime distribution;ctime - triggerTime (ns)',
255 32, -0.5, 1023.5)
256
257 self.hist_ScintCtimeRange = ROOT.TH1F(
258 'ScintCtimeRange', expRun + 'Scint ctime-range in event;ctimeMax - ctimeMin (ns)', 128, -0.5, 8191.5)
259

◆ makeGraph()

makeGraph ( self,
x,
y )
Create and return a ROOT TGraph

Arguments:
  x[] (real): x coordinates
  y[] (real): y coordinates

Definition at line 75 of file EventInspectorPocketDAQ.py.

75 def makeGraph(self, x, y):
76 """Create and return a ROOT TGraph
77
78 Arguments:
79 x[] (real): x coordinates
80 y[] (real): y coordinates
81 """
82 graph = ROOT.TGraph()
83 for i in range(0, len(x)):
84 graph.SetPoint(i, x[i], y[i])
85 graph.SetLineColor(2)
86 graph.SetLineWidth(1)
87 return graph
88

◆ makeText()

makeText ( self,
x,
y,
s )
Create and return a ROOT TLatex with the following properties:
size = 0.04, color = red, alignment = middle centre, angle = 90 degrees

Arguments:
  x (real): x coordinate
  y (real): y coordinate
  s (str):  character string

Definition at line 89 of file EventInspectorPocketDAQ.py.

89 def makeText(self, x, y, s):
90 """Create and return a ROOT TLatex with the following properties:
91 size = 0.04, color = red, alignment = middle centre, angle = 90 degrees
92
93 Arguments:
94 x (real): x coordinate
95 y (real): y coordinate
96 s (str): character string
97 """
98 text = ROOT.TLatex(x, y, s)
99 text.SetTextSize(0.04)
100 text.SetTextColor(2)
101 text.SetTextAlign(22)
102 text.SetTextAngle(90)
103 return text
104

◆ terminate()

terminate ( self)
Handle job termination: draw histograms, close output files

Definition at line 260 of file EventInspectorPocketDAQ.py.

260 def terminate(self):
261 """Handle job termination: draw histograms, close output files"""
262
263 canvas = ROOT.TCanvas("canvas", self.pdfName, 1600, 1600)
264 title = f'{self.pdfName}['
265 canvas.SaveAs(title)
266 canvas.Clear()
267 canvas.GetPad(0).SetGrid(1, 1)
268 canvas.GetPad(0).Update()
269 self.hist_rawKLMlane.Draw()
270 canvas.Print(self.pdfName, f"Title:{self.hist_rawKLMlane.GetName()}")
271 self.hist_rawKLMsizeMultihit.Draw()
272 canvas.Print(self.pdfName, f"Title:{self.hist_rawKLMsizeMultihit.GetName()}")
273 self.hist_rawKLMsize.Draw()
274 canvas.Print(self.pdfName, f"Title:{self.hist_rawKLMsize.GetName()}")
275 self.hist_PerChannelMultiplicity.Draw("box")
276 canvas.Print(self.pdfName, f"Title:{self.hist_PerChannelMultiplicity.GetName()}")
277 canvas.Clear()
278 canvas.Divide(2, 1)
279 canvas.GetPad(0).SetGrid(1, 1)
280 canvas.GetPad(1).SetGrid(1, 1)
281 canvas.GetPad(2).SetGrid(1, 1)
282 for sectorFB in range(0, 1):
283 canvas.cd(1)
284 self.hist_ChannelOccupancy[0].Draw("colz")
285 canvas.cd(2)
286 self.hist_ChannelOccupancy[1].Draw("colz")
287 canvas.Print(self.pdfName, f"Title:{self.hist_ChannelOccupancy[0].GetName()}")
288 for lane in range(0, 21):
289 n0 = self.hist_ChannelOccupancyAL[lane][0].GetEntries()
290 n1 = self.hist_ChannelOccupancyAL[lane][1].GetEntries()
291 if n0 + n1 > 0:
292 canvas.cd(1)
293 self.hist_ChannelOccupancyAL[lane][0].Draw()
294 canvas.cd(2)
295 self.hist_ChannelOccupancyAL[lane][1].Draw()
296 canvas.Print(self.pdfName, f"Title:{self.hist_ChannelOccupancyAL[lane][0].GetName()}")
297 canvas.Clear()
298 canvas.Divide(1, 1)
299 self.hist_ttc_trigtime.Draw()
300 canvas.Print(self.pdfName, f"Title:{self.hist_ttc_trigtime.GetName()}")
301 self.hist_RPCTimeLowBitsBySector.Draw("box")
302 canvas.Print(self.pdfName, f"Title:{self.hist_RPCTimeLowBitsBySector.GetName()}")
303 self.hist_RPCTime.Draw()
304 canvas.Print(self.pdfName, f"Title:{self.hist_RPCTime.GetName()}")
305 for lane in range(0, 21):
306 if self.hist_RPCTimePerLayerA0[lane].GetEntries() > 0:
307 self.hist_RPCTimePerLayerA0[lane].Draw()
308 canvas.Print(self.pdfName, f"Title:{self.hist_RPCTimePerLayerA0[lane].GetName()}")
309 for lane in range(0, 21):
310 if self.hist_RPCTimePerLayerA1[lane].GetEntries() > 0:
311 self.hist_RPCTimePerLayerA1[lane].Draw()
312 canvas.Print(self.pdfName, f"Title:{self.hist_RPCTimePerLayerA1[lane].GetName()}")
313 self.hist_RPCTdcRange.Draw()
314 canvas.Print(self.pdfName, f"Title:{self.hist_RPCTdcRange.GetName()}")
315 self.hist_RPCRevotimeRange.Draw()
316 canvas.Print(self.pdfName, f"Title:{self.hist_RPCRevotimeRange.GetName()}")
317 self.hist_revotimeRPCtdc.Draw("colz")
318 canvas.Print(self.pdfName, f"Title:{self.hist_revotimeRPCtdc.GetName()}")
319 # self.hist_revotimeRPCtdc2.Draw("colz")
320 # canvas.Print(self.pdfName, "Title:{0}".format(self.hist_revotimeRPCtdc2.GetName()))
321 self.hist_jRPCtdc.Draw("colz")
322 canvas.Print(self.pdfName, f"Title:{self.hist_jRPCtdc.GetName()}")
323 # self.hist_jRPCtdc2.Draw("colz")
324 # canvas.Print(self.pdfName, "Title:{0}".format(self.hist_jRPCtdc2.GetName()))
325 self.hist_ScintTimeLowBitsBySector.Draw("box")
326 canvas.Print(self.pdfName, f"Title:{self.hist_ScintTimeLowBitsBySector.GetName()}")
327 self.hist_ScintTime.Draw()
328 canvas.Print(self.pdfName, f"Title:{self.hist_ScintTime.GetName()}")
329 self.hist_ScintCtime.Draw()
330 canvas.Print(self.pdfName, f"Title:{self.hist_ScintCtime.GetName()}")
331 self.hist_ScintCtime0.Draw()
332 canvas.Print(self.pdfName, f"Title:{self.hist_ScintCtime0.GetName()}")
333 self.hist_ScintCtimeRange.Draw()
334 canvas.Print(self.pdfName, f"Title:{self.hist_ScintCtimeRange.GetName()}")
335 pdfNameLast = f'{self.pdfName}]'
336 canvas.Print(pdfNameLast, f"Title:{self.hist_ScintCtimeRange.GetName()}")
337 self.histogramFile.Write()
338 self.histogramFile.Close()
339 print('Goodbye')
340

Member Data Documentation

◆ BKLM_ID

int BKLM_ID = 0x07000000
static

COPPER base identifier for BKLM readout.

Definition at line 23 of file EventInspectorPocketDAQ.py.

◆ BKLM_LAYER_BIT

int BKLM_LAYER_BIT = 7
static

bit position for layer-1 [0..14]; 0 is innermost

Definition at line 31 of file EventInspectorPocketDAQ.py.

◆ BKLM_LAYER_MASK

tuple BKLM_LAYER_MASK = (15 << BKLM_LAYER_BIT)
static

bit mask for layer-1 [0..15]; 0 is innermost and 14 is outermost

Definition at line 43 of file EventInspectorPocketDAQ.py.

◆ BKLM_MAXSTRIP_BIT

int BKLM_MAXSTRIP_BIT = 15
static

bit position for maxStrip-1 [0..47]

Definition at line 37 of file EventInspectorPocketDAQ.py.

◆ BKLM_MAXSTRIP_MASK

tuple BKLM_MAXSTRIP_MASK = (63 << BKLM_MAXSTRIP_BIT)
static

bit mask for maxStrip-1 [0..47]

Definition at line 49 of file EventInspectorPocketDAQ.py.

◆ BKLM_MODULEID_MASK

tuple BKLM_MODULEID_MASK = (BKLM_SECTION_MASK | BKLM_SECTOR_MASK | BKLM_LAYER_MASK)
static

bit mask for unique module identifier (end, sector, layer)

Definition at line 51 of file EventInspectorPocketDAQ.py.

◆ BKLM_PLANE_BIT

int BKLM_PLANE_BIT = 6
static

bit position for plane-1 [0..1]; 0 is inner-plane

Definition at line 29 of file EventInspectorPocketDAQ.py.

◆ BKLM_PLANE_MASK

tuple BKLM_PLANE_MASK = (1 << BKLM_PLANE_BIT)
static

bit mask for plane-1 [0..1]; 0 is inner-plane

Definition at line 41 of file EventInspectorPocketDAQ.py.

◆ BKLM_SECTION_BIT

int BKLM_SECTION_BIT = 14
static

bit position for section [0..1]; forward is 0

Definition at line 35 of file EventInspectorPocketDAQ.py.

◆ BKLM_SECTION_MASK

tuple BKLM_SECTION_MASK = (1 << BKLM_SECTION_BIT)
static

bit mask for section [0..1]; forward is 0

Definition at line 47 of file EventInspectorPocketDAQ.py.

◆ BKLM_SECTOR_BIT

int BKLM_SECTOR_BIT = 11
static

bit position for sector-1 [0..7]; 0 is on the +x axis and 2 is on the +y axis

Definition at line 33 of file EventInspectorPocketDAQ.py.

◆ BKLM_SECTOR_MASK

tuple BKLM_SECTOR_MASK = (7 << BKLM_SECTOR_BIT)
static

bit mask for sector-1 [0..7]; 0 is on the +x axis and 2 is on the +y axis

Definition at line 45 of file EventInspectorPocketDAQ.py.

◆ BKLM_STRIP_BIT

int BKLM_STRIP_BIT = 0
static

bit position for strip-1 [0..47]

Definition at line 27 of file EventInspectorPocketDAQ.py.

◆ BKLM_STRIP_MASK

int BKLM_STRIP_MASK = 0x3f
static

bit mask for strip-1 [0..47]

Definition at line 39 of file EventInspectorPocketDAQ.py.

◆ EKLM_ID

int EKLM_ID = 0x08000000
static

COPPER base identifier for EKLM readout.

Definition at line 25 of file EventInspectorPocketDAQ.py.

◆ exp

exp = exp

internal copy of experiment number

Definition at line 67 of file EventInspectorPocketDAQ.py.

◆ hist_ChannelOccupancy

list hist_ChannelOccupancy = [0, 0]

scatterplots of channel occupancy (1 hit per readout channel) for each axis

Definition at line 154 of file EventInspectorPocketDAQ.py.

◆ hist_ChannelOccupancyAL

list hist_ChannelOccupancyAL
Initial value:
= [
[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
[0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0], [0, 0],
[0, 0], [0, 0], [0, 0], [0, 0], [0, 0]]

histograms of channel occupancy (1 hit per readout channel), indexed by axis/lane

Definition at line 162 of file EventInspectorPocketDAQ.py.

◆ hist_jRPCtdc

hist_jRPCtdc
Initial value:
= ROOT.TH2F('jRPCtdc',
expRun + 'RPC TDC vs hit index;tdc (ns);Hit index',
64, 767.5, 1023.5, 60, -0.5, 59.5)

scatterplot of RPC calibrated time vs hit's index

Definition at line 230 of file EventInspectorPocketDAQ.py.

◆ hist_jRPCtdc2

hist_jRPCtdc2
Initial value:
= ROOT.TH2F('jRPCtdc2',
expRun + 'RPC TDC vs hit index;tdc - dt(index) (ns);Hit index',
64, 767.5, 1023.5, 60, -0.5, 59.5)

scatterplot of RPC calibrated time vs hit's index, corrected for DC-processing delay

Definition at line 234 of file EventInspectorPocketDAQ.py.

◆ hist_PerChannelMultiplicity

hist_PerChannelMultiplicity
Initial value:
= ROOT.TH2F(
'PerChannelMultiplicity',
expRun + 'Per-channel multiplicity (N/channel > 1);' +
'Per-channel multiplicity;' +
'(Lane #) * 2 + (Axis #)',
30, -0.5, 29.5, 42, -0.5, 41.5)

scatterplot of multiplicity of entries in one readout channel vs lane/axis

Definition at line 133 of file EventInspectorPocketDAQ.py.

◆ hist_rawKLMlane

hist_rawKLMlane
Initial value:
= ROOT.TH1F('rawKLMlane',
expRun + 'RawKLM lane;Lane (scint: 1..7, RPC: 8..20)',
21, -0.5, 20.5)

histogram of the hit's lane

Definition at line 121 of file EventInspectorPocketDAQ.py.

◆ hist_rawKLMsize

hist_rawKLMsize
Initial value:
= ROOT.TH1F('rawKLMsize',
expRun + 'RawKLM word count (1/channel)',
200, -0.5, 199.5)

histogram of number of hits, at most one entry per readout channel

Definition at line 129 of file EventInspectorPocketDAQ.py.

◆ hist_rawKLMsizeMultihit

hist_rawKLMsizeMultihit
Initial value:
= ROOT.TH1F('rawKLMsizeMultihit',
expRun + 'RawKLM word count (N/channel)',
200, -0.5, 199.5)

histogram of number of hits, including multiple entries on one readout channel

Definition at line 125 of file EventInspectorPocketDAQ.py.

◆ hist_revotimeRPCtdc

hist_revotimeRPCtdc
Initial value:
= ROOT.TH2F('revotimeRPCtdc',
expRun + 'RPC TDC vs revotime;tdc (ns);revotime - minRevotime',
64, 767.5, 1023.5, 10, -0.5, 159.5)

scatterplot of RPC REVO9 range vs TDC value in event

Definition at line 219 of file EventInspectorPocketDAQ.py.

◆ hist_revotimeRPCtdc2

hist_revotimeRPCtdc2
Initial value:
= ROOT.TH2F(
'revotimeRPCtdc2',
expRun + 'RPC TDC vs revotime;' +
'tdc - dt(index) (ns);' +
'revotime - minRevotime',
64, 767.5, 1023.5, 10, -0.5, 159.5)

scatterplot of RPC REVO9 range vs TDC value corrected for DC-processing delay in event

Definition at line 223 of file EventInspectorPocketDAQ.py.

◆ hist_RPCLaneAxisOccupancy

hist_RPCLaneAxisOccupancy
Initial value:
= ROOT.TH2F(
'RPCLaneAxisOccupancy',
expRun + 'Lane/axis occupancy of RPC channels (1/channel);' +
'Sector # (always 0);' +
'(Lane #) * 2 + (Axis #)',
3, -1.5, 1.5, 42, -0.5, 41.5)

scatterplot of number of mapped RPC hits by lane/axis vs sector, at most one entry per readout channel

Definition at line 140 of file EventInspectorPocketDAQ.py.

◆ hist_RPCRevotimeRange

hist_RPCRevotimeRange
Initial value:
= ROOT.TH1F('RPCRevotimeRange',
expRun + 'RPC revotime-range in event;revotimeMax - revotimeMin (ns)',
128, -0.5, 8191.5)

histogram of RPC REVO9 range in event

Definition at line 215 of file EventInspectorPocketDAQ.py.

◆ hist_RPCTdcRange

hist_RPCTdcRange = ROOT.TH1F('RPCTdcRange', expRun + 'RPC TDC-range in event;TDCMax - TDCMin (ns)', 512, -0.5, 2047.5)

histogram of RPC TDC range in event

Definition at line 213 of file EventInspectorPocketDAQ.py.

◆ hist_RPCTime

hist_RPCTime
Initial value:
= ROOT.TH1F('RPCTime',
expRun + 'RPC tdc relative to event trigtime;tdc - triggerTime (ns)',
256, -0.5, 1023.5)

histogram of RPC TDC value relative to event's REVO9 trigger time in last word of event

Definition at line 181 of file EventInspectorPocketDAQ.py.

◆ hist_RPCTime2

hist_RPCTime2
Initial value:
= ROOT.TH1F('RPCTime_Ctime',
expRun + 'RPC tdc relative to event ctime;tdc - trigCtime (ns)',
256, -0.5, 1023.5)

histogram of RPC TDC value relative to event's ctime in event header

Definition at line 185 of file EventInspectorPocketDAQ.py.

◆ hist_RPCTime2PerLayerA0

list hist_RPCTime2PerLayerA0 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

histograms of RPC TDC value relative to event's ctime for axis 0, indexed by lane

Definition at line 201 of file EventInspectorPocketDAQ.py.

◆ hist_RPCTime2PerLayerA1

list hist_RPCTime2PerLayerA1 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

histograms of RPC TDC value relative to event's ctime for axis 1, indexed by lane

Definition at line 207 of file EventInspectorPocketDAQ.py.

◆ hist_RPCTimeLowBitsBySector

hist_RPCTimeLowBitsBySector
Initial value:
= ROOT.TH2F('RPCTimeLowBitsBySector',
expRun + 'RPC TDC lowest-order bits;' +
'Sector # (always 0);' +
'TDC % 4 (ns) [should be 0]',
3, -1.5, 1.5, 8, -0.25, 3.75)

scatterplot of RPC TDC low-order bits vs sector (should be 0 since granularity is 4 ns)

Definition at line 175 of file EventInspectorPocketDAQ.py.

◆ hist_RPCTimePerLayerA0

list hist_RPCTimePerLayerA0 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

histograms of RPC TDC value relative to event's trigger time for axis 0, indexed by lane

Definition at line 189 of file EventInspectorPocketDAQ.py.

◆ hist_RPCTimePerLayerA1

list hist_RPCTimePerLayerA1 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]

histograms of RPC TDC value relative to event's trigger time for axis 1, indexed by lane

Definition at line 195 of file EventInspectorPocketDAQ.py.

◆ hist_ScintCtime

hist_ScintCtime
Initial value:
= ROOT.TH1F('ScintCtime',
expRun + 'Scint ctime distribution;ctime - triggerCtime (ns)',
32, -0.5, 1023.5)

histogram of scint CTIME value relative to event's ctime

Definition at line 249 of file EventInspectorPocketDAQ.py.

◆ hist_ScintCtime0

hist_ScintCtime0
Initial value:
= ROOT.TH1F('ScintCtime0',
expRun + 'Scint ctime distribution;ctime - triggerTime (ns)',
32, -0.5, 1023.5)

histogram of scint CTIME value relative to event's trigger time

Definition at line 253 of file EventInspectorPocketDAQ.py.

◆ hist_ScintCtimeRange

hist_ScintCtimeRange
Initial value:
= ROOT.TH1F(
'ScintCtimeRange', expRun + 'Scint ctime-range in event;ctimeMax - ctimeMin (ns)', 128, -0.5, 8191.5)

histogram of scint CTIME range in event

Definition at line 257 of file EventInspectorPocketDAQ.py.

◆ hist_ScintLaneAxisOccupancy

hist_ScintLaneAxisOccupancy
Initial value:
= ROOT.TH2F(
'ScintLaneAxisOccupancy',
expRun + 'Lane/axis occupancy of scint channels (1/channel);' +
'Sector # (always 0);' +
'(Lane #) * 2 + (Axis #)',
3, -1.5, 1.5, 42, -0.5, 41.5)

scatterplot of number of mapped scint hits by lane/axis vs sector, at most one entry per readout channel

Definition at line 147 of file EventInspectorPocketDAQ.py.

◆ hist_ScintTime

hist_ScintTime
Initial value:
= ROOT.TH1F('ScintTime',
expRun + 'Scint tdc distribution;tdc - triggerTime (ns)',
256, -0.5, 1023.5)

histogram of scint TDC value relative to event's trigger time

Definition at line 245 of file EventInspectorPocketDAQ.py.

◆ hist_ScintTimeLowBitsBySector

hist_ScintTimeLowBitsBySector
Initial value:
= ROOT.TH2F(
'ScintTimeLowBitsBySector',
expRun + 'Scint TDC lowest-order bits;' +
'Sector # (always 0);' +
'TDC % 4 (ns)',
3, -1.5, 1.5, 8, -0.25, 3.75)

scatterplot of scint TDC low-order bits vs sector

Definition at line 238 of file EventInspectorPocketDAQ.py.

◆ hist_ttc_trigtime

hist_ttc_trigtime
Initial value:
= ROOT.TH1F('ttc_trigtime',
expRun + 'tt_ctime relative to triggertime;' +
'tt_ctime - triggertime (ns)',
256, -0.5, 2047.5)

histogram of the tt_ctime relative to triggertime

Definition at line 116 of file EventInspectorPocketDAQ.py.

◆ histName

histName = histName

internal copy of the pathname of the output histogram ROOT file

Definition at line 71 of file EventInspectorPocketDAQ.py.

◆ histogramFile

histogramFile = ROOT.TFile.Open(self.histName, "RECREATE")

Output ROOT TFile that will contain the histograms/scatterplots.

Definition at line 111 of file EventInspectorPocketDAQ.py.

◆ pdfName

pdfName = pdfName

internal copy of the pathname of the output histogram PDF file

Definition at line 73 of file EventInspectorPocketDAQ.py.

◆ run

run = run

internal copy of run number

Definition at line 69 of file EventInspectorPocketDAQ.py.


The documentation for this class was generated from the following file: