106 """Handle job initialization: create histograms"""
108 expRun = f
'e{int(self.exp):02d}r{int(self.run)}: '
117 expRun +
'tt_ctime relative to triggertime;' +
118 'tt_ctime - triggertime (ns)',
122 expRun +
'RawKLM lane;Lane (scint: 1..7, RPC: 8..20)',
126 expRun +
'RawKLM word count (N/channel)',
130 expRun +
'RawKLM word count (1/channel)',
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)
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)
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)
156 expRun +
'Channel occupancy for axis 0;lane;channel',
157 42, -0.25, 20.75, 128, -0.25, 63.75)
159 expRun +
'Channel occupancy for axis 1;lane;channel',
160 42, -0.25, 20.75, 128, -0.25, 63.75)
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'
171 label = f
'ChannelOccupancy_A1L{lane}'
172 title = f
'{expRun}Channel occupancy for axis 1 lane {lane};channel'
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)
182 expRun +
'RPC tdc relative to event trigtime;tdc - triggerTime (ns)',
186 expRun +
'RPC tdc relative to event ctime;tdc - trigCtime (ns)',
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)'
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)'
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)'
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)'
213 self.
hist_RPCTdcRange = ROOT.TH1F(
'RPCTdcRange', expRun +
'RPC TDC-range in event;TDCMax - TDCMin (ns)', 512, -0.5, 2047.5)
216 expRun +
'RPC revotime-range in event;revotimeMax - revotimeMin (ns)',
220 expRun +
'RPC TDC vs revotime;tdc (ns);revotime - minRevotime',
221 64, 767.5, 1023.5, 10, -0.5, 159.5)
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)
231 expRun +
'RPC TDC vs hit index;tdc (ns);Hit index',
232 64, 767.5, 1023.5, 60, -0.5, 59.5)
235 expRun +
'RPC TDC vs hit index;tdc - dt(index) (ns);Hit index',
236 64, 767.5, 1023.5, 60, -0.5, 59.5)
239 'ScintTimeLowBitsBySector',
240 expRun +
'Scint TDC lowest-order bits;' +
241 'Sector # (always 0);' +
243 3, -1.5, 1.5, 8, -0.25, 3.75)
246 expRun +
'Scint tdc distribution;tdc - triggerTime (ns)',
250 expRun +
'Scint ctime distribution;ctime - triggerCtime (ns)',
254 expRun +
'Scint ctime distribution;ctime - triggerTime (ns)',
258 'ScintCtimeRange', expRun +
'Scint ctime-range in event;ctimeMax - ctimeMin (ns)', 128, -0.5, 8191.5)
349 def event(self, eventHits, tt_ctime, raw_time):
350 """Process one event: fill histograms"""
354 countAllMultihit = 2 * n + 1
if (n > 0)
else 0
356 channelMultiplicity = {}
362 minScintCtime = 99999
365 for j
in range(0, n):
371 flag = 1
if (lane > 2)
else 2
373 isScint = (flag == 2)
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
382 for j
in range(0, n):
390 flag = 1
if (lane > 2)
else 2
392 isScint = (flag == 2)
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:
399 t = (tdc - raw_time) & 0x03ff
400 t2 = (tdc - tt_ctime) & 0x03ff
401 ct = ((ctime << 3) - tt_ctime) & 0x3ff
407 if ctime < minRPCCtime:
409 if ctime > maxRPCCtime:
428 if ctime < minScintCtime:
429 minScintCtime = ctime
430 if ctime > maxScintCtime:
431 maxScintCtime = ctime
444 if maxScintCtime > 0: