ATLAS Offline Software
Loading...
Searching...
No Matches
Database
IOVDbSvc
python
IOVDbAutoCfgFlags.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3
from
AthenaCommon.Logging
import
logging
4
log = logging.getLogger(
'IOVDbAutoCfgFlags'
)
5
6
def
getLastGlobalTag
(prevFlags):
7
if
not
prevFlags.Input.Files:
8
return
""
9
10
from
AthenaConfiguration.AutoConfigFlags
import
GetFileMD
11
globaltag = GetFileMD(prevFlags.Input.Files).
get
(
"IOVDbGlobalTag"
,
None
)
12
if
globaltag
is
None
:
13
return
""
14
15
if
isinstance(globaltag, list):
# if different tags have been used at different steps
16
globaltag = globaltag[-1]
17
18
return
globaltag
19
20
21
def
getDatabaseInstanceDefault
(flags):
22
# MC
23
if
flags.Input.isMC:
24
return
"OFLP200"
25
26
# real-data
27
try
:
28
year = int(flags.Input.ProjectName[4:6])
29
except
Exception:
30
log.warning(
"Failed to extract year from project tag %s. Assuming CONDBR2."
, flags.Input.ProjectName)
31
return
"CONDBR2"
32
33
if
year > 13:
34
return
"CONDBR2"
35
else
:
36
return
"COMP200"
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition
hcg.cxx:130
python.IOVDbAutoCfgFlags.getDatabaseInstanceDefault
getDatabaseInstanceDefault(flags)
Definition
IOVDbAutoCfgFlags.py:21
python.IOVDbAutoCfgFlags.getLastGlobalTag
getLastGlobalTag(prevFlags)
Definition
IOVDbAutoCfgFlags.py:6
Generated on
for ATLAS Offline Software by
1.14.0