4 from __future__
import print_function
8 from CoolRunQuery.utils.AtlRunQueryIOV
import IOVRange
9 from CoolRunQuery.utils.AtlRunQueryTimer
import timer
10 from CoolRunQuery.utils.AtlRunQueryUtils
import coolDbConn, GetRanges
12 from .AtlRunQuerySelectorBase
import RunLBBasedCondition
17 super(EventSelector,self).
__init__(name=name,
18 dbfolderkey=
'oracle::SFO-based',
19 channelKeys = [(0,
'#Events',
'EFEvents')])
27 return "SELOUT Checking if number of events matches %s" % self.
events
29 return "Retrieving event numbers"
39 connection = coolDbConn.GetSFODBConnection()
40 cursor = connection.cursor()
41 cursor.arraysize = 1000
43 runnrlist = [r.runNr
for r
in runlist]
45 from CoolRunQuery.AtlRunQuerySFO
import GetSFO_NphysicseventsAll
46 with timer(
"GetSFO_NphysicseventsAll", disabled=
True):
51 iov = IOVRange(runStart=run.runNr, lbStart=1, runEnd=run.runNr+1, lbEnd=0)
54 if run.runNr
not in events:
57 run.addResult(k,
"n.a.", iov, reject=
False)
58 run.showDataIncomplete=
True
61 nev = events[run.runNr]
64 run.addResult(k, self.
prettyValue(nev,k), iov, reject=
True)
72 newrunlist += [run.runNr]
74 runlist = [r
for r
in runlist
if r.runNr
in newrunlist]
76 duration = time() - start
78 print (
" ==> %i runs found (%.2f sec)" % (len(runlist),duration))
80 print (
" ==> Done (%g sec)" % duration)
90 if val>=cr[0]
and val<=cr[1]:
99 super(AllEventsSelector,self).
__init__(name=name,
100 dbfolderkey=
'COOLONL_TDAQ::/TDAQ/RunCtrl/EventCounters',
101 channelKeys = [(0,
'#Events (incl. calib.)',
'EFEvents'),
102 (0,
'#Events (streamed)',
'RecordedEvents'),
103 (0,
'#L2A',
'L2Events')])
109 return "SELOUT Checking if number of events matches %s" % self.
events
111 return "Retrieving event numbers"
120 if val>=cr[0]
and val<=cr[1]:
128 super(L1EventsSelector,self).
__init__(name=name,
129 dbfolderkey=
'COOLONL_TRIGGER::/TRIGGER/LVL1/CTPCORELBDATA',
130 channelKeys = [(0,
'#L1A',
'GlobalL1AcceptCounter')])
137 return "SELOUT Checking if number of L1A events matches %s" % self.
events
139 return "Retrieving L1A numbers"