31 bs_filename =
'bs-streamerinfos.root'
33 from ROOT
import TFile
34 from TrigSerializeResult
import StreamerInfoGenerator
36 from collections
import defaultdict
37 streamerChecksums = defaultdict(set)
38 logger.info(
"Reading streamerinfos from %s", bs_filename)
39 file = TFile(bs_filename,
'UPDATE')
41 if file.GetStreamerInfoList():
42 for i
in file.GetStreamerInfoList():
43 if i.GetName() !=
'listOfRules':
44 streamerChecksums[i.GetName()].
add( i.GetCheckSum() )
46 logger.info(
"Read %i streamers for %i types\n", streamer_n, len(streamerChecksums))
49 from TrigEDMConfig.TriggerEDM
import getRawTriggerEDMList
50 from TrigEDMConfig.DataScoutingInfo
import getAllDataScoutingIdentifiers
52 logger.info(
"BS_destinations = {}".
format(BS_destinations))
54 if any(bs
in item[1].
split()
for bs
in BS_destinations):
55 objects.append(item[0].
split(
"#")[0])
60 fulllist = SIG.classlist
62 logger.info(
'*******************************')
64 from CLIDComps.clidGenerator
import clidGenerator
65 cgen = clidGenerator(
"")
72 if doxAODonly
and 'xAOD' not in item:
continue
73 logger.info(
"Trying to fill item %s to root file", item)
74 c_clid = cgen.genClidFromName(item)
75 c_typeinfo = cgen.getTidFromClid(c_clid)
76 logger.info(
"CLID %s", c_clid)
77 logger.info(
"TypeInfo %s", 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 logger.warning(
'Warning: no checksum in streamerinfo for type: %s', cls.GetName())
89 logger.warning(
'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 logger.info(
'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 logger.info(
'Skipping {} streamer checksum 0x{:x} - already in the file'.
format(cls.GetName(), chksum))
103 logger.info(
'skipping %s', item)
108 logger.info(
'Wrote %i types', types_new)
109 logger.info(
'Skipped %i existing types', types_exist)
110 logger.info(
'Problems with %i types', types_bad + len(SIG.problemclasses))
111 for t
in SIG.problemclasses:
112 logger.info(
' {}'.
format(t))