ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
python.CaloCondTools.CaloBlobReader Class Reference
Inheritance diagram for python.CaloCondTools.CaloBlobReader:
Collaboration diagram for python.CaloCondTools.CaloBlobReader:

Public Member Functions

def __init__ (self, db, folder, tag="")
 
def getCells (self, systemId, pointInTime)
 
def folderIsMultiVersion (self)
 

Private Attributes

 __db
 
 __folder
 
 __folderType
 
 __tag
 
 __objDict
 

Detailed Description

CaloBlobReader is a helper class, managing the details of COOL interactions

Definition at line 271 of file CaloCondTools.py.

Constructor & Destructor Documentation

◆ __init__()

def python.CaloCondTools.CaloBlobReader.__init__ (   self,
  db,
  folder,
  tag = "" 
)
Input:
- db    : db should be an open database connection 
- folder: full folder path
- tag   : The folder tag, e.g. \"000-00\"

Definition at line 277 of file CaloCondTools.py.

277  def __init__(self, db, folder, tag=""):
278  """
279  Input:
280  - db : db should be an open database connection
281  - folder: full folder path
282  - tag : The folder tag, e.g. \"000-00\"
283  """
284  #=== initialize base class
285  CaloCondLogger.__init__(self,"CaloBlobReader")
286 
287  #=== try to open db
288  try:
289  self.__db = db
290  self.__folder = self.__db.getFolder(folder)
291  except Exception as e:
292  self.log().critical( e )
293  raise
294 
295  #=== determine if "run-lumi" or "time" folder
296  validFolderTypes = ("run-lumi","time")
297  folderDescr = self.__folder.description()
298  self.__folderType = getAthenaFolderType(folderDescr)
299  if self.__folderType not in validFolderTypes:
300  raise Exception("Invalid folder type found: \'%s\'" % self.__folderType)
301 
302  #=== use camelized full folder path only if tag is given
303  self.__tag = tag
304 
305  #=== initialize dictionary to keep reference to DB object
306  #=== and timestamp, so they do not go out of scope
307  self.__objDict = {}
308 

Member Function Documentation

◆ folderIsMultiVersion()

def python.CaloCondTools.CaloBlobReader.folderIsMultiVersion (   self)
Returns true if MultiVersion folder is connected

Definition at line 343 of file CaloCondTools.py.

343  def folderIsMultiVersion(self):
344  """
345  Returns true if MultiVersion folder is connected
346  """
347  if self.__folder.versioningMode()==cool.FolderVersioning.MULTI_VERSION:
348  return True
349  else:
350  return False
351 
352 
353 #======================================================================
354 #===
355 #=== CaloBlobWriter
356 #===
357 #======================================================================
358 
359 #
360 #______________________________________________________________________

◆ getCells()

def python.CaloCondTools.CaloBlobReader.getCells (   self,
  systemId,
  pointInTime 
)
Returns a CaloCondBlob object for the given system.

Definition at line 310 of file CaloCondTools.py.

310  def getCells(self, systemId, pointInTime):
311  """
312  Returns a CaloCondBlob object for the given system.
313  """
314 
315  validityKey = getCoolValidityKey(pointInTime)
316  self.log().debug("Validity key is %s", validityKey)
317  try:
318  #=== Have we retrieved data previously?
319  key = (systemId,validityKey)
320  obj = self.__objDict.get(key)
321  #=== ... if not, get it from DB
322  if not obj:
323  channelId = cool.ChannelId(systemId)
324  obj = self.__folder.findObject(validityKey, channelId, self.__tag)
325  self.log().debug("Fetching from DB: %s", obj)
326  blob = obj.payload()[0]
327  self.log().debug("blob size: %d", blob.size())
328  #=== store object in dictionary
329  self.__objDict[key] = obj
330  #=== get blob
331  blob = obj.payload()[0]
332  self.log().debug("blob size: %d", blob.size())
333 
334  #=== create CaloCondBlob object
335  flt = g.CaloCondBlobFlt.getInstance(blob)
336  return flt
337  except Exception as e:
338  self.log().error("Fetching of systemId=%i failed with exception %s",systemId,e)
339  return None
340 
341 

Member Data Documentation

◆ __db

python.CaloCondTools.CaloBlobReader.__db
private

Definition at line 289 of file CaloCondTools.py.

◆ __folder

python.CaloCondTools.CaloBlobReader.__folder
private

Definition at line 290 of file CaloCondTools.py.

◆ __folderType

python.CaloCondTools.CaloBlobReader.__folderType
private

Definition at line 298 of file CaloCondTools.py.

◆ __objDict

python.CaloCondTools.CaloBlobReader.__objDict
private

Definition at line 307 of file CaloCondTools.py.

◆ __tag

python.CaloCondTools.CaloBlobReader.__tag
private

Definition at line 303 of file CaloCondTools.py.


The documentation for this class was generated from the following file:
python.CaloCondTools.getAthenaFolderType
def getAthenaFolderType(folderDescr)
Definition: CaloCondTools.py:52
python.CaloCondTools.getCoolValidityKey
def getCoolValidityKey(pointInTime, isSince=True)
Definition: CaloCondTools.py:195
debug
const bool debug
Definition: MakeUncertaintyPlots.cxx:53
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
get
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition: hcg.cxx:127
error
Definition: IImpactPoint3dEstimator.h:70
description
std::string description
glabal timer - how long have I taken so far?
Definition: hcg.cxx:88