ATLAS Offline Software
Functions
python.CommonGeoDB Namespace Reference

Functions

def InitializeGeometryParameters (dbGeomCursor)
 
def InitializeGeometryParameters_SQLite (sqliteDbReader)
 
def InitializeLuminosityDetectorParameters (dbGeomCursor)
 
def InitializeLuminosityDetectorParameters_SQLite (sqliteDbReader)
 
def SetupLocalSqliteGeometryDb (geometryFilePath, geometryTag)
 

Function Documentation

◆ InitializeGeometryParameters()

def python.CommonGeoDB.InitializeGeometryParameters (   dbGeomCursor)
Read version name, layout and dbm from AtlasCommon table.

dbGeomCursor: AtlasGeoDBInterface instance

Definition at line 3 of file CommonGeoDB.py.

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 

◆ InitializeGeometryParameters_SQLite()

def python.CommonGeoDB.InitializeGeometryParameters_SQLite (   sqliteDbReader)
Read version name, layout and dbm from AtlasCommon table in SQLite

sqliteDbReader: AtlasGeoDBInterface_SQLite instance

Definition at line 25 of file CommonGeoDB.py.

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 

◆ InitializeLuminosityDetectorParameters()

def python.CommonGeoDB.InitializeLuminosityDetectorParameters (   dbGeomCursor)
Read luminosity detectors from the DB

dbGeomCursor: AtlasGeoDBInterface instance

Definition at line 87 of file CommonGeoDB.py.

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 

◆ InitializeLuminosityDetectorParameters_SQLite()

def python.CommonGeoDB.InitializeLuminosityDetectorParameters_SQLite (   sqliteDbReader)
Read luminosity detectors from LuminositySwitches table in the SQLite DB

sqliteDbReader: AtlasGeoDBInterface_SQLite instance

Definition at line 107 of file CommonGeoDB.py.

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
125 

◆ SetupLocalSqliteGeometryDb()

def python.CommonGeoDB.SetupLocalSqliteGeometryDb (   geometryFilePath,
  geometryTag 
)
Configure the reading of local SQLite Geometry Database file

This process consists of three steps
1. It is necessary to create ./Geometry directory
2. Place in this directory a symlink to the geometryFilePath with the name 'geometryTag.db'
3. Prepend '.' to the CALIBPATH environment

Definition at line 126 of file CommonGeoDB.py.

126 def SetupLocalSqliteGeometryDb(geometryFilePath,geometryTag):
127  """ Configure the reading of local SQLite Geometry Database file
128 
129  This process consists of three steps
130  1. It is necessary to create ./Geometry directory
131  2. Place in this directory a symlink to the geometryFilePath with the name 'geometryTag.db'
132  3. Prepend '.' to the CALIBPATH environment
133  """
134 
135  import os
136  if not os.path.exists("Geometry"):
137  try:
138  os.mkdir("Geometry")
139  except FileExistsError:
140  pass
141  linkName = geometryTag + ".db"
142  linkPath = os.path.join("Geometry",linkName)
143  if not os.path.exists(linkPath):
144  os.symlink(geometryFilePath,linkPath)
145  if 'CALIBPATH' in os.environ.keys():
146  os.environ['CALIBPATH']='.:'+ os.environ['CALIBPATH']
147  else:
148  os.environ['CALIBPATH']='.'
149 
150  return
151 
python.CommonGeoDB.SetupLocalSqliteGeometryDb
def SetupLocalSqliteGeometryDb(geometryFilePath, geometryTag)
Definition: CommonGeoDB.py:126
python.CommonGeoDB.InitializeGeometryParameters_SQLite
def InitializeGeometryParameters_SQLite(sqliteDbReader)
Definition: CommonGeoDB.py:25
python.CommonGeoDB.InitializeGeometryParameters
def InitializeGeometryParameters(dbGeomCursor)
Definition: CommonGeoDB.py:3
python.CommonGeoDB.InitializeLuminosityDetectorParameters_SQLite
def InitializeLuminosityDetectorParameters_SQLite(sqliteDbReader)
Definition: CommonGeoDB.py:107
CxxUtils::set
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.
Definition: bitmask.h:232
python.CommonGeoDB.InitializeLuminosityDetectorParameters
def InitializeLuminosityDetectorParameters(dbGeomCursor)
Definition: CommonGeoDB.py:87
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
Trk::split
@ split
Definition: LayerMaterialProperties.h:38