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 CDCTriggerTSF

Definition at line 114 of file TSF_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 119 of file TSF_OldVsNew.py.

119 def event(self):
120 """
121 give info for both output lists and warnings in the case of mismatches
122 """
123 oldHits = Belle2.PyStoreArray("CDCTriggerSegmentHits")
124 newHits = Belle2.PyStoreArray("TSHits")
125 if oldHits.getEntries() == newHits.getEntries():
126 basf2.B2INFO(f"{int(oldHits.getEntries())} hits")
127 else:
128 basf2.B2WARNING(f"old version: {int(oldHits.getEntries())}, new version: {int(newHits.getEntries())}")
129 for i in range(max(oldHits.getEntries(), newHits.getEntries())):
130 if i < oldHits.getEntries():
131 oldString = f"ID {oldHits[i].getSegmentID():d} priority {oldHits[i].getPriorityPosition():d} LR " + \
132 f"{oldHits[i].getLeftRight():d} fastest T {oldHits[i].fastestTime():d} " + \
133 f"priority T {oldHits[i].priorityTime():d} found T {oldHits[i].foundTime():d}"
134 else:
135 oldString = "no hit"
136 if i < newHits.getEntries():
137 newString = f"ID {newHits[i].getSegmentID():d} priority {newHits[i].getPriorityPosition():d} " + \
138 f"LR {newHits[i].getLeftRight():d} fastest T {newHits[i].fastestTime():d} " + \
139 f"priority T {newHits[i].priorityTime():d} found T {newHits[i].foundTime():d}"
140 else:
141 newString = "no hit"
142 if oldString == newString:
143 basf2.B2INFO(oldString)
144 else:
145 basf2.B2WARNING("old: " + oldString)
146 basf2.B2WARNING("new: " + newString)
147 # check relations
148 if clock:
149 oldCDCRels = oldHits[i].getRelationsTo("CDCHits4Trg")
150 newCDCRels = newHits[i].getRelationsTo("CDCHits4Trg")
151 else:
152 oldCDCRels = oldHits[i].getRelationsTo("CDCHits")
153 newCDCRels = newHits[i].getRelationsTo("CDCHits")
154 if len(oldCDCRels) == len(newCDCRels):
155 basf2.B2INFO(f"{len(oldCDCRels)} related CDCHits")
156 else:
157 basf2.B2WARNING(f"old version: {len(oldCDCRels)} related CDCHits")
158 basf2.B2WARNING(f"new version: {len(newCDCRels)} related CDCHits")
159 for irel in range(max(len(oldCDCRels), len(newCDCRels))):
160 if irel < len(oldCDCRels):
161 oldString = f"relation to hit {int(oldCDCRels[irel].getArrayIndex())}, weight {oldCDCRels.weight(irel):.1f}"
162 else:
163 oldString = "no relation"
164 if irel < len(newCDCRels):
165 newString = f"relation to hit {int(newCDCRels[irel].getArrayIndex())}, weight {newCDCRels.weight(irel):.1f}"
166 else:
167 newString = "no relation"
168 if oldString == newString:
169 basf2.B2INFO(oldString)
170 else:
171 basf2.B2WARNING(oldString)
172 basf2.B2WARNING(newString)
173
174
A (simplified) python wrapper for StoreArray.
Definition: PyStoreArray.h:72

Member Data Documentation

◆ logLevel

logLevel
static

Definition at line 175 of file TSF_OldVsNew.py.


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