281 def __init__(self,name,geometryMapper):
288 self.cut_gain_low = 0.
289 self.cut_gain_high = 3
290 self.cut_offset_low = -100.
291 self.cut_offset_high = 100.
293 self.geometry_convertor = geometryMapper
298 self.measured_gains={}
299 self.measured_chi2={}
300 self.measured_offset={}
301 self.measured_error_code={}
303 self.UNIX2COOL = 1000000000
306 dbSvc = cool.DatabaseSvcFactory.databaseService()
308 dbString=
'sqlite://;schema='+name+
';dbname=L1CALO'
310 db = dbSvc.openDatabase(dbString,
False)
311 except Exception
as e:
312 print (
'Error: Problem opening database', e)
315 folder_name =
'/TRIGGER/L1Calo/V1/Results/EnergyScanResults'
316 folder=db.getFolder(folder_name)
318 startUtime =
int(time.time())
319 endUtime =
int(time.time())
320 startValKey = startUtime * self.UNIX2COOL
321 endValKey = endUtime * self.UNIX2COOL
322 chsel = cool.ChannelSelection(0,sys.maxsize)
325 itr=folder.browseObjects(startValKey, endValKey, chsel)
326 except Exception
as e:
331 CoolId = hex(
int(row.channelId()))
332 payload = row.payload()
333 self.measured_gains[CoolId] = payload[
'Slope']
334 self.measured_chi2[CoolId] = payload[
'Chi2']
335 self.measured_offset[CoolId] = payload[
'Offset']
336 self.measured_error_code[CoolId] = payload[
'ErrorCode']
340 folder_gen_name =
'/TRIGGER/L1Calo/V1/Results/EnergyScanRunInfo'
341 folder_gen=db.getFolder(folder_gen_name)
344 itr=folder_gen.browseObjects(startValKey, endValKey, chsel)
345 except Exception
as e:
350 payload = row.payload()
351 self.run_nr = payload[
'RunNumber']
352 self.strategy = payload[
'GainStrategy']