ATLAS Offline Software
Loading...
Searching...
No Matches
doL1CaloHVCorrections.HVCorrectionCOOLReader Class Reference
Collaboration diagram for doL1CaloHVCorrections.HVCorrectionCOOLReader:

Public Member Functions

 __init__ (self)
 getCorrection (self, receiver)

Public Attributes

dict correctionsFromCOOL = {}
int UNIX2COOL = 1000000000

Detailed Description

Definition at line 23 of file doL1CaloHVCorrections.py.

Constructor & Destructor Documentation

◆ __init__()

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()

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

dict doL1CaloHVCorrections.HVCorrectionCOOLReader.correctionsFromCOOL = {}

Definition at line 27 of file doL1CaloHVCorrections.py.

◆ UNIX2COOL

int doL1CaloHVCorrections.HVCorrectionCOOLReader.UNIX2COOL = 1000000000

Definition at line 28 of file doL1CaloHVCorrections.py.


The documentation for this class was generated from the following file: