Belle II Software  release-08-01-10
TestModule Class Reference
Inheritance diagram for TestModule:
Collaboration 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 98 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 103 of file trgcdcReadout.py.

103  def event(self):
104  """
105  print output values of the different stages in the CDC trigger
106  """
107  print("CDC trigger readout")
108  print("event time:", Belle2.PyStoreObj("CDCTriggerEventTime").obj().getTiming())
109  tracks2Dfinder = Belle2.PyStoreArray("Trg2DFinderTracks")
110  tracks2Dfitter = Belle2.PyStoreArray("Trg2DFitterTracks")
111  tracks3Dfitter = Belle2.PyStoreArray("Trg3DFitterTracks")
112  tracks3Dneuro = Belle2.PyStoreArray("TrgNNTracks")
113  listnames = ["2D finder", "2D fitter", "3D fitter", "Neurotrigger"]
114  for i, tracks in enumerate([tracks2Dfinder, tracks2Dfitter,
115  tracks3Dfitter, tracks3Dneuro]):
116  print(listnames[i], "has", len(tracks), "tracks.")
117  for track in tracks:
118  print("phi0[deg] = %.2f" % (track.getPhi0() * 180. / np.pi),
119  "pt[GeV] = %.3f" % track.getTransverseMomentum(1.5),
120  "charge = %d" % track.getChargeSign(),
121  "theta[deg] = %.2f" % (np.arctan2(1., track.getCotTheta()) * 180. / np.pi),
122  "z[cm] = %.2f" % track.getZ0())
123  print(len(Belle2.PyStoreArray("MCParticles")), "MCParticles.")
124  for particle in Belle2.PyStoreArray("MCParticles"):
125  print("phi0[deg] = %.2f" % (particle.getMomentum().Phi() * 180. / np.pi),
126  "pt[GeV] = %.3f" % particle.getMomentum().Pt(),
127  "charge = %d" % particle.getCharge(),
128  "theta[deg] = %.2f" % (particle.getMomentum().Theta() * 180. / np.pi),
129  "z[cm] = %.2f" % particle.getProductionVertex().Z())
130 
131 
132 main.add_module(TestModule())
133 
134 # Process events
135 basf2.process(main)
136 
137 # Print call statistics
138 print(basf2.statistics)
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: