Belle II Software development
TestModule Class Reference
Inheritance diagram for TestModule:

Public Member Functions

def event (self)
 

Detailed Description

short test module to demonstrate the readout of the CDC trigger

Definition at line 97 of file trgcdcReadout.py.

Member Function Documentation

◆ event()

def event (   self)
print output values of the different stages in the CDC trigger

Definition at line 102 of file trgcdcReadout.py.

102 def event(self):
103 """
104 print output values of the different stages in the CDC trigger
105 """
106 print("CDC trigger readout")
107 print("event time:", Belle2.PyStoreObj("CDCTriggerEventTime").obj().getTiming())
108 tracks2Dfinder = Belle2.PyStoreArray("Trg2DFinderTracks")
109 tracks2Dfitter = Belle2.PyStoreArray("Trg2DFitterTracks")
110 tracks3Dfitter = Belle2.PyStoreArray("Trg3DFitterTracks")
111 tracks3Dneuro = Belle2.PyStoreArray("TrgNNTracks")
112 listnames = ["2D finder", "2D fitter", "3D fitter", "Neurotrigger"]
113 for i, tracks in enumerate([tracks2Dfinder, tracks2Dfitter,
114 tracks3Dfitter, tracks3Dneuro]):
115 print(listnames[i], "has", len(tracks), "tracks.")
116 for track in tracks:
117 print(f"phi0[deg] = {track.getPhi0() * 180.0 / np.pi:.2f}",
118 f"pt[GeV] = {track.getTransverseMomentum(1.5):.3f}",
119 f"charge = {int(track.getChargeSign())}",
120 f"theta[deg] = {np.arctan2(1.0, track.getCotTheta()) * 180.0 / np.pi:.2f}",
121 f"z[cm] = {track.getZ0():.2f}")
122 print(len(Belle2.PyStoreArray("MCParticles")), "MCParticles.")
123 for particle in Belle2.PyStoreArray("MCParticles"):
124 print(f"phi0[deg] = {particle.getMomentum().Phi() * 180.0 / np.pi:.2f}",
125 f"pt[GeV] = {particle.getMomentum().Pt():.3f}",
126 f"charge = {int(particle.getCharge())}",
127 f"theta[deg] = {particle.getMomentum().Theta() * 180.0 / np.pi:.2f}",
128 f"z[cm] = {particle.getProductionVertex().Z():.2f}")
129
130
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72
a (simplified) python wrapper for StoreObjPtr.
Definition: PyStoreObj.h:67

The documentation for this class was generated from the following file: