 |
ATLAS Offline Software
|
|
def | CondInputLoaderCfg (flags, **kwargs) |
|
def | DBReplicaSvcCfg (flags, vetoDBRelease=False, **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, tagType="tag", db=None) |
|
def | _extractFolder (folderString) |
|
def | getSqliteContent (sqliteInput, takeFolders, databaseInstance) |
|
def | blockFolder (ca, folder) |
|
◆ _extractFolder()
def python.IOVDbSvcConfig._extractFolder |
( |
|
folderString | ) |
|
|
private |
Extract the folder name (non-XML text) from a IOVDbSvc.Folders entry
Definition at line 246 of file IOVDbSvcConfig.py.
247 """Extract the folder name (non-XML text) from a IOVDbSvc.Folders entry"""
251 while ix < len(folderString):
252 if (folderString[ix] ==
'<' and xmlTag ==
''):
253 ix2 = folderString.find(
'>', ix)
255 xmlTag = folderString[ix + 1 : ix2].strip()
257 elif folderString[ix:ix+2] ==
'</' and xmlTag !=
'':
258 ix2 = folderString.find(
'>', ix)
263 ix2 = folderString.find(
'<', ix)
265 ix2 = len(folderString)
267 folderName = folderName + folderString[ix : ix2]
269 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 104 of file IOVDbSvcConfig.py.
104 def addFolderList(flags, listOfFolderInfoTuple, extensible=False, db=None, modifiers=''):
105 """Add access to the given set of folders, in the identified subdetector schema.
106 FolerInfoTuple consists of (foldername,detDB,classname)
108 If EXTENSIBLE is set, then if we access an open-ended IOV at the end of the list,
109 the end time for this range will be set to just past the current event.
110 Subsequent accesses will update this end time for subsequent events.
111 This allows the possibility of later adding a new IOV using IOVSvc::setRange."""
115 flags.IOVDb.SqliteFolders,
116 flags.IOVDb.DatabaseInstance)
118 for (fs, detDb, className)
in listOfFolderInfoTuple:
121 if className
is not None:
122 loadFolders.add((className, fse))
124 if fse
in sqliteFolders:
125 msg.warning(f
'Reading folder {fs} from sqlite, bypassing production database')
126 fs+=sqliteFolders[fse]
127 elif detDb
is not None and fs.find(
'<db>') == -1:
132 dbName = flags.IOVDb.DatabaseInstance
133 if detDb
in _dblist.keys():
134 fs = f
'<db>{_dblist[detDb]}/{dbName}</db> {fs}'
135 elif os.access(detDb, os.R_OK):
137 fs = f
'<db>sqlite://;schema={detDb};dbname={dbName}</db> {fs}'
139 raise ConfigurationError(f
'Error, db shorthand {detDb} not known, nor found as sqlite file')
143 fs = fs +
'<extensible/>'
153 result.getPrimary().Folders+=folders
155 result.getCondAlgo(
'CondInputLoader').Load |= loadFolders
157 if flags.IOVDb.CleanerRingSize > 0:
159 cleanerSvc = CompFactory.Athena.DelayedConditionsCleanerSvc(RingSize=flags.IOVDb.CleanerRingSize)
160 result.addService(cleanerSvc)
161 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 86 of file IOVDbSvcConfig.py.
86 def addFolders(flags, folderStrings, detDb=None, className=None, extensible=False, tag=None, db=None, modifiers=''):
89 tagString =
'<tag>%s</tag>' % tag
92 if isinstance(folderStrings, str):
93 return addFolderList(flags, ((folderStrings + tagString, detDb, className),), extensible, db, modifiers)
96 folderDefinitions = []
98 for folderString
in folderStrings:
99 folderDefinitions.append((folderString + tagString, detDb, className))
101 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 167 of file IOVDbSvcConfig.py.
167 def addFoldersSplitOnline(flags, detDb, onlineFolders, offlineFolders, className=None, extensible=False, addMCString='_OFL', splitMC=False, tag=None, forceDb=None, modifiers=''):
168 """Add access to given folder, using either online_folder or offline_folder. For MC, add addMCString as a postfix (default is _OFL)"""
170 if flags.Common.isOnline
and not flags.Input.isMC:
171 folders = onlineFolders
172 elif splitMC
and not flags.Input.isMC:
173 folders = onlineFolders
176 detDb = detDb + addMCString
177 folders = offlineFolders
179 return addFolders(flags, folders, detDb, className, extensible, tag=tag, db=forceDb, modifiers=modifiers)
◆ addOverride()
def python.IOVDbSvcConfig.addOverride |
( |
|
flags, |
|
|
|
folder, |
|
|
|
tag, |
|
|
|
tagType = "tag" , |
|
|
|
db = None |
|
) |
| |
Add xml override for the specified folder (folder-level tag, forceRunNumber, ...)
Definition at line 238 of file IOVDbSvcConfig.py.
238 def addOverride(flags, folder, tag, tagType="tag", db=None):
239 """Add xml override for the specified folder (folder-level tag, forceRunNumber, ...)"""
242 suffix = f
' <db>{db}</db>'
243 return IOVDbSvcCfg(flags, overrideTags=(f
'<prefix>{folder}</prefix> <{tagType}>{tag}</{tagType}>{suffix}',))
◆ blockFolder()
def python.IOVDbSvcConfig.blockFolder |
( |
|
ca, |
|
|
|
folder |
|
) |
| |
Definition at line 310 of file IOVDbSvcConfig.py.
311 "Block use of specified conditions DB folder so data can be read from elsewhere"
312 msg.info(
"Trying to remove folder [%s] from IOVDbSvc.Folders",folder)
313 iovdbsvc=ca.getService(
"IOVDbSvc")
314 oldLen=len(iovdbsvc.Folders)
315 iovdbsvc.Folders=[x
for x
in iovdbsvc.Folders
if x.find(folder)==-1]
316 newLen=len(iovdbsvc.Folders)
318 msg.warning(
"Folder [%s] not found in IOVDbSvc.Folder",folder)
320 elif (oldLen-newLen>1):
321 msg.warning(
"Folder string [%s] matched more than one folder, removed %i folders",folder,oldLen-newLen)
324 condInputLoader=ca.getCondAlgo(
"CondInputLoader")
325 condInputLoader.Load=
set([x
for x
in condInputLoader.Load
if x[1].
find(folder)==-1])
◆ CondInputLoaderCfg()
def python.IOVDbSvcConfig.CondInputLoaderCfg |
( |
|
flags, |
|
|
** |
kwargs |
|
) |
| |
Definition at line 12 of file IOVDbSvcConfig.py.
14 result.addCondAlgo(CompFactory.CondInputLoader(**kwargs))
◆ DBReplicaSvcCfg()
def python.IOVDbSvcConfig.DBReplicaSvcCfg |
( |
|
flags, |
|
|
|
vetoDBRelease = False , |
|
|
** |
kwargs |
|
) |
| |
Definition at line 18 of file IOVDbSvcConfig.py.
20 kwargs.setdefault(
'COOLSQLiteVetoPattern',
'/DBRelease/')
23 result.addService(CompFactory.DBReplicaSvc(**kwargs))
◆ getSqliteContent()
def python.IOVDbSvcConfig.getSqliteContent |
( |
|
sqliteInput, |
|
|
|
takeFolders, |
|
|
|
databaseInstance |
|
) |
| |
Definition at line 273 of file IOVDbSvcConfig.py.
274 if sqliteInput ==
"":
return []
276 if isinstance(takeFolders, str):
277 takeFolders=[takeFolders,]
278 dbStr=
"sqlite://;schema="+ sqliteInput+
";dbname="+databaseInstance
279 from PyCool
import cool
280 dbSvc = cool.DatabaseSvcFactory.databaseService()
281 db = dbSvc.openDatabase(dbStr)
282 nodelist=db.listAllNodes()
283 for node
in nodelist:
284 if db.existsFolder(node):
285 if (len(takeFolders)>0
and str(node)
not in takeFolders):
continue
286 connStr=
"<db>"+dbStr+
"</db>"
288 if f.versioningMode
is not cool.FolderVersioning.SINGLE_VERSION:
291 connStr+=
"<tag>"+tags[0]+
"</tag>"
292 sqliteFolders[
str(node)]=connStr
295 if len(takeFolders)>0:
296 missedFolders=
set(takeFolders)-
set(sqliteFolders.keys())
297 if len(missedFolders):
298 msg.error(
"The following folders were requested via the flag IOVSvc.sqliteFolder but not found in the sqlite file %s",(sqliteInput))
299 for f
in missedFolders:
302 msg.info(
"The following folders/tags are read from sqlite:")
303 for v
in sqliteFolders.items():
304 msg.info(
"\t"+
str(v))
◆ IOVDbSvcCfg()
def python.IOVDbSvcConfig.IOVDbSvcCfg |
( |
|
flags, |
|
|
** |
kwargs |
|
) |
| |
Definition at line 28 of file IOVDbSvcConfig.py.
32 kwargs.setdefault(
'OnlineMode', flags.Common.isOnline)
33 kwargs.setdefault(
'dbConnection', flags.IOVDb.DBConnection)
34 kwargs.setdefault(
'crestServer', flags.IOVDb.CrestServer)
36 kwargs.setdefault(
'DBInstance', flags.IOVDb.DatabaseInstance)
38 if 'FRONTIER_SERVER' in os.environ.keys()
and os.environ[
'FRONTIER_SERVER'] !=
'':
39 kwargs.setdefault(
'CacheAlign', 3)
42 if flags.Common.isOnline
and flags.Trigger.Online.isPartition:
43 kwargs[
'CacheAlign'] = 0
44 kwargs[
'CacheRun'] = 0
45 kwargs[
'CacheTime'] = 0
47 kwargs.setdefault(
'GlobalTag', flags.IOVDb.GlobalTag)
48 if 'Folders' in kwargs:
49 kwargs[
'Folders'] = [
'/TagInfo<metaOnly/>'] + kwargs[
'Folders']
51 kwargs.setdefault(
'Folders', [
'/TagInfo<metaOnly/>'])
54 if flags.IOVDb.GlobalTag
and flags.IOVDb.GlobalTag.startswith(
'CREST-'):
55 kwargs.setdefault(
'Source',
'CREST')
57 result.addService(CompFactory.IOVDbSvc(**kwargs), primary=
True)
60 from AthenaPoolCnvSvc.PoolCommonConfig
import PoolSvcCfg
61 result.merge(
PoolSvcCfg(flags, withCatalogs=
True))
62 if flags.MP.UseSharedReader
or flags.MP.UseSharedWriter:
63 from AthenaPoolCnvSvc.PoolCommonConfig
import AthenaPoolSharedIOCnvSvcCfg
66 from AthenaPoolCnvSvc.PoolCommonConfig
import AthenaPoolCnvSvcCfg
68 result.addService(CompFactory.CondSvc())
69 result.addService(CompFactory.ProxyProviderSvc(ProviderNames=[
'IOVDbSvc']))
71 if not flags.Input.isMC:
75 from EventInfoMgt.TagInfoMgrConfig
import TagInfoMgrCfg
79 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)
std::string find(const std::string &s)
return a remapped string
def addFolderList(flags, listOfFolderInfoTuple, extensible=False, db=None, modifiers='')
def AthenaPoolSharedIOCnvSvcCfg(flags, **kwargs)
def TagInfoMgrCfg(flags, tagValuePairs={})
def blockFolder(ca, folder)
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 addOverride(flags, folder, tag, tagType="tag", db=None)
def DBReplicaSvcCfg(flags, vetoDBRelease=False, **kwargs)
def getSqliteContent(sqliteInput, takeFolders, databaseInstance)