|
def | GetConnection (dbconn, verbosity=0) |
|
def | getHLTConfigKeys (db, runlist) |
|
def | getHLTPrescaleKeys (db, runlist) |
|
def | getL1ConfigKeys (db, runlist) |
|
def | getBunchGroupKey (db, runlist) |
|
def | getRunStartTime (db, runlist, runs) |
|
def | printL1Menu (db, run, verbosity) |
|
def | printHLTMenu (db, run, verbosity, printL2=True, printEF=True) |
|
def | printStreams (db, run, verbosity) |
|
|
def | _getKeys (db, runlist, folder, in_name, out_name) |
|
Definition at line 32 of file TriggerCoolUtil.py.
◆ _getKeys()
def python.TriggerCoolUtil.TriggerCoolUtil._getKeys |
( |
|
db, |
|
|
|
runlist, |
|
|
|
folder, |
|
|
|
in_name, |
|
|
|
out_name |
|
) |
| |
|
staticprivate |
Helper to retrieve run/LB-index configuration keys
Definition at line 85 of file TriggerCoolUtil.py.
85 def _getKeys(db, runlist, folder, in_name, out_name):
86 """Helper to retrieve run/LB-index configuration keys"""
89 f = db.getFolder( folder )
91 objs = f.browseObjects( limmin, limmax, cool.ChannelSelection(0))
92 while objs.goToNext():
94 runNr = obj.since()>>32
95 if runNr>1e9:
continue
96 payload = obj.payload()
97 key = payload[in_name]
98 firstLB = obj.since() & lbmask
99 until = (obj.until() & lbmask)
100 lastLB = until-1
if until>0
else lbmask
101 configKeys.setdefault(runNr,{}).setdefault( out_name, [] ).
append((key,firstLB,lastLB))
◆ getBunchGroupKey()
def python.TriggerCoolUtil.TriggerCoolUtil.getBunchGroupKey |
( |
|
db, |
|
|
|
runlist |
|
) |
| |
|
static |
Definition at line 116 of file TriggerCoolUtil.py.
116 def getBunchGroupKey(db,runlist):
117 return TriggerCoolUtil._getKeys(db, runlist,
"/TRIGGER/LVL1/BunchGroupKey",
118 "Lvl1BunchGroupConfigurationKey",
"BGKey")
◆ GetConnection()
def python.TriggerCoolUtil.TriggerCoolUtil.GetConnection |
( |
|
dbconn, |
|
|
|
verbosity = 0 |
|
) |
| |
|
static |
Definition at line 35 of file TriggerCoolUtil.py.
35 def GetConnection(dbconn,verbosity=0):
37 m =
match(
r".*?([^/.]+)\.db",dbconn)
38 if dbconn
in [
"CONDBR2",
"COMP200",
"OFLP200"]:
39 connection = f
'COOLONL_TRIGGER/{dbconn}'
41 dbname=m.group(1).
upper()
42 connection =
"sqlite://;schema=%s;dbname=%s;" % (dbconn,dbname)
44 raise RuntimeError (
"Can't connect to COOL db %s" % dbconn)
46 openConn =
indirectOpen(connection,readOnly=
True,debug=(verbosity>0))
◆ getHLTConfigKeys()
def python.TriggerCoolUtil.TriggerCoolUtil.getHLTConfigKeys |
( |
|
db, |
|
|
|
runlist |
|
) |
| |
|
static |
Definition at line 54 of file TriggerCoolUtil.py.
56 f = db.getFolder(
"/TRIGGER/HLT/HltConfigKeys" )
58 objs = f.browseObjects( limmin, limmax, cool.ChannelSelection(0))
59 while objs.goToNext():
61 runNr = obj.since()>>32
62 if runNr>1e9:
continue
64 smk = payload[
'MasterConfigurationKey']
65 hltpsk = payload[
'HltPrescaleConfigurationKey']
71 confsrc = payload[
'ConfigSource'].
split(
';')
72 if len(confsrc)>2: release = confsrc[2].
split()[0]
74 confsrc = payload[
'ConfigSource'].
split(
',', maxsplit=1)
75 if len(confsrc)>1: release = confsrc[1]
78 configKeys[runNr] = {
"REL" : release,
◆ getHLTPrescaleKeys()
def python.TriggerCoolUtil.TriggerCoolUtil.getHLTPrescaleKeys |
( |
|
db, |
|
|
|
runlist |
|
) |
| |
|
static |
Definition at line 106 of file TriggerCoolUtil.py.
106 def getHLTPrescaleKeys(db,runlist):
107 return TriggerCoolUtil._getKeys(db, runlist,
"/TRIGGER/HLT/PrescaleKey",
108 "HltPrescaleKey",
"HLTPSK2")
◆ getL1ConfigKeys()
def python.TriggerCoolUtil.TriggerCoolUtil.getL1ConfigKeys |
( |
|
db, |
|
|
|
runlist |
|
) |
| |
|
static |
Definition at line 111 of file TriggerCoolUtil.py.
111 def getL1ConfigKeys(db,runlist):
112 return TriggerCoolUtil._getKeys(db, runlist,
"/TRIGGER/LVL1/Lvl1ConfigKey",
113 "Lvl1PrescaleConfigurationKey",
"LVL1PSK")
◆ getRunStartTime()
def python.TriggerCoolUtil.TriggerCoolUtil.getRunStartTime |
( |
|
db, |
|
|
|
runlist, |
|
|
|
runs |
|
) |
| |
|
static |
Definition at line 121 of file TriggerCoolUtil.py.
121 def getRunStartTime(db,runlist, runs):
124 f = db.getFolder(
"/TRIGGER/LUMI/LBLB" )
126 limmin=(rr[0] << 32)+0
127 limmax=((rr[1]+1) << 32)+0
128 objs = f.browseObjects( limmin, limmax, cool.ChannelSelection(0) )
129 while objs.goToNext():
130 obj=objs.currentRef()
131 runNr = obj.since()>>32
132 if runNr==latestRunNr:
continue
134 if runNr
not in runs:
continue
135 payload=obj.payload()
136 starttime = payload[
'StartTime']
137 startTime[runNr] = {
"STARTTIME" : ctime(starttime/1E9).
replace(
' ',
'_') }
◆ printHLTMenu()
def python.TriggerCoolUtil.TriggerCoolUtil.printHLTMenu |
( |
|
db, |
|
|
|
run, |
|
|
|
verbosity, |
|
|
|
printL2 = True , |
|
|
|
printEF = True |
|
) |
| |
|
static |
Definition at line 185 of file TriggerCoolUtil.py.
185 def printHLTMenu(db, run, verbosity, printL2=True, printEF=True):
187 limmax=((run+1)<<32)-1
189 f = db.getFolder(
"/TRIGGER/HLT/Menu" )
190 chansel=cool.ChannelSelection.all()
191 objs = f.browseObjects( limmin,limmax,chansel)
199 while objs.goToNext():
200 obj=objs.currentRef()
201 payload=obj.payload()
202 level = payload[
'TriggerLevel']
203 if level==
'L2' and not printL2:
continue
204 if level==
'EF' and not printEF:
continue
205 name = payload[
'ChainName']
206 sizeName=
max(sizeName,len(name))
207 counter = payload[
'ChainCounter']
208 chainNames[(level,counter)] = name
210 version = payload[
'ChainVersion']
211 prescale = payload[
'Prescale']
212 passthr = payload[
'PassThrough']
213 stream = payload[
'StreamInfo']
214 lower = payload[
'LowerChainName']
215 sizePS=
max(sizePS,prescale)
216 sizePT=
max(sizePT,passthr)
217 sizeStr=
max(sizeStr,len(stream))
218 sizeLow=
max(sizeLow,len(lower))
219 chainExtraInfo[(name,level)] = (version, prescale, passthr, stream, lower)
220 sizePS = len(
"%i"%sizePS)
221 sizePT = len(
"%i"%sizePT)
222 counters = chainNames.keys()
226 print (
"%s %4i: %-*s" % (c[0], c[1], sizeName, name),)
228 (version, prescale, passthr, stream, lower) = chainExtraInfo[(name,c[0])]
229 print (
"[V %1s, PS %*i, PT %*i, by %-*s , => %-*s ]" %
230 (version, sizePS, prescale, sizePT, passthr, sizeLow, lower, sizeStr, stream), end=
'')
◆ printL1Menu()
def python.TriggerCoolUtil.TriggerCoolUtil.printL1Menu |
( |
|
db, |
|
|
|
run, |
|
|
|
verbosity |
|
) |
| |
|
static |
Definition at line 142 of file TriggerCoolUtil.py.
142 def printL1Menu(db, run, verbosity):
146 printPrescales = verbosity>0
147 printDisabled = verbosity>1
149 f = db.getFolder(
"/TRIGGER/LVL1/Menu" )
150 chansel=cool.ChannelSelection.all()
151 objs = f.browseObjects( limmin,limmax,chansel)
152 fps = db.getFolder(
"/TRIGGER/LVL1/Prescales" )
153 objsps = fps.browseObjects( limmin,limmax,chansel)
157 while objs.goToNext():
158 obj=objs.currentRef()
159 channel = obj.channelId()
160 payload=obj.payload()
161 itemname = payload[
'ItemName']
162 itemName[channel] = itemname
163 longestName=
max(longestName,len(itemname))
164 while objsps.goToNext():
165 objps=objsps.currentRef()
166 channel = objps.channelId()
167 payloadps=objps.payload()
168 ps = payloadps[
'Lvl1Prescale']
169 if channel
in itemPrescale:
170 itemPrescale[channel] += [ ps ]
172 itemPrescale[channel] = [ ps ]
173 for channel
in itemName:
175 for x
in itemPrescale[channel]:
176 if x>0
or printDisabled: doPrint =
True
177 if not doPrint:
continue
179 print (
"%4i: %-*s PS " % (channel, longestName, itemName[channel]), itemPrescale[channel])
181 print (
"%4i: %s" % (channel, itemName[channel]))
◆ printStreams()
def python.TriggerCoolUtil.TriggerCoolUtil.printStreams |
( |
|
db, |
|
|
|
run, |
|
|
|
verbosity |
|
) |
| |
|
static |
Definition at line 234 of file TriggerCoolUtil.py.
234 def printStreams(db, run, verbosity):
236 limmax=((run+1)<<32)-1
237 print (
"Used Streams:")
238 f = db.getFolder(
"/TRIGGER/HLT/Menu" )
239 chansel=cool.ChannelSelection.all()
240 objs = f.browseObjects( limmin,limmax,chansel)
242 while objs.goToNext():
243 obj=objs.currentRef()
244 payload=obj.payload()
245 streamsOfChain = payload[
'StreamInfo']
246 for streamprescale
in streamsOfChain.split(
';'):
247 streamname = streamprescale.split(
',')[0]
248 streams.add(streamname)
The documentation for this class was generated from the following file:
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.