|
def | __init__ (self) |
|
def | openDB (self) |
|
def | closeDB (self) |
|
def | loadRunData (self, run) |
|
def | loadBunchgroups (self, run) |
|
def | getTrainPosition (self, run, lb, bcid) |
|
def | getNeighbourBcids (self, run, lb, bcid) |
|
def | getNeighbourPattern (self, run, lb, bcid) |
|
◆ __init__()
def StandaloneBunchgroupHandler.BunchgroupHandler.__init__ |
( |
|
self | ) |
|
Definition at line 73 of file StandaloneBunchgroupHandler.py.
76 self.trigProdDbName =
'COOLONL_TRIGGER/COMP200'
77 self.bunchGroupContentFolder =
'/TRIGGER/LVL1/BunchGroupContent'
78 self.bunchGroupDescFolder =
'/TRIGGER/LVL1/BunchGroupDescription'
81 self.trigProdDb =
None
87 self.physicsBunchgroupBit = 1
90 self.runObjects = dict()
95 self.runsToArchive = 20
◆ closeDB()
def StandaloneBunchgroupHandler.BunchgroupHandler.closeDB |
( |
|
self | ) |
|
◆ getNeighbourBcids()
def StandaloneBunchgroupHandler.BunchgroupHandler.getNeighbourBcids |
( |
|
self, |
|
|
|
run, |
|
|
|
lb, |
|
|
|
bcid |
|
) |
| |
Definition at line 155 of file StandaloneBunchgroupHandler.py.
155 def getNeighbourBcids(self,run,lb,bcid):
158 print(
'getNeighbourBcids called')
160 before, after = self.getNeighbourPattern(run,lb,bcid)
163 for bcidOffset
in range(len(before)):
164 checkBcid = bcid - (bcidOffset+1)
165 if checkBcid < 0: checkBcid += 3564
166 if before[bcidOffset]:
168 print(
"BCID",checkBcid,
"is filled")
171 for bcidOffset
in range(len(after)):
172 checkBcid = bcid + (bcidOffset+1)
173 if checkBcid > 3563: checkBcid -= 3564
174 if after[bcidOffset]:
176 print(
"BCID",checkBcid,
"is filled")
◆ getNeighbourPattern()
def StandaloneBunchgroupHandler.BunchgroupHandler.getNeighbourPattern |
( |
|
self, |
|
|
|
run, |
|
|
|
lb, |
|
|
|
bcid |
|
) |
| |
Definition at line 181 of file StandaloneBunchgroupHandler.py.
181 def getNeighbourPattern(self,run,lb,bcid):
184 print(
'getNeighbourPattern called')
188 lbList =
list(self.runObjects[run].physicsBunchgroupBcids.keys())
190 self.loadRunData(run)
191 lbList =
list(self.runObjects[run].physicsBunchgroupBcids.keys())
195 latestLb = self.runObjects[run].lbLookup[lb]
197 for testLb
in sorted(lbList):
198 if latestLb < 0: latestLb = testLb
199 if lb > testLb: latestLb = testLb
201 print(
"LB",lb,
"latest LB",latestLb)
202 self.runObjects[run].lbLookup[lb] = latestLb
204 return (self.runObjects[run].bcidLookupBefore[latestLb][bcid], self.runObjects[run].bcidLookupAfter[latestLb][bcid])
◆ getTrainPosition()
def StandaloneBunchgroupHandler.BunchgroupHandler.getTrainPosition |
( |
|
self, |
|
|
|
run, |
|
|
|
lb, |
|
|
|
bcid |
|
) |
| |
Definition at line 148 of file StandaloneBunchgroupHandler.py.
148 def getTrainPosition(self,run,lb,bcid):
151 print(
'getTrainPosition called')
152 before, after = self.getNeighbourBcids(run,lb,bcid)
153 return (len(before)+1)
◆ loadBunchgroups()
def StandaloneBunchgroupHandler.BunchgroupHandler.loadBunchgroups |
( |
|
self, |
|
|
|
run |
|
) |
| |
Definition at line 126 of file StandaloneBunchgroupHandler.py.
126 def loadBunchgroups(self, run):
128 self.runObjects[run] = BunchgroupRunData(run)
129 self.runArchive.
append(run)
130 self.runObjects[run].verbose = self.verbose
133 print(
'loadBounchgroups called, run',run)
135 bgFolder = self.trigProdDb.getFolder(self.bunchGroupContentFolder)
136 itr = bgFolder.browseObjects(run << 32,(run+1) << 32,cool.ChannelSelection.all())
137 while itr.goToNext() :
139 lb=(obj.since() & 0xffff)
140 self.runObjects[run].physicsBunchgroupBcids[lb] = []
141 bgcont = obj.payload()[
'BunchCode']
142 for bcid
in range(3564):
143 if(bgcont[bcid]>>self.physicsBunchgroupBit & 1): self.runObjects[run].physicsBunchgroupBcids[lb].
append(bcid)
144 self.runObjects[run].createLookup(lb,self.bcidRange)
146 print(
"LB",lb,
"BCIDs",self.runObjects[run].physicsBunchgroupBcids[lb])
◆ loadRunData()
def StandaloneBunchgroupHandler.BunchgroupHandler.loadRunData |
( |
|
self, |
|
|
|
run |
|
) |
| |
Definition at line 116 of file StandaloneBunchgroupHandler.py.
116 def loadRunData(self, run):
118 self.loadBunchgroups(run)
120 if len(self.runArchive) > self.runsToArchive:
122 print(
"Remove run",self.runArchive[0],
"from memory")
123 del self.runObjects[self.runArchive[0]]
124 self.runArchive.pop(0)
◆ openDB()
def StandaloneBunchgroupHandler.BunchgroupHandler.openDB |
( |
|
self | ) |
|
◆ bcidRange
StandaloneBunchgroupHandler.BunchgroupHandler.bcidRange |
◆ bunchGroupContentFolder
StandaloneBunchgroupHandler.BunchgroupHandler.bunchGroupContentFolder |
◆ bunchGroupDescFolder
StandaloneBunchgroupHandler.BunchgroupHandler.bunchGroupDescFolder |
◆ physicsBunchgroupBit
StandaloneBunchgroupHandler.BunchgroupHandler.physicsBunchgroupBit |
◆ runArchive
StandaloneBunchgroupHandler.BunchgroupHandler.runArchive |
◆ runObjects
StandaloneBunchgroupHandler.BunchgroupHandler.runObjects |
◆ runsToArchive
StandaloneBunchgroupHandler.BunchgroupHandler.runsToArchive |
◆ trigProdDb
StandaloneBunchgroupHandler.BunchgroupHandler.trigProdDb |
◆ trigProdDbName
StandaloneBunchgroupHandler.BunchgroupHandler.trigProdDbName |
◆ verbose
StandaloneBunchgroupHandler.BunchgroupHandler.verbose |
The documentation for this class was generated from the following file: