122 give info for both output lists and warnings in the case of mismatches
126 if oldHits.getEntries() == newHits.getEntries():
127 basf2.B2INFO(
"%d hits" % oldHits.getEntries())
129 basf2.B2WARNING(
"old version: %d, new version: %d" %
130 (oldHits.getEntries(), newHits.getEntries()))
131 for i
in range(max(oldHits.getEntries(), newHits.getEntries())):
132 if i < oldHits.getEntries():
133 oldString =
"ID %d priority %d LR %d fastest T %d priority T %d found T %d" % \
134 (oldHits[i].getSegmentID(), oldHits[i].getPriorityPosition(),
135 oldHits[i].getLeftRight(), oldHits[i].fastestTime(),
136 oldHits[i].priorityTime(), oldHits[i].foundTime())
139 if i < newHits.getEntries():
140 newString =
"ID %d priority %d LR %d fastest T %d priority T %d found T %d" % \
141 (newHits[i].getSegmentID(), newHits[i].getPriorityPosition(),
142 newHits[i].getLeftRight(), newHits[i].fastestTime(),
143 newHits[i].priorityTime(), newHits[i].foundTime())
146 if oldString == newString:
147 basf2.B2INFO(oldString)
149 basf2.B2WARNING(
"old: " + oldString)
150 basf2.B2WARNING(
"new: " + newString)
153 oldCDCRels = oldHits[i].getRelationsTo(
"CDCHits4Trg")
154 newCDCRels = newHits[i].getRelationsTo(
"CDCHits4Trg")
156 oldCDCRels = oldHits[i].getRelationsTo(
"CDCHits")
157 newCDCRels = newHits[i].getRelationsTo(
"CDCHits")
158 if len(oldCDCRels) == len(newCDCRels):
159 basf2.B2INFO(
"%d related CDCHits" % len(oldCDCRels))
161 basf2.B2WARNING(
"old version: %d related CDCHits" % len(oldCDCRels))
162 basf2.B2WARNING(
"new version: %d related CDCHits" % len(newCDCRels))
163 for irel
in range(max(len(oldCDCRels), len(newCDCRels))):
164 if irel < len(oldCDCRels):
165 oldString =
"relation to hit %d, weight %.1f" % \
166 (oldCDCRels[irel].getArrayIndex(), oldCDCRels.weight(irel))
168 oldString =
"no relation"
169 if irel < len(newCDCRels):
170 newString =
"relation to hit %d, weight %.1f" % \
171 (newCDCRels[irel].getArrayIndex(), newCDCRels.weight(irel))
173 newString =
"no relation"
174 if oldString == newString:
175 basf2.B2INFO(oldString)
177 basf2.B2WARNING(oldString)
178 basf2.B2WARNING(newString)
181 main.add_module(TestModule(), logLevel=basf2.LogLevel.INFO)
187 print(basf2.statistics)
A (simplified) python wrapper for StoreArray.