diff --git a/Control/xAODRootAccess/python/ClassNameManips.py b/Control/xAODRootAccess/python/ClassNameManips.py new file mode 100644 index 0000000000000000000000000000000000000000..356d92e9c66cea80055aea7c62d53521e52a5f2b --- /dev/null +++ b/Control/xAODRootAccess/python/ClassNameManips.py @@ -0,0 +1,27 @@ +# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration + +# Helper functions for class name manipulations + +# For some of the finding +import re + +# For logging errors and warnings +from AthenaCommon import Logging +cnm_log = Logging.logging.getLogger('ClassNameManips') + +def pers_to_trans_name(p): + # Baseline: transient name is identical + t = p + # Let's look for a version in the name + vers = re.findall('_v\d+',t) + if len(vers)>1: + cnm_log.warning('Input name '+p+' seems to have multiple version numbers: '+str(vers)+' - will wipe them all') + for v in vers: + # Wipe out the version + t = t.replace(v,'') + # Now convert data vectors + if 'DataVector<' in t: + t = t.replace('DataVector<','').replace('>','') + t = 'Container#'.join(t.split('#')) + cnm_log.debug('Translated '+p+' to '+t) + return t diff --git a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py index a05093959a3a34eb6511afe90787714c47bc5b51..5fe6060df29526e13c0e3ba595f18eaad980ee70 100755 --- a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py +++ b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py @@ -1369,7 +1369,9 @@ if rec.doDPD() and (rec.DPDMakerScripts()!=[] or rec.doDPD.passThroughMode): from RecExConfig.InputFilePeeker import inputFileSummary #Explicitely add file metadata from input and from transient store - MSMgr.AddMetaDataItemToAllStreams(inputFileSummary['metadata_itemsList']) + #Include translation of name from persistent format to transient format + from xAODRootAccess.ClassNameManips import pers_to_trans_name + MSMgr.AddMetaDataItemToAllStreams([pers_to_trans_name(x) for x in inputFileSummary['metadata_itemsList']]) MSMgr.AddMetaDataItemToAllStreams(dfMetadataItemList()) pass pass