|
def | __init__ (self) |
|
def | LoadGainsXml (self, name) |
|
def | LoadReferenceXml (self, name) |
|
def | LoadGainsSqlite (self, name) |
|
def | LoadReferenceSqlite (self, name) |
|
def | LoadReferenceOracle (self, mapping_tool) |
|
def | getGain (self, coolId) |
|
def | getChi2 (self, coolId) |
|
def | getOffset (self, coolId) |
|
def | getReferenceGain (self, coolId) |
|
def | passesSelection (self, coolId) |
|
Definition at line 287 of file PlotCalibrationGains.py.
◆ __init__()
def PlotCalibrationGains.GainReader.__init__ |
( |
|
self | ) |
|
Definition at line 289 of file PlotCalibrationGains.py.
291 self.measured_gains={}
292 self.reference_gains={}
293 self.measured_chi2={}
294 self.measured_offset={}
295 self.UNIX2COOL = 1000000000
◆ getChi2()
def PlotCalibrationGains.GainReader.getChi2 |
( |
|
self, |
|
|
|
coolId |
|
) |
| |
◆ getGain()
def PlotCalibrationGains.GainReader.getGain |
( |
|
self, |
|
|
|
coolId |
|
) |
| |
Definition at line 480 of file PlotCalibrationGains.py.
480 def getGain(self,coolId):
481 if (coolId
in self.measured_gains):
482 return float(self.measured_gains[coolId])
◆ getOffset()
def PlotCalibrationGains.GainReader.getOffset |
( |
|
self, |
|
|
|
coolId |
|
) |
| |
◆ getReferenceGain()
def PlotCalibrationGains.GainReader.getReferenceGain |
( |
|
self, |
|
|
|
coolId |
|
) |
| |
Definition at line 499 of file PlotCalibrationGains.py.
499 def getReferenceGain(self,coolId):
500 if (coolId
in self.reference_gains):
501 return float(self.reference_gains[coolId])
◆ LoadGainsSqlite()
def PlotCalibrationGains.GainReader.LoadGainsSqlite |
( |
|
self, |
|
|
|
name |
|
) |
| |
Definition at line 340 of file PlotCalibrationGains.py.
340 def LoadGainsSqlite(self,name):
343 dbSvc = cool.DatabaseSvcFactory.databaseService()
345 dbString=
'sqlite://;schema='+name+
';dbname=L1CALO'
347 db = dbSvc.openDatabase(dbString,
False)
348 except Exception
as e:
349 print (
'Error: Problem opening database', e)
352 folder_name =
'/TRIGGER/L1Calo/V1/Results/EnergyScanResults'
353 folder=db.getFolder(folder_name)
355 startUtime =
int(time.time())
356 endUtime =
int(time.time())
357 startValKey = startUtime * self.UNIX2COOL
358 endValKey = endUtime * self.UNIX2COOL
359 chsel = cool.ChannelSelection(0,sys.maxsize)
362 itr=folder.browseObjects(startValKey, endValKey, chsel)
363 except Exception
as e:
368 CoolId = hex(
int(row.channelId()))
369 payload = row.payload()
370 self.measured_gains[CoolId] = payload[
'Slope']
371 self.measured_chi2[CoolId] = payload[
'Chi2']
372 self.measured_offset[CoolId] = payload[
'Offset']
376 folder_gen_name =
'/TRIGGER/L1Calo/V1/Results/EnergyScanRunInfo'
377 folder_gen=db.getFolder(folder_gen_name)
380 itr=folder_gen.browseObjects(startValKey, endValKey, chsel)
382 payload = row.payload()
383 self.run_nr = payload[
'RunNumber']
384 self.strategy = payload[
'GainStrategy']
385 print (
"Run nr. = ", self.run_nr ,
" Strategy = ", self.strategy)
388 print (
"Warning, in LoadGainsSqlite can't get runtype info! Hope this is not serious!")
◆ LoadGainsXml()
def PlotCalibrationGains.GainReader.LoadGainsXml |
( |
|
self, |
|
|
|
name |
|
) |
| |
Definition at line 300 of file PlotCalibrationGains.py.
300 def LoadGainsXml(self,name):
302 input_file =
open(name)
304 for line
in input_file.readlines():
305 parts = line.split(
' ')
306 if parts[0] ==
'<Channel':
307 list_cool=parts[1].
split(
'\'')
310 list_gain=parts[2].
split(
'\'')
312 self.measured_gains[cool_id]=gain
314 list_offset=parts[3].
split(
'\'')
315 offset=list_offset[1]
316 self.measured_offset[cool_id]=offset
318 list_chi2=parts[4].
split(
'\'')
320 self.measured_chi2[cool_id]=chi2
◆ LoadReferenceOracle()
def PlotCalibrationGains.GainReader.LoadReferenceOracle |
( |
|
self, |
|
|
|
mapping_tool |
|
) |
| |
Definition at line 431 of file PlotCalibrationGains.py.
431 def LoadReferenceOracle(self,mapping_tool):
434 dbSvc = cool.DatabaseSvcFactory.databaseService()
436 dbString =
'oracle://ATLAS_COOLPROD;schema=ATLAS_COOLONL_TRIGGER;dbname=CONDBR2'
438 db = dbSvc.openDatabase(dbString,
False)
439 except Exception
as e:
440 print (
'Error: Problem opening database', e)
443 folder_name =
"/TRIGGER/Receivers/Factors/CalibGains"
444 folder=db.getFolder(folder_name)
446 startUtime =
int(time.time())
447 endUtime =
int(time.time())
448 startValKey = startUtime * self.UNIX2COOL
449 endValKey = endUtime * self.UNIX2COOL
450 chsel = cool.ChannelSelection(0,sys.maxsize)
453 itr=folder.browseObjects(startValKey, endValKey, chsel)
454 except Exception
as e:
459 ReceiverId = hex(
int(row.channelId()))
460 PPMId = mapping_tool.getPPMfromReceiver(ReceiverId)
461 payload = row.payload()
462 gain = payload[
'factor']
464 if PPMId
is not None:
465 if self.strategy
is None:
466 self.reference_gains[PPMId]=gain
468 if mapping_tool.getReceiverfromPPM(PPMId,self.strategy) == ReceiverId:
470 self.reference_gains[PPMId]=gain
◆ LoadReferenceSqlite()
def PlotCalibrationGains.GainReader.LoadReferenceSqlite |
( |
|
self, |
|
|
|
name |
|
) |
| |
Definition at line 394 of file PlotCalibrationGains.py.
394 def LoadReferenceSqlite(self,name):
397 dbSvc = cool.DatabaseSvcFactory.databaseService()
399 dbString=
'sqlite://;schema='+name+
';dbname=L1CALO'
401 db = dbSvc.openDatabase(dbString,
False)
402 except Exception
as e:
403 print (
'Error: Problem opening database', e)
406 folder_name =
'/TRIGGER/L1Calo/V1/Results/EnergyScanResults'
407 folder=db.getFolder(folder_name)
409 startUtime =
int(time.time())
410 endUtime =
int(time.time())
411 startValKey = startUtime * self.UNIX2COOL
412 endValKey = endUtime * self.UNIX2COOL
413 chsel = cool.ChannelSelection(0,sys.maxsize)
416 itr=folder.browseObjects(startValKey, endValKey, chsel)
417 except Exception
as e:
422 CoolId = hex(
int(row.channelId()))
423 payload = row.payload()
424 self.reference_gains[CoolId]=payload[
'Slope']
◆ LoadReferenceXml()
def PlotCalibrationGains.GainReader.LoadReferenceXml |
( |
|
self, |
|
|
|
name |
|
) |
| |
Definition at line 325 of file PlotCalibrationGains.py.
325 def LoadReferenceXml(self,name):
327 input_gains_reference =
open(name)
329 for line
in input_gains_reference.readlines():
330 parts = line.split(
' ')
331 if parts[0] ==
'<Channel':
332 list_cool=parts[1].
split(
'\'')
335 list_gain=parts[2].
split(
'\'')
337 self.reference_gains[cool_id]=gain
◆ passesSelection()
def PlotCalibrationGains.GainReader.passesSelection |
( |
|
self, |
|
|
|
coolId |
|
) |
| |
Definition at line 505 of file PlotCalibrationGains.py.
506 if ((coolId
in self.measured_gains)
and
507 (self.getGain(coolId) > 0.5
and self.getGain(coolId)<1.6)
and
510 (self.getOffset(coolId) > -10
and self.getOffset(coolId) < 10)):
◆ measured_chi2
PlotCalibrationGains.GainReader.measured_chi2 |
◆ measured_gains
PlotCalibrationGains.GainReader.measured_gains |
◆ measured_offset
PlotCalibrationGains.GainReader.measured_offset |
◆ reference_gains
PlotCalibrationGains.GainReader.reference_gains |
◆ run_nr
PlotCalibrationGains.GainReader.run_nr |
◆ strategy
PlotCalibrationGains.GainReader.strategy |
◆ UNIX2COOL
PlotCalibrationGains.GainReader.UNIX2COOL |
The documentation for this class was generated from the following file:
double getChi2(int &ndof, double ipt, double eta1, double seta1, double phi1, double sphi1, double ipt1, double sipt1, double eta2, double seta2, double phi2, double sphi2, double ipt2, double sipt2, bool useAbsPt)
Get OLD style (i.e. muFast time) Chi2.