76 def event(self):
77 """
78 reimplement Module::event()
79 """
80 self.return_value(0)
81
82 frombuffer = np.frombuffer
83 GetNodeID = Belle2.RawTRG.GetNodeID
84 GetDetectorNwords = Belle2.RawTRG.GetDetectorNwords
85 GetDetectorBuffer = Belle2.RawTRG.GetDetectorBuffer
87
89
90
91 if integrity_check:
92 print(len(trgary), 'copper(s)')
93 for evt in trgary:
94 for entry in range(evt.GetNumEntries()):
95 print(f'{GetNodeID(evt, entry):0x}')
96 for bid in range(4):
97 if (GetNodeID(evt, entry), bid) in hslb:
98 count = GetDetectorNwords(evt, entry, bid)
99 print(bid, "exist, ", count, "words.")
100 return
101 dataList = []
102 for evt in trgary:
103
104 for entry in range(evt.GetNumEntries()):
105
106 for bid in range(4):
107 if (GetNodeID(evt, entry), bid) not in hslb:
108 continue
109 count = GetDetectorNwords(evt, entry, bid)
110 if count == 0:
111
112 pass
113 bf = GetDetectorBuffer(evt, entry, bid)
114 ary = frombuffer(bf, np.uintc, count)
115
116
117
118
119
120 self.return_value(1)
121 dataList.append(join(ary))
122
123 event = evtmeta.getEvent()
124 run = evtmeta.getRun()
125 subrun = evtmeta.getSubrun()
126 meta.append((event, run, subrun))
127 data.append(dataList)
128
129
130
131
A (simplified) python wrapper for StoreArray.
a (simplified) python wrapper for StoreObjPtr.