ATLAS Offline Software
Public Member Functions | Public Attributes | List of all members
LArHVGainsPredictor.OracleGainReader Class Reference
Collaboration diagram for LArHVGainsPredictor.OracleGainReader:

Public Member Functions

def __init__ (self)
 
def getGain (self, ReceiverId)
 

Public Attributes

 reference_gains
 
 UNIX2COOL
 

Detailed Description

Definition at line 25 of file LArHVGainsPredictor.py.

Constructor & Destructor Documentation

◆ __init__()

def LArHVGainsPredictor.OracleGainReader.__init__ (   self)

Definition at line 27 of file LArHVGainsPredictor.py.

27  def __init__(self):
28 
29  self.reference_gains={}
30  self.UNIX2COOL = 1000000000
31 
32  # get database service and open database
33  dbSvc = cool.DatabaseSvcFactory.databaseService()
34 
35  dbString = 'oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=CONDBR2'
36  try:
37  db = dbSvc.openDatabase(dbString, False)
38  except Exception as e:
39  print ('Error: Problem opening database', e)
40  sys.exit(1)
41 
42  folder_name = "/TRIGGER/Receivers/Factors/CalibGains"
43  folder=db.getFolder(folder_name)
44 
45  startUtime = int(time.time())
46  endUtime = int(time.time())
47  startValKey = startUtime * self.UNIX2COOL
48  endValKey = endUtime * self.UNIX2COOL
49  chsel = cool.ChannelSelection(0,sys.maxint)
50 
51  try:
52  itr=folder.browseObjects(startValKey, endValKey, chsel)
53  except Exception as e:
54  print (e)
55  sys.exit(1)
56 
57  for row in itr:
58  ReceiverId = hex(int(row.channelId()))
59  payload = row.payload()
60  gain = payload['factor']
61  self.reference_gains[ReceiverId]=gain
62 
63  # close database
64  db.closeDatabase()
65 
66 

Member Function Documentation

◆ getGain()

def LArHVGainsPredictor.OracleGainReader.getGain (   self,
  ReceiverId 
)

Definition at line 67 of file LArHVGainsPredictor.py.

67  def getGain(self,ReceiverId):
68 
69  if (ReceiverId in self.reference_gains):
70  return float(self.reference_gains[ReceiverId])
71  else:
72  return ''
73 
74 

Member Data Documentation

◆ reference_gains

LArHVGainsPredictor.OracleGainReader.reference_gains

Definition at line 29 of file LArHVGainsPredictor.py.

◆ UNIX2COOL

LArHVGainsPredictor.OracleGainReader.UNIX2COOL

Definition at line 30 of file LArHVGainsPredictor.py.


The documentation for this class was generated from the following file:
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
readCCLHist.float
float
Definition: readCCLHist.py:83