|
def | __init__ (self, dbconn, iovstart, iovend) |
|
def | getRLB (self, timestamp, StartType=True) |
|
Definition at line 454 of file AtlCoolLib.py.
◆ __init__()
def python.AtlCoolLib.TimeStampToRLB.__init__ |
( |
|
self, |
|
|
|
dbconn, |
|
|
|
iovstart, |
|
|
|
iovend |
|
) |
| |
Definition at line 457 of file AtlCoolLib.py.
457 def __init__(self,dbconn,iovstart,iovend):
458 "Initialise and cache using the given DB connection, for RLB start/end"
469 lblbname=
'/TRIGGER/LUMI/LBLB'
471 readfolder=self.readdb.getFolder(lblbname)
472 except Exception
as e:
474 print (
"Could not access folder %s " % lblbname)
475 raise RuntimeError (
"TimeStampToRLB initialisation error")
479 readobjs=readfolder.browseObjects(self.since,self.until,cool.ChannelSelection.all())
480 while readobjs.goToNext():
481 readobj=readobjs.currentRef()
482 payload=readobj.payload()
483 if (isFirst
is True):
485 self.StartTime=payload[
'StartTime']
487 self.EndTime = payload[
'EndTime']
488 except Exception
as e:
490 print (
"Problem reading data from folder %s" % lblbname)
491 raise RuntimeError (
"TimeStampToRLB: initialisation error")
492 if (self.StartTime==-1):
493 raise RuntimeError (
"TimeStampToRLB: no data for given runs")
496 lbtimename=
'/TRIGGER/LUMI/LBTIME'
498 readfolder=self.readdb.getFolder(lbtimename)
499 except Exception
as e:
501 print (
"Problem accessing folder %s" % lbtimename)
502 raise RuntimeError (
"TimeStampToRLB: Initialisation error")
504 readobjs=readfolder.browseObjects(self.StartTime, self.EndTime, cool.ChannelSelection.all())
505 while readobjs.goToNext():
506 readobj=readobjs.currentRef()
507 payload=readobj.payload()
508 TimeStampStart = readobj.since()
509 TimeStampEnd = readobj.until()
510 iov=(payload[
'Run'] << 32)+payload[
'LumiBlock']
511 self.TSBeginMap+=[TimeStampStart]
512 self.TSEndMap+=[TimeStampEnd]
514 except Exception
as e:
516 print (
"Problem reading from folder %s" % lbtimename)
517 raise RuntimeError (
"TimeStampToRLB: Time data access error")
518 print (
"TimeStampToRLB initialised with %i entries in map" % len(self.RLMap))
◆ getRLB()
def python.AtlCoolLib.TimeStampToRLB.getRLB |
( |
|
self, |
|
|
|
timestamp, |
|
|
|
StartType = True |
|
) |
| |
Lookup a timestamp value. If it is outside a run, round up to next
run (StartType=True) or down to previous (StartType=False)
Definition at line 520 of file AtlCoolLib.py.
520 def getRLB(self,timestamp,StartType=True):
521 """Lookup a timestamp value. If it is outside a run, round up to next
522 run (StartType=True) or down to previous (StartType=False)"""
526 for TSbegin, RL
in zip(self.TSBeginMap, self.RLMap):
527 if (timestamp <= TSbegin):
533 for TSend, RL
in reversed(zip(self.TSEndMap, self.RLMap)):
534 if (timestamp >= TSend):
◆ EndTime
python.AtlCoolLib.TimeStampToRLB.EndTime |
◆ readdb
python.AtlCoolLib.TimeStampToRLB.readdb |
◆ RLMap
python.AtlCoolLib.TimeStampToRLB.RLMap |
◆ since
python.AtlCoolLib.TimeStampToRLB.since |
◆ StartTime
python.AtlCoolLib.TimeStampToRLB.StartTime |
◆ TSBeginMap
python.AtlCoolLib.TimeStampToRLB.TSBeginMap |
◆ TSEndMap
python.AtlCoolLib.TimeStampToRLB.TSEndMap |
◆ until
python.AtlCoolLib.TimeStampToRLB.until |
The documentation for this class was generated from the following file: