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

Public Member Functions

def __init__ (self)
 
def getCorrection (self, receiver)
 

Public Attributes

 correctionsFromCOOL
 
 UNIX2COOL
 

Detailed Description

Definition at line 23 of file doL1CaloHVCorrections.py.

Constructor & Destructor Documentation

◆ __init__()

def doL1CaloHVCorrections.HVCorrectionCOOLReader.__init__ (   self)

Definition at line 25 of file doL1CaloHVCorrections.py.

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

Member Function Documentation

◆ getCorrection()

def doL1CaloHVCorrections.HVCorrectionCOOLReader.getCorrection (   self,
  receiver 
)

Definition at line 65 of file doL1CaloHVCorrections.py.

65  def getCorrection(self, receiver):
66 
67  return self.correctionsFromCOOL[receiver]
68 

Member Data Documentation

◆ correctionsFromCOOL

doL1CaloHVCorrections.HVCorrectionCOOLReader.correctionsFromCOOL

Definition at line 27 of file doL1CaloHVCorrections.py.

◆ UNIX2COOL

doL1CaloHVCorrections.HVCorrectionCOOLReader.UNIX2COOL

Definition at line 28 of file doL1CaloHVCorrections.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