16 logger = logging.getLogger(__name__)
19 MN: NOTE about xAOD containers in ROOT5
20 For an xAOD container like xAOD::HIEventShapeContainer_v1
22 a) use the real class name: DataVector<xAOD::HIEventShape_v2>
23 b) have a real class in the 'objects' list BEFORE the typedef
24 (so the dict library gets loaded and the typedefs resolved)
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))
118 'xAOD::TrigEMCluster_v1',
119 'xAOD::TrigEMClusterContainer_v1',
120 'xAOD::TrigEMClusterAuxContainer_v1',
121 'xAOD::TrigRingerRings_v1',
122 'xAOD::TrigRingerRingsContainer_v1',
123 'xAOD::TrigRingerRingsAuxContainer_v1',
124 'xAOD::TrigRNNOutput_v1',
125 'xAOD::TrigRNNOutputContainer_v1',
126 'xAOD::TrigRNNOutputAuxContainer_v1',
127 'xAOD::CaloClusterContainer_v1',
128 'xAOD::CaloClusterAuxContainer_v2',
129 'xAOD::L2StandAloneMuonContainer_v1',
130 'xAOD::L2StandAloneMuonAuxContainer_v1',
131 'xAOD::L2StandAloneMuonAuxContainer_v2',
132 'xAOD::L2CombinedMuonContainer_v1',
133 'xAOD::L2CombinedMuonAuxContainer_v1',
134 'xAOD::L2IsoMuonContainer_v1',
135 'xAOD::L2IsoMuonAuxContainer_v1',
136 'xAOD::MuonContainer_v1',
137 'xAOD::MuonAuxContainer_v1',
138 'xAOD::MuonAuxContainer_v2',
139 'xAOD::MuonAuxContainer_v3',
140 'xAOD::MuonAuxContainer_v4',
141 'xAOD::TrackParticleContainer_v1',
142 'xAOD::TrackParticleAuxContainer_v1',
143 'xAOD::TrackParticleAuxContainer_v2',
144 'xAOD::TrackParticleAuxContainer_v3',
145 'xAOD::TauJetContainer_v2',
146 'xAOD::TauJetAuxContainer_v2',
147 'xAOD::TauJetAuxContainer_v3',
148 'xAOD::VertexContainer_v1',
149 'xAOD::VertexAuxContainer_v1',
150 'xAOD::TrigCompositeContainer_v1',
151 'xAOD::TrigCompositeAuxContainer_v1',
152 'xAOD::TrigCompositeAuxContainer_v2',
153 'xAOD::MuonRoIContainer_v1',
154 'xAOD::MuonRoIAuxContainer_v1',
155 'xAOD::EmTauRoIContainer_v2',
156 'xAOD::EmTauRoIAuxContainer_v2',
157 'xAOD::JetRoIContainer_v2',
158 'xAOD::JetRoIAuxContainer_v2',
160 'xAOD::JetEtRoIAuxInfo_v1',
161 'xAOD::EnergySumRoI_v1',
162 'xAOD::EnergySumRoIAuxInfo_v1',
163 'xAOD::TriggerTowerContainer_v2',
164 'xAOD::TriggerTowerAuxContainer_v2',
165 'xAOD::ElectronContainer_v1',
166 'xAOD::ElectronAuxContainer_v1',
167 'xAOD::PhotonContainer_v1',
168 'xAOD::PhotonAuxContainer_v1',
169 'xAOD::TrigBphysContainer_v1',
170 'xAOD::TrigBphysAuxContainer_v1',
171 'xAOD::TrigT2MbtsBitsAuxContainer_v1',
172 'xAOD::TrigT2MbtsBitsContainer_v1',
173 'xAOD::TrigSpacePointCountsContainer_v1',
174 'xAOD::TrigSpacePointCountsAuxContainer_v1',
175 'xAOD::TrigVertexCountsContainer_v1',
176 'xAOD::TrigVertexCountsAuxContainer_v1',
177 'xAOD::TrigTrackCounts_v1',
178 'xAOD::TrigTrackCountsContainer_v1',
179 'xAOD::TrigTrackCountsAuxContainer_v1',
180 'xAOD::TrigMissingETContainer_v1',
181 'xAOD::TrigMissingETAuxContainer_v1',
182 'xAOD::TrigPhotonContainer_v1',
183 'xAOD::TrigPhotonAuxContainer_v1',
184 'xAOD::TrigElectronContainer_v1',
185 'xAOD::TrigElectronAuxContainer_v1',
186 'xAOD::JetContainer_v1',
187 'xAOD::JetTrigAuxContainer_v1',
188 'xAOD::JetTrigAuxContainer_v2',
189 'xAOD::TrigDecision_v1',
190 'xAOD::TrigDecisionAuxInfo_v1',
191 'xAOD::TrigConfKeys_v1',
192 'xAOD::TrigNavigation_v1',
193 'xAOD::TrigNavigationAuxInfo_v1',
194 'xAOD::BTaggingContainer_v1',
195 'xAOD::BTaggingAuxContainer_v1',
196 'xAOD::BTaggingTrigAuxContainer_v1',
197 'xAOD::BTagVertexContainer_v1',
198 'xAOD::BTagVertexAuxContainer_v1',
199 'xAOD::HIEventShapeAuxContainer_v2',
200 'xAOD::HIEventShapeContainer_v2',
201 'xAOD::TrigT2ZdcSignalsAuxContainer_v1',
202 'xAOD::TrigT2ZdcSignalsContainer_v1',
203 'xAOD::TrigPassBitsContainer_v1',
204 'xAOD::TrigPassBitsAuxContainer_v1',
205 'xAOD::CaloClusterTrigAuxContainer_v1',
206 'xAOD::ElectronTrigAuxContainer_v1',
207 'xAOD::PhotonTrigAuxContainer_v1',
208 'xAOD::TrigEMClusterAuxContainer_v2',
209 'xAOD::TrigRingerRingsAuxContainer_v2',
210 'xAOD::TrigRNNOutput_v2',
211 'xAOD::TrigRNNOutputContainer_v2',
212 'xAOD::TrigRNNOutputAuxContainer_v2',
214 'xAOD::TauTrackContainer_v1',
215 'xAOD::TauTrackAuxContainer_v1',
217 'xAOD::BTaggingAuxContainer_v2',
218 'xAOD::jFexMETRoI_v1',
219 'xAOD::jFexMETRoIAuxContainer_v1',
220 'xAOD::jFexSumETRoI_v1',
221 'xAOD::jFexSumETRoIAuxContainer_v1',
222 'xAOD::eFexTauRoIAuxContainer_v1',
223 'xAOD::gFexGlobalRoI_v1',
224 'xAOD::gFexGlobalRoIAuxContainer_v1',
225 'xAOD::gFexJetRoI_v1',
226 'xAOD::gFexJetRoIAuxContainer_v1',
227 'xAOD::AFPToFHit_v1',
228 'xAOD::AFPVertex_v1',
229 'xAOD::AFPVertexAuxContainer_v1',
231 'xAOD::AFPProton_v1',
232 'xAOD::AFPProtonAuxContainer_v1',
233 'xAOD::AFPToFTrack_v1',
234 'xAOD::AFPToFTrackAuxContainer_v1',
235 'xAOD::AFPSiHitsClusterAuxContainer_v1',
236 'xAOD::jFexTauRoIAuxContainer_v1',
237 'xAOD::jFexSRJetRoI_v1',
238 'xAOD::jFexSRJetRoIAuxContainer_v1',
239 'xAOD::jFexLRJetRoI_v1',
240 'xAOD::jFexLRJetRoIAuxContainer_v1',
245 if __name__ ==
"__main__":