|
ATLAS Offline Software
|
|
def | CondInputLoaderCfg (flags, **kwargs) |
|
def | IOVDbSvcCfg (flags, **kwargs) |
|
def | addFolders (flags, folderStrings, detDb=None, className=None, extensible=False, tag=None, db=None, modifiers='') |
|
def | addFolderList (flags, listOfFolderInfoTuple, extensible=False, db=None, modifiers='') |
|
def | addFoldersSplitOnline (flags, detDb, onlineFolders, offlineFolders, className=None, extensible=False, addMCString='_OFL', splitMC=False, tag=None, forceDb=None, modifiers='') |
|
def | addOverride (flags, folder, tag, db=None) |
|
def | _extractFolder (folderString) |
|
def | getSqliteContent (sqliteInput, takeFolders, databaseInstance) |
|
◆ _extractFolder()
def python.IOVDbSvcConfig._extractFolder |
( |
|
folderString | ) |
|
|
private |
Extract the folder name (non-XML text) from a IOVDbSvc.Folders entry
Definition at line 232 of file IOVDbSvcConfig.py.
233 """Extract the folder name (non-XML text) from a IOVDbSvc.Folders entry"""
237 while ix < len(folderString):
238 if (folderString[ix] ==
'<' and xmlTag ==
''):
239 ix2 = folderString.find(
'>', ix)
241 xmlTag = folderString[ix + 1 : ix2].strip()
243 elif folderString[ix:ix+2] ==
'</' and xmlTag !=
'':
244 ix2 = folderString.find(
'>', ix)
249 ix2 = folderString.find(
'<', ix)
251 ix2 = len(folderString)
253 folderName = folderName + folderString[ix : ix2]
255 return folderName.strip()
◆ addFolderList()
def python.IOVDbSvcConfig.addFolderList |
( |
|
flags, |
|
|
|
listOfFolderInfoTuple, |
|
|
|
extensible = False , |
|
|
|
db = None , |
|
|
|
modifiers = '' |
|
) |
| |
Add access to the given set of folders, in the identified subdetector schema.
FolerInfoTuple consists of (foldername,detDB,classname)
If EXTENSIBLE is set, then if we access an open-ended IOV at the end of the list,
the end time for this range will be set to just past the current event.
Subsequent accesses will update this end time for subsequent events.
This allows the possibility of later adding a new IOV using IOVSvc::setRange.
Definition at line 90 of file IOVDbSvcConfig.py.
90 def addFolderList(flags, listOfFolderInfoTuple, extensible=False, db=None, modifiers=''):
91 """Add access to the given set of folders, in the identified subdetector schema.
92 FolerInfoTuple consists of (foldername,detDB,classname)
94 If EXTENSIBLE is set, then if we access an open-ended IOV at the end of the list,
95 the end time for this range will be set to just past the current event.
96 Subsequent accesses will update this end time for subsequent events.
97 This allows the possibility of later adding a new IOV using IOVSvc::setRange."""
101 flags.IOVDb.SqliteFolders,
102 flags.IOVDb.DatabaseInstance)
104 for (fs, detDb, className)
in listOfFolderInfoTuple:
107 if className
is not None:
108 loadFolders.add((className, fse))
110 if fse
in sqliteFolders:
111 msg.warning(f
'Reading folder {fs} from sqlite, bypassing production database')
112 fs+=sqliteFolders[fse]
113 elif detDb
is not None and fs.find(
'<db>') == -1:
118 dbName = flags.IOVDb.DatabaseInstance
119 if detDb
in _dblist.keys():
120 fs = f
'<db>{_dblist[detDb]}/{dbName}</db> {fs}'
121 elif os.access(detDb, os.R_OK):
123 fs = f
'<db>sqlite://;schema={detDb};dbname={dbName}</db> {fs}'
125 raise ConfigurationError(f
'Error, db shorthand {detDb} not known, nor found as sqlite file')
129 fs = fs +
'<extensible/>'
139 result.getPrimary().Folders+=folders
141 result.getCondAlgo(
'CondInputLoader').Load |= loadFolders
143 if flags.IOVDb.CleanerRingSize > 0:
145 cleanerSvc = CompFactory.Athena.DelayedConditionsCleanerSvc(RingSize=flags.IOVDb.CleanerRingSize)
146 result.addService(cleanerSvc)
147 result.addService(CompFactory.Athena.ConditionsCleanerSvc(CleanerSvc=cleanerSvc))
◆ addFolders()
def python.IOVDbSvcConfig.addFolders |
( |
|
flags, |
|
|
|
folderStrings, |
|
|
|
detDb = None , |
|
|
|
className = None , |
|
|
|
extensible = False , |
|
|
|
tag = None , |
|
|
|
db = None , |
|
|
|
modifiers = '' |
|
) |
| |
Definition at line 72 of file IOVDbSvcConfig.py.
72 def addFolders(flags, folderStrings, detDb=None, className=None, extensible=False, tag=None, db=None, modifiers=''):
75 tagString =
'<tag>%s</tag>' % tag
78 if isinstance(folderStrings, str):
79 return addFolderList(flags, ((folderStrings + tagString, detDb, className),), extensible, db, modifiers)
82 folderDefinitions = []
84 for folderString
in folderStrings:
85 folderDefinitions.append((folderString + tagString, detDb, className))
87 return addFolderList(flags, folderDefinitions, extensible, db, modifiers)
◆ addFoldersSplitOnline()
def python.IOVDbSvcConfig.addFoldersSplitOnline |
( |
|
flags, |
|
|
|
detDb, |
|
|
|
onlineFolders, |
|
|
|
offlineFolders, |
|
|
|
className = None , |
|
|
|
extensible = False , |
|
|
|
addMCString = '_OFL' , |
|
|
|
splitMC = False , |
|
|
|
tag = None , |
|
|
|
forceDb = None , |
|
|
|
modifiers = '' |
|
) |
| |
Add access to given folder, using either online_folder or offline_folder. For MC, add addMCString as a postfix (default is _OFL)
Definition at line 153 of file IOVDbSvcConfig.py.
153 def addFoldersSplitOnline(flags, detDb, onlineFolders, offlineFolders, className=None, extensible=False, addMCString='_OFL', splitMC=False, tag=None, forceDb=None, modifiers=''):
154 """Add access to given folder, using either online_folder or offline_folder. For MC, add addMCString as a postfix (default is _OFL)"""
156 if flags.Common.isOnline
and not flags.Input.isMC:
157 folders = onlineFolders
158 elif splitMC
and not flags.Input.isMC:
159 folders = onlineFolders
162 detDb = detDb + addMCString
163 folders = offlineFolders
165 return addFolders(flags, folders, detDb, className, extensible, tag=tag, db=forceDb, modifiers=modifiers)
◆ addOverride()
def python.IOVDbSvcConfig.addOverride |
( |
|
flags, |
|
|
|
folder, |
|
|
|
tag, |
|
|
|
db = None |
|
) |
| |
Add a tag override for the specified folder
Definition at line 224 of file IOVDbSvcConfig.py.
225 """Add a tag override for the specified folder"""
228 suffix = f
' <db>{db}</db>'
229 return IOVDbSvcCfg(flags, overrideTags=(f
'<prefix>{folder}</prefix> <tag>{tag}</tag>{suffix}',))
◆ CondInputLoaderCfg()
def python.IOVDbSvcConfig.CondInputLoaderCfg |
( |
|
flags, |
|
|
** |
kwargs |
|
) |
| |
Definition at line 12 of file IOVDbSvcConfig.py.
14 result.addCondAlgo(CompFactory.CondInputLoader(**kwargs))
◆ getSqliteContent()
def python.IOVDbSvcConfig.getSqliteContent |
( |
|
sqliteInput, |
|
|
|
takeFolders, |
|
|
|
databaseInstance |
|
) |
| |
Definition at line 259 of file IOVDbSvcConfig.py.
260 if sqliteInput ==
"":
return []
262 if isinstance(takeFolders, str):
263 takeFolders=[takeFolders,]
264 dbStr=
"sqlite://;schema="+ sqliteInput+
";dbname="+databaseInstance
265 from PyCool
import cool
266 dbSvc = cool.DatabaseSvcFactory.databaseService()
267 db = dbSvc.openDatabase(dbStr)
268 nodelist=db.listAllNodes()
269 for node
in nodelist:
270 if db.existsFolder(node):
271 if (len(takeFolders)>0
and str(node)
not in takeFolders):
continue
272 connStr=
"<db>"+dbStr+
"</db>"
274 if f.versioningMode
is not cool.FolderVersioning.SINGLE_VERSION:
277 connStr+=
"<tag>"+tags[0]+
"</tag>"
278 sqliteFolders[
str(node)]=connStr
281 if len(takeFolders)>0:
282 missedFolders=
set(takeFolders)-
set(sqliteFolders.keys())
283 if len(missedFolders):
284 msg.error(
"The following folders were requested via the flag IOVSvc.sqliteFolder but not found in the sqlite file %s",(sqliteInput))
285 for f
in missedFolders:
288 msg.info(
"The following folders/tags are read from sqlite:")
289 for v
in sqliteFolders.items():
290 msg.info(
"\t"+
str(v))
◆ IOVDbSvcCfg()
def python.IOVDbSvcConfig.IOVDbSvcCfg |
( |
|
flags, |
|
|
** |
kwargs |
|
) |
| |
Definition at line 19 of file IOVDbSvcConfig.py.
23 kwargs.setdefault(
'OnlineMode', flags.Common.isOnline)
24 kwargs.setdefault(
'dbConnection', flags.IOVDb.DBConnection)
25 kwargs.setdefault(
'crestServer', flags.IOVDb.CrestServer)
27 kwargs.setdefault(
'DBInstance', flags.IOVDb.DatabaseInstance)
29 if 'FRONTIER_SERVER' in os.environ.keys()
and os.environ[
'FRONTIER_SERVER'] !=
'':
30 kwargs.setdefault(
'CacheAlign', 3)
33 if flags.Common.isOnline
and flags.Trigger.Online.isPartition:
34 kwargs[
'CacheAlign'] = 0
35 kwargs[
'CacheRun'] = 0
36 kwargs[
'CacheTime'] = 0
38 kwargs.setdefault(
'GlobalTag', flags.IOVDb.GlobalTag)
39 if 'Folders' in kwargs:
40 kwargs[
'Folders'] = [
'/TagInfo<metaOnly/>'] + kwargs[
'Folders']
42 kwargs.setdefault(
'Folders', [
'/TagInfo<metaOnly/>'])
45 if flags.IOVDb.GlobalTag
and flags.IOVDb.GlobalTag.startswith(
'CREST-'):
46 kwargs.setdefault(
'Source',
'CREST')
48 result.addService(CompFactory.IOVDbSvc(**kwargs), primary=
True)
51 from AthenaPoolCnvSvc.PoolCommonConfig
import PoolSvcCfg, AthenaPoolCnvSvcCfg
52 result.merge(
PoolSvcCfg(flags, withCatalogs=
True))
54 result.addService(CompFactory.CondSvc())
55 result.addService(CompFactory.ProxyProviderSvc(ProviderNames=[
'IOVDbSvc']))
57 if not flags.Input.isMC:
58 result.addService(CompFactory.DBReplicaSvc(COOLSQLiteVetoPattern=
'/DBRelease/'))
61 from EventInfoMgt.TagInfoMgrConfig
import TagInfoMgrCfg
65 from AthenaServices.MetaDataSvcConfig
import MetaDataSvcCfg
◆ _dblist
dictionary python.IOVDbSvcConfig._dblist |
|
private |
◆ acc
◆ Files
python.IOVDbSvcConfig.Files |
◆ flags
python.IOVDbSvcConfig.flags = initConfigFlags() |
◆ msg
python.IOVDbSvcConfig.msg = logging.getLogger('IOVDbSvcCfg') |
def CondInputLoaderCfg(flags, **kwargs)
def addFolderList(flags, listOfFolderInfoTuple, extensible=False, db=None, modifiers='')
def TagInfoMgrCfg(flags, tagValuePairs={})
def addOverride(flags, folder, tag, db=None)
def addFolders(flags, folderStrings, detDb=None, className=None, extensible=False, tag=None, db=None, modifiers='')
def IOVDbSvcCfg(flags, **kwargs)
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.
def PoolSvcCfg(flags, withCatalogs=False, **kwargs)
def AthenaPoolCnvSvcCfg(flags, **kwargs)
def addFoldersSplitOnline(flags, detDb, onlineFolders, offlineFolders, className=None, extensible=False, addMCString='_OFL', splitMC=False, tag=None, forceDb=None, modifiers='')
def _extractFolder(folderString)
def getSqliteContent(sqliteInput, takeFolders, databaseInstance)