205 ''' event processing '''
209 b2.B2ERROR(
'no TOPRecBunch')
211 if not recBunch.isReconstructed():
213 self.bunchOffset.Fill(recBunch.getCurrentOffset())
216 self.data.run = evtMetaData.getRun()
217 self.data.offset = recBunch.getCurrentOffset()
218 self.data.usedTrk = recBunch.getUsedTracks()
222 if not trk.isValid():
224 if not self.trk_selector.isSelected(trk):
226 pdfs = track.getRelated(
'TOPPDFCollections')
229 self.data.slot = pdfs.getModuleID()
230 momentum = pdfs.getAssociatedLocalMomentum()
231 position = pdfs.getAssociatedLocalHit()
232 self.data.p = momentum.R()
233 self.data.cth = math.cos(momentum.Theta())
234 self.data.phi = momentum.Phi()
235 self.data.z = position.Z()
236 self.data.x = position.X()
237 self.data.tof = trk.getTOF(Belle2.Const.muon)
239 tfit = track.getTrackFitResultWithClosestMass(Belle2.Const.muon)
240 except BaseException:
241 b2.B2ERROR(
"No trackFitResult available")
243 self.data.charge = tfit.getChargeSign()
244 pocaPosition = tfit.getPosition()
245 self.data.poca_x = pocaPosition.X()
246 self.data.poca_y = pocaPosition.Y()
247 self.data.poca_z = pocaPosition.Z()
248 self.data.hitsCDC = tfit.getHitPatternCDC().getNHits()
249 self.data.Ecms = self.trk_selector.getCMSEnergy()
251 extHit = trk.getExtHit()
252 timeZero = extHit.getRelated(
'TOPTimeZeros')
253 self.data.rec_t0 = timeZero.getTime()
254 self.data.valid_t0 = timeZero.isValid()
255 except BaseException:
257 self.data.valid_t0 = 0
259 self.h_cth_vs_p.Fill(self.data.p, self.data.cth)
260 self.h_momentum.Fill(self.data.p)
261 self.h_cth.Fill(self.data.cth)
262 self.h_phi.Fill(self.data.phi)
263 self.h_z.Fill(self.data.z)
264 self.h_x.Fill(self.data.x)
265 self.h_charge.Fill(self.data.charge)
266 self.h_poca_xy.Fill(self.data.poca_x, self.data.poca_y)
267 self.h_poca_z.Fill(self.data.poca_z)
268 self.h_hitsCDC.Fill(self.data.hitsCDC)
269 self.h_Ecms.Fill(self.data.Ecms)
271 pdf = pdfs.getHypothesisPDF(13)
272 except BaseException:
273 b2.B2ERROR(
"No PDF available for PDG = 13")
276 self.pdfHistogram(pdf)
277 emi = trk.getEmissionPoint()
278 x0 = emi.position.X()
279 z0 = emi.position.Y()
282 if digit.getModuleID() == self.data.slot
and digit.getHitQuality() == 1:
287 self.data.channel[k] = digit.getChannel()
288 self.data.pixel[k] = digit.getPixelID()
289 self.data.time[k] = digit.getTime()
290 self.data.timeErr[k] = digit.getTimeError()
291 self.data.pulseHeight[k] = digit.getPulseHeight()
292 self.data.pulseWidth[k] = digit.getPulseWidth()
293 self.data.sample[k] = digit.getModulo256Sample()
294 self.data.status[k] = digit.getStatus()
295 peaks = pdf[digit.getPixelID() - 1]
298 self.data.wid0[k] = 0
301 sorted_peaks = self.sortPeaks(peaks)
302 self.data.t0[k] = sorted_peaks[0].mean
303 self.data.wid0[k] = sorted_peaks[0].width
304 self.data.t1[k] = self.data.t0[k] + 100
306 self.data.t1[k] = sorted_peaks[1].mean
307 self.data.t_pdf[k] = 0
310 self.data.type[k] = 0
323 self.data.alpha[k] = 0
324 assocPDF = digit.getRelated(
'TOPAssociatedPDFs')
326 pik = assocPDF.getSinglePeak()
328 self.data.t_pdf[k] = pik.position
329 self.data.wid[k] = pik.width
330 self.data.fic[k] = math.degrees(pik.fic)
331 self.data.type[k] = pik.type
332 self.data.nx[k] = pik.nx
333 self.data.ny[k] = pik.ny
334 self.data.nxm[k] = pik.nxm
335 self.data.nym[k] = pik.nym
336 self.data.nxe[k] = pik.nxe
337 self.data.nye[k] = pik.nye
339 self.data.nys[k] = int(pik.nye / 2)
341 self.data.nys[k] = int((pik.nye + 1) / 2)
342 self.data.xd[k] = pik.xd
343 self.data.yd[k] = pik.yd
345 self.data.xm[k] = x0 + pik.kxe / pik.kze * (130.0 - z0)
346 self.data.kx[k] = pik.kxe
347 self.data.ky[k] = pik.kye
348 self.data.alpha[k] = math.degrees(math.acos(abs(pik.kzd)))
A (simplified) python wrapper for StoreArray.
a (simplified) python wrapper for StoreObjPtr.
Reconstructed track at TOP.