ATLAS Offline Software
AtlRunQuerySelectorLhcOlc.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2 
3 import sys
4 from CoolRunQuery.utils.AtlRunQueryTimer import timer
5 from CoolRunQuery.utils.AtlRunQueryUtils import GetRanges
6 
7 from CoolRunQuery.selector.AtlRunQuerySelectorBase import Selector, RunLBBasedCondition, TimeBasedCondition
8 
9 class LHCSelector(Selector):
10  def __init__(self, name, lhc=[], addArg=''):
11  super(LHCSelector,self).__init__(name)
12  self.condition = LHCCondition( 'lhc', lhc, addArg = addArg )
13  self.showarg=addArg
14  if not lhc:
15  self.condition.applySelection = False
16 
17  def __str__(self):
18  return str(self.condition)
19 
20  def addShowSelector(self, addArg=''):
21  self.showarg=addArg
22 
23  def setShowOutput(self):
25 
26  def select(self, runlist):
27  print (self, end='')
28  sys.stdout.flush()
29  runlist = self.condition.select(runlist)
30  return runlist
31 
32 class LHCCondition(TimeBasedCondition):
33  def __init__(self, name, condition=[], channel=0, addArg=''):
34  ck = [(1,'lhc:fillnumber', 'FillNumber'),
35  (1,'lhc:stablebeams', 'StableBeams'),
36  (1,'lhc:beamenergy', 'BeamEnergyGeV')]
37  if addArg == 'all':
38  ck += [(1,'lhc:beammode', 'BeamMode')]
39  elif addArg == 'min':
40  ck = [(1,'lhc:stablebeams', 'StableBeams')]
41  super(LHCCondition,self).__init__(name=name,
42  dbfolderkey='COOLOFL_DCS::/LHC/DCS/FILLSTATE',
43  channelKeys = ck)
44 
45  # define arguments (after initialising base class!)
46  self.lhc = {}
47  for c in condition:
48  # format: 'fillnumber 891' or 'stablebeams 1', etc
49  lhcargs = c.split()
50  if len(lhcargs) == 2:
51  key = 'lhc:' + lhcargs[0].strip().lower()
52  # does it exist?
53  if key not in self.ResultKey():
54  print ('ERROR: unknown LHC variable "%s"' % key)
55  sys.exit(1)
56 
57  cond = lhcargs[1].strip()
58  if cond:
59  try:
60  float(cond[0])
61  self.lhc[key] = GetRanges( cond )
62  except ValueError:
63  self.lhc[key] = [[cond]]
64  pass
65  else:
66  print ('ERROR: unknown condition format for LHC: "%s" -> need two arguments separated by blank' % lhcargs)
67  sys.exit(1)
68 
69  def setShowOutput(self, addArg ):
70  ck = ['lhc:fillnumber', 'lhc:stablebeams', 'lhc:beamenergy']
71  if addArg == 'all':
72  ck += ['lhc:beammode']
73  elif addArg == 'min':
74  ck = ['lhc:stablebeams']
75  super(LHCCondition,self).setShowOutput()
76 
77  def __str__(self):
78  if self.applySelection:
79  return "SELOUT Checking if LHC fill state information %s" % self.lhc
80  else:
81  return "Retrieving LHC fill state information"
82 
83  def passes(self, value, k):
84  if k not in self.lhc:
85  return True
86  if 'n.a.' in value:
87  return True
88  try:
89  v = float(value)
90  # special treatment for E-beam = 7864 --> value for ASYNC
91  if v >= 7864:
92  return False
93 
94  # iterate over conditions
95  for cr in self.lhc[k]:
96  if v >= cr[0] and v <= cr[1]:
97  return True
98  except ValueError:
99  # value is a string
100  # note that it still can happen that the reference of the string is a number. For example, the
101  # beam energy can be returned as "ASYNC", when the two beams were in asynchronous mode. Need
102  # to cover such a case.
103  try:
104  float(self.lhc[k][0][0])
105  return False # comparing number to string -> don't pass
106  except ValueError:
107  if value == self.lhc[k][0][0]:
108  return True
109  return False
110 
111 class OLCFillParamsCondition(TimeBasedCondition):
112  def __init__(self, name, condition=[], channel=0):
113  super(OLCFillParamsCondition,self).__init__(name=name,
114  dbfolderkey='COOLONL_TDAQ::/TDAQ/OLC/LHC/FILLPARAMS',
115  channelKeys = [(0,'olc:beam1bunches', 'Beam1Bunches'),
116  (0,'olc:beam2bunches', 'Beam2Bunches'),
117  (0,'olc:collbunches', 'LuminousBunches'),
118  (0,'olc:bcidmask', 'BCIDmasks')])
119  self.onl = {}
120 
121  def __str__(self):
122  if self.applySelection:
123  return "SELOUT Checking if online lumi is %s" % self.olc
124  else:
125  return "Retrieving online lumi information /TDAQ/OLC/LHC/FILLPARAMS"
126 
127  def passes(self,values,k):
128  if k not in self.onl:
129  return True
130  if 'n.a.' in values:
131  return True
132  if values == self.onl[k]:
133  return True
134  return False
135 
136  def runAfterQuery(self,runlist):
137 
138  for k in self.ResultKey():
139  with timer("olc afterquery blocks prepare for: %s" % k):
140  for run in runlist:
141  run.stats[k] = {}
142  if k not in run.data:
143  continue
144  blocks = []
145  for entry in run.data[k]:
146  v = entry.value
147  if k!='olc:bcidmask':
148  v = int(v)
149  if len(blocks) > 0 and blocks[-1][0]==v and blocks[-1][2]==entry.startlb:
150  blocks[-1][2] = entry.endlb
151  else:
152  blocks += [ [v, entry.startlb, entry.endlb] ]
153  run.stats[k] = { "blocks" : blocks, "first" : run.data[k][0].value }
154 
155  #f = open("olc.pickle", "w")
156  #cPickle.dump([run.data,run.stats],f)
157  #f.close()
158 
159  with timer("olc afterquery rest"):
160  from CoolRunQuery.utils.AtlRunQueryUtils import unpackRun1BCIDMask, unpackRun2BCIDMask
161  for run in runlist:
162 
163  if run.runNr < 151260:
164  continue # OLC information was not in COOL before this run
165 
166  # these contain the number of bunches for each IOV [(nb,lbstart,lbend)(...)...]
167  xb1 = run.stats['olc:beam1bunches']['blocks']
168  xb2 = run.stats['olc:beam2bunches']['blocks']
169  xbc = run.stats['olc:collbunches']['blocks']
170 
171  # loop over BCID mask
172  bcidmask = run.stats['olc:bcidmask']['blocks']
173  for i in range(len(bcidmask)):
174  (bcidblob,lbstart,lbend) = bcidmask[i]
175 
176  # number of bunches
177  for nb1, b, e in xb1:
178  if lbstart>=b and lbstart<e:
179  break
180  for nb2, b, e in xb2:
181  if lbstart>=b and lbstart<e:
182  break
183  for nbc, b, e in xbc:
184  if lbstart>=b and lbstart<e:
185  break
186 
187 
188  bcidBlobLength = len(bcidblob)
189  if bcidBlobLength == 3564:
190  # run 2
191  beam1, beam2, beam12 = unpackRun2BCIDMask(bcidblob)
192  #print ("BC beam 1: %i, beam 2: %i, coll: %i" % (len(beam1), len(beam2), len(beam12)))
193  else:
194  # unpack BCID mask
195  if len(bcidblob) == 2 * (nb1 + nb2 + nbc):
196  beam1, beam2, beam12 = unpackRun1BCIDMask( bcidblob, nb1, nb2, nbc )
197  #print ("BC beam 1: %i, beam 2: %i, coll: %i" % (len(beam1), len(beam2), len(beam12)))
198  else:
199  print ("WARNING, bcidMask inconsistent",nb1, nb2, nbc,"should add up to half of",len(bcidblob))
200  beam1, beam2, beam12 = ([],[],[])
201 
202  # refill run stats
203  bcidmask[i] = ((nb1, nb2, nbc), (beam1, beam2, beam12), lbstart, lbend)
204 
205 class OLCLBDataCondition(TimeBasedCondition):
206  def __init__(self, name, condition=[]):
207  super(OLCLBDataCondition,self).__init__(name=name,
208  dbfolderkey='COOLONL_TDAQ::/TDAQ/OLC/LHC/LBDATA',
209  channelKeys = [(1,'olc:beam1intensity', 'Beam1Intensity'),
210  (1,'olc:beam2intensity', 'Beam2Intensity')])
211  #(1,'olc:beam1intensitybct', 'Beam1IntensityAll'),
212  #(1,'olc:beam2intensitybct', 'Beam2IntensityAll')])
213  #(0,'olc:invlivetime', 'Beam1InvLifetime')])
214  #(0,'olc:invlivetime', 'Beam2InvLifetime')])
215  self.onl = {}
216 
217  def __str__(self):
218  if self.applySelection:
219  return "SELOUT Checking if online lumi is %s" % self.olc
220  else:
221  return "Retrieving online lumi information /TDAQ/OLC/LHC/LBDATA"
222 
223  def passes(self,values,k):
224  if k not in self.onl:
225  return True
226  if 'n.a.' in values:
227  return True
228  if values == self.onl[k]:
229  return True
230  return False
231 
232  def runAfterQuery(self,runlist):
233  for k in self.ResultKey():
234  for run in runlist:
235  blocks = []
236  first = 0
237  if len(run.data[k])>0:
238  for entry in run.data[k]:
239  v = entry.value
240  if len(blocks) > 0 and blocks[-1][0]==v and blocks[-1][2]==entry.startlb:
241  blocks[-1][2] = entry.endlb
242  else:
243  blocks += [ [v, entry.startlb, entry.endlb] ]
244  first = run.data[k][0].value
245  run.stats[k] = { "blocks" : blocks, "first" : first }
246 
247 # moved from LUMINOSITY timestamp-based to LB-based folder
248 #... class OLCLumiCondition(TimeBasedCondition):
249 class OLCLumiCondition(RunLBBasedCondition):
250  def __init__(self, name, condition=[], channel=0):
251 
252  self.condition = condition
253  name, sep, channel = name.partition(' ')
254  try:
255  channel = int(channel)
256  except ValueError:
257  channel = 0
258  pass
259 
260  # the key
261  # interpret condition: reference luminosity: ub-1, default: ub-1
262  # format: 1ub, 100nb, 1mb+, 1pb-, etc
263  units = [ 'mb', 'ub', 'nb', 'pb', 'fb', 'ab', 'b' ]
264  factoub = [ 1e-3, 1, 1e3, 1e6, 1e9, 1e12, 1e-6 ]
265  self.complumi = -1
266  self.compsign = +1
267  f = 1
268  if self.condition:
269  c = self.condition[0].strip()
270  for iu,u in enumerate(units):
271  if u in c:
272  f = factoub[iu]
273  c = c.replace(u,'')
274  break
275  try:
276  if '+' in c:
277  c = c.replace('+','').strip()
278  self.complumi = float(c)
279  elif '-' in c:
280  self.compsign = -1
281  c = c.replace('-','').strip()
282  self.complumi = float(c)
283  except ValueError:
284  print ("ERROR: in 'olc' condition: %s" % self.condition)
285  sys.exit(1)
286  self.complumi *= f # in ub-1
287 
288  super(OLCLumiCondition,self).__init__(name=name,
289  dbfolderkey=( 'COOLONL_TRIGGER::/TRIGGER/LUMI/OnlPrefLumi' if self.isRun2() else 'COOLONL_TRIGGER::/TRIGGER/LUMI/LBLESTONL'),
290  channelKeys = [(channel,'olc:lumi:%i' % (channel), 'LBAvInstLumi')])
291  # -----------------------------------------------------------------------------------------------------------
292  # old, timestamp based folder
293  # super(OLCLumiCondition,self).__init__(name=name,
294  # dbfolderkey='COOLONL_TDAQ::/TDAQ/OLC/LUMINOSITY',
295  # channelKeys = [(channel,'olc:lumi:%i' % channel, 'LBAvInstLumPhys')])
296  # -----------------------------------------------------------------------------------------------------------
297  self.olc = {}
298 
299  def __str__(self):
300  if self.applySelection:
301  return "SELOUT Checking if online lumi is %s" % self.condition
302  else:
303  return "Retrieving online lumi information /TRIGGER/LUMI/LBLESTONL"
304 
305  def passes(self,values,k):
306  return True
307  if k not in self.olc:
308  return True
309  if 'n.a.' in values:
310  return True
311 
312  if values == self.olc[k]:
313  return True
314  return False
315 
316  def runAfterQuery(self, runlist):
317 
318  # correct "old" runs for uncalibrated luminosity
319  k = self.ResultKey()[0] # lumi
320  kst = 'lhc:stablebeams'
321  for ir,run in enumerate(runlist):
322  for entry in run.data[k]:
323  if entry.startlb == 0:
324  continue
325  if entry.value != 'n.a.':
326  if run.runNr <= 158632:
327  entry.value *= 1.13
328 
329  if not self.condition:
330  return
331 
332  # compute integrated luminosity
333  # given is the delivered luminosity in units of 10^30 cm-2 = 1 ub-1
334  # insert events per LB
335  vetolist = []
336  for ir,run in enumerate(runlist):
337  yvecInt = [] # olc per lb in 10^27 cm-2s-1
338  xvecStb = []
339  for entry in run.data[k]:
340  assert entry.startlb != 0, 'entry should not start at LB=0'
341  val = 0
342  if entry.value != 'n.a.':
343  val = max(0,entry.value) * 1.e3 # unit of val was: 10^30 cm-2 s-1, transform to: 10^27 cm-2s-1
344  lbs = range(entry.startlb,entry.endlb)
345  yvecInt += len(lbs)*[val]
346 
347  # check LBs with stable beam
348  print (run.data[kst].atLB(entry.startlb))
349  stable_beam = run.data[kst].atLB(entry.startlb)[0].value
350  if 'true' in stable_beam.lower():
351  xvecStb += lbs
352 
353  # correct for time span
354  intlumi = 0
355  for idx,(lbtime,lbendtime) in enumerate(run.lbtimes):
356  lb=idx+1
357  if lb in xvecStb:
358  # unit of yvec was: 10^27 cm-2 s-1 -> 10^30 cm-2 = ub-1
359  yvecInt[idx] *= (float(lbendtime)-float(lbtime))/1.E9/1000.
360  intlumi += yvecInt[idx]
361 
362  if not (intlumi > self.compsign*self.complumi or -1*intlumi > self.compsign*self.complumi):
363  vetolist.append(ir)
364 
365  # remove vetoed runs
366  ic = 0
367  vetolist.sort()
368  for ir in vetolist:
369  del runlist[ir-ic]
370  ic += 1
371 
372  def prettyValue(self, value, key):
373  if value=='n.a.':
374  return value
375  return float(value) # unit is ub-1 s-1
376 
377 class OLCLumiSelector(Selector):
378  def __init__(self, name, olclumi=[]):
379  super(OLCLumiSelector,self).__init__(name)
380  self.condition = OLCLumiCondition( 'olclumi', olclumi )
381  if not olclumi:
382  self.condition.applySelection = False
383 
384  def setShowOutput(self):
385  self.condition.setShowOutput()
386 
387  def runAfterQuery(self, runlist):
388  self.condition.runAfterQuery( runlist )
389 
390  def select(self, runlist):
391  runlist = self.condition.select(runlist)
392  return runlist
393 
394 class LuminositySelector(RunLBBasedCondition):
395  def __init__(self, name, lumi=None):
396 
397  name, tag = (name.split(None,1) + [""])[:2]
398 
399  channel, condtag = self.__interpretTag(tag)
400 
401  if self.isRun2():
402  self._dbfolderkey='COOLOFL_TRIGGER::/TRIGGER/OFLLUMI/OflPrefLumi'
403  else:
404  self._dbfolderkey='COOLOFL_TRIGGER::/TRIGGER/OFLLUMI/LBLESTOFL'
405  if condtag:
406  self._dbfolderkey += "#" + condtag
407 
408  self._channelKeys = [(channel,'ofllumi:%i:%s' % (channel,condtag), 'LBAvInstLumi')]
409 
410  super(LuminositySelector,self).__init__(name=name,
411  dbfolderkey = self._dbfolderkey,
412  channelKeys = self._channelKeys)
413 
414  if lumi:
415  self.cutRange = GetRanges(lumi)
416  self.applySelection = True
417 
418  def addShowTag(self, tag):
419  channel, condtag = self.__interpretTag(tag)
420  if self.isRun2():
421  self._dbfolderkey='COOLOFL_TRIGGER::/TRIGGER/OFLLUMI/OflPrefLumi'
422  else:
423  self._dbfolderkey='COOLOFL_TRIGGER::/TRIGGER/OFLLUMI/LBLESTOFL'
424  if condtag:
425  self._dbfolderkey += "#" + condtag
426  self._channelKeys = [(channel,'ofllumi:%i:%s' % (channel,condtag), 'LBAvInstLumi')]
427 
428  def initialize(self):
429  print ("Setting channelkeys",self._channelKeys)
430  self.setSchemaFolderTag(self._dbfolderkey)
431  self.setChannelKeys(self._channelKeys)
432 
433  def __interpretTag(self, tag):
434  # default settings
435  channel = 0 # 'ATLAS_PREFERRED' algorithm
436  condtag = None
437 
438  tt = tag.split()
439  if len(tt) == 1:
440  # format: "luminosity <channel_number>" OR "luminosity <COOL tag>"
441  try:
442  channel = int(tt[0])
443  except ValueError:
444  condtag = tt[0]
445  elif len(tt) == 2:
446  # format: "luminosity <channel_number> <COOL tag>"
447  try:
448  channel = int(tt[0])
449  except ValueError:
450  channel = 0
451  condtag = tt[1]
452 
453  if condtag is not None:
454  print ("Using channel %i and conditions tag %s" % (channel, condtag))
455  return channel, condtag
456 
457  if self.isRun2():
458  import sys
459  from PyCool import cool
460  sys.path.append('/afs/cern.ch/user/a/atlcond/utils/python/')
461  try:
462  from AtlCoolBKLib import resolveAlias
463 
464  cur = resolveAlias.getCurrent()
465  # cur = resolveAlias.getNext()
466  dbSvc = cool.DatabaseSvcFactory.databaseService()
467 
468  db = dbSvc.openDatabase('oracle://ATLAS_COOLPROD;schema=ATLAS_COOLOFL_TRIGGER;dbname=CONDBR2',False)
469 
470  fld = db.getFolder('/TRIGGER/OFLLUMI/OflPrefLumi')
471 
472  updLumiTag = fld.resolveTag(cur.replace('*','ST'))
473 
474  condtag = updLumiTag
475  except ImportError as ex:
476  print ("WARNING: ImportError, can not read conditions tag (likely an afs permission issue): ",ex)
477  condtag = "OflPrefLumi-RUN2-UPD4-10"
478  except SyntaxError as ex:
479  print ("WARNING: SyntaxError, can not read conditions tag (need to understand where the py3 code is located): ",ex)
480  condtag = "OflPrefLumi-RUN2-UPD4-10"
481  else:
482  condtag = "OflLumi-UPD2-006"
483 
484  print ("Using channel %i and conditions tag %s" % (channel, condtag))
485  return channel, condtag
486 
487 
488  def __str__(self):
489  if self.applySelection:
490  return "SELOUT Checking if number of events matches %r" % self.cutRange
491  else:
492  return "Retrieving lumi numbers"
493 
494  def passes(self,values,key):
495  try:
496  val = int(values)
497  except ValueError: # if n.a.
498  self.selDataMissing = True
499  return True
500  for cr in self.cutRange:
501  if val>=cr[0] and val<=cr[1]:
502  return True
503  return False
504 
505 class BeamspotSelector(RunLBBasedCondition):
506  def __init__(self, name, bs=None, args=""):
507  self.bs = bs
508  args = args.split()
509 
510  # defaults
511  folder = 'COOLOFL_INDET::/Indet/Beampos'
512  # self.condtag = 'IndetBeampos-ES1-UPD2'
513  self.condtag = 'IndetBeampos-ES1-UPD2-02' # new default tag (operational since rel 17, run 188902, 7 Sep)
514  self.isOffline = True
515 
516  if args: # more information: online and/or COOL tag
517  # check if online
518  if args[0].lower().startswith('onl'):
519  # online format: "online MyTag" or "online"
520  self.isOffline = False
521  folder = 'COOLONL_INDET::/Indet/Onl/Beampos'
522  self.condtag = 'IndetBeamposOnl-HLT-UPD1-001-00' # default tag
523  if len(args)>1:
524  if args[1]=='live':
525  self.condtag = 'IndetBeamposOnl-LiveMon-001-00'
526  else:
527  self.condtag = args[1]
528  else:
529  # assume second entry is COOL tag
530  self.condtag = args[0]
531 
532  super(BeamspotSelector,self).__init__(name = name,
533  dbfolderkey = folder,
534  channelKeys = [
535  (0,'bs:Status','status'),
536  (0,'bs:Pos-X', ('posX','posXErr')),
537  (0,'bs:Pos-Y', ('posY','posYErr')),
538  (0,'bs:Pos-Z', ('posZ','posZErr')),
539  (0,'bs:Sig-X', ('sigmaX','sigmaXErr')),
540  (0,'bs:Sig-Y', ('sigmaY','sigmaYErr')),
541  (0,'bs:Sig-Z', ('sigmaZ','sigmaZErr')),
542  (0,'bs:Sig-XY',('sigmaXY','sigmaXYErr')),
543  (0,'bs:Tilt-X',('tiltX','tiltXErr')),
544  (0,'bs:Tilt-Y',('tiltY','tiltYErr'))
545  ])
546 
547  if bs:
548  self.cutRange = GetRanges(bs)
549 
550  def __str__(self):
551  if self.applySelection:
552  return "SELOUT Checking if %s beamspot information matches %s" % ("offline" if self.isOffline else "online", self.bs)
553  else:
554  return "Retrieving %s beamspot information" % ("offline" if self.isOffline else "online",)
555 
556  def prettyValue(self, value, key):
557  if type(value)==tuple:
558  return tuple(map(float,value))
559  return float(value)
560 
561 
562  def passes(self,values,key):
563  try:
564  val = int(values)
565  except ValueError: # if n.a.
566  self.selDataMissing = True
567  return True
568  for cr in self.cutRange:
569  if val>=cr[0] and val<=cr[1]:
570  return True
571  return False
572 
573  def runAfterQuery(self,runlist):
574  whatitis = 'offline' if self.isOffline else 'online'
575  from CoolRunQuery.AtlRunQueryRun import Run
576  Run.BeamspotSource = '%s, COOL tag: %s' % (whatitis, self.condtag)
577  for run in runlist:
578  run.stats['Beamspot'] = whatitis
579 
580 if __name__ == "__main__":
581 
582  from CoolRunQuery.selector.AtlRunQuerySelectorBase import Selector
583  from CoolRunQuery.selector.AtlRunQuerySelectorRuntime import RunTimeSelector
584 
585  runNumbers = "251103,251106,251363,251367,251371,251663,251666,251667,251669,266904,"
586  runNumbers += "266919,267073,251863,251869,251873,251876,251880,252009,252044,252072,"
587  runNumbers += "252099,252115,267148,267152,267162,252179,252186,252194,252198,252207,"
588  runNumbers += "252220,252222,252223,252226,252233,252376,252380,252390,267167,252402,"
589  runNumbers += "252404,252589,252604,252608,252662,252663,252838,252840,252844,252854,"
590  runNumbers += "253009,253010,253014,267638,267639"
591 
592  #runNumbers = "251103,251106"
593 
594  Selector._conddb = "CONDBR2" # set Run 2 for entire query
595 
596  print(Selector.condDB())
597 
598 
599  sel = LuminositySelector(name = 'lumiSelector 0 OflPrefLumi-RUN2-UPD4-10')
600  sel.applySelection = False
601 
602  # the run selector
603  rtSel = RunTimeSelector(name = 'runtime', runlist = runNumbers.split(","))
604 
605  # find the begin and end of each interesting run
606  runlist = rtSel.select()
607 
608  from CoolRunQuery.AtlRunQuerySelectorWorker import SelectorWorker
609 
610  SelectorWorker.addSelector(selector=sel, priority=1)
611  sd = SelectorWorker.findSelectorDescriptor(sel.name)
612  sd.doesSelect = False
613 
614  selectionOutput = []
615  # Selectors can implement an initialize function which runs after any constructor and setShow
616  for sd in SelectorWorker.getOrderedSelectorList():
617  s = sd.selector
618  if hasattr(s, 'initialize'):
619  with timer("initializing selector '%s'" % s.name):
620  s.verbose = True
621  s.initialize()
622 
623  # apply the selectors to initial run list
624  for s in SelectorWorker.selectors():
625  with timer("run selector '%s'" % s.name):
626  s.verbose = True
627  runlist = s.select(runlist)
628  selectionOutput += ["%s" % s.__str__()]
629  with timer("run AfterQuery for selector '%s'" % s.name):
630  s.runAfterQuery(runlist)
631 
632  #for r in runlist:
633  # print(r.__dict__)
python.selector.AtlRunQuerySelectorLhcOlc.OLCLumiCondition.passes
def passes(self, values, k)
Definition: AtlRunQuerySelectorLhcOlc.py:305
python.selector.AtlRunQuerySelectorLhcOlc.OLCLumiCondition.runAfterQuery
def runAfterQuery(self, runlist)
Definition: AtlRunQuerySelectorLhcOlc.py:316
python.selector.AtlRunQuerySelectorLhcOlc.LHCCondition.passes
def passes(self, value, k)
Definition: AtlRunQuerySelectorLhcOlc.py:83
python.selector.AtlRunQuerySelectorLhcOlc.LHCSelector.addShowSelector
def addShowSelector(self, addArg='')
Definition: AtlRunQuerySelectorLhcOlc.py:20
python.selector.AtlRunQuerySelectorLhcOlc.BeamspotSelector.__str__
def __str__(self)
Definition: AtlRunQuerySelectorLhcOlc.py:550
python.selector.AtlRunQuerySelectorLhcOlc.LHCSelector.condition
condition
Definition: AtlRunQuerySelectorLhcOlc.py:12
python.selector.AtlRunQuerySelectorLhcOlc.OLCFillParamsCondition.passes
def passes(self, values, k)
Definition: AtlRunQuerySelectorLhcOlc.py:127
python.selector.AtlRunQuerySelectorLhcOlc.LHCSelector
Definition: AtlRunQuerySelectorLhcOlc.py:9
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
python.selector.AtlRunQuerySelectorLhcOlc.LuminositySelector.__interpretTag
def __interpretTag(self, tag)
Definition: AtlRunQuerySelectorLhcOlc.py:433
python.selector.AtlRunQuerySelectorLhcOlc.BeamspotSelector.condtag
condtag
Definition: AtlRunQuerySelectorLhcOlc.py:513
python.selector.AtlRunQuerySelectorLhcOlc.LuminositySelector.__str__
def __str__(self)
Definition: AtlRunQuerySelectorLhcOlc.py:488
python.selector.AtlRunQuerySelectorLhcOlc.OLCFillParamsCondition.onl
onl
Definition: AtlRunQuerySelectorLhcOlc.py:119
python.selector.AtlRunQuerySelectorLhcOlc.LuminositySelector.initialize
def initialize(self)
Definition: AtlRunQuerySelectorLhcOlc.py:428
python.selector.AtlRunQuerySelectorLhcOlc.BeamspotSelector.passes
def passes(self, values, key)
Definition: AtlRunQuerySelectorLhcOlc.py:562
python.selector.AtlRunQuerySelectorLhcOlc.BeamspotSelector.cutRange
cutRange
Definition: AtlRunQuerySelectorLhcOlc.py:548
python.selector.AtlRunQuerySelectorLhcOlc.OLCLumiCondition.complumi
complumi
Definition: AtlRunQuerySelectorLhcOlc.py:265
python.selector.AtlRunQuerySelectorLhcOlc.BeamspotSelector.selDataMissing
selDataMissing
Definition: AtlRunQuerySelectorLhcOlc.py:566
python.selector.AtlRunQuerySelectorLhcOlc.BeamspotSelector
Definition: AtlRunQuerySelectorLhcOlc.py:505
python.selector.AtlRunQuerySelectorLhcOlc.OLCLBDataCondition.onl
onl
Definition: AtlRunQuerySelectorLhcOlc.py:215
python.selector.AtlRunQuerySelectorLhcOlc.OLCLumiSelector.setShowOutput
def setShowOutput(self)
Definition: AtlRunQuerySelectorLhcOlc.py:384
python.selector.AtlRunQuerySelectorLhcOlc.LHCSelector.__init__
def __init__(self, name, lhc=[], addArg='')
Definition: AtlRunQuerySelectorLhcOlc.py:10
python.selector.AtlRunQuerySelectorLhcOlc.BeamspotSelector.prettyValue
def prettyValue(self, value, key)
Definition: AtlRunQuerySelectorLhcOlc.py:556
python.selector.AtlRunQuerySelectorLhcOlc.OLCLumiCondition.prettyValue
def prettyValue(self, value, key)
Definition: AtlRunQuerySelectorLhcOlc.py:372
python.selector.AtlRunQuerySelectorLhcOlc.BeamspotSelector.bs
bs
Definition: AtlRunQuerySelectorLhcOlc.py:507
python.selector.AtlRunQuerySelectorLhcOlc.LHCCondition.__init__
def __init__(self, name, condition=[], channel=0, addArg='')
Definition: AtlRunQuerySelectorLhcOlc.py:33
python.selector.AtlRunQuerySelectorLhcOlc.LuminositySelector.cutRange
cutRange
Definition: AtlRunQuerySelectorLhcOlc.py:415
python.selector.AtlRunQuerySelectorLhcOlc.OLCLumiCondition.__init__
def __init__(self, name, condition=[], channel=0)
Definition: AtlRunQuerySelectorLhcOlc.py:250
python.CaloAddPedShiftConfig.type
type
Definition: CaloAddPedShiftConfig.py:42
python.LumiBlobConversion.unpackRun2BCIDMask
def unpackRun2BCIDMask(blob, nb1, nb2, nlumi)
Definition: LumiBlobConversion.py:112
python.selector.AtlRunQuerySelectorLhcOlc.LuminositySelector.passes
def passes(self, values, key)
Definition: AtlRunQuerySelectorLhcOlc.py:494
python.selector.AtlRunQuerySelectorLhcOlc.LuminositySelector.selDataMissing
selDataMissing
Definition: AtlRunQuerySelectorLhcOlc.py:498
python.utils.AtlRunQueryTimer.timer
def timer(name, disabled=False)
Definition: AtlRunQueryTimer.py:85
python.selector.AtlRunQuerySelectorLhcOlc.OLCLumiCondition
Definition: AtlRunQuerySelectorLhcOlc.py:249
python.selector.AtlRunQuerySelectorLhcOlc.LHCSelector.showarg
showarg
Definition: AtlRunQuerySelectorLhcOlc.py:13
python.selector.AtlRunQuerySelectorLhcOlc.OLCLBDataCondition.__init__
def __init__(self, name, condition=[])
Definition: AtlRunQuerySelectorLhcOlc.py:206
python.LumiBlobConversion.unpackRun1BCIDMask
def unpackRun1BCIDMask(blob, nb1, nb2, nlumi)
Definition: LumiBlobConversion.py:137
python.selector.AtlRunQuerySelectorLhcOlc.LHCSelector.__str__
def __str__(self)
Definition: AtlRunQuerySelectorLhcOlc.py:17
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
python.selector.AtlRunQuerySelectorLhcOlc.OLCLBDataCondition.runAfterQuery
def runAfterQuery(self, runlist)
Definition: AtlRunQuerySelectorLhcOlc.py:232
python.selector.AtlRunQuerySelectorLhcOlc.OLCFillParamsCondition.__str__
def __str__(self)
Definition: AtlRunQuerySelectorLhcOlc.py:121
python.selector.AtlRunQuerySelectorLhcOlc.BeamspotSelector.__init__
def __init__(self, name, bs=None, args="")
Definition: AtlRunQuerySelectorLhcOlc.py:506
python.selector.AtlRunQuerySelectorLhcOlc.LuminositySelector.applySelection
applySelection
Definition: AtlRunQuerySelectorLhcOlc.py:416
python.selector.AtlRunQuerySelectorLhcOlc.OLCLumiCondition.condition
condition
Definition: AtlRunQuerySelectorLhcOlc.py:252
python.selector.AtlRunQuerySelectorLhcOlc.LuminositySelector._channelKeys
_channelKeys
Definition: AtlRunQuerySelectorLhcOlc.py:408
print
void print(char *figname, TCanvas *c1)
Definition: TRTCalib_StrawStatusPlots.cxx:25
python.selector.AtlRunQuerySelectorLhcOlc.OLCLumiCondition.compsign
compsign
Definition: AtlRunQuerySelectorLhcOlc.py:266
python.selector.AtlRunQuerySelectorLhcOlc.OLCLumiSelector
Definition: AtlRunQuerySelectorLhcOlc.py:377
python.selector.AtlRunQuerySelectorLhcOlc.LHCSelector.select
def select(self, runlist)
Definition: AtlRunQuerySelectorLhcOlc.py:26
python.utils.AtlRunQueryUtils.GetRanges
def GetRanges(rangestr, intRepFnc=stringToIntOrTime, maxval=1<< 30)
Definition: AtlRunQueryUtils.py:327
python.selector.AtlRunQuerySelectorLhcOlc.OLCLumiSelector.condition
condition
Definition: AtlRunQuerySelectorLhcOlc.py:380
python.selector.AtlRunQuerySelectorLhcOlc.OLCFillParamsCondition.runAfterQuery
def runAfterQuery(self, runlist)
Definition: AtlRunQuerySelectorLhcOlc.py:136
python.selector.AtlRunQuerySelectorLhcOlc.OLCFillParamsCondition
Definition: AtlRunQuerySelectorLhcOlc.py:111
python.selector.AtlRunQuerySelectorLhcOlc.BeamspotSelector.runAfterQuery
def runAfterQuery(self, runlist)
Definition: AtlRunQuerySelectorLhcOlc.py:573
python.selector.AtlRunQuerySelectorLhcOlc.OLCLumiSelector.runAfterQuery
def runAfterQuery(self, runlist)
Definition: AtlRunQuerySelectorLhcOlc.py:387
python.selector.AtlRunQuerySelectorLhcOlc.BeamspotSelector.isOffline
isOffline
Definition: AtlRunQuerySelectorLhcOlc.py:514
python.selector.AtlRunQuerySelectorLhcOlc.LHCSelector.setShowOutput
def setShowOutput(self)
Definition: AtlRunQuerySelectorLhcOlc.py:23
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
python.selector.AtlRunQuerySelectorLhcOlc.OLCLBDataCondition.passes
def passes(self, values, k)
Definition: AtlRunQuerySelectorLhcOlc.py:223
python.selector.AtlRunQuerySelectorLhcOlc.LuminositySelector.__init__
def __init__(self, name, lumi=None)
Definition: AtlRunQuerySelectorLhcOlc.py:395
python.selector.AtlRunQuerySelectorLhcOlc.LuminositySelector
Definition: AtlRunQuerySelectorLhcOlc.py:394
python.selector.AtlRunQuerySelectorLhcOlc.OLCLBDataCondition.__str__
def __str__(self)
Definition: AtlRunQuerySelectorLhcOlc.py:217
python.selector.AtlRunQuerySelectorLhcOlc.LHCCondition.lhc
lhc
Definition: AtlRunQuerySelectorLhcOlc.py:46
str
Definition: BTagTrackIpAccessor.cxx:11
python.selector.AtlRunQuerySelectorLhcOlc.OLCLumiSelector.__init__
def __init__(self, name, olclumi=[])
Definition: AtlRunQuerySelectorLhcOlc.py:378
python.selector.AtlRunQuerySelectorLhcOlc.OLCLumiCondition.__str__
def __str__(self)
Definition: AtlRunQuerySelectorLhcOlc.py:299
python.selector.AtlRunQuerySelectorLhcOlc.LHCCondition
Definition: AtlRunQuerySelectorLhcOlc.py:32
python.selector.AtlRunQuerySelectorLhcOlc.LuminositySelector.addShowTag
def addShowTag(self, tag)
Definition: AtlRunQuerySelectorLhcOlc.py:418
python.selector.AtlRunQuerySelectorLhcOlc.LHCCondition.__str__
def __str__(self)
Definition: AtlRunQuerySelectorLhcOlc.py:77
python.selector.AtlRunQuerySelectorLhcOlc.OLCLumiSelector.select
def select(self, runlist)
Definition: AtlRunQuerySelectorLhcOlc.py:390
python.selector.AtlRunQuerySelectorLhcOlc.OLCFillParamsCondition.__init__
def __init__(self, name, condition=[], channel=0)
Definition: AtlRunQuerySelectorLhcOlc.py:112
python.selector.AtlRunQuerySelectorLhcOlc.LHCCondition.setShowOutput
def setShowOutput(self, addArg)
Definition: AtlRunQuerySelectorLhcOlc.py:69
python.selector.AtlRunQuerySelectorLhcOlc.OLCLBDataCondition
Definition: AtlRunQuerySelectorLhcOlc.py:205
python.selector.AtlRunQuerySelectorLhcOlc.LuminositySelector._dbfolderkey
_dbfolderkey
Definition: AtlRunQuerySelectorLhcOlc.py:402
python.selector.AtlRunQuerySelectorLhcOlc.OLCLumiCondition.olc
olc
Definition: AtlRunQuerySelectorLhcOlc.py:297
python.LArMinBiasAlgConfig.float
float
Definition: LArMinBiasAlgConfig.py:65