195 opt.decodeL1trig =
True
196 opt.decodeL2trig =
True
197 opt.decodeEFtrig =
True
199 fname = opt.eispbfile
201 spbf = SpbFile(fname)
202 info = spbf.getInfo()
203 except Exception
as e:
204 print(
"Error reading SPB file. Please check file: " +
str(e))
208 print(
" version: ", info[
'version'])
209 print(
" #input files: ", info[
'nfiles'])
210 print(
" number of events: ", info[
'nevents'])
211 print(
" StartProcTime: ", info[
'startProcTime'])
212 print(
" EndProcTime: ", info[
'endProcTime'])
213 print(
" TaskID: ", info[
'taskID'])
214 print(
" JobID: ", info[
'jobID'])
215 print(
" InputDsName: ", info[
'inputDsName'])
216 print(
" Includes Provenance: ", info[
'provenanceRef'])
217 print(
" Includes Trigger: ", info[
'triggerInfo'])
219 for f
in info[
'guids']:
222 print(
" Events in this file: {:8d}".
format(f[
'nevents']))
223 print(
" Unique events in this file: {:8d}".
format(f[
'nuevents']))
225 f[
'fileStartProcTime']))
227 f[
'fileEndProcTime']))
231 print(
" RunEvtRanges: {}".
format(f[
'runevtRanges']))
234 eipbof = EIPBof(spbf.getVersion())
237 print(
"Summary: (info for {:d} events max)".
format(opt.evtmax))
242 (mtype_ver, mlen, msg) = spbf.getMsg()
243 mtype = (mtype_ver & 0x000fff00) >> 8
244 if mtype == eic.EI_PROTO_HEADER:
245 header = eipbof.Header()
246 header.ParseFromString(msg)
247 elif mtype == eic.EI_PROTO_BEGINGUID:
248 beginGUID = eipbof.BeginGUID()
249 beginGUID.ParseFromString(msg)
250 elif mtype == eic.EI_PROTO_ENDGUID:
251 endGUID = eipbof.EndGUID()
252 endGUID.ParseFromString(msg)
253 elif mtype == eic.EI_PROTO_EIEVENT:
254 eventPB = eipbof.EIEvent()
255 eventPB.ParseFromString(msg)
256 if nevt_shown < opt.evtmax:
257 if (opt.evtnumber != 0
and
258 opt.evtnumber != eventPB.eventNumber):
260 if (opt.runnumber != 0
and
261 opt.runnumber != eventPB.runNumber):
267 elif mtype == eic.EI_PROTO_TRIGGERMENU:
268 triggerMenu = eipbof.TriggerMenu()
269 triggerMenu.ParseFromString(msg)
270 elif mtype == eic.EI_PROTO_TRAILER:
271 trailer = eipbof.Trailer()
272 trailer.ParseFromString(msg)