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

Public Member Functions

def event (self)
 

Static Public Attributes

 logLevel
 

Detailed Description

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

Definition at line 121 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 126 of file Fitter_OldVsNew.py.

126 def event(self):
127 """
128 give info for both output lists and warnings in the case of mismatches
129 """
130 oldTracks = Belle2.PyStoreArray("Trg3DFitterTracks")
131 newTracks = Belle2.PyStoreArray("Fitter3DTracks")
132 if oldTracks.getEntries() == newTracks.getEntries():
133 basf2.B2INFO(f"{int(oldTracks.getEntries())} tracks")
134 else:
135 basf2.B2WARNING(f"old version: {int(oldTracks.getEntries())}, new version: {int(newTracks.getEntries())}")
136 for i in range(max(oldTracks.getEntries(), newTracks.getEntries())):
137 if i < oldTracks.getEntries():
138 ptfactor = 0.3 * 1.5 / 100 * 222.376063
139 oldString = f"phi {oldTracks[i].getPhi0() * 180. / np.pi:.3f} pt " + \
140 f"{oldTracks[i].getTransverseMomentum(1.5) / ptfactor:.3f} charge {oldTracks[i].getChargeSign():d} " + \
141 f"chi2 {oldTracks[i].getChi2D():.3f} z {oldTracks[i].getZ0():.3f} cot {oldTracks[i].getCotTheta():.3f} " + \
142 f"chi2 {oldTracks[i].getChi3D():.3f}"
143 else:
144 oldString = "no track"
145 if i < newTracks.getEntries():
146 newString = f"phi {newTracks[i].getPhi0() * 180. / np.pi:.3f} pt {newTracks[i].getTransverseMomentum(1.5):.3f} " + \
147 f"charge {newTracks[i].getChargeSign():d} chi2 {newTracks[i].getChi2D():.3f} z {newTracks[i].getZ0():.3f} " + \
148 f"cot {newTracks[i].getCotTheta():.3f} chi2 {newTracks[i].getChi3D():.3f}"
149 else:
150 newString = "no track"
151 if oldString == newString:
152 basf2.B2INFO(oldString)
153 else:
154 basf2.B2WARNING("old: " + oldString)
155 basf2.B2WARNING("new: " + newString)
156
157
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72

Member Data Documentation

◆ logLevel

logLevel
static

Definition at line 158 of file Fitter_OldVsNew.py.


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