149 def event(self):
150 '''
151 Event processor: get data and print to screen
152 '''
154 event = evtMetaData.obj().getEvent()
155 run = evtMetaData.obj().getRun()
157 for waveform in waveforms:
158 chan = waveform.getChannel()
159 self.nWaveForms += 1
160
161 nInFirstWindow, nNarrowPeaks, nHeight150, nOscillations = 0, 0, 0, 0
162
163
164 wins = np.array(waveform.getStorageWindows())
165 if not np.all(wins[:-1] <= wins[1:]):
166 self.nWaveFormsOutOfOrder += 1
167 if False and args.plotWaveforms:
168 wf_display(waveform, run, event, "windowOrder")
169 self.plotCounter += 1
170
171 wf = np.array(waveform.getWaveform())
172 if False and args.plotWaveforms:
173 wf_display(waveform, run, event, "general")
174 self.plotCounter += 1
175
176
177
178 rawDigits = waveform.getRelationsWith("TOPRawDigits")
179 nTOPRawDigits = len(rawDigits)
180
181 if False and args.plotWaveforms and nTOPRawDigits > 2:
182
183 wf_display(waveform, run, event, "manyPeaks")
184 self.plotCounter += 1
185 if False and args.plotWaveforms and nTOPRawDigits > 3:
186
187 wf_display(waveform, run, event, "tooManyPeaks")
188 self.plotCounter += 1
189 raw = rawDigits[0]
190 fePeakHt = raw.getValuePeak()
191 fePeakTDC = raw.getSamplePeak()
192 fePeakWd = raw.getSampleFall() - raw.getSampleRise()
193 fePeakIntegral = raw.getIntegral()
194
195
196
197 if 0 < fePeakTDC < 65 and chan % 8 == 0:
198
199 nInFirstWindow += 1
200 if False and args.plotWaveforms:
201 wf_display(waveform, run, event, "calPuls_firstWin")
202 self.plotCounter += 1
203
204
205 if (140 < fePeakHt < 220) and chan % 8 == 0:
206 if False and args.plotWaveforms:
207 wf_display(waveform, run, event, "strangeADCBump_1")
208 self.plotCounter += 1
209 if (300 < fePeakHt < 410) and chan % 8 == 0:
210 if False and args.plotWaveforms:
211 wf_display(waveform, run, event, "strangeADCBump_2")
212 self.plotCounter += 1
213
214 fePeak1Ht = -1
215 fePeak1TDC = -1
216 fePeak1Wd = -1
217
218 if nTOPRawDigits > 1:
219
220 fePeak1Ht = rawDigits[1].getValuePeak()
221 fePeak1TDC = rawDigits[1].getSamplePeak()
222 fePeak1Wd = rawDigits[1].getSampleFall() - rawDigits[1].getSampleRise()
223
224
225 if nTOPRawDigits > 1 and fePeak1TDC < 64:
226
227 if False and args.plotWaveforms:
228 wf_display(waveform, run, event, "secondPeakInFirstWindow")
229 self.plotCounter += 1
230
231 if fePeakWd < 5 or nTOPRawDigits > 1 and fePeak1Wd < 5:
232
233 nNarrowPeaks += 1
234 if False and args.plotWaveforms:
235 wf_display(waveform, run, event, "thinpeak")
236 self.plotCounter += 1
237
238 if 145 < fePeak1Ht < 155 and chan % 8 == 0:
239
240 nHeight150 += 1
241 if False and args.plotWaveforms:
242 wf_display(waveform, run, event, "peak1Ht_is_150")
243 self.plotCounter += 1
244
245 if nTOPRawDigits > 5 and (fePeakHt - fePeak1Ht) < 5:
246 if np.mean(wf) < 10:
247
248
249 nOscillations += 1
250 if False and args.plotWaveforms:
251 wf_display(waveform, run, event, "oscillations")
252 self.plotCounter += 1
253
254 self.feProps.Fill(
255 event,
256 run,
257 fePeak1Ht,
258 fePeak1TDC,
259 fePeak1Wd,
260 fePeakHt,
261 fePeakTDC,
262 fePeakWd,
263 fePeakIntegral,
264 nTOPRawDigits,
265 chan,
266 nNarrowPeaks,
267 nInFirstWindow,
268 nHeight150,
269 nOscillations,
270 )
271
272
273 if args.plotWaveforms and self.plotCounter >= 10:
274 evtMetaData.obj().setEndOfData()
275
A (simplified) python wrapper for StoreArray.
a (simplified) python wrapper for StoreObjPtr.