|
def | __init__ (self, dbconn, iovstart, iovend) |
|
def | getRLB (self, timestamp, StartType=True) |
|
Definition at line 453 of file AtlCoolLib.py.
◆ __init__()
def python.AtlCoolLib.TimeStampToRLB.__init__ |
( |
|
self, |
|
|
|
dbconn, |
|
|
|
iovstart, |
|
|
|
iovend |
|
) |
| |
Definition at line 456 of file AtlCoolLib.py.
456 def __init__(self,dbconn,iovstart,iovend):
457 "Initialise and cache using the given DB connection, for RLB start/end"
468 lblbname=
'/TRIGGER/LUMI/LBLB'
470 readfolder=self.readdb.getFolder(lblbname)
471 except Exception
as e:
473 print (
"Could not access folder %s " % lblbname)
474 raise RuntimeError (
"TimeStampToRLB initialisation error")
478 readobjs=readfolder.browseObjects(self.since,self.until,cool.ChannelSelection.all())
479 while readobjs.goToNext():
480 readobj=readobjs.currentRef()
481 payload=readobj.payload()
482 if (isFirst
is True):
484 self.StartTime=payload[
'StartTime']
486 self.EndTime = payload[
'EndTime']
487 except Exception
as e:
489 print (
"Problem reading data from folder %s" % lblbname)
490 raise RuntimeError (
"TimeStampToRLB: initialisation error")
491 if (self.StartTime==-1):
492 raise RuntimeError (
"TimeStampToRLB: no data for given runs")
495 lbtimename=
'/TRIGGER/LUMI/LBTIME'
497 readfolder=self.readdb.getFolder(lbtimename)
498 except Exception
as e:
500 print (
"Problem accessing folder %s" % lbtimename)
501 raise RuntimeError (
"TimeStampToRLB: Initialisation error")
503 readobjs=readfolder.browseObjects(self.StartTime, self.EndTime, cool.ChannelSelection.all())
504 while readobjs.goToNext():
505 readobj=readobjs.currentRef()
506 payload=readobj.payload()
507 TimeStampStart = readobj.since()
508 TimeStampEnd = readobj.until()
509 iov=(payload[
'Run'] << 32)+payload[
'LumiBlock']
510 self.TSBeginMap+=[TimeStampStart]
511 self.TSEndMap+=[TimeStampEnd]
513 except Exception
as e:
515 print (
"Problem reading from folder %s" % lbtimename)
516 raise RuntimeError (
"TimeStampToRLB: Time data access error")
517 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 519 of file AtlCoolLib.py.
519 def getRLB(self,timestamp,StartType=True):
520 """Lookup a timestamp value. If it is outside a run, round up to next
521 run (StartType=True) or down to previous (StartType=False)"""
525 for TSbegin, RL
in zip(self.TSBeginMap, self.RLMap):
526 if (timestamp <= TSbegin):
532 for TSend, RL
in reversed(zip(self.TSEndMap, self.RLMap)):
533 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: