ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
DetectorDescription
GeoModel
AtlasGeoModel
python
CommonGeoDB.py
Go to the documentation of this file.
1
# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3
def
InitializeGeometryParameters
(dbGeomCursor):
4
"""Read version name, layout and dbm from AtlasCommon table.
5
6
dbGeomCursor: AtlasGeoDBInterface instance
7
"""
8
9
dbId, dbCommon, dbParam = dbGeomCursor.GetCurrentLeafContent(
"AtlasCommon"
)
10
11
params = {
"Run"
:
"UNDEFINED"
,
12
"GeoType"
:
"UNDEFINED"
,
13
"Detectors"
:
set
(),
14
"DetectorsConfigured"
:
False
}
15
16
if
len(dbId)>0:
17
key = dbId[0]
18
if
"CONFIG"
in
dbParam :
19
params[
"Run"
] = dbCommon[key][dbParam.index(
"CONFIG"
)]
20
if
"GEOTYPE"
in
dbParam :
21
params[
"GeoType"
] = dbCommon[key][dbParam.index(
"GEOTYPE"
)]
22
23
return
params
24
25
def
InitializeGeometryParameters_SQLite
(sqliteDbReader):
26
"""Read version name, layout and dbm from AtlasCommon table in SQLite
27
28
sqliteDbReader: AtlasGeoDBInterface_SQLite instance
29
"""
30
31
dbData = sqliteDbReader.GetData(
"AtlasCommon"
)
32
33
params = {
"Run"
:
"UNDEFINED"
,
34
"GeoType"
:
"UNDEFINED"
,
35
"Detectors"
:
set
(),
36
"DetectorsConfigured"
:
False
}
37
38
if
dbData:
39
if
"CONFIG"
in
dbData[0].keys():
40
params[
"Run"
] = dbData[0][
"CONFIG"
]
41
if
"GEOTYPE"
in
dbData[0].keys():
42
params[
"GeoType"
] = dbData[0][
"GEOTYPE"
]
43
44
45
dbData = sqliteDbReader.GetData(
"AAHEADER"
)
46
if
dbData:
47
if
"PluginNames"
in
dbData[0].keys():
48
plugins = dbData[0][
"PluginNames"
].
split
(
";"
)
49
print
(plugins)
50
detectors =
set
()
51
52
if
"Beampipe"
in
plugins:
53
detectors.add(
"Bpipe"
)
54
55
if
"Pixel"
in
plugins:
56
detectors.add(
"Pixel"
)
57
detectors.add(
"BCM"
)
58
if
"SCT"
in
plugins:
59
detectors.add(
"SCT"
)
60
if
"TRT"
in
plugins:
61
detectors.add(
"TRT"
)
62
63
64
if
"ITk"
in
plugins
or
"ITkStrip"
in
plugins:
65
detectors.add(
"ITkStrip"
)
66
if
"ITk"
in
plugins
or
"ITkPixel"
in
plugins:
67
detectors.add(
"ITkPixel"
)
68
if
"ITk"
in
plugins
or
"BCMPrime"
in
plugins:
69
detectors.add(
"BCMPrime"
)
70
if
"ITk"
in
plugins
or
"PLR"
in
plugins:
71
detectors.add(
"PLR"
)
72
73
if
"LAr"
in
plugins:
74
detectors.add(
"LAr"
)
75
if
"Tile"
in
plugins:
76
detectors.add(
"Tile"
)
77
78
if
"HGTD"
in
plugins:
79
detectors.add(
"HGTD"
)
80
82
params[
"Detectors"
] = detectors
83
params[
"DetectorsConfigured"
] =
True
84
return
params
85
86
87
def
InitializeLuminosityDetectorParameters
(dbGeomCursor):
88
"""Read luminosity detectors from the DB
89
90
dbGeomCursor: AtlasGeoDBInterface instance
91
"""
92
93
dbId, dbCommon, dbParam = dbGeomCursor.GetCurrentLeafContent(
"LuminositySwitches"
)
94
95
params = {
"BCMPrime"
:
False
,
96
"PLR"
:
False
}
97
98
if
len(dbId):
99
key = dbId[0]
100
if
"BCMPRIME"
in
dbParam :
101
params[
"BCMPrime"
] = dbCommon[key][dbParam.index(
"BCMPRIME"
)] == 1
102
if
"PLR"
in
dbParam :
103
params[
"PLR"
] = dbCommon[key][dbParam.index(
"PLR"
)] == 1
104
105
return
params
106
107
def
InitializeLuminosityDetectorParameters_SQLite
(sqliteDbReader):
108
"""Read luminosity detectors from LuminositySwitches table in the SQLite DB
109
110
sqliteDbReader: AtlasGeoDBInterface_SQLite instance
111
"""
112
113
dbData = sqliteDbReader.GetData(
"LuminositySwitches"
)
114
115
params = {
"BCMPrime"
:
False
,
116
"PLR"
:
False
}
117
118
if
dbData:
119
if
"BCMPRIME"
in
dbData[0].keys():
120
params[
"BCMPrime"
] = dbData[0][
"BCMPRIME"
] == 1
121
if
"PLR"
in
dbData[0].keys():
122
params[
"PLR"
] = dbData[0][
"PLR"
] == 1
123
124
return
params
set
STL class.
split
std::vector< std::string > split(const std::string &s, const std::string &t=":")
Definition
hcg.cxx:179
python.CommonGeoDB.InitializeGeometryParameters
InitializeGeometryParameters(dbGeomCursor)
Definition
CommonGeoDB.py:3
python.CommonGeoDB.InitializeGeometryParameters_SQLite
InitializeGeometryParameters_SQLite(sqliteDbReader)
Definition
CommonGeoDB.py:25
python.CommonGeoDB.InitializeLuminosityDetectorParameters_SQLite
InitializeLuminosityDetectorParameters_SQLite(sqliteDbReader)
Definition
CommonGeoDB.py:107
python.CommonGeoDB.InitializeLuminosityDetectorParameters
InitializeLuminosityDetectorParameters(dbGeomCursor)
Definition
CommonGeoDB.py:87
Generated on
for ATLAS Offline Software by
1.17.0