61 def event(self):
62 """
63 reimplement Module::event()
64 """
65
67 for pid in pids:
68 track = pid.getRelatedFrom('Tracks')
69 if track:
70 mcpart = track.getRelatedTo('MCParticles')
71 if not track or not mcpart:
72
73 b2.B2WARNING('problems with track <-> mcparticle relations')
75 print(f'event: {int(event)}, track: {int(track.getArrayIndex())}')
76 else:
77 pdg = abs(mcpart.getPDG())
78 momentumVec = mcpart.getMomentum()
79 momentum = momentumVec.Mag()
80 if momentum > 3.5:
81 continue
82
83
84
85 selectedpart = Belle2.Const.kaon
88 logl_sel = pid.getLogL(selectedpart, pid_dedx)
89 logl_pi = pid.getLogL(Belle2.Const.pion, pid_dedx)
90 dedx_DLL = logl_pi - logl_sel
91
92 logl_sel = pid.getLogL(selectedpart, pid_top)
93 logl_pi = pid.getLogL(Belle2.Const.pion, pid_top)
94 top_DLL = logl_pi - logl_sel
95
96 if pdg == selectedpart.getPDGCode():
97 hist[0].Fill(momentum, dedx_DLL)
98 hist[2].Fill(momentum, top_DLL)
99 elif pdg == 211:
100 hist[1].Fill(momentum, dedx_DLL)
101 hist[3].Fill(momentum, top_DLL)
102
A class for sets of detector IDs whose content is limited to restricted set of valid detector IDs.
A (simplified) python wrapper for StoreArray.
a (simplified) python wrapper for StoreObjPtr.