ATLAS Offline Software
Loading...
Searching...
No Matches
PlotCalibrationHV.L1CaloHVReader Class Reference
Collaboration diagram for PlotCalibrationHV.L1CaloHVReader:

Public Member Functions

 __init__ (self, file_name)
 read_corrections (self, file_name)
 read_geometry (self, file_name)
 GetMeanCorections (self)
 GetCorLayer1 (self)
 GetCorLayer2 (self)
 GetCorLayer3 (self)
 GetCorLayer4 (self)
 GetAffectedCells1 (self)
 GetAffectedCells2 (self)
 GetAffectedCells3 (self)
 GetAffectedCells4 (self)
 GetNCells1 (self)
 GetNCells2 (self)
 GetNCells3 (self)
 GetNCells4 (self)
 GetNLayers (self)
 GetName1 (self)
 GetName2 (self)
 GetName3 (self)
 GetName4 (self)

Public Attributes

dict NLayers = {}
dict MeanCorr = {}
dict CorrLayer1 = {}
dict CorrLayer2 = {}
dict CorrLayer3 = {}
dict CorrLayer4 = {}
dict AffectedCells1 = {}
dict AffectedCells2 = {}
dict AffectedCells3 = {}
dict AffectedCells4 = {}
dict NCells1 = {}
dict NCells2 = {}
dict NCells3 = {}
dict NCells4 = {}
dict Name1 = {}
dict Name2 = {}
dict Name3 = {}
dict Name4 = {}
int UNIX2COOL = 1000000000

Detailed Description

Definition at line 120 of file PlotCalibrationHV.py.

Constructor & Destructor Documentation

◆ __init__()

PlotCalibrationHV.L1CaloHVReader.__init__ ( self,
file_name )

Definition at line 122 of file PlotCalibrationHV.py.

122 def __init__(self,file_name):
123
124 self.NLayers = {}
125 self.MeanCorr = {}
126
127 self.CorrLayer1 = {}
128 self.CorrLayer2 = {}
129 self.CorrLayer3 = {}
130 self.CorrLayer4 = {}
131
132 self.AffectedCells1 = {}
133 self.AffectedCells2 = {}
134 self.AffectedCells3 = {}
135 self.AffectedCells4 = {}
136
137 self.NCells1 = {}
138 self.NCells2 = {}
139 self.NCells3 = {}
140 self.NCells4 = {}
141
142 self.Name1 = {}
143 self.Name2 = {}
144 self.Name3 = {}
145 self.Name4 = {}
146
147 self.NLayers = {}
148
149 self.UNIX2COOL = 1000000000
150
151 self.read_corrections(file_name)
152 self.read_geometry(file_name)
153

Member Function Documentation

◆ GetAffectedCells1()

PlotCalibrationHV.L1CaloHVReader.GetAffectedCells1 ( self)

Definition at line 267 of file PlotCalibrationHV.py.

267 def GetAffectedCells1(self):
268 return self.AffectedCells1
269

◆ GetAffectedCells2()

PlotCalibrationHV.L1CaloHVReader.GetAffectedCells2 ( self)

Definition at line 270 of file PlotCalibrationHV.py.

270 def GetAffectedCells2(self):
271 return self.AffectedCells2
272

◆ GetAffectedCells3()

PlotCalibrationHV.L1CaloHVReader.GetAffectedCells3 ( self)

Definition at line 273 of file PlotCalibrationHV.py.

273 def GetAffectedCells3(self):
274 return self.AffectedCells3
275

◆ GetAffectedCells4()

PlotCalibrationHV.L1CaloHVReader.GetAffectedCells4 ( self)

Definition at line 276 of file PlotCalibrationHV.py.

276 def GetAffectedCells4(self):
277 return self.AffectedCells4
278

◆ GetCorLayer1()

PlotCalibrationHV.L1CaloHVReader.GetCorLayer1 ( self)

Definition at line 255 of file PlotCalibrationHV.py.

255 def GetCorLayer1(self):
256 return self.CorrLayer1
257

◆ GetCorLayer2()

PlotCalibrationHV.L1CaloHVReader.GetCorLayer2 ( self)

Definition at line 258 of file PlotCalibrationHV.py.

258 def GetCorLayer2(self):
259 return self.CorrLayer2
260

◆ GetCorLayer3()

PlotCalibrationHV.L1CaloHVReader.GetCorLayer3 ( self)

Definition at line 261 of file PlotCalibrationHV.py.

261 def GetCorLayer3(self):
262 return self.CorrLayer3
263

◆ GetCorLayer4()

PlotCalibrationHV.L1CaloHVReader.GetCorLayer4 ( self)

Definition at line 264 of file PlotCalibrationHV.py.

264 def GetCorLayer4(self):
265 return self.CorrLayer4
266

◆ GetMeanCorections()

PlotCalibrationHV.L1CaloHVReader.GetMeanCorections ( self)

Definition at line 252 of file PlotCalibrationHV.py.

252 def GetMeanCorections(self):
253 return self.MeanCorr
254

◆ GetName1()

PlotCalibrationHV.L1CaloHVReader.GetName1 ( self)

Definition at line 294 of file PlotCalibrationHV.py.

294 def GetName1(self):
295 return self.Name1
296

◆ GetName2()

PlotCalibrationHV.L1CaloHVReader.GetName2 ( self)

Definition at line 297 of file PlotCalibrationHV.py.

297 def GetName2(self):
298 return self.Name2
299

◆ GetName3()

PlotCalibrationHV.L1CaloHVReader.GetName3 ( self)

Definition at line 300 of file PlotCalibrationHV.py.

300 def GetName3(self):
301 return self.Name3
302

◆ GetName4()

PlotCalibrationHV.L1CaloHVReader.GetName4 ( self)

Definition at line 303 of file PlotCalibrationHV.py.

303 def GetName4(self):
304 return self.Name4
305
306

◆ GetNCells1()

PlotCalibrationHV.L1CaloHVReader.GetNCells1 ( self)

Definition at line 279 of file PlotCalibrationHV.py.

279 def GetNCells1(self):
280 return self.NCells1
281

◆ GetNCells2()

PlotCalibrationHV.L1CaloHVReader.GetNCells2 ( self)

Definition at line 282 of file PlotCalibrationHV.py.

282 def GetNCells2(self):
283 return self.NCells2
284

◆ GetNCells3()

PlotCalibrationHV.L1CaloHVReader.GetNCells3 ( self)

Definition at line 285 of file PlotCalibrationHV.py.

285 def GetNCells3(self):
286 return self.NCells3
287

◆ GetNCells4()

PlotCalibrationHV.L1CaloHVReader.GetNCells4 ( self)

Definition at line 288 of file PlotCalibrationHV.py.

288 def GetNCells4(self):
289 return self.NCells4
290

◆ GetNLayers()

PlotCalibrationHV.L1CaloHVReader.GetNLayers ( self)

Definition at line 291 of file PlotCalibrationHV.py.

291 def GetNLayers(self):
292 return self.NLayers
293

◆ read_corrections()

PlotCalibrationHV.L1CaloHVReader.read_corrections ( self,
file_name )

Definition at line 154 of file PlotCalibrationHV.py.

154 def read_corrections(self,file_name):
155
156 # get database service and open database
157 dbSvc = cool.DatabaseSvcFactory.databaseService()
158
159 dbString='sqlite://;schema='+file_name+';dbname=L1CALO'
160 try:
161 db = dbSvc.openDatabase(dbString, False)
162 except Exception as e:
163 print(('Error: Problem opening database', e))
164 sys.exit(1)
165
166 folder_name = '/TRIGGER/L1Calo/V1/Results/HVCorrections'
167 folder=db.getFolder(folder_name)
168
169 startUtime = int(time.time())
170 endUtime = int(time.time())
171 startValKey = startUtime * self.UNIX2COOL
172 endValKey = endUtime * self.UNIX2COOL
173 chsel = cool.ChannelSelection(0,sys.maxsize)
174
175 try:
176 itr=folder.browseObjects(startValKey, endValKey, chsel)
177 except Exception as e:
178 print (e)
179 sys.exit(1)
180
181 for row in itr:
182 CoolId = hex(int(row.channelId()))
183 payload = row.payload()
184
185 self.MeanCorr[CoolId] = payload['RxMean']
186
187 self.CorrLayer1[CoolId] = payload['LayerMean1']
188 self.CorrLayer2[CoolId] = payload['LayerMean2']
189 self.CorrLayer3[CoolId] = payload['LayerMean3']
190 self.CorrLayer4[CoolId] = payload['LayerMean4']
191
192 self.AffectedCells1[CoolId] = struct.unpack('B'.encode('utf-8'),payload['AffectedCells1'].encode('utf-8'))[0]
193 self.AffectedCells2[CoolId] = struct.unpack('B'.encode('utf-8'),payload['AffectedCells2'].encode('utf-8'))[0]
194 self.AffectedCells3[CoolId] = struct.unpack('B'.encode('utf-8'),payload['AffectedCells3'].encode('utf-8'))[0]
195 self.AffectedCells4[CoolId] = struct.unpack('B'.encode('utf-8'),payload['AffectedCells4'].encode('utf-8'))[0]
196
197# print ( " CoolId", CoolId ,"AffectedCells", struct.unpack('B',self.AffectedCells1[CoolId])[0])
198
199
200 # close database
201 db.closeDatabase()
202
void print(char *figname, TCanvas *c1)

◆ read_geometry()

PlotCalibrationHV.L1CaloHVReader.read_geometry ( self,
file_name )

Definition at line 203 of file PlotCalibrationHV.py.

203 def read_geometry(self,file_name):
204
205 # get database service and open database
206 dbSvc = cool.DatabaseSvcFactory.databaseService()
207
208 dbString='sqlite://;schema='+file_name+';dbname=L1CALO'
209 try:
210 db = dbSvc.openDatabase(dbString, False)
211 except Exception as e:
212 print(('Error: Problem opening database', e))
213 sys.exit(1)
214
215 folder_name = '/TRIGGER/L1Calo/V1/Results/RxLayers'
216 folder=db.getFolder(folder_name)
217
218 startUtime = int(time.time())
219 endUtime = int(time.time())
220 startValKey = startUtime * self.UNIX2COOL
221 endValKey = endUtime * self.UNIX2COOL
222 chsel = cool.ChannelSelection(0,sys.maxsize)
223
224 try:
225 itr=folder.browseObjects(startValKey, endValKey, chsel)
226 except Exception as e:
227 print (e)
228 sys.exit(1)
229
230 for row in itr:
231 CoolId = hex(int(row.channelId()))
232 payload = row.payload()
233
234 self.NCells1[CoolId] = struct.unpack('B'.encode('utf-8'),payload['NCells1'].encode('utf-8'))[0]
235 self.NCells2[CoolId] = struct.unpack('B'.encode('utf-8'),payload['NCells2'].encode('utf-8'))[0]
236 self.NCells3[CoolId] = struct.unpack('B'.encode('utf-8'),payload['NCells3'].encode('utf-8'))[0]
237 self.NCells4[CoolId] = struct.unpack('B'.encode('utf-8'),payload['NCells4'].encode('utf-8'))[0]
238
239 self.NLayers[CoolId] = struct.unpack('B'.encode('utf-8'),payload['NLayers'].encode('utf-8'))[0]
240
241 self.Name1[CoolId] = struct.unpack('B'.encode('utf-8'),payload['Name1'].encode('utf-8'))[0]
242 self.Name2[CoolId] = struct.unpack('B'.encode('utf-8'),payload['Name2'].encode('utf-8'))[0]
243 self.Name3[CoolId] = struct.unpack('B'.encode('utf-8'),payload['Name3'].encode('utf-8'))[0]
244 self.Name4[CoolId] = struct.unpack('B'.encode('utf-8'),payload['Name4'].encode('utf-8'))[0]
245
246
247
248 # close database
249 db.closeDatabase()
250
251

Member Data Documentation

◆ AffectedCells1

dict PlotCalibrationHV.L1CaloHVReader.AffectedCells1 = {}

Definition at line 132 of file PlotCalibrationHV.py.

◆ AffectedCells2

dict PlotCalibrationHV.L1CaloHVReader.AffectedCells2 = {}

Definition at line 133 of file PlotCalibrationHV.py.

◆ AffectedCells3

dict PlotCalibrationHV.L1CaloHVReader.AffectedCells3 = {}

Definition at line 134 of file PlotCalibrationHV.py.

◆ AffectedCells4

dict PlotCalibrationHV.L1CaloHVReader.AffectedCells4 = {}

Definition at line 135 of file PlotCalibrationHV.py.

◆ CorrLayer1

dict PlotCalibrationHV.L1CaloHVReader.CorrLayer1 = {}

Definition at line 127 of file PlotCalibrationHV.py.

◆ CorrLayer2

dict PlotCalibrationHV.L1CaloHVReader.CorrLayer2 = {}

Definition at line 128 of file PlotCalibrationHV.py.

◆ CorrLayer3

dict PlotCalibrationHV.L1CaloHVReader.CorrLayer3 = {}

Definition at line 129 of file PlotCalibrationHV.py.

◆ CorrLayer4

dict PlotCalibrationHV.L1CaloHVReader.CorrLayer4 = {}

Definition at line 130 of file PlotCalibrationHV.py.

◆ MeanCorr

dict PlotCalibrationHV.L1CaloHVReader.MeanCorr = {}

Definition at line 125 of file PlotCalibrationHV.py.

◆ Name1

dict PlotCalibrationHV.L1CaloHVReader.Name1 = {}

Definition at line 142 of file PlotCalibrationHV.py.

◆ Name2

dict PlotCalibrationHV.L1CaloHVReader.Name2 = {}

Definition at line 143 of file PlotCalibrationHV.py.

◆ Name3

dict PlotCalibrationHV.L1CaloHVReader.Name3 = {}

Definition at line 144 of file PlotCalibrationHV.py.

◆ Name4

dict PlotCalibrationHV.L1CaloHVReader.Name4 = {}

Definition at line 145 of file PlotCalibrationHV.py.

◆ NCells1

dict PlotCalibrationHV.L1CaloHVReader.NCells1 = {}

Definition at line 137 of file PlotCalibrationHV.py.

◆ NCells2

dict PlotCalibrationHV.L1CaloHVReader.NCells2 = {}

Definition at line 138 of file PlotCalibrationHV.py.

◆ NCells3

dict PlotCalibrationHV.L1CaloHVReader.NCells3 = {}

Definition at line 139 of file PlotCalibrationHV.py.

◆ NCells4

dict PlotCalibrationHV.L1CaloHVReader.NCells4 = {}

Definition at line 140 of file PlotCalibrationHV.py.

◆ NLayers

dict PlotCalibrationHV.L1CaloHVReader.NLayers = {}

Definition at line 124 of file PlotCalibrationHV.py.

◆ UNIX2COOL

int PlotCalibrationHV.L1CaloHVReader.UNIX2COOL = 1000000000

Definition at line 149 of file PlotCalibrationHV.py.


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