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