112 def event(self):
113 """
114 load original TOPRawDigits and the packed/unpacked ones, sort and compare them
115 """
116
117
119
121
122
123 digits_sorted = self.sortDigits(digits)
124 digitsUnpacked_sorted = self.sortDigits(digitsUnpacked)
125
126
127 if not len(digits_sorted) == len(digitsUnpacked_sorted):
128 print('size: ', len(digits_sorted), len(digitsUnpacked_sorted))
129 b2.B2FATAL("TOPRawDigits: size not equal after packing and unpacking")
130
131
132 for i in range(len(digits_sorted)):
133
134 digit = digits_sorted[i]
135 digitUnpacked = digitsUnpacked_sorted[i]
136
137
138 assert digit.getScrodID() == digitUnpacked.getScrodID()
139 assert digit.getCarrierNumber() == digitUnpacked.getCarrierNumber()
140 assert digit.getASICNumber() == digitUnpacked.getASICNumber()
141 assert digit.getASICChannel() == digitUnpacked.getASICChannel()
142 assert digit.getASICWindow() == digitUnpacked.getASICWindow()
143 assert digit.getTFine() == digitUnpacked.getTFine()
144 assert digit.getSampleRise() == digitUnpacked.getSampleRise()
145 assert digit.getDeltaSamplePeak() == digitUnpacked.getDeltaSamplePeak()
146 assert digit.getDeltaSampleFall() == digitUnpacked.getDeltaSampleFall()
147 assert digit.getValueRise0() == digitUnpacked.getValueRise0()
148 assert digit.getValueRise1() == digitUnpacked.getValueRise1()
149 assert digit.getValuePeak() == digitUnpacked.getValuePeak()
150 assert digit.getValueFall0() == digitUnpacked.getValueFall0()
151 assert digit.getValueFall1() == digitUnpacked.getValueFall1()
152
153 assert digit.getRevo9Counter() == digitUnpacked.getRevo9Counter()
154 assert digit.getPhase() == digitUnpacked.getPhase()
155 assert digit.getErrorFlags() == digitUnpacked.getErrorFlags()
156 assert digit.getDataType() == digitUnpacked.getDataType()
157
158
A (simplified) python wrapper for StoreArray.