Belle II Software  release-06-01-15
EventInspectorPocketDAQ.py
1 #!/usr/bin/env python3
2 # -*- coding: utf-8 -*-
3 
4 
11 
12 # Purpose:
13 # basf2 module to histogram useful values in PocketDAQ data created by the
14 # test stand at Indiana University.
15 #
16 import ROOT
17 
18 
20  """Fill BKLM histograms of values from RawKLMs, KLMDigits, BKLMHit1ds, and BKLMHit2ds;
21  (optionally) draw event displays from these data-objects."""
22 
23 
24  BKLM_ID = 0x07000000
25 
26  EKLM_ID = 0x08000000
27 
28  BKLM_STRIP_BIT = 0
29 
30  BKLM_PLANE_BIT = 6
31 
32  BKLM_LAYER_BIT = 7
33 
34  BKLM_SECTOR_BIT = 11
35 
36  BKLM_SECTION_BIT = 14
37 
38  BKLM_MAXSTRIP_BIT = 15
39 
40  BKLM_STRIP_MASK = 0x3f
41 
42  BKLM_PLANE_MASK = (1 << BKLM_PLANE_BIT)
43 
44  BKLM_LAYER_MASK = (15 << BKLM_LAYER_BIT)
45 
46  BKLM_SECTOR_MASK = (7 << BKLM_SECTOR_BIT)
47 
48  BKLM_SECTION_MASK = (1 << BKLM_SECTION_BIT)
49 
50  BKLM_MAXSTRIP_MASK = (63 << BKLM_MAXSTRIP_BIT)
51 
52  BKLM_MODULEID_MASK = (BKLM_SECTION_MASK | BKLM_SECTOR_MASK | BKLM_LAYER_MASK)
53 
54  def __init__(self, exp, run, histName, pdfName):
55  """Constructor
56 
57  Arguments:
58  exp (str): formatted experiment number
59  run (str): formatter run number
60  histName (str): path name of the output histogram ROOT file
61  pdfName (str): path name of the output histogram PDF file
62  eventPdfName (str): path name of the output event-display PDF file
63  maxDisplays (int): max # of events displays to write
64  minRPCHits (int): min # of RPC BKLMHit2ds in any sector for event display
65  """
66  super().__init__()
67 
68  self.expexp = exp
69 
70  self.runrun = run
71 
72  self.histNamehistName = histName
73 
74  self.pdfNamepdfName = pdfName
75 
76  def makeGraph(self, x, y):
77  """Create and return a ROOT TGraph
78 
79  Arguments:
80  x[] (real): x coordinates
81  y[] (real): y coordinates
82  """
83  graph = ROOT.TGraph()
84  for i in range(0, len(x)):
85  graph.SetPoint(i, x[i], y[i])
86  graph.SetLineColor(2)
87  graph.SetLineWidth(1)
88  return graph
89 
90  def makeText(self, x, y, s):
91  """Create and return a ROOT TLatex with the following properties:
92  size = 0.04, color = red, alignment = middle centre, angle = 90 degrees
93 
94  Arguments:
95  x (real): x coordinate
96  y (real): y coordinate
97  s (str): character string
98  """
99  text = ROOT.TLatex(x, y, s)
100  text.SetTextSize(0.04)
101  text.SetTextColor(2)
102  text.SetTextAlign(22)
103  text.SetTextAngle(90)
104  return text
105 
106  def initialize(self):
107  """Handle job initialization: create histograms"""
108 
109  expRun = 'e{0:02d}r{1}: '.format(int(self.expexp), int(self.runrun))
110 
111 
112  self.histogramFilehistogramFile = ROOT.TFile.Open(self.histNamehistName, "RECREATE")
113 
114  # create the rawKLM histograms
115 
116 
117  self.hist_ttc_trigtimehist_ttc_trigtime = ROOT.TH1F('ttc_trigtime',
118  expRun + 'tt_ctime relative to triggertime;' +
119  'tt_ctime - triggertime (ns)',
120  256, -0.5, 2047.5)
121 
122  self.hist_rawKLMlanehist_rawKLMlane = ROOT.TH1F('rawKLMlane',
123  expRun + 'RawKLM lane;Lane (scint: 1..7, RPC: 8..20)',
124  21, -0.5, 20.5)
125 
126  self.hist_rawKLMsizeMultihithist_rawKLMsizeMultihit = ROOT.TH1F('rawKLMsizeMultihit',
127  expRun + 'RawKLM word count (N/channel)',
128  200, -0.5, 199.5)
129 
130  self.hist_rawKLMsizehist_rawKLMsize = ROOT.TH1F('rawKLMsize',
131  expRun + 'RawKLM word count (1/channel)',
132  200, -0.5, 199.5)
133 
134  self.hist_PerChannelMultiplicityhist_PerChannelMultiplicity = ROOT.TH2F(
135  'PerChannelMultiplicity',
136  expRun + 'Per-channel multiplicity (N/channel > 1);' +
137  'Per-channel multiplicity;' +
138  '(Lane #) * 2 + (Axis #)',
139  30, -0.5, 29.5, 42, -0.5, 41.5)
140 
141  self.hist_RPCLaneAxisOccupancyhist_RPCLaneAxisOccupancy = ROOT.TH2F(
142  'RPCLaneAxisOccupancy',
143  expRun + 'Lane/axis occupancy of RPC channels (1/channel);' +
144  'Sector # (always 0);' +
145  '(Lane #) * 2 + (Axis #)',
146  3, -1.5, 1.5, 42, -0.5, 41.5)
147 
148  self.hist_ScintLaneAxisOccupancyhist_ScintLaneAxisOccupancy = ROOT.TH2F(
149  'ScintLaneAxisOccupancy',
150  expRun + 'Lane/axis occupancy of scint channels (1/channel);' +
151  'Sector # (always 0);' +
152  '(Lane #) * 2 + (Axis #)',
153  3, -1.5, 1.5, 42, -0.5, 41.5)
154 
155  self.hist_ChannelOccupancyhist_ChannelOccupancy = [0, 0]
156  self.hist_ChannelOccupancyhist_ChannelOccupancy[0] = ROOT.TH2F('ChannelOccupancy_a0',
157  expRun + 'Channel occupancy for axis 0;lane;channel',
158  42, -0.25, 20.75, 128, -0.25, 63.75)
159  self.hist_ChannelOccupancyhist_ChannelOccupancy[1] = ROOT.TH2F('ChannelOccupancy_a1',
160  expRun + 'Channel occupancy for axis 1;lane;channel',
161  42, -0.25, 20.75, 128, -0.25, 63.75)
162 
163  self.hist_ChannelOccupancyALhist_ChannelOccupancyAL = [
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], [0, 0], [0, 0], [0, 0],
166  [0, 0], [0, 0], [0, 0], [0, 0], [0, 0]]
167  for lane in range(0, 21):
168  nChannels = 64 if (lane > 2) else 128
169  label = 'ChannelOccupancy_A0L{0}'.format(lane)
170  title = '{0}Channel occupancy for axis 0 lane {1};channel'.format(expRun, lane)
171  self.hist_ChannelOccupancyALhist_ChannelOccupancyAL[lane][0] = ROOT.TH1F(label, title, nChannels, -0.5, nChannels - 0.5)
172  label = 'ChannelOccupancy_A1L{0}'.format(lane)
173  title = '{0}Channel occupancy for axis 1 lane {1};channel'.format(expRun, lane)
174  self.hist_ChannelOccupancyALhist_ChannelOccupancyAL[lane][1] = ROOT.TH1F(label, title, nChannels, -0.5, nChannels - 0.5)
175 
176  self.hist_RPCTimeLowBitsBySectorhist_RPCTimeLowBitsBySector = ROOT.TH2F('RPCTimeLowBitsBySector',
177  expRun + 'RPC TDC lowest-order bits;' +
178  'Sector # (always 0);' +
179  'TDC % 4 (ns) [should be 0]',
180  3, -1.5, 1.5, 8, -0.25, 3.75)
181 
182  self.hist_RPCTimehist_RPCTime = ROOT.TH1F('RPCTime',
183  expRun + 'RPC tdc relative to event trigtime;tdc - triggerTime (ns)',
184  256, -0.5, 1023.5)
185 
186  self.hist_RPCTime2hist_RPCTime2 = ROOT.TH1F('RPCTime_Ctime',
187  expRun + 'RPC tdc relative to event ctime;tdc - trigCtime (ns)',
188  256, -0.5, 1023.5)
189 
190  self.hist_RPCTimePerLayerA0hist_RPCTimePerLayerA0 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
191  for lane in range(0, 21):
192  label = 'RPCTimeA0L{0:02d}'.format(lane)
193  title = '{0}RPC axis 0 lane {1} time relative to trigtime;t - triggerTime (ns)'.format(expRun, lane)
194  self.hist_RPCTimePerLayerA0hist_RPCTimePerLayerA0[lane] = ROOT.TH1F(label, title, 256, -0.5, 1023.5)
195 
196  self.hist_RPCTimePerLayerA1hist_RPCTimePerLayerA1 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
197  for lane in range(0, 21):
198  label = 'RPCTimeA1L{0:02d}'.format(lane)
199  title = '{0}RPC axis 1 lane {1} time relative to trigtime;t - triggerTime (ns)'.format(expRun, lane)
200  self.hist_RPCTimePerLayerA1hist_RPCTimePerLayerA1[lane] = ROOT.TH1F(label, title, 256, -0.5, 1023.5)
201 
202  self.hist_RPCTime2PerLayerA0hist_RPCTime2PerLayerA0 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
203  for lane in range(0, 21):
204  label = 'RPCTime2A0L{0:02d}'.format(lane)
205  title = '{0}RPC axis 0 lane {1} time relative to trigCtime;t - trigCtime (ns)'.format(expRun, lane)
206  self.hist_RPCTime2PerLayerA0hist_RPCTime2PerLayerA0[lane] = ROOT.TH1F(label, title, 256, -0.5, 1023.5)
207 
208  self.hist_RPCTime2PerLayerA1hist_RPCTime2PerLayerA1 = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
209  for lane in range(0, 21):
210  label = 'RPCTime2A1L{0:02d}'.format(lane)
211  title = '{0}RPC axis 1 lane {1} time relative to trigCtime;t - trigCtime (ns)'.format(expRun, lane)
212  self.hist_RPCTime2PerLayerA1hist_RPCTime2PerLayerA1[lane] = ROOT.TH1F(label, title, 256, -0.5, 1023.5)
213 
214  self.hist_RPCTdcRangehist_RPCTdcRange = ROOT.TH1F('RPCTdcRange', expRun + 'RPC TDC-range in event;TDCMax - TDCMin (ns)', 512, -0.5, 2047.5)
215 
216  self.hist_RPCRevotimeRangehist_RPCRevotimeRange = ROOT.TH1F('RPCRevotimeRange',
217  expRun + 'RPC revotime-range in event;revotimeMax - revotimeMin (ns)',
218  128, -0.5, 8191.5)
219 
220  self.hist_revotimeRPCtdchist_revotimeRPCtdc = ROOT.TH2F('revotimeRPCtdc',
221  expRun + 'RPC TDC vs revotime;tdc (ns);revotime - minRevotime',
222  64, 767.5, 1023.5, 10, -0.5, 159.5)
223 
224  self.hist_revotimeRPCtdc2hist_revotimeRPCtdc2 = ROOT.TH2F(
225  'revotimeRPCtdc2',
226  expRun + 'RPC TDC vs revotime;' +
227  'tdc - dt(index) (ns);' +
228  'revotime - minRevotime',
229  64, 767.5, 1023.5, 10, -0.5, 159.5)
230 
231  self.hist_jRPCtdchist_jRPCtdc = ROOT.TH2F('jRPCtdc',
232  expRun + 'RPC TDC vs hit index;tdc (ns);Hit index',
233  64, 767.5, 1023.5, 60, -0.5, 59.5)
234 
235  self.hist_jRPCtdc2hist_jRPCtdc2 = ROOT.TH2F('jRPCtdc2',
236  expRun + 'RPC TDC vs hit index;tdc - dt(index) (ns);Hit index',
237  64, 767.5, 1023.5, 60, -0.5, 59.5)
238 
239  self.hist_ScintTimeLowBitsBySectorhist_ScintTimeLowBitsBySector = ROOT.TH2F(
240  'ScintTimeLowBitsBySector',
241  expRun + 'Scint TDC lowest-order bits;' +
242  'Sector # (always 0);' +
243  'TDC % 4 (ns)',
244  3, -1.5, 1.5, 8, -0.25, 3.75)
245 
246  self.hist_ScintTimehist_ScintTime = ROOT.TH1F('ScintTime',
247  expRun + 'Scint tdc distribution;tdc - triggerTime (ns)',
248  256, -0.5, 1023.5)
249 
250  self.hist_ScintCtimehist_ScintCtime = ROOT.TH1F('ScintCtime',
251  expRun + 'Scint ctime distribution;ctime - triggerCtime (ns)',
252  32, -0.5, 1023.5)
253 
254  self.hist_ScintCtime0hist_ScintCtime0 = ROOT.TH1F('ScintCtime0',
255  expRun + 'Scint ctime distribution;ctime - triggerTime (ns)',
256  32, -0.5, 1023.5)
257 
258  self.hist_ScintCtimeRangehist_ScintCtimeRange = ROOT.TH1F(
259  'ScintCtimeRange', expRun + 'Scint ctime-range in event;ctimeMax - ctimeMin (ns)', 128, -0.5, 8191.5)
260 
261  def terminate(self):
262  """Handle job termination: draw histograms, close output files"""
263 
264  canvas = ROOT.TCanvas("canvas", self.pdfNamepdfName, 1600, 1600)
265  title = '{0}['.format(self.pdfNamepdfName)
266  canvas.SaveAs(title)
267  canvas.Clear()
268  canvas.GetPad(0).SetGrid(1, 1)
269  canvas.GetPad(0).Update()
270  self.hist_rawKLMlanehist_rawKLMlane.Draw()
271  canvas.Print(self.pdfNamepdfName, "Title:{0}".format(self.hist_rawKLMlanehist_rawKLMlane.GetName()))
272  self.hist_rawKLMsizeMultihithist_rawKLMsizeMultihit.Draw()
273  canvas.Print(self.pdfNamepdfName, "Title:{0}".format(self.hist_rawKLMsizeMultihithist_rawKLMsizeMultihit.GetName()))
274  self.hist_rawKLMsizehist_rawKLMsize.Draw()
275  canvas.Print(self.pdfNamepdfName, "Title:{0}".format(self.hist_rawKLMsizehist_rawKLMsize.GetName()))
276  self.hist_PerChannelMultiplicityhist_PerChannelMultiplicity.Draw("box")
277  canvas.Print(self.pdfNamepdfName, "Title:{0}".format(self.hist_PerChannelMultiplicityhist_PerChannelMultiplicity.GetName()))
278  canvas.Clear()
279  canvas.Divide(2, 1)
280  canvas.GetPad(0).SetGrid(1, 1)
281  canvas.GetPad(1).SetGrid(1, 1)
282  canvas.GetPad(2).SetGrid(1, 1)
283  for sectorFB in range(0, 1):
284  canvas.cd(1)
285  self.hist_ChannelOccupancyhist_ChannelOccupancy[0].Draw("colz")
286  canvas.cd(2)
287  self.hist_ChannelOccupancyhist_ChannelOccupancy[1].Draw("colz")
288  canvas.Print(self.pdfNamepdfName, "Title:{0}".format(self.hist_ChannelOccupancyhist_ChannelOccupancy[0].GetName()))
289  for lane in range(0, 21):
290  n0 = self.hist_ChannelOccupancyALhist_ChannelOccupancyAL[lane][0].GetEntries()
291  n1 = self.hist_ChannelOccupancyALhist_ChannelOccupancyAL[lane][1].GetEntries()
292  if n0 + n1 > 0:
293  canvas.cd(1)
294  self.hist_ChannelOccupancyALhist_ChannelOccupancyAL[lane][0].Draw()
295  canvas.cd(2)
296  self.hist_ChannelOccupancyALhist_ChannelOccupancyAL[lane][1].Draw()
297  canvas.Print(self.pdfNamepdfName, "Title:{0}".format(self.hist_ChannelOccupancyALhist_ChannelOccupancyAL[lane][0].GetName()))
298  canvas.Clear()
299  canvas.Divide(1, 1)
300  self.hist_ttc_trigtimehist_ttc_trigtime.Draw()
301  canvas.Print(self.pdfNamepdfName, "Title:{0}".format(self.hist_ttc_trigtimehist_ttc_trigtime.GetName()))
302  self.hist_RPCTimeLowBitsBySectorhist_RPCTimeLowBitsBySector.Draw("box")
303  canvas.Print(self.pdfNamepdfName, "Title:{0}".format(self.hist_RPCTimeLowBitsBySectorhist_RPCTimeLowBitsBySector.GetName()))
304  self.hist_RPCTimehist_RPCTime.Draw()
305  canvas.Print(self.pdfNamepdfName, "Title:{0}".format(self.hist_RPCTimehist_RPCTime.GetName()))
306  for lane in range(0, 21):
307  if self.hist_RPCTimePerLayerA0hist_RPCTimePerLayerA0[lane].GetEntries() > 0:
308  self.hist_RPCTimePerLayerA0hist_RPCTimePerLayerA0[lane].Draw()
309  canvas.Print(self.pdfNamepdfName, "Title:{0}".format(self.hist_RPCTimePerLayerA0hist_RPCTimePerLayerA0[lane].GetName()))
310  for lane in range(0, 21):
311  if self.hist_RPCTimePerLayerA1hist_RPCTimePerLayerA1[lane].GetEntries() > 0:
312  self.hist_RPCTimePerLayerA1hist_RPCTimePerLayerA1[lane].Draw()
313  canvas.Print(self.pdfNamepdfName, "Title:{0}".format(self.hist_RPCTimePerLayerA1hist_RPCTimePerLayerA1[lane].GetName()))
314  self.hist_RPCTdcRangehist_RPCTdcRange.Draw()
315  canvas.Print(self.pdfNamepdfName, "Title:{0}".format(self.hist_RPCTdcRangehist_RPCTdcRange.GetName()))
316  self.hist_RPCRevotimeRangehist_RPCRevotimeRange.Draw()
317  canvas.Print(self.pdfNamepdfName, "Title:{0}".format(self.hist_RPCRevotimeRangehist_RPCRevotimeRange.GetName()))
318  self.hist_revotimeRPCtdchist_revotimeRPCtdc.Draw("colz")
319  canvas.Print(self.pdfNamepdfName, "Title:{0}".format(self.hist_revotimeRPCtdchist_revotimeRPCtdc.GetName()))
320  # self.hist_revotimeRPCtdc2.Draw("colz")
321  # canvas.Print(self.pdfName, "Title:{0}".format(self.hist_revotimeRPCtdc2.GetName()))
322  self.hist_jRPCtdchist_jRPCtdc.Draw("colz")
323  canvas.Print(self.pdfNamepdfName, "Title:{0}".format(self.hist_jRPCtdchist_jRPCtdc.GetName()))
324  # self.hist_jRPCtdc2.Draw("colz")
325  # canvas.Print(self.pdfName, "Title:{0}".format(self.hist_jRPCtdc2.GetName()))
326  self.hist_ScintTimeLowBitsBySectorhist_ScintTimeLowBitsBySector.Draw("box")
327  canvas.Print(self.pdfNamepdfName, "Title:{0}".format(self.hist_ScintTimeLowBitsBySectorhist_ScintTimeLowBitsBySector.GetName()))
328  self.hist_ScintTimehist_ScintTime.Draw()
329  canvas.Print(self.pdfNamepdfName, "Title:{0}".format(self.hist_ScintTimehist_ScintTime.GetName()))
330  self.hist_ScintCtimehist_ScintCtime.Draw()
331  canvas.Print(self.pdfNamepdfName, "Title:{0}".format(self.hist_ScintCtimehist_ScintCtime.GetName()))
332  self.hist_ScintCtime0hist_ScintCtime0.Draw()
333  canvas.Print(self.pdfNamepdfName, "Title:{0}".format(self.hist_ScintCtime0hist_ScintCtime0.GetName()))
334  self.hist_ScintCtimeRangehist_ScintCtimeRange.Draw()
335  canvas.Print(self.pdfNamepdfName, "Title:{0}".format(self.hist_ScintCtimeRangehist_ScintCtimeRange.GetName()))
336  pdfNameLast = '{0}]'.format(self.pdfNamepdfName)
337  canvas.Print(pdfNameLast, "Title:{0}".format(self.hist_ScintCtimeRangehist_ScintCtimeRange.GetName()))
338  self.histogramFilehistogramFile.Write()
339  self.histogramFilehistogramFile.Close()
340  print('Goodbye')
341 
342  def beginRun(self):
343  """Handle begin of run: print diagnostic message"""
344  print('beginRun', self.runrun)
345 
346  def endRun(self):
347  """Handle end of run: print diagnostic message"""
348  print('endRun', self.runrun)
349 
350  def event(self, eventHits, tt_ctime, raw_time):
351  """Process one event: fill histograms"""
352 
353  sectorFB = 0
354  n = len(eventHits)
355  countAllMultihit = 2 * n + 1 if (n > 0) else 0
356  countAll = 1
357  channelMultiplicity = {}
358  minCtime = 99999
359  minRPCTdc = 99999
360  maxRPCTdc = 0
361  minRPCCtime = 99999
362  maxRPCCtime = 0
363  minScintCtime = 99999
364  maxScintCtime = 0
365  self.hist_ttc_trigtimehist_ttc_trigtime.Fill((tt_ctime - raw_time) & 0x0fff)
366  for j in range(0, n):
367  items = eventHits[j]
368  lane = items[0]
369  channel = items[1]
370  axis = items[2]
371  ctime = items[3] # this is revo9 time for RPCs, ctime for scintillators
372  flag = 1 if (lane > 2) else 2
373  isRPC = (flag == 1)
374  isScint = (flag == 2)
375  laneAxisChannel = (((lane << 1) + axis) << 7) + channel
376  if laneAxisChannel not in channelMultiplicity:
377  countAll = countAll + 2
378  channelMultiplicity[laneAxisChannel] = 0
379  channelMultiplicity[laneAxisChannel] = channelMultiplicity[laneAxisChannel] + 1
380  if ctime < minCtime:
381  minCtime = ctime
382  self.hist_rawKLMlanehist_rawKLMlane.Fill(lane)
383  for j in range(0, n):
384  items = eventHits[j]
385  lane = items[0]
386  channel = items[1]
387  axis = items[2]
388  ctime = items[3] # this is revo9 time for RPCs, ctime for scintillators
389  tdc = items[4]
390  charge = items[5]
391  flag = 1 if (lane > 2) else 2
392  isRPC = (flag == 1)
393  isScint = (flag == 2)
394  laneAxisChannel = (((lane << 1) + axis) << 7) + channel
395  laneAxis = axis if ((lane < 1) or (lane > 20)) else ((lane << 1) + axis)
396  if laneAxisChannel in channelMultiplicity:
397  if channelMultiplicity[laneAxisChannel] > 1:
398  self.hist_PerChannelMultiplicityhist_PerChannelMultiplicity.Fill(channelMultiplicity[laneAxisChannel], laneAxis)
399  # DIVOT del channelMultiplicity[laneAxisChannel] # consider only first hit in the channel/axis/lane of this dc
400  t = (tdc - raw_time) & 0x03ff # in ns, range is 0..1023
401  t2 = (tdc - tt_ctime) & 0x03ff # in ns, range is 0..1023
402  ct = ((ctime << 3) - tt_ctime) & 0x3ff
403  if isRPC:
404  if tdc < minRPCTdc:
405  minRPCTdc = tdc
406  if tdc > maxRPCTdc:
407  maxRPCTdc = tdc
408  if ctime < minRPCCtime:
409  minRPCCtime = ctime
410  if ctime > maxRPCCtime:
411  maxRPCCtime = ctime
412  self.hist_RPCTimeLowBitsBySectorhist_RPCTimeLowBitsBySector.Fill(sectorFB, (tdc & 3))
413  self.hist_RPCLaneAxisOccupancyhist_RPCLaneAxisOccupancy.Fill(sectorFB, laneAxis)
414  self.hist_RPCTimehist_RPCTime.Fill(t)
415  self.hist_RPCTime2hist_RPCTime2.Fill(t2)
416  if axis == 0:
417  self.hist_RPCTimePerLayerA0hist_RPCTimePerLayerA0[lane].Fill(t)
418  self.hist_RPCTime2PerLayerA0hist_RPCTime2PerLayerA0[lane].Fill(t2)
419  else:
420  self.hist_RPCTimePerLayerA1hist_RPCTimePerLayerA1[lane].Fill(t)
421  self.hist_RPCTime2PerLayerA1hist_RPCTime2PerLayerA1[lane].Fill(t2)
422  if n > 0:
423  t0j = 0.75 * j
424  self.hist_revotimeRPCtdchist_revotimeRPCtdc.Fill(t, ctime - minCtime)
425  self.hist_revotimeRPCtdc2hist_revotimeRPCtdc2.Fill(t - t0j, ctime - minCtime)
426  self.hist_jRPCtdchist_jRPCtdc.Fill(t, j)
427  self.hist_jRPCtdc2hist_jRPCtdc2.Fill(t - t0j, j)
428  else:
429  if ctime < minScintCtime:
430  minScintCtime = ctime
431  if ctime > maxScintCtime:
432  maxScintCtime = ctime
433  self.hist_ScintTimeLowBitsBySectorhist_ScintTimeLowBitsBySector.Fill(sectorFB, (tdc & 3))
434  self.hist_ScintLaneAxisOccupancyhist_ScintLaneAxisOccupancy.Fill(sectorFB, laneAxis)
435  self.hist_ScintTimehist_ScintTime.Fill(t)
436  self.hist_ScintCtimehist_ScintCtime.Fill(ct)
437  self.hist_ScintCtime0hist_ScintCtime0.Fill(((ctime << 3) - raw_time) & 0x3ff)
438  self.hist_ChannelOccupancyhist_ChannelOccupancy[axis].Fill(lane, channel)
439  self.hist_ChannelOccupancyALhist_ChannelOccupancyAL[lane][axis].Fill(channel)
440  if n > 1:
441  if maxRPCTdc > 0:
442  self.hist_RPCTdcRangehist_RPCTdcRange.Fill(maxRPCTdc - minRPCTdc)
443  if maxRPCCtime > 0:
444  self.hist_RPCRevotimeRangehist_RPCRevotimeRange.Fill((maxRPCCtime - minRPCCtime) << 3)
445  if maxScintCtime > 0:
446  self.hist_ScintCtimeRangehist_ScintCtimeRange.Fill((maxScintCtime - minScintCtime) << 3)
447  self.hist_rawKLMsizeMultihithist_rawKLMsizeMultihit.Fill(countAllMultihit)
448  self.hist_rawKLMsizehist_rawKLMsize.Fill(countAll)
hist_ChannelOccupancyAL
histograms of channel occupancy (1 hit per readout channel), indexed by axis/lane
hist_PerChannelMultiplicity
scatterplot of multiplicity of entries in one readout channel vs lane/axis
hist_ScintCtimeRange
histogram of scint CTIME range in event
hist_RPCTimePerLayerA0
histograms of RPC TDC value relative to event's trigger time for axis 0, indexed by lane
hist_jRPCtdc
scatterplot of RPC calibrated time vs hit's index
hist_RPCTimePerLayerA1
histograms of RPC TDC value relative to event's trigger time for axis 1, indexed by lane
hist_RPCTdcRange
histogram of RPC TDC range in event
hist_RPCTime2PerLayerA0
histograms of RPC TDC value relative to event's ctime for axis 0, indexed by lane
hist_ScintLaneAxisOccupancy
scatterplot of number of mapped scint hits by lane/axis vs sector, at most one entry per readout chan...
def event(self, eventHits, tt_ctime, raw_time)
hist_rawKLMsizeMultihit
histogram of number of hits, including multiple entries on one readout channel
hist_revotimeRPCtdc
scatterplot of RPC REVO9 range vs TDC value in event
hist_ChannelOccupancy
scatterplots of channel occupancy (1 hit per readout channel) for each axis
hist_revotimeRPCtdc2
scatterplot of RPC REVO9 range vs TDC value corrected for DC-processing delay in event
hist_ttc_trigtime
histogram of the tt_ctime relative to triggertime
def __init__(self, exp, run, histName, pdfName)
hist_RPCRevotimeRange
histogram of RPC REVO9 range in event
hist_RPCTimeLowBitsBySector
scatterplot of RPC TDC low-order bits vs sector (should be 0 since granularity is 4 ns)
hist_RPCTime2
histogram of RPC TDC value relative to event's ctime in event header
hist_ScintCtime
histogram of scint CTIME value relative to event's ctime
hist_RPCTime
histogram of RPC TDC value relative to event's REVO9 trigger time in last word of event
hist_ScintTime
histogram of scint TDC value relative to event's trigger time
pdfName
internal copy of the pathname of the output histogram PDF file
hist_RPCTime2PerLayerA1
histograms of RPC TDC value relative to event's ctime for axis 1, indexed by lane
histogramFile
Output ROOT TFile that will contain the histograms/scatterplots.
hist_ScintTimeLowBitsBySector
scatterplot of scint TDC low-order bits vs sector
histName
internal copy of the pathname of the output histogram ROOT file
hist_RPCLaneAxisOccupancy
scatterplot of number of mapped RPC hits by lane/axis vs sector, at most one entry per readout channe...
hist_ScintCtime0
histogram of scint CTIME value relative to event's trigger time
hist_rawKLMsize
histogram of number of hits, at most one entry per readout channel
hist_jRPCtdc2
scatterplot of RPC calibrated time vs hit's index, corrected for DC-processing delay