ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonCalib
MuonCalibDbOperations
python
CalibrationTargetFolderConfig.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2
3
4
import
sys
5
import
CoolConvUtilities.AtlCoolLib
as
AtlCoolLib
6
from
MuonCalibDbOperations.MuonCalibResolveTag
import
ResolveTag
7
8
9
MuonCalib__gCalibrationTargetConfigs = []
10
11
class
MuonCalib__CalibrationTargetConfig
:
12
13
def
__init__
(self, FolderType="T0"):
14
if
FolderType
not
in
[
"T0"
,
"RT"
,
"T0BLOB"
,
"RTBLOB"
]:
15
print
(
"FATAL Folder type must be 'T0[BLOB]' or 'RT[BLOB]'"
)
16
sys.exit(1)
17
18
#set defaults
19
20
# Default None for all FolderTypes
21
self.
Tag
=
None
22
23
if
FolderType==
"T0"
:
24
self.
__is_t0
=
True
25
self.
Compress
=
False
26
self.
Folder
=
"/MDT/T0"
27
elif
FolderType ==
"T0BLOB"
:
28
self.
__is_t0
=
True
29
self.
Compress
=
True
30
self.
Folder
=
"/MDT/T0BLOB"
31
if
FolderType==
"RT"
:
32
self.
__is_t0
=
False
33
self.
Compress
=
False
34
self.
Folder
=
"/MDT/RT"
35
elif
FolderType ==
"RTBLOB"
:
36
self.
__is_t0
=
False
37
self.
Compress
=
True
38
self.
Folder
=
"/MDT/RTBLOB"
39
40
MuonCalib__gCalibrationTargetConfigs.append(self)
41
42
def
ResolveGlobalTag
(self, tag, dbstring="COOLOFL_MDT/CONDBR2"):
43
if
self.
Tag
:
44
print
(
"INFO Tag for"
, self.
Folder
,
"already set to"
, self.
Tag
)
45
print
(
"INFO Not resolving global tag"
)
46
return
47
try
:
48
db=AtlCoolLib.indirectOpen(dbstring, readOnly=
True
, debug=
True
)
49
except
Exception
as
e:
50
print
(
'Problem opening database'
,e)
51
sys.exit(-1)
52
cool_folder=db.getFolder(self.
Folder
)
53
self.
Tag
=ResolveTag(cool_folder, tag)
54
print
(
"INFO tag '"
+ tag +
"' resolves to '"
+ self.
Tag
+
"' for folder '"
+ self.
Folder
+
"'"
)
55
56
57
58
def
AddToCoolInserter
(self, coolInserter):
59
60
if
self.
__is_t0
:
61
coolInserter.T0Folder.append(self.
Folder
)
62
coolInserter.T0Tag.append(self.
Tag
)
63
coolInserter.T0FolderCompress.append(self.
Compress
)
64
else
:
65
coolInserter.RtFolder.append(self.
Folder
)
66
coolInserter.RtTag.append(self.
Tag
)
67
coolInserter.RtFolderCompress.append(self.
Compress
)
68
CalibrationTargetFolderConfig.MuonCalib__CalibrationTargetConfig
Definition
CalibrationTargetFolderConfig.py:11
CalibrationTargetFolderConfig.MuonCalib__CalibrationTargetConfig.__init__
__init__(self, FolderType="T0")
Definition
CalibrationTargetFolderConfig.py:13
CalibrationTargetFolderConfig.MuonCalib__CalibrationTargetConfig.AddToCoolInserter
AddToCoolInserter(self, coolInserter)
Definition
CalibrationTargetFolderConfig.py:58
CalibrationTargetFolderConfig.MuonCalib__CalibrationTargetConfig.Tag
Tag
Definition
CalibrationTargetFolderConfig.py:21
CalibrationTargetFolderConfig.MuonCalib__CalibrationTargetConfig.Compress
bool Compress
Definition
CalibrationTargetFolderConfig.py:25
CalibrationTargetFolderConfig.MuonCalib__CalibrationTargetConfig.__is_t0
bool __is_t0
Definition
CalibrationTargetFolderConfig.py:24
CalibrationTargetFolderConfig.MuonCalib__CalibrationTargetConfig.ResolveGlobalTag
ResolveGlobalTag(self, tag, dbstring="COOLOFL_MDT/CONDBR2")
Definition
CalibrationTargetFolderConfig.py:42
CalibrationTargetFolderConfig.MuonCalib__CalibrationTargetConfig.Folder
str Folder
Definition
CalibrationTargetFolderConfig.py:26
Generated on
for ATLAS Offline Software by
1.17.0