ATLAS Offline Software
Functions | Variables
dictwrite Namespace Reference

Functions

def update_streamerinfos (objects, updated_objects)
 
def main ()
 

Variables

 logger
 

Function Documentation

◆ main()

def dictwrite.main ( )

Definition at line 116 of file dictwrite.py.

116 def main():
117  objects = [
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',
159  'xAOD::JetEtRoI_v1',
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',
213  'xAOD::TauTrack_v1',
214  'xAOD::TauTrackContainer_v1',
215  'xAOD::TauTrackAuxContainer_v1',
216  #'TrigMuonEFIsolation_p2',
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',
230  'xAOD::AFPSiHit_v2',
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',
241  ]
242  updated_objects = []
243  return update_streamerinfos(objects, updated_objects)
244 

◆ update_streamerinfos()

def dictwrite.update_streamerinfos (   objects,
  updated_objects 
)

Definition at line 27 of file dictwrite.py.

27 def update_streamerinfos(objects, updated_objects):
28  #doEDM=False
29  doEDM=True
30  doxAODonly=False
31  bs_filename = 'bs-streamerinfos.root'
32  import 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')
40  streamer_n = 0
41  if file.GetStreamerInfoList():
42  for i in file.GetStreamerInfoList():
43  if i.GetName() != 'listOfRules':
44  streamerChecksums[i.GetName()].add( i.GetCheckSum() )
45  streamer_n += 1
46  logger.info("Read %i streamers for %i types\n", streamer_n, len(streamerChecksums))
47 
48  if doEDM:
49  from TrigEDMConfig.TriggerEDM import getRawTriggerEDMList
50  from TrigEDMConfig.DataScoutingInfo import getAllDataScoutingIdentifiers
51  BS_destinations = ["BS"] + getAllDataScoutingIdentifiers()
52  logger.info("BS_destinations = {}".format(BS_destinations))
53  for item in getRawTriggerEDMList(flags=None, runVersion=3):
54  if any(bs in item[1].split() for bs in BS_destinations):
55  objects.append(item[0].split("#")[0])
56 
57  for pers in objects:
58  SIG.inspect(pers)
59 
60  fulllist = SIG.classlist
61  logger.info(fulllist)
62  logger.info('*******************************')
63 
64  from CLIDComps.clidGenerator import clidGenerator
65  cgen = clidGenerator("")
66 
67  types_new = 0
68  types_exist = 0
69  types_bad = 0
70  fulllist = list(set(fulllist))
71  for item in fulllist:
72  if doxAODonly and 'xAOD' not in item: continue # current issues seen because of missing xAOD libs not being loaded
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)
78  try:
79  cls = ROOT.gROOT.GetClass(item)
80  except Exception:
81  cls = ROOT.gROOT.GetClass(c_typeinfo)
82  logger.info(cls)
83 
84  if cls is not None:
85  streamerinfo = cls.GetStreamerInfo()
86  if streamerinfo.GetCheckSum() == 0:
87  # try to patch missing checksum in DataVectors
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() )
91 
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)
95  obj = cls.New()
96  file.WriteObjectAny(obj, cls, cls.GetName())
97  types_new += 1
98  updated_objects.append( (cls.GetName(), chksum) )
99  else:
100  logger.info('Skipping {} streamer checksum 0x{:x} - already in the file'.format(cls.GetName(), chksum))
101  types_exist += 1
102  else:
103  logger.info('skipping %s', item)
104  types_bad += 1
105  #sys.exit()
106  logger.info('----')
107 
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))
113 
114  return 0
115 

Variable Documentation

◆ logger

dictwrite.logger

Definition at line 16 of file dictwrite.py.

python.TriggerEDM.getRawTriggerEDMList
def getRawTriggerEDMList(flags, runVersion=-1)
Definition: TriggerEDM.py:125
dictwrite.main
def main()
Definition: dictwrite.py:116
vtune_athena.format
format
Definition: vtune_athena.py:14
StreamerInfoGenerator.StreamerInfoGenerator
Definition: StreamerInfoGenerator.py:7
python.DataScoutingInfo.getAllDataScoutingIdentifiers
def getAllDataScoutingIdentifiers()
Definition: DataScoutingInfo.py:79
dictwrite.update_streamerinfos
def update_streamerinfos(objects, updated_objects)
Definition: dictwrite.py:27
add
bool add(const std::string &hname, TKey *tobj)
Definition: fastadd.cxx:55
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
Trk::split
@ split
Definition: LayerMaterialProperties.h:38