44 def event(self):
45 """ load SVDShaperDigits of the simulation and the packed/unpacked ones
46 and compare them"""
47
49
51
52 svdDigits_sorted = self.sortDigits(svdDigits)
53 svdDigitsPackedUnpacked_sorted = self.sortDigits(svdDigitsPackedUnpacked)
54
55 if not len(svdDigits_sorted) == len(svdDigitsPackedUnpacked_sorted):
56 b2.B2FATAL("SVDShaperDigits count not equal after packing and unpacking")
57
58
59 for i in range(len(svdDigits_sorted)):
60
61
62
63 hit = svdDigits_sorted[i]
64 hitPackedUnpacked = svdDigitsPackedUnpacked_sorted[i]
65
66
67 assert hit.getTime() == hitPackedUnpacked.getTime()
68 assert hit.getIndex() == hitPackedUnpacked.getIndex()
69
70
71
72 assert numpy.isclose(hit.getCharge(), hitPackedUnpacked.getCharge())
73
74
75 assert hit.getSensorID().getID() == hitPackedUnpacked.getSensorID().getID()
76 assert hit.getSensorID().getLayerNumber() == hitPackedUnpacked.getSensorID().getLayerNumber()
77 assert hit.getSensorID().getLadderNumber() == hitPackedUnpacked.getSensorID().getLadderNumber()
78 assert hit.getSensorID().getSensorNumber() == hitPackedUnpacked.getSensorID().getSensorNumber()
79 assert hit.getSensorID().getSegmentNumber() == hitPackedUnpacked.getSensorID().getSegmentNumber()
80
81
82
A (simplified) python wrapper for StoreArray.