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

test module to compare the output of TRGCDC and CDCTrigger2DFitter/CDCTrigger3DFitter

Definition at line 122 of file Fitter_OldVsNew.py.

Member Function Documentation

◆ event()

def event (   self)
give info for both output lists and warnings in the case of mismatches

Definition at line 127 of file Fitter_OldVsNew.py.

127  def event(self):
128  """
129  give info for both output lists and warnings in the case of mismatches
130  """
131  oldTracks = Belle2.PyStoreArray("Trg3DFitterTracks")
132  newTracks = Belle2.PyStoreArray("Fitter3DTracks")
133  if oldTracks.getEntries() == newTracks.getEntries():
134  basf2.B2INFO("%d tracks" % oldTracks.getEntries())
135  else:
136  basf2.B2WARNING("old version: %d, new version: %d" %
137  (oldTracks.getEntries(), newTracks.getEntries()))
138  for i in range(max(oldTracks.getEntries(), newTracks.getEntries())):
139  if i < oldTracks.getEntries():
140  ptfactor = 0.3 * 1.5 / 100 * 222.376063
141  oldString = "phi %.3f pt %.3f charge %d chi2 %.3f z %.3f cot %.3f chi2 %.3f" % \
142  (oldTracks[i].getPhi0() * 180. / np.pi,
143  oldTracks[i].getTransverseMomentum(1.5) / ptfactor,
144  oldTracks[i].getChargeSign(),
145  oldTracks[i].getChi2D(),
146  oldTracks[i].getZ0(),
147  oldTracks[i].getCotTheta(),
148  oldTracks[i].getChi3D())
149  else:
150  oldString = "no track"
151  if i < newTracks.getEntries():
152  newString = "phi %.3f pt %.3f charge %d chi2 %.3f z %.3f cot %.3f chi2 %.3f" % \
153  (newTracks[i].getPhi0() * 180. / np.pi,
154  newTracks[i].getTransverseMomentum(1.5),
155  newTracks[i].getChargeSign(),
156  newTracks[i].getChi2D(),
157  newTracks[i].getZ0(),
158  newTracks[i].getCotTheta(),
159  newTracks[i].getChi3D())
160  else:
161  newString = "no track"
162  if oldString == newString:
163  basf2.B2INFO(oldString)
164  else:
165  basf2.B2WARNING("old: " + oldString)
166  basf2.B2WARNING("new: " + newString)
167 
168 
169 main.add_module(TestModule(), logLevel=basf2.LogLevel.INFO)
170 
171 # Process events
172 basf2.process(main)
173 
174 # Print call statistics
175 print(basf2.statistics)
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72

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