ATLAS Offline Software
TriggerConfigAccessBase.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 import os
4 import json
5 import re
6 from typing import Any
7 import six
8 import xml.etree.ElementTree as ET
9 from collections import OrderedDict as odict
10 import coral
11 
12 from AthenaCommon.Logging import logging
13 log = logging.getLogger('TriggerConfigAccessBase.py')
14 
15 def getFileType(filename):
16  filetype = "unknown"
17  with open(filename, 'r') as fp:
18  config = json.load(fp)
19  filetype = config['filetype']
20  return filetype
21 
22 from enum import Enum
23 class ConfigType(Enum):
24  NONE = ("Config", "None", "None")
25  L1MENU = ("L1Menu", "l1menu", "L1M")
26  HLTMENU = ("HLTMenu", "hltmenu", "HLTM")
27  L1PS = ("L1PrescalesSet", "l1prescale", "L1PS")
28  HLTPS = ("HLTPrescalesSet", "hltprescale", "HLTPS")
29  BGS = ("L1BunchGroupsSet", "bunchgroupset", "BGS")
30  HLTJO = ("HLTJobOptions", "joboptions", "JO")
31  HLTMON = ("HLTMonitoring", "hltmonitoringsummary", "MGS")
32  def __init__(self, basename, filetype, crestkey):
33  self.basename = basename
34  self.filetype = filetype
35  self.crestkey = crestkey
36  def __eq__(self, other):
37  if isinstance(other,six.string_types):
38  return self.filetype == other
39  else:
40  return self.filetype == other.filetype
41  def __ne__(self, other):
42  return not self.__eq__(other)
43 
45  """
46  ConfigLoader derived classes hold the information of the configuration source
47  and define the method to load the configuration
48  """
49  def __init__(self,configType):
50  self.configType = configType
51  def confirmConfigType(self,config):
52  """
53  checks that the in-file specification of the configuration type matches the expected type
54  """
55  if config['filetype'] != self.configType:
56  raise RuntimeError("Can not load file with filetype '%s' when expecting '%s'" % (config['filetype'], self.configType.filetype))
57 
59  def __init__(self, configType, filename ):
60  super(ConfigFileLoader,self).__init__(configType)
61  self.filename = filename
62  def load(self):
63  with open(self.filename, 'r') as fp:
64  config = json.load(fp, object_pairs_hook = odict)
65  self.confirmConfigType(config)
66  return config
67  def setQuery(self, query):
68  pass
69  def getWriteFilename(self):
70  outfn = os.path.basename(self.filename)
71  if outfn.endswith(".json"):
72  outfn = outfn.rsplit('.',1)[0]
73  return outfn + ".out.json"
74 
76  """Class to load from json string"""
77  def __init__(self, configType, jsonString):
78  super(ConfigDirectLoader,self).__init__(configType)
79  self.jsonString = jsonString
80  def load(self):
81  config = json.loads(self.jsonString, object_pairs_hook = odict)
82  self.confirmConfigType(config)
83  return config
84  def setQuery(self, query):
85  pass
86  def getWriteFilename(self):
87  pass
88 
89 class ConfigDBLoader(ConfigLoader):
90  def __init__(self, configType, dbalias, dbkey):
91  super().__init__(configType)
92  self.dbalias = dbalias
93  self.dbkey = dbkey
94  self.query = None
95  self.schema = None
96 
97  def setQuery(self, query):
98  """
99  query template is a dictionary of queries, identified by schema version,
100  similar to TrigConf::TrigDBMenuLoader::m_hltQueries and TrigConf::TrigDBMenuLoader::m_l1Queries
101  """
102  self.query = query
103 
104  @staticmethod
105  def getResolvedFileName(filename, pathenv=""):
106  """ looks for file, first absolute, then by resolving envvar pathenv"""
107  if os.access(filename,os.R_OK):
108  return filename
109  pathlist = os.getenv(pathenv,'').split(os.pathsep)
110  for path in pathlist:
111  f = os.path.join( path, filename )
112  if os.access( f, os.R_OK ):
113  return f
114  raise RuntimeError("Can't read file %s, neither locally nor in %s" % (filename, pathenv) )
115 
116  @staticmethod
118  dblookupFile = ConfigDBLoader.getResolvedFileName("dblookup.xml", "CORAL_DBLOOKUP_PATH")
119  dbp = ET.parse(dblookupFile)
120  listOfServices = None
121  for logSvc in dbp.iter("logicalservice"):
122  if logSvc.attrib["name"] != dbalias:
123  continue
124  listOfServices = [ serv.attrib["name"] for serv in logSvc.iter("service") ]
125  if len(listOfServices) == 0:
126  raise RuntimeError("DB %s has no services listed in %s" % (dbalias, dblookupFile))
127  break
128  if listOfServices is None:
129  raise RuntimeError("DB %s not available in %s" % (dbalias, dblookupFile))
130 
131  if "FRONTIER_SERVER" not in os.environ:
132  # remove all frontier connnections in the list if the environment FRONTIER_SERVER variable does not exist
133  # this speeds up the resolution of the connection specification (dbalias)
134  listOfServices = [svc for svc in listOfServices if not svc.startswith("frontier:")]
135 
136  # now get the account and pw for oracle connections
137  credentials = odict().fromkeys(listOfServices)
138 
139  for svc in filter(lambda s : s.startswith("frontier:"), listOfServices):
140  credentials[svc] = dict()
141  credentials[svc]["user"] = svc
142  credentials[svc]["password"] = ""
143 
144  try:
145  authFile = ConfigDBLoader.getResolvedFileName("authentication.xml", "CORAL_AUTH_PATH")
146  except Exception as e:
147  log.warning("File authentication.xml is not available! Oracle connection cannot be established. Exception message is: %s",e)
148  else:
149  for svc in filter(lambda s : s.startswith("oracle:"), listOfServices):
150  ap = ET.parse(authFile)
151  count = 0
152  for con in filter( lambda c: c.attrib["name"]==svc, ap.iter("connection")):
153  credentials[svc] = dict([(par.attrib["name"],par.attrib["value"]) for par in con])
154  count += 1
155  if count==0:
156  raise RuntimeError("No credentials found for connection %s from service %s for db %s" % (con,svc,dbalias))
157  if count>1:
158  raise RuntimeError("More than 1 connection found in %s for service %s" % (authFile, svc))
159 
160  return credentials
161 
162  @staticmethod
163  def getSchema(connStr):
164  ''' Read schema from connection string '''
165  if connStr.startswith("oracle:"):
166  [_, schema] = connStr.split("/")[-2:]
167  return schema
168 
169  if connStr.startswith("frontier:"):
170  import re
171  pattern = r"frontier://ATLF/\‍(\‍)/(.*)"
172  m = re.match(pattern, connStr)
173  if not m:
174  raise RuntimeError("connection string '%s' doesn't match the pattern '%s'?" % (connStr, pattern))
175  (schema, ) = m.groups()
176  return schema
177 
178  if connStr.startswith("sqlite_file:"):
179  raise NotImplementedError("Python-loading of trigger configuration from sqlite has not yet been implemented")
180 
181  @staticmethod
182  def readSchemaVersion(qdict, session):
183  ''' Read schema version form database, based on TrigConf::TrigDBLoader::schemaVersion '''
184  try:
185  q = "SELECT TS_TAG FROM {schema}.TRIGGER_SCHEMA TS"
186  query = ConfigDBLoader.getCoralQuery(session, q.format(**qdict))
187  cursor = query.execute()
188  cursor.next()
189 
190  versionTag = cursor.currentRow()[0].data()
191 
192  versionTagPrefix = "Trigger-Run3-Schema-v"
193  if not versionTag.startswith(versionTagPrefix):
194  raise RuntimeError( "Tag format error: Trigger schema version tag %s does not start with %s", versionTag, versionTagPrefix)
195 
196  vstr = versionTag[len(versionTagPrefix)]
197 
198  if not vstr.isdigit():
199  raise RuntimeError( "Invalid argument when interpreting the version part %s of schema tag %s is %s", vstr, versionTag, type(vstr))
200 
201  log.debug("Found schema version %s", vstr)
202  return int(vstr)
203 
204  except Exception as e:
205  log.warning("Failed to read schema version: %r", e)
206 
207  @staticmethod
208  def getCoralQuery(session, queryStr, qdict = None):
209  ''' Parse output, tables and condition from the query string into coral query object'''
210  query = session.nominalSchema().newQuery()
211 
212  if qdict is not None:
213  queryStr = queryStr.format(**qdict)
214 
215  # bind vars
216  bindVars = coral.AttributeList()
217  bindVarsInQuery = re.findall(r":(\w*)", queryStr)
218  if len(bindVarsInQuery) > 0 and qdict is None:
219  log.error("Query has bound-variable syntax but no value dictionary is provided. Query: %s", queryStr)
220  for k in bindVarsInQuery:
221  bindVars.extend(k, "int")
222  bindVars[k].setData(qdict[k])
223 
224  output = queryStr.split("SELECT")[1].split("FROM")[0]
225  for field in output.split(','):
226  query.addToOutputList(field)
227 
228  log.debug("Conversion for Coral of query: %s", queryStr)
229 
230  for table in queryStr.split("FROM")[1].split("WHERE")[0].split(","):
231  tableSplit = list(filter(None, table.split(" ")))
232  # Schema name is stripped from TableList in Coral query
233  query.addToTableList(tableSplit[0].split(".")[1], tableSplit[1])
234 
235  if "WHERE" in queryStr:
236  cond = queryStr.split("WHERE")[1]
237  m = re.match("(.*)(?i: ORDER *BY )(.*)", cond) # check for "order by" clause
238  if m:
239  where, order = m.groups()
240  query.setCondition(where, bindVars)
241  query.addToOrderList(order)
242  else:
243  query.setCondition(cond, bindVars)
244 
245  return query
246 
247  def getQueryDefinition(self, schemaVersion):
248  '''Choose query based on schema version, based on TrigConf::TrigDBLoader::getQueryDefinition '''
249  maxDefVersion = 0
250  for vkey in self.query.keys():
251  if vkey>maxDefVersion and vkey<=schemaVersion:
252  maxDefVersion = vkey
253 
254  if maxDefVersion == 0:
255  raise RuntimeError("No query available for schema version {0}".format(schemaVersion))
256 
257  return self.query[maxDefVersion]
258 
259  def load(self):
260  credentials: dict[str,Any] = ConfigDBLoader.getConnectionParameters(self.dbalias)
261 
262  if not credentials:
263  log.error("No TriggerDB connections found for %s", self.dbalias)
264  raise RuntimeError(f"No TriggerDB connections found for {self.dbalias}")
265 
266  svc = coral.ConnectionService()
267  svcconfig = svc.configuration()
268  svcconfig.disablePoolAutomaticCleanUp()
269  svcconfig.setConnectionTimeOut(0)
270 
271  failureMode = 0
272  for credential in credentials:
273  log.debug("Trying credentials %s",credential)
274 
275  try:
276  session = svc.connect(credential, coral.access_ReadOnly)
277  except Exception as e:
278  log.warning("Failed to establish connection: %s",e)
279  failureMode = max(1, failureMode)
280  continue
281 
282  # Check that the FRONTIER_SERVER is set properly, if not reduce the retrial period and time out values
283  if 'FRONTIER_SERVER' in os.environ and os.environ['FRONTIER_SERVER']:
284  svcconfig.setConnectionRetrialPeriod(300)
285  svcconfig.setConnectionRetrialTimeOut(3600)
286  else:
287  svcconfig.setConnectionRetrialPeriod(1)
288  svcconfig.setConnectionRetrialTimeOut(1)
289 
290  try:
291  session.transaction().start(True) # readOnly
292  self.schema = ConfigDBLoader.getSchema(credential)
293  qdict = { "schema" : self.schema, "dbkey" : self.dbkey }
294 
295  # Choose query based on schema
296  schemaVersion = ConfigDBLoader.readSchemaVersion(qdict, session)
297  qstr = self.getQueryDefinition(schemaVersion)
298  # execute coral query
299  query = ConfigDBLoader.getCoralQuery(session, qstr, qdict)
300  cursor = query.execute()
301 
302  except Exception as e:
303  log.warning(f"DB query on {credential} failed to execute.")
304  log.warning("Exception message: %r", e)
305  failureMode = max(2, failureMode)
306  continue # to next source
307 
308  # Read query result
309  if not cursor.next():
310  # empty result
311  log.warning(f"DB query on {credential} returned empty result, likely due to non-existing key {self.dbkey}")
312  failureMode = 3
313  continue # to next source
314 
315  configblob = cursor.currentRow()[0].data()
316  if type(configblob) is not str:
317  configblob = configblob.readline()
318  config = json.loads(configblob, object_pairs_hook = odict)
319  session.transaction().commit()
320 
321  self.confirmConfigType(config)
322  return config
323 
324  if failureMode == 1:
325  log.error("TriggerDB query: could not connect to any source for %s", self.configType.basename)
326  log.error("Considered sources: %s", ", ".join(credentials))
327  raise RuntimeError("TriggerDB query: could not connect to any source", self.configType.basename)
328  if failureMode == 2:
329  log.error("Query failed due to wrong definition for %s", self.configType.basename)
330  log.error("DB query was: %s", qstr.format(**qdict))
331  raise RuntimeError("Query failed due to wrong definition", self.configType.basename)
332  elif failureMode == 3:
333  log.error("DB key %s does not exist for %s", self.dbkey, self.configType.basename)
334  raise KeyError("DB key does not exist", self.dbkey, self.configType.basename)
335  else:
336  raise RuntimeError("Query failed for unknown reason")
337 
338  # proposed filename when writing config to file
339  def getWriteFilename(self):
340  return "{basename}_{schema}_{dbkey}.json".format(basename = self.configType.basename, schema = self.schema, dbkey = self.dbkey)
341 
343  def __init__(self, *, configType, dbalias, dbkey, crestServer):
344  super().__init__(configType)
345  self.crestServer = crestServer
346  self.dbalias = dbalias
347  self.dbkey = dbkey
348  self.schema = ""
349 
350  def setQuery(self, query):
351  """
352  With CREST all queries are defined in the CREST server
353  """
354  pass
355 
356  def _get_payload(self, hash: str) -> dict:
357  """get payload from crest server using request library
358 
359  Args:
360  hash (str): the query part of the url as required by the REST api
361 
362  Raises:
363  RuntimeError: when connection or query failed
364 
365  Returns:
366  dict: the json content
367  """
368  import requests
369 
370  url = f"{self.crestServer}/payloads/data"
371  params = {
372  "format": "BLOB",
373  "hash": hash
374  }
375  preq = requests.Request(method='GET', url=url, params=params).prepare()
376  with requests.Session() as session:
377  try:
378  resp = session.send(preq)
379  except requests.ConnectionError as exc:
380  log.error(f"Could not connect to crest server {self.crestServer} ({exc})")
381  raise RuntimeError(f"Could not connect to CREST server {self.crestServer}")
382 
383  if resp.status_code != 200:
384  log.error(f"Error: HTTP GET request '{preq.url}' failed")
385  raise RuntimeError(f"Query {hash} to crest failed with status code {resp.status_code}")
386 
387  config = json.loads(resp.content, object_pairs_hook = odict)
388  self.confirmConfigType(config)
389  return config
390 
391  @staticmethod
392  def _getDBSchemaName(dbalias) -> str:
393  dblookupFile = ConfigDBLoader.getResolvedFileName("dblookup.xml", "CORAL_DBLOOKUP_PATH")
394  dbp = ET.parse(dblookupFile)
395  for logSvc in dbp.iter("logicalservice"):
396  if logSvc.attrib["name"] != dbalias:
397  continue
398  oracleServer = ""
399  for serv in logSvc.iter("service"):
400  if serv.attrib["name"].startswith("oracle://"):
401  oracleService = serv.attrib["name"]
402  oracleServer = oracleService.split('/')[3]
403  return oracleServer
404  raise RuntimeError(f"DB {dbalias} has no oracle services listed in {dblookupFile}")
405  raise RuntimeError(f"DB {dbalias} is not listed in {dblookupFile}")
406 
407  def load(self) -> dict:
408  # see SCHEMA_MAP in https://gitlab.cern.ch/crest-db/crest/-/blob/master/src/main/java/hep/crest/server/repositories/triggerdb/TriggerDb.java
409  self.schema = ConfigCrestLoader._getDBSchemaName(self.dbalias)
410  url_schema = {
411  "ATLAS_CONF_TRIGGER_RUN3": "CONF_DATA_RUN3",
412  "ATLAS_CONF_TRIGGER_MC_RUN3": "CONF_MC_RUN3",
413  "ATLAS_CONF_TRIGGER_REPR_RUN3": "CONF_REPR_RUN3",
414  }.get(self.schema)
415  if url_schema is None:
416  raise RuntimeError(f"Oracle server {self.schema} is not implemented in the crest server {self.crestServer}")
417  hash = f"triggerdb://{url_schema}/{self.configType.crestkey}/{self.dbkey}"
418  config = self._get_payload(hash=hash)
419  return config
420 
421  # proposed filename when writing config to file
422  def getWriteFilename(self):
423  return "{basename}_{schema}_{dbkey}.json".format(basename = self.configType.basename, schema = self.schema, dbkey = self.dbkey)
424 
426  """
427  base class to hold the configuration (OrderedDict)
428  and provides basic functions to access and print
429  """
430  def __init__(self, configType, mainkey, filename = None, jsonString = None, dbalias = None, dbkey = None, useCrest=False, crestServer=""):
431  self._getLoader(configType = configType, filename = filename, jsonString = jsonString, dbalias = dbalias, dbkey = dbkey,
432  useCrest=useCrest, crestServer=crestServer)
433  self._mainkey = mainkey
434  self._config = None
435 
436  def _getLoader(self, *, configType, filename = None, jsonString = None, dbalias = None, dbkey = None,
437  useCrest:bool = False, crestServer:str = ""):
438  if filename:
439  self.loader = ConfigFileLoader( configType, filename )
440  elif dbalias and dbkey:
441  if useCrest:
442  self.loader = ConfigCrestLoader(configType=configType, dbalias=dbalias, dbkey=dbkey, crestServer=crestServer)
443  else:
444  self.loader = ConfigDBLoader( configType, dbalias, dbkey)
445  elif jsonString:
446  self.loader = ConfigDirectLoader( configType, jsonString )
447  else:
448  raise RuntimeError("Neither input file, nor JSON nor db alias and key provided")
449 
450  def load(self):
451  self._config = self.loader.load()
452 
453  def __str__(self):
454  return str(self._config)
455 
456  def __iter__(self):
457  return iter(self[self._mainkey])
458 
459  def __getitem__(self, item):
460  return self._config[item]
461 
462  def __len__(self):
463  return len(self[self._mainkey])
464 
465  def config(self):
466  """ returns the configuration """
467  return self._config
468 
469  def prettyPrint(self):
470  if self._config:
471  print(json.dumps(self._config, indent = 4, separators=(',', ': ')))
472 
473  def name(self):
474  return self["name"]
475 
476  def filetype(self):
477  return self["filetype"]
478 
479  def printSummary(self):
480  """ print summary info, should be overwritten by derived classes """
481  log.info("Configuration name: {0}".format(self.name()))
482  log.info("Configuration size: {0}".format(len(self)))
483 
484  def writeFile(self, filename = None):
485  if filename is None:
486  filename: str = self.loader.getWriteFilename()
487  with open(filename, 'w') as fh:
488  json.dump(self.config(), fh, indent = 4, separators=(',', ': '))
489  log.info("Wrote file %s", filename)
python.TriggerConfigAccessBase.ConfigFileLoader
Definition: TriggerConfigAccessBase.py:58
python.TriggerConfigAccessBase.ConfigDBLoader
Definition: TriggerConfigAccessBase.py:89
python.TriggerConfigAccessBase.ConfigCrestLoader.setQuery
def setQuery(self, query)
Definition: TriggerConfigAccessBase.py:350
python.TriggerConfigAccessBase.getFileType
def getFileType(filename)
Definition: TriggerConfigAccessBase.py:15
python.TriggerConfigAccessBase.ConfigCrestLoader
Definition: TriggerConfigAccessBase.py:342
python.TriggerConfigAccessBase.ConfigDBLoader.readSchemaVersion
def readSchemaVersion(qdict, session)
Definition: TriggerConfigAccessBase.py:182
data
char data[hepevt_bytes_allocation_ATLAS]
Definition: HepEvt.cxx:11
python.TriggerConfigAccessBase.TriggerConfigAccess._mainkey
_mainkey
Definition: TriggerConfigAccessBase.py:433
python.TriggerConfigAccessBase.ConfigCrestLoader.__init__
def __init__(self, *configType, dbalias, dbkey, crestServer)
Definition: TriggerConfigAccessBase.py:343
python.TriggerConfigAccessBase.TriggerConfigAccess.__str__
def __str__(self)
Definition: TriggerConfigAccessBase.py:453
python.TriggerConfigAccessBase.TriggerConfigAccess.__init__
def __init__(self, configType, mainkey, filename=None, jsonString=None, dbalias=None, dbkey=None, useCrest=False, crestServer="")
Definition: TriggerConfigAccessBase.py:430
vtune_athena.format
format
Definition: vtune_athena.py:14
python.TriggerConfigAccessBase.TriggerConfigAccess.__iter__
def __iter__(self)
Definition: TriggerConfigAccessBase.py:456
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
python.TriggerConfigAccessBase.TriggerConfigAccess.prettyPrint
def prettyPrint(self)
Definition: TriggerConfigAccessBase.py:469
python.TriggerConfigAccessBase.ConfigCrestLoader._get_payload
dict _get_payload(self, str hash)
Definition: TriggerConfigAccessBase.py:356
python.TriggerConfigAccessBase.ConfigDBLoader.getCoralQuery
def getCoralQuery(session, queryStr, qdict=None)
Definition: TriggerConfigAccessBase.py:208
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
python.TriggerConfigAccessBase.TriggerConfigAccess.name
def name(self)
Definition: TriggerConfigAccessBase.py:473
mergePhysValFiles.start
start
Definition: DataQuality/DataQualityUtils/scripts/mergePhysValFiles.py:14
python.TriggerConfigAccessBase.TriggerConfigAccess.printSummary
def printSummary(self)
Definition: TriggerConfigAccessBase.py:479
python.TriggerConfigAccessBase.ConfigCrestLoader.dbalias
dbalias
Definition: TriggerConfigAccessBase.py:346
python.TriggerConfigAccessBase.ConfigDBLoader.load
def load(self)
Definition: TriggerConfigAccessBase.py:259
python.TriggerConfigAccessBase.ConfigFileLoader.filename
filename
Definition: TriggerConfigAccessBase.py:61
python.TriggerConfigAccessBase.TriggerConfigAccess.__len__
def __len__(self)
Definition: TriggerConfigAccessBase.py:462
python.TriggerConfigAccessBase.ConfigType.basename
basename
Definition: TriggerConfigAccessBase.py:33
python.TriggerConfigAccessBase.ConfigDBLoader.dbalias
dbalias
Definition: TriggerConfigAccessBase.py:92
python.TriggerConfigAccessBase.ConfigCrestLoader.load
dict load(self)
Definition: TriggerConfigAccessBase.py:407
python.TriggerConfigAccessBase.ConfigDBLoader.getQueryDefinition
def getQueryDefinition(self, schemaVersion)
Definition: TriggerConfigAccessBase.py:247
python.TriggerConfigAccessBase.ConfigLoader.__init__
def __init__(self, configType)
Definition: TriggerConfigAccessBase.py:49
python.TriggerConfigAccessBase.ConfigLoader
Definition: TriggerConfigAccessBase.py:44
python.TriggerConfigAccessBase.ConfigDBLoader.getConnectionParameters
def getConnectionParameters(dbalias)
Definition: TriggerConfigAccessBase.py:117
python.TriggerConfigAccessBase.ConfigDBLoader.dbkey
dbkey
Definition: TriggerConfigAccessBase.py:93
covarianceTool.filter
filter
Definition: covarianceTool.py:514
python.TriggerConfigAccessBase.ConfigDirectLoader.getWriteFilename
def getWriteFilename(self)
Definition: TriggerConfigAccessBase.py:86
python.TriggerConfigAccessBase.TriggerConfigAccess.load
def load(self)
Definition: TriggerConfigAccessBase.py:450
python.TriggerConfigAccessBase.ConfigType.crestkey
crestkey
Definition: TriggerConfigAccessBase.py:35
python.TriggerConfigAccessBase.ConfigDBLoader.getResolvedFileName
def getResolvedFileName(filename, pathenv="")
Definition: TriggerConfigAccessBase.py:105
python.TriggerConfigAccessBase.ConfigDBLoader.getWriteFilename
def getWriteFilename(self)
Definition: TriggerConfigAccessBase.py:339
python.TriggerConfigAccessBase.TriggerConfigAccess.writeFile
def writeFile(self, filename=None)
Definition: TriggerConfigAccessBase.py:484
python.TriggerConfigAccessBase.ConfigFileLoader.getWriteFilename
def getWriteFilename(self)
Definition: TriggerConfigAccessBase.py:69
python.TriggerConfigAccessBase.TriggerConfigAccess
Definition: TriggerConfigAccessBase.py:425
python.TriggerConfigAccessBase.ConfigDBLoader.setQuery
def setQuery(self, query)
Definition: TriggerConfigAccessBase.py:97
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
python.TriggerConfigAccessBase.ConfigCrestLoader.schema
schema
Definition: TriggerConfigAccessBase.py:348
python.TriggerConfigAccessBase.ConfigDBLoader.schema
schema
Definition: TriggerConfigAccessBase.py:95
python.TriggerConfigAccessBase.ConfigDirectLoader.__init__
def __init__(self, configType, jsonString)
Definition: TriggerConfigAccessBase.py:77
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
python.TriggerConfigAccessBase.ConfigCrestLoader.dbkey
dbkey
Definition: TriggerConfigAccessBase.py:347
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.TriggerConfigAccessBase.ConfigDBLoader.query
query
Definition: TriggerConfigAccessBase.py:94
python.TriggerConfigAccessBase.ConfigDirectLoader.setQuery
def setQuery(self, query)
Definition: TriggerConfigAccessBase.py:84
python.TriggerConfigAccessBase.ConfigLoader.confirmConfigType
def confirmConfigType(self, config)
Definition: TriggerConfigAccessBase.py:51
python.TriggerConfigAccessBase.TriggerConfigAccess._config
_config
Definition: TriggerConfigAccessBase.py:434
python.TriggerConfigAccessBase.ConfigLoader.configType
configType
Definition: TriggerConfigAccessBase.py:50
python.TriggerConfigAccessBase.ConfigType.__ne__
def __ne__(self, other)
Definition: TriggerConfigAccessBase.py:41
python.TriggerConfigAccessBase.ConfigFileLoader.__init__
def __init__(self, configType, filename)
Definition: TriggerConfigAccessBase.py:59
python.TriggerConfigAccessBase.ConfigCrestLoader.crestServer
crestServer
Definition: TriggerConfigAccessBase.py:345
Trk::open
@ open
Definition: BinningType.h:40
python.TriggerConfigAccessBase.ConfigFileLoader.load
def load(self)
Definition: TriggerConfigAccessBase.py:62
python.TriggerConfigAccessBase.TriggerConfigAccess.loader
loader
Definition: TriggerConfigAccessBase.py:438
python.TriggerConfigAccessBase.ConfigCrestLoader._getDBSchemaName
str _getDBSchemaName(dbalias)
Definition: TriggerConfigAccessBase.py:392
python.TriggerConfigAccessBase.ConfigType.__init__
def __init__(self, basename, filetype, crestkey)
Definition: TriggerConfigAccessBase.py:32
python.TriggerConfigAccessBase.ConfigDBLoader.__init__
def __init__(self, configType, dbalias, dbkey)
Definition: TriggerConfigAccessBase.py:90
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
python.TriggerConfigAccessBase.ConfigType
Definition: TriggerConfigAccessBase.py:23
python.TriggerConfigAccessBase.ConfigDirectLoader.jsonString
jsonString
Definition: TriggerConfigAccessBase.py:79
python.TriggerConfigAccessBase.ConfigType.filetype
filetype
Definition: TriggerConfigAccessBase.py:34
python.TriggerConfigAccessBase.ConfigFileLoader.setQuery
def setQuery(self, query)
Definition: TriggerConfigAccessBase.py:67
str
Definition: BTagTrackIpAccessor.cxx:11
python.TriggerConfigAccessBase.ConfigDirectLoader
Definition: TriggerConfigAccessBase.py:75
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
calibdata.commit
bool commit
Definition: calibdata.py:832
python.TriggerConfigAccessBase.TriggerConfigAccess.config
def config(self)
Definition: TriggerConfigAccessBase.py:465
python.TriggerConfigAccessBase.TriggerConfigAccess.filetype
def filetype(self)
Definition: TriggerConfigAccessBase.py:476
python.TriggerConfigAccessBase.ConfigDirectLoader.load
def load(self)
Definition: TriggerConfigAccessBase.py:80
python.TriggerConfigAccessBase.ConfigType.__eq__
def __eq__(self, other)
Definition: TriggerConfigAccessBase.py:36
python.TriggerConfigAccessBase.ConfigCrestLoader.getWriteFilename
def getWriteFilename(self)
Definition: TriggerConfigAccessBase.py:422
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
python.TriggerConfigAccessBase.TriggerConfigAccess._getLoader
def _getLoader(self, *configType, filename=None, jsonString=None, dbalias=None, dbkey=None, bool useCrest=False, str crestServer="")
Definition: TriggerConfigAccessBase.py:436
python.TriggerConfigAccessBase.TriggerConfigAccess.__getitem__
def __getitem__(self, item)
Definition: TriggerConfigAccessBase.py:459
python.TriggerConfigAccessBase.ConfigDBLoader.getSchema
def getSchema(connStr)
Definition: TriggerConfigAccessBase.py:163