43def my_dump(bsfile):
44 """Runs the dumping routines"""
45
46
48 print(
"Opening %s" % bsfile)
49
50
51 events = {}
52
53 input = eformat.istream(bsfile)
54 subdet = eformat.helper.SubDetector.TDAQ_EVENT_FILTER if opt.ef else eformat.helper.SubDetector.TDAQ_LVL2
55
56 for event in input:
57 ev = ( event.global_id(), event.lvl1_id() )
58
59 chains = {}
60 for f in event.children():
61 if f.source_id().subdetector_id() == subdet:
62 res.load(f)
63 chains_data = list(res.getChainResult())
64
65 for c in chains_data[1:]:
66 chain = HLTChain(c)
67 chains[chain.getChainCounter()] = chain.isPrescaled()
68 break
69
70 events[ev] = chains
71
72 output = open(opt.pickle, "wb")
73 cPickle.dump(events, output)
74 output.close()
75
76