Belle II Software  release-05-02-19
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 90 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 95 of file trgcdcReadout.py.

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

The documentation for this class was generated from the following file:
Belle2::PyStoreObj
a (simplified) python wrapper for StoreObjPtr.
Definition: PyStoreObj.h:69
basf2.process
def process(path, max_event=0)
Definition: __init__.py:25
ClusterEfficiency.ClusterEfficiency.event
def event(self)
Definition: ClusterEfficiency.py:146
Belle2::PyStoreArray
a (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:58