29 bs_filename =
'bs-streamerinfos.root'
31 from ROOT
import TFile
32 from TrigSerializeResult
import StreamerInfoGenerator
34 from collections
import defaultdict
35 streamerChecksums = defaultdict(set)
36 print(
"Reading streamerinfos from", bs_filename)
37 file = TFile(bs_filename,
'UPDATE')
39 if file.GetStreamerInfoList():
40 for i
in file.GetStreamerInfoList():
41 if i.GetName() !=
'listOfRules':
42 streamerChecksums[i.GetName()].
add( i.GetCheckSum() )
44 print(
"Read", streamer_n,
'streamers for', len(streamerChecksums),
'types')
48 from TrigEDMConfig.TriggerEDMRun3
import TriggerHLTListRun3
49 from TrigEDMConfig.DataScoutingInfo
import getAllDataScoutingIdentifiers
51 print(
"BS_destinations = {}".
format(BS_destinations))
52 for item
in TriggerHLTListRun3:
53 if any(bs
in item[1].
split()
for bs
in BS_destinations):
54 objects.append(item[0].
split(
"#")[0])
60 fulllist = SIG.classlist
62 print(
'*******************************')
64 from CLIDComps.clidGenerator
import clidGenerator
65 cgen = clidGenerator(
"")
72 if doxAODonly
and 'xAOD' not in item:
continue
73 print(
"Trying to fill item", item,
"to root file")
74 c_clid = cgen.genClidFromName(item)
75 c_typeinfo = cgen.getTidFromClid(c_clid)
77 print(
"TypeInfo", c_typeinfo)
79 cls = ROOT.gROOT.GetClass(item)
81 cls = ROOT.gROOT.GetClass(c_typeinfo)
85 streamerinfo = cls.GetStreamerInfo()
86 if streamerinfo.GetCheckSum() == 0:
88 print(
'Warning: no checksum in streamerinfo for type: ', cls.GetName())
89 print(
'Attempting to fix with 0x%x' % cls.GetCheckSum())
90 streamerinfo.SetCheckSum( cls.GetCheckSum() )
92 chksum = streamerinfo.GetCheckSum()
93 if chksum
not in streamerChecksums[cls.GetName()]:
94 print(
'Writing: %s streamer size=%d, checksum=0x%x' %(cls.GetName(), streamerinfo.Sizeof(), chksum))
96 file.WriteObjectAny(obj, cls, cls.GetName())
98 updated_objects.append( (cls.GetName(), chksum) )
100 print(
'Skipping {} streamer checksum 0x{:x} - already in the file'.
format(cls.GetName(), chksum))
103 print(
'skipping ', item)
108 print(
'Wrote', types_new,
'types')
109 print(
'Skipped', types_exist,
' existing types')
110 print(
'Problems with', types_bad + len(SIG.problemclasses),
' types')
111 for t
in SIG.problemclasses: