43 def event(self):
44 """
45 load original TOPDigits and the packed/unpacked ones, sort and compare them
46 """
47
48
50
52
53
54 digits_sorted = self.sortDigits(digits)
55 digitsUnpacked_sorted = self.sortDigits(digitsUnpacked)
56
57
58 if not len(digits_sorted) == len(digitsUnpacked_sorted):
59 b2.B2FATAL("TOPDigits: size not equal after packing and unpacking")
60
61
62 precision = 0.0001
63 for i in range(len(digits_sorted)):
64 digit = digits_sorted[i]
65 digitUnpacked = digitsUnpacked_sorted[i]
66
67
68 assert digit.getModuleID() == digitUnpacked.getModuleID()
69 assert digit.getPixelID() == digitUnpacked.getPixelID()
70 assert digit.getChannel() == digitUnpacked.getChannel()
71 assert digit.getRawTime() == digitUnpacked.getRawTime()
72 assert abs(digit.getTime() - digitUnpacked.getTime()) < precision
73 assert abs(digit.getTimeError() - digitUnpacked.getTimeError()) < precision
74 assert digit.getPulseHeight() == digitUnpacked.getPulseHeight()
75 assert abs(digit.getPulseWidth() - digitUnpacked.getPulseWidth()) < precision
76 assert digit.getIntegral() == digitUnpacked.getIntegral()
77 assert digit.getFirstWindow() == digitUnpacked.getFirstWindow()
78 assert digit.getHitQuality() == digitUnpacked.getHitQuality()
79 assert digit.getStatus() == digitUnpacked.getStatus()
80 assert digit.isChargeShare() == digitUnpacked.isChargeShare()
81 assert digit.isPrimaryChargeShare() == digitUnpacked.isPrimaryChargeShare()
82
83
A (simplified) python wrapper for StoreArray.