test module to compare the output of TRGCDC and CDCTrigger2DFitter/CDCTrigger3DFitter
Definition at line 122 of file Fitter_OldVsNew.py.
◆ event()
give info for both output lists and warnings in the case of mismatches
Definition at line 127 of file Fitter_OldVsNew.py.
129 give info for both output lists and warnings in the case of mismatches
133 if oldTracks.getEntries() == newTracks.getEntries():
134 basf2.B2INFO(
"%d tracks" % oldTracks.getEntries())
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())
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())
161 newString =
"no track"
162 if oldString == newString:
163 basf2.B2INFO(oldString)
165 basf2.B2WARNING(
"old: " + oldString)
166 basf2.B2WARNING(
"new: " + newString)
169 main.add_module(TestModule(), logLevel=basf2.LogLevel.INFO)
175 print(basf2.statistics)
A (simplified) python wrapper for StoreArray.
The documentation for this class was generated from the following file: