ATLAS Offline Software
AtlRunQuerySelectorBase.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
2 
3 
4 from __future__ import print_function
5 from PyCool import cool
6 from copy import deepcopy
7 
8 from CoolRunQuery.utils.AtlRunQueryUtils import coolDbConn, MergeRanges, SmartRangeCalulator #, runsOnServer, GetRanges
9 from CoolRunQuery.utils.AtlRunQueryIOV import IOVTime, IOVRange
10 
11 import sys
12 from time import time
13 from collections import namedtuple, defaultdict
14 
15 from itertools import groupby
16 from operator import itemgetter
17 
18 
19 OOO = namedtuple('OOO', 'channel payload iovrange isvf')
20 def coolgen(coolobjs):
21  while coolobjs.goToNext():
22  obj=coolobjs.currentRef()
23  yield OOO(obj.channelId(),obj.payloadValue, IOVRange(obj), False)
24 
25 ChDesc = namedtuple('ChDesc','CoolPayloadKey,CoolChannel,ResultKey,Header,SelectShowRetrieve')
26 
27 class DataKey(object):
28  SELECT = 0x1
29  SHOW = 0x2
30  RETRIEVE = 0x4
31 
32  UNDEFINED = 0
33  STREAM = 1
34  DETECTOR = 2
35  DQDEFECTS = 3
36 
37  def __init__(self, x, keytype=UNDEFINED, selecttype = SELECT):
38  if isinstance(x,str):
39  self._cool_channel = 0
40  self._cool_attr = ''
41  self._internal_key = x.strip()
43  self._table_header = x.strip()
44  else:
45  self._cool_channel = x[0]
46  self._cool_attr = x[2]
47  self._internal_key = x[1].strip()
48  self._second_internal_key = ''
49  self._table_header = x[1] if len(x)<4 else x[3]
50  self._type = keytype
51  self._select_show_retrieve = selecttype # 0-retrieve only, 1-select, 2-show, 3-select&show
52 
53  @property
54  def _seltype(self):
55  if self._select_show_retrieve == DataKey.SELECT:
56  return "SELECT"
57  if self._select_show_retrieve == DataKey.SHOW:
58  return "SHOW"
59  if self._select_show_retrieve == DataKey.RETRIEVE:
60  return "RETRIEVE"
61  return ""
62 
63  def __repr__(self):
64  return "<DataKey '%s' type %i %s>" % (self._internal_key, self._type, self._seltype)
65 
66  def __eq__(self,other):
67  if isinstance(other,DataKey):
68  #print ("Compare (%s) with (%s) ==> %r" % (self._internal_key,other._internal_key, self._internal_key==other._internal_key))
69  eq = self._internal_key==other._internal_key and self._second_internal_key==other._second_internal_key
70  return eq
71  else:
72  #print ("Compare (%s) with '%s' ==> %r" % (self._internal_key, other, self._internal_key==other))
73  eq = self._internal_key==other
74  return eq
75 
76  def __cmp__(self,other):
77  if isinstance(other,DataKey):
78  if self._internal_key==other._internal_key and self._second_internal_key==other._second_internal_key:
79  return 0
80  if self._internal_key==other._internal_key:
81  return self._second_internal_key.__cmp__(other._second_internal_key)
82  return self._internal_key.__cmp__(other._internal_key)
83  else:
84  #print ("Compare (%s) with '%s' ==> %r" % (self._internal_key, other, self._internal_key==other))
85  return self._internal_key==other
86 
87  def __hash__(self):
88  return hash( (self._internal_key,self._second_internal_key) )
89 
90  def pickled(self):
91  if self._second_internal_key != '':
92  return (self._internal_key,self._second_internal_key)
93  return self._internal_key
94 
95 
96  @property
97  def CoolPayloadKey(self):
98  return self._cool_attr
99 
100  @property
101  def CoolChannel(self):
102  return self._cool_channel
103 
104  @property
105  def ResultKey(self):
106  return self._internal_key
107 
108  @property
109  def Header(self):
110  return self._table_header
111 
112  @property
114  return self._select_show_retrieve
115 
116  @property
117  def Type(self):
118  return self._type
119 
120 
121 
122 
124  _conddb = None
125  condtag = ""
126 
127  @staticmethod
128  def setCondDBMC():
129  Selector._conddb = 'OFLP200'
130 
131  @staticmethod
132  def condDB(run_number = None ):
133  if not run_number:
134  if Selector._conddb:
135  return Selector._conddb
136  raise RuntimeError("CondDB not yet set")
137 
138  Selector._conddb = "CONDBR2" if run_number > 236100 else "COMP200"
139  print ("Determinded %s, based on run number %i" % (Selector._conddb, run_number))
140  return Selector._conddb
141 
142  @staticmethod
143  def isRun2(run_number = None ):
144  return Selector.condDB(run_number)=="CONDBR2"
145 
146  def __init__(self, name):
147  self.name = name
148  self.priority = 50
149  self.verbose = False
150  self.applySelection = True
151  self.mcenabled = False
152  def select(self, runlist):
153  return runlist
154  def prettyValue(self, value, key):
155  return value
156  def ApplySelection(self, key):
157  return self.applySelection
158  def runAfterQuery(self, runlist):
159  pass
160 
161  # use this method for the selector to specify which data should be stored
162  def valueForStorage(self, condData, key):
163  return None
164 
165 
167  def __init__(self, name, dbfolderkey, channelKeys):
168  super(Condition,self).__init__(name)
169  self.selDataMissing = False
170  self.setSchemaFolderTag(dbfolderkey)
171  self.setChannelKeys(channelKeys)
172 
173  def setSchemaFolderTag(self,dbfoldertag):
174  # setting schema, folder, and tag
175  self.schema, foldertag = dbfoldertag.split('::')
176  self.folder, self.tagname = (foldertag.split('#')+[''])[0:2]
177  if self.tagname=="":
178  self.tagname = self.condtag
179 
180  def setChannelKeys(self,channelKeys,ssr=None):
181  self.data_keys = [DataKey(x) for x in channelKeys]
182  if ssr:
183  assert len(ssr)==len(self.data_keys)
184  for (x,_ssr) in zip(self.data_keys,ssr):
185  x._select_show_retrieve = _ssr
186 
187  self._channelKeys = channelKeys
188  self._coolpayloadkey = [x[2] for x in channelKeys]
189  self._coolchannel = [x[0] for x in channelKeys]
190  self._resultKey = [x[1] for x in channelKeys]
191  self._headerKey = [x[1] for x in channelKeys]
192  if not ssr:
193  self._doSelectShowRetrieve = len(channelKeys)*[1] # 0-retrieve only, 1-select, 2-show, 3-select&show
194  else:
195  self._doSelectShowRetrieve = ssr
197 
198  def _getFolder(self):
199  f = coolDbConn.GetDBConn(schema = self.schema,db=Selector.condDB()).getFolder(self.folder)
200  if f.versioningMode()==0:
201  self.tagname=""
202  if self.tagname not in ["HEAD", ""]:
203  self.tagname = f.resolveTag(self.tagname)
204  return f
205 
206  def addChannelKey(self,channelKey,ssr=None):
207  """
208  channelKey: (0,'SMK','MasterConfigurationKey')
209  ssr: 0-retrieve only, 1-select, 2-show, 3-select&show
210  """
211 
212  if DataKey(channelKey) in self.data_keys:
213  # key already exists
214  return
215 
216  self.data_keys += [ DataKey(channelKey) ]
217  if ssr:
218  self.data_keys[-1]._select_show_retrieve = ssr
219 
220  self._channelKeys += [ channelKey ]
221  self._coolpayloadkey += [ channelKey[2] ]
222  self._coolchannel += [ channelKey[0] ]
223  self._resultKey += [ channelKey[1] ]
224  self._headerKey += [ channelKey[1] ]
225  if ssr:
226  self._doSelectShowRetrieve += [ ssr ]
227  else:
228  self._doSelectShowRetrieve += [ 1 ]
229  self._channeldesc = self.data_keys
230 
231  def ResultKey(self):
232  return self._resultKey
233 
234  def ChannelKeys(self):
235  return self._channelKeys
236 
237  def CoolChannels(self):
238  return self._coolchannel
239 
240  def HeaderKeys(self):
241  return self._headerKey
242 
244  return self._doSelectShowRetrieve
245 
246  def ChannelDesc(self):
247  return self._channeldesc
248 
249  def setShowOutput(self, listofchans=None ):
250  for cd in self.ChannelDesc():
251  if listofchans and cd.ResultKey not in listofchans:
252  continue
253  cd._select_show_retrieve |= 2
254  self._doSelectShowRetrieve = [cd.SelectShowRetrieve for cd in self._channeldesc]
255  self.updateShowOrder()
256 
257  def updateShowOrder(self):
258  from CoolRunQuery.AtlRunQueryRun import Run
259  for cd in self.ChannelDesc():
260  if cd.SelectShowRetrieve<2:
261  continue
262  Run.AddToShowOrder(cd)
263 
264 
266  def __init__(self, name, dbfolderkey, channelKeys=None):
267  super(RunLBBasedCondition,self).__init__(name, dbfolderkey, channelKeys)
268 
269  def _retrieve(self, iovmin, iovmax, f, sortedRanges):
270  chansel = None
271  for ch1,ch2 in sortedRanges:
272  if chansel is None:
273  chansel = cool.ChannelSelection(ch1,ch2,cool.ChannelSelection.sinceBeforeChannel)
274  else:
275  chansel.addRange(ch1,ch2)
276  #print (self.name,"browsing objects with tag",self.tagname)
277  return coolgen(f.browseObjects( iovmin, iovmax, chansel, self.tagname))
278 
279  def findPayload(self, runNr, iovpllist):
280  """
281  iovpllist is a list [(IOV,payload),(IOV,payload),..,(IOV,payload)]
282  """
283  for x in iovpllist:
284  if IOVTime(runNr,1).inRange(x[0]):
285  return x[1]
286  return 'n.a.'
287 
288  def getSortedAndCompletedPayloadDict(self, iovpllist, runlist, key):
289  # reduce to data in the run 'runNr' and sort by iov start time
290 
291  pld = defaultdict(list)
292  if not iovpllist:
293  return pld
294  if not runlist:
295  return pld
296 
297  runnrlist = [r.runNr for r in runlist]
298  nlb = dict([(r.runNr,r.lastlb) for r in runlist])
299 
300  # first and last run of the runlist
301  firstrun = runnrlist[0]
302  lastrun = runnrlist[-1]
303 
304  for iov, pl in iovpllist:
305  first = max(firstrun,iov.startTime.run)
306  last = min(lastrun,(iov.endTime-1).run)
307  for r in range(first,last+1):
308  if r in runnrlist:
309  pld[r].append((deepcopy(iov),pl))
310 
311  # adjustments of IOV
312  for runnr, iovplbyrun in pld.items():
313  # adjust lb 0 to lb 1
314  if iovplbyrun[0][0].startTime.lb==0:
315  iovplbyrun[0][0].startTime.lb=1
316 
317  # truncate first IOV to a single run
318  iovplbyrun[0][0].truncateToSingleRun(runnr)
319 
320  # sometimes an IOV has [RunLB1 - RunLB2), where RunLB2 has LB==1
321  # -> that gets truncated to [RunLB2 - RunLB2), which is obviously not valid
322  # -> so we slice that right out
323  if iovplbyrun[0][0].startTime == iovplbyrun[0][0].endTime:
324  iovplbyrun[:1] = []
325 
326  # truncate last IOV to a single run
327  lastiov = iovplbyrun[-1][0]
328  lastiov.truncateToSingleRun(runnr)
329 
330  # insert IOVs for missing ranges (value n.a.)
331  idx=0
332  curTime = IOVTime(runnr,1)
333  while curTime<lastiov.startTime:
334  iov = iovplbyrun[idx][0]
335  if curTime < iov.startTime:
336  # insert n.a. for missing iov
337  missingIOV = IOVRange(starttime=curTime, endtime=iov.startTime)
338  iovplbyrun.insert( idx, (missingIOV, "n.a.") )
339  curTime = IOVTime(iov.endTime)
340  idx += 1
341 
342  # also check if IOV at the end is missing
343  runEndTime = IOVTime(runnr,nlb[runnr]+1) # last lb + 1
344  if lastiov.endTime<runEndTime:
345  missingIOV = IOVRange(starttime=lastiov.endTime, endtime=runEndTime)
346  iovplbyrun.append( (missingIOV, "n.a.") )
347 
348  return pld
349 
350  def readCondData(self, runranges, f, sortedRanges):
351  # get the data from cool
352  condData = defaultdict(list)
353 
354  keys = dict([(ch,set(k)) for ch, k in groupby(sorted(self.ChannelKeys(), key=itemgetter(0)), itemgetter(0))])
355 
356  for rr in runranges:
357  iovmin=(rr[0] << 32)+0
358  iovmax=((rr[1]+1) << 32)-1
359 
360  # access to COOL
361  objs = self._retrieve(iovmin, iovmax, f, sortedRanges)
362 
363  for obj in objs:
364  ch = obj.channel
365  for chtmp, internalKey, payloadKey in keys[ch]:
366  if type(payloadKey)==tuple:
367  if obj.isvf:
368  payload = obj.payload
369  else:
370  payload = tuple(map(obj.payload, payloadKey))
371  else:
372  payload = obj.payload(payloadKey)
373 
374  condData[internalKey].append( (IOVRange(obj.iovrange), payload) )
375 
376  return condData
377 
378  def select(self, runlist):
379  print (self, end='')
380  sys.stdout.flush()
381  start = time()
382  newrunlist = []
383 
384  sortedChannel = sorted( list( set( self.CoolChannels() ) ) )
385  sortedRanges = MergeRanges([(x,x) for x in sortedChannel])
386 
387  runranges = SmartRangeCalulator(runlist)
388 
389  f = self._getFolder()
390 
391  condData = self.readCondData(runranges, f, sortedRanges)
392 
393  # for each key sort the data by IOV start time
394  for k in self.ResultKey():
395  condData[k].sort()
396  # if k.startswith('Rele'):
397  # for x in condData[k]:
398  # print("TEST",k,x)
399 
400  condDataDict = {}
401  for k in self.ResultKey():
402  condDataDict[k] = self.getSortedAndCompletedPayloadDict(condData[k],runlist,k)
403 
404  for run in runlist: # go through old runlist and see
405 
406  rejectSomething = False
407  for k in self.ResultKey():
408  if run.runNr not in condDataDict[k]:
409  if self.ApplySelection(k):
410  rejectSomething = True
411  run.addResult(k, "n.a.")
412  continue
413 
414  datavec = condDataDict[k][run.runNr]
415 
416  if not datavec or len(datavec)==0:
417  run.addResult(k, "n.a.")
418  continue
419 
420  if 'n.a.' in datavec:
421  run.showDataIncomplete = True
422 
423  for iov, data in datavec:
424  self.selDataMissing = False
425  if self.ApplySelection(k) and not self.passes(data,k):
426  run.addResult(k, self.prettyValue(data,k), iov, reject=True, valueForStorage=self.valueForStorage(data,k))
427  rejectSomething = True
428  else:
429  run.addResult(k, self.prettyValue(data,k), iov, valueForStorage=self.valueForStorage(data,k))
430  if self.selDataMissing:
431  run.selDataIncomplete = True
432 
433  if not (rejectSomething and self.rejectRun(run)):
434  newrunlist += [run.runNr]
435 
436  runlist = [r for r in runlist if r.runNr in newrunlist]
437 
438  duration = time() - start
439 
440  if self.applySelection:
441  print (" ==> %i runs found (%.2f sec)" % (len(runlist),duration))
442  else:
443  print (" ==> Done (%g sec)" % duration)
444 
445  return runlist
446 
447 
448  def rejectRun(self,run):
449  return run.data.isRejected
450 
451 
453  def __init__(self, name, dbfolderkey, channelKeys=None):
454  super(TimeBasedCondition,self).__init__(name, dbfolderkey, channelKeys)
455 
456 
457  def getSortedAndCompletedPayloadDict(self, iovpllist, runlist,key):
458  # reduce to data in the run 'runNr' and sort by iov start time
459 
460  pld = {}
461  if not iovpllist or not runlist:
462  return pld
463 
464  startiovindex = 0
465  for run in runlist:
466  pld[run.runNr] = []
467 
468  if startiovindex<-1:
469  continue
470 
471  # find the first iov that overlaps
472  iovindex = startiovindex
473  while True:
474  try:
475  iov = iovpllist[iovindex][0]
476  iovstart = iov.startTime.time
477  iovend = iov.endTime.time
478 
479  if iovend>run.sor:
480  startiovindex = iovindex
481  break
482 
483  if iovstart>run.eor:
484  startiovindex = -1
485  break
486 
487  if iovend<run.sor and iovindex==len(iovpllist)-1:
488  startiovindex = -2
489  break
490 
491  iovindex += 1
492  except IndexError:
493  startiovindex = -1
494 
495  if startiovindex<0:
496  continue
497 
498  # find the last iov that overlaps
499  iovindex = startiovindex
500  while True:
501  iov = iovpllist[iovindex][0]
502  iovstart = iov.startTime.time
503  iovend = iov.endTime.time
504 
505  if iovend>=run.eor or iovindex==len(iovpllist)-1:
506  endiovindex = iovindex
507  break
508 
509  iovindex += 1
510 
511  # now we have the first and last iov that overlap with that run: startiovindex, endiovindex
512  lbindex = 0
513  for iov,pl in iovpllist[startiovindex:endiovindex+1]:
514  iovstart = iov.startTime.time
515  iovend = iov.endTime.time
516  endrun = run.runNr
517 
518  while lbindex<len(run.lbtimes) and run.lbtimes[lbindex][0]<iovstart:
519  lbindex += 1
520  startlb = lbindex+1
521 
522  while lbindex<len(run.lbtimes) and run.lbtimes[lbindex][0]<iovend:
523  lbindex += 1
524  lbindex -= 1
525 
526  # now lbindex points to the last lb that starts within the iov or to one after the last lb
527  if lbindex==len(run.lbtimes)-1:
528  endlb = 0
529  endrun += 1
530  else:
531  endlb = lbindex+2 # +1 for lb-index->lb-number, +1 for closed interval
532 
533 
534  # append info of this IOV
535  lastIOV,lastpl=None,None
536  if len(pld[run.runNr])>0:
537  lastIOV,lastpl = pld[run.runNr][-1]
538  if lastpl==pl:
539  lastIOV.endTime.run = endrun
540  lastIOV.endTime.lb = endlb
541  else:
542  pld[run.runNr] += [(IOVRange(runStart=run.runNr, lbStart=startlb, runEnd=endrun, lbEnd=endlb), pl)] # in this case the end LB is inclusive
543 
544 
545  # for the next run we start looking at:
546  startiovindex = endiovindex
547 
548  return pld
549 
550 
551  def select(self, runlist):
552  runlistNo = [run.runNr for run in runlist]
553  start = time()
554  newrunlist = []
555  f = coolDbConn.GetDBConn(schema=self.schema, db=Selector.condDB()).getFolder(self.folder)
556  sortedChannel = sorted( list( set( self.CoolChannels() ) ) )
557  chansel = None
558  for ch in sortedChannel:
559  if chansel is None:
560  chansel = cool.ChannelSelection(ch,ch,cool.ChannelSelection.sinceBeforeChannel)
561  else:
562  chansel.addChannel(ch)
563 
564  runranges = SmartRangeCalulator(runlist,True)
565  condData = defaultdict(list)
566 
567 
568  # access COOL
569  for rr in runranges:
570  firstrun = runlist[runlistNo.index(rr[0])]
571  lastrun = runlist[runlistNo.index(rr[1])]
572  iovmin=firstrun.sor
573  iovmax=lastrun.eor
574 
575  objs = f.browseObjects( iovmin, iovmax, chansel)
576  while objs.goToNext():
577  obj= objs.currentRef()
578  ch = obj.channelId()
579  for chKey in self.ChannelKeys():
580  (channelNumber, resultKey, payloadKey) = chKey
581  if channelNumber != ch:
582  continue
583  isBlob = (resultKey == 'olc:bcidmask')
584  if isBlob:
585  payloadvalue = obj.payload()[chKey[2]].read()
586  else:
587  payloadvalue = obj.payloadValue(chKey[2])
588 
589  condData[resultKey].append( (IOVRange(obj=obj, timebased=True), payloadvalue) )
590 
591 
592  # for each key sort the data by IOV start time
593  for k in self.ResultKey():
594  condData[k].sort()
595 
596  condDataDict = {}
597  for k in self.ResultKey():
598  condDataDict[k] = self.getSortedAndCompletedPayloadDict(condData[k],runlist,k)
599 
600  for run in runlist:
601 
602  rejectSomething = False
603  for k in self.ResultKey():
604 
605  if run.runNr not in condDataDict[k]:
606  run.addResult(k, "n.a.")
607  continue
608 
609  datavec = condDataDict[k][run.runNr]
610 
611  if not datavec or len(datavec)==0:
612  run.addResult(k, "n.a.")
613  continue
614 
615  if 'n.a.' in datavec:
616  run.showDataIncomplete=True
617 
618  for iov, data in datavec:
619  self.selDataMissing = False
620  if self.ApplySelection(k) and not self.passes(data,k):
621  run.addResult(k, self.prettyValue(data,k), iov, reject=True)
622  rejectSomething = True
623  continue
624 
625  run.addResult(k, self.prettyValue(data,k), iov)
626 
627  if self.selDataMissing:
628  run.selDataIncomplete = True
629 
630  if not (rejectSomething and self.rejectRun(run)):
631  newrunlist += [run.runNr]
632 
633 
634  runlist = [r for r in runlist if r.runNr in newrunlist]
635 
636  duration = time() - start
637 
638  if self.applySelection:
639  print (" ==> %i runs found (%.2f sec)" % (len(runlist),duration))
640  else:
641  print (" ==> Done (%g sec)" % duration)
642 
643  return runlist
644 
645  def rejectRun(self,run):
646  return run.data.isRejected
647 
python.selector.AtlRunQuerySelectorBase.Condition.DoSelectShowRetrieve
def DoSelectShowRetrieve(self)
Definition: AtlRunQuerySelectorBase.py:243
read
IovVectorMap_t read(const Folder &theFolder, const SelectionCriterion &choice, const unsigned int limit=10)
Definition: openCoraCool.cxx:569
python.selector.AtlRunQuerySelectorBase.DataKey
Definition: AtlRunQuerySelectorBase.py:27
python.selector.AtlRunQuerySelectorBase.Condition.setSchemaFolderTag
def setSchemaFolderTag(self, dbfoldertag)
Definition: AtlRunQuerySelectorBase.py:173
python.selector.AtlRunQuerySelectorBase.Selector.setCondDBMC
def setCondDBMC()
Definition: AtlRunQuerySelectorBase.py:128
max
#define max(a, b)
Definition: cfImp.cxx:41
python.selector.AtlRunQuerySelectorBase.Condition._coolpayloadkey
_coolpayloadkey
Definition: AtlRunQuerySelectorBase.py:188
python.selector.AtlRunQuerySelectorBase.RunLBBasedCondition._retrieve
def _retrieve(self, iovmin, iovmax, f, sortedRanges)
Definition: AtlRunQuerySelectorBase.py:269
python.selector.AtlRunQuerySelectorBase.DataKey._seltype
def _seltype(self)
Definition: AtlRunQuerySelectorBase.py:54
python.selector.AtlRunQuerySelectorBase.Condition.ChannelKeys
def ChannelKeys(self)
Definition: AtlRunQuerySelectorBase.py:234
python.selector.AtlRunQuerySelectorBase.Condition
Definition: AtlRunQuerySelectorBase.py:166
python.selector.AtlRunQuerySelectorBase.Selector
Definition: AtlRunQuerySelectorBase.py:123
python.selector.AtlRunQuerySelectorBase.TimeBasedCondition.__init__
def __init__(self, name, dbfolderkey, channelKeys=None)
Definition: AtlRunQuerySelectorBase.py:453
python.selector.AtlRunQuerySelectorBase.DataKey.Header
def Header(self)
Definition: AtlRunQuerySelectorBase.py:109
python.selector.AtlRunQuerySelectorBase.RunLBBasedCondition.readCondData
def readCondData(self, runranges, f, sortedRanges)
Definition: AtlRunQuerySelectorBase.py:350
python.selector.AtlRunQuerySelectorBase.Condition.setChannelKeys
def setChannelKeys(self, channelKeys, ssr=None)
Definition: AtlRunQuerySelectorBase.py:180
python.selector.AtlRunQuerySelectorBase.DataKey.Type
def Type(self)
Definition: AtlRunQuerySelectorBase.py:117
python.selector.AtlRunQuerySelectorBase.Selector.mcenabled
mcenabled
Definition: AtlRunQuerySelectorBase.py:151
python.selector.AtlRunQuerySelectorBase.Selector.name
name
Definition: AtlRunQuerySelectorBase.py:147
python.selector.AtlRunQuerySelectorBase.Condition._coolchannel
_coolchannel
Definition: AtlRunQuerySelectorBase.py:189
python.selector.AtlRunQuerySelectorBase.Selector.applySelection
applySelection
Definition: AtlRunQuerySelectorBase.py:150
python.selector.AtlRunQuerySelectorBase.DataKey._second_internal_key
_second_internal_key
Definition: AtlRunQuerySelectorBase.py:42
python.selector.AtlRunQuerySelectorBase.Condition.setShowOutput
def setShowOutput(self, listofchans=None)
Definition: AtlRunQuerySelectorBase.py:249
python.selector.AtlRunQuerySelectorBase.Selector.ApplySelection
def ApplySelection(self, key)
Definition: AtlRunQuerySelectorBase.py:156
dumpHVPathFromNtuple.append
bool append
Definition: dumpHVPathFromNtuple.py:91
python.selector.AtlRunQuerySelectorBase.Selector.priority
priority
Definition: AtlRunQuerySelectorBase.py:148
python.selector.AtlRunQuerySelectorBase.OOO
OOO
Definition: AtlRunQuerySelectorBase.py:19
python.selector.AtlRunQuerySelectorBase.RunLBBasedCondition.__init__
def __init__(self, name, dbfolderkey, channelKeys=None)
Definition: AtlRunQuerySelectorBase.py:266
python.selector.AtlRunQuerySelectorBase.Condition.ChannelDesc
def ChannelDesc(self)
Definition: AtlRunQuerySelectorBase.py:246
python.selector.AtlRunQuerySelectorBase.Condition._channelKeys
_channelKeys
Definition: AtlRunQuerySelectorBase.py:187
python.selector.AtlRunQuerySelectorBase.Selector.condDB
def condDB(run_number=None)
Definition: AtlRunQuerySelectorBase.py:132
python.selector.AtlRunQuerySelectorBase.DataKey.CoolPayloadKey
def CoolPayloadKey(self)
Definition: AtlRunQuerySelectorBase.py:97
python.selector.AtlRunQuerySelectorBase.TimeBasedCondition.select
def select(self, runlist)
Definition: AtlRunQuerySelectorBase.py:551
python.utils.AtlRunQueryUtils.MergeRanges
def MergeRanges(listOfRanges)
Definition: AtlRunQueryUtils.py:217
python.selector.AtlRunQuerySelectorBase.DataKey._cool_attr
_cool_attr
Definition: AtlRunQuerySelectorBase.py:40
python.selector.AtlRunQuerySelectorBase.DataKey.__hash__
def __hash__(self)
Definition: AtlRunQuerySelectorBase.py:87
python.selector.AtlRunQuerySelectorBase.Selector.isRun2
def isRun2(run_number=None)
Definition: AtlRunQuerySelectorBase.py:143
python.selector.AtlRunQuerySelectorBase.DataKey.__cmp__
def __cmp__(self, other)
Definition: AtlRunQuerySelectorBase.py:76
python.selector.AtlRunQuerySelectorBase.Condition._doSelectShowRetrieve
_doSelectShowRetrieve
Definition: AtlRunQuerySelectorBase.py:193
python.selector.AtlRunQuerySelectorBase.DataKey.__init__
def __init__(self, x, keytype=UNDEFINED, selecttype=SELECT)
Definition: AtlRunQuerySelectorBase.py:37
python.selector.AtlRunQuerySelectorBase.Selector.__init__
def __init__(self, name)
Definition: AtlRunQuerySelectorBase.py:146
python.selector.AtlRunQuerySelectorBase.DataKey.SelectShowRetrieve
def SelectShowRetrieve(self)
Definition: AtlRunQuerySelectorBase.py:113
python.selector.AtlRunQuerySelectorBase.coolgen
def coolgen(coolobjs)
Definition: AtlRunQuerySelectorBase.py:20
python.selector.AtlRunQuerySelectorBase.Condition.CoolChannels
def CoolChannels(self)
Definition: AtlRunQuerySelectorBase.py:237
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
python.selector.AtlRunQuerySelectorBase.DataKey.CoolChannel
def CoolChannel(self)
Definition: AtlRunQuerySelectorBase.py:101
python.selector.AtlRunQuerySelectorBase.DataKey._select_show_retrieve
_select_show_retrieve
Definition: AtlRunQuerySelectorBase.py:51
python.selector.AtlRunQuerySelectorBase.DataKey.pickled
def pickled(self)
Definition: AtlRunQuerySelectorBase.py:90
python.selector.AtlRunQuerySelectorBase.DataKey._type
_type
Definition: AtlRunQuerySelectorBase.py:50
python.selector.AtlRunQuerySelectorBase.Condition.addChannelKey
def addChannelKey(self, channelKey, ssr=None)
Definition: AtlRunQuerySelectorBase.py:206
DerivationFramework::TriggerMatchingUtils::sorted
std::vector< typename T::value_type > sorted(T begin, T end)
Helper function to create a sorted vector from an unsorted one.
inRange
bool inRange(const double *boundaries, const double value, const double tolerance=0.02)
Definition: LArSCIdVsIdTest.cxx:5
CxxUtils::set
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.
Definition: bitmask.h:232
min
#define min(a, b)
Definition: cfImp.cxx:40
python.selector.AtlRunQuerySelectorBase.Condition.__init__
def __init__(self, name, dbfolderkey, channelKeys)
Definition: AtlRunQuerySelectorBase.py:167
python.selector.AtlRunQuerySelectorBase.Condition.tagname
tagname
Definition: AtlRunQuerySelectorBase.py:176
python.selector.AtlRunQuerySelectorBase.DataKey.__eq__
def __eq__(self, other)
Definition: AtlRunQuerySelectorBase.py:66
python.selector.AtlRunQuerySelectorBase.RunLBBasedCondition.rejectRun
def rejectRun(self, run)
Definition: AtlRunQuerySelectorBase.py:448
python.selector.AtlRunQuerySelectorBase.Condition.data_keys
data_keys
Definition: AtlRunQuerySelectorBase.py:181
python.selector.AtlRunQuerySelectorBase.Condition._headerKey
_headerKey
Definition: AtlRunQuerySelectorBase.py:191
python.selector.AtlRunQuerySelectorBase.DataKey._cool_channel
_cool_channel
Definition: AtlRunQuerySelectorBase.py:39
python.selector.AtlRunQuerySelectorBase.Condition.ResultKey
def ResultKey(self)
Definition: AtlRunQuerySelectorBase.py:231
python.selector.AtlRunQuerySelectorBase.Selector.verbose
verbose
Definition: AtlRunQuerySelectorBase.py:149
python.selector.AtlRunQuerySelectorBase.TimeBasedCondition.rejectRun
def rejectRun(self, run)
Definition: AtlRunQuerySelectorBase.py:645
python.selector.AtlRunQuerySelectorBase.DataKey._table_header
_table_header
Definition: AtlRunQuerySelectorBase.py:43
python.selector.AtlRunQuerySelectorBase.RunLBBasedCondition.select
def select(self, runlist)
Definition: AtlRunQuerySelectorBase.py:378
python.selector.AtlRunQuerySelectorBase.Condition.selDataMissing
selDataMissing
Definition: AtlRunQuerySelectorBase.py:169
CaloCondBlobAlgs_fillNoiseFromASCII.hash
dictionary hash
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:109
python.selector.AtlRunQuerySelectorBase.TimeBasedCondition.getSortedAndCompletedPayloadDict
def getSortedAndCompletedPayloadDict(self, iovpllist, runlist, key)
Definition: AtlRunQuerySelectorBase.py:457
python.selector.AtlRunQuerySelectorBase.RunLBBasedCondition.findPayload
def findPayload(self, runNr, iovpllist)
Definition: AtlRunQuerySelectorBase.py:279
python.selector.AtlRunQuerySelectorBase.RunLBBasedCondition.getSortedAndCompletedPayloadDict
def getSortedAndCompletedPayloadDict(self, iovpllist, runlist, key)
Definition: AtlRunQuerySelectorBase.py:288
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
python.selector.AtlRunQuerySelectorBase.DataKey.__repr__
def __repr__(self)
Definition: AtlRunQuerySelectorBase.py:63
python.selector.AtlRunQuerySelectorBase.Selector.valueForStorage
def valueForStorage(self, condData, key)
Definition: AtlRunQuerySelectorBase.py:162
python.selector.AtlRunQuerySelectorBase.Selector.select
def select(self, runlist)
Definition: AtlRunQuerySelectorBase.py:152
python.selector.AtlRunQuerySelectorBase.Selector.prettyValue
def prettyValue(self, value, key)
Definition: AtlRunQuerySelectorBase.py:154
pickleTool.object
object
Definition: pickleTool.py:30
python.selector.AtlRunQuerySelectorBase.Condition.updateShowOrder
def updateShowOrder(self)
Definition: AtlRunQuerySelectorBase.py:257
python.selector.AtlRunQuerySelectorBase.DataKey.ResultKey
def ResultKey(self)
Definition: AtlRunQuerySelectorBase.py:105
python.selector.AtlRunQuerySelectorBase.RunLBBasedCondition
Definition: AtlRunQuerySelectorBase.py:265
python.selector.AtlRunQuerySelectorBase.Condition._getFolder
def _getFolder(self)
Definition: AtlRunQuerySelectorBase.py:198
python.selector.AtlRunQuerySelectorBase.Condition.HeaderKeys
def HeaderKeys(self)
Definition: AtlRunQuerySelectorBase.py:240
python.selector.AtlRunQuerySelectorBase.Condition._channeldesc
_channeldesc
Definition: AtlRunQuerySelectorBase.py:196
python.utils.AtlRunQueryUtils.SmartRangeCalulator
def SmartRangeCalulator(runlist, singleRuns=True)
Definition: AtlRunQueryUtils.py:406
python.selector.AtlRunQuerySelectorBase.DataKey._internal_key
_internal_key
Definition: AtlRunQuerySelectorBase.py:41
python.selector.AtlRunQuerySelectorBase.Selector.runAfterQuery
def runAfterQuery(self, runlist)
Definition: AtlRunQuerySelectorBase.py:158
python.selector.AtlRunQuerySelectorBase.TimeBasedCondition
Definition: AtlRunQuerySelectorBase.py:452
python.selector.AtlRunQuerySelectorBase.Selector.condtag
string condtag
Definition: AtlRunQuerySelectorBase.py:125
python.selector.AtlRunQuerySelectorBase.Condition._resultKey
_resultKey
Definition: AtlRunQuerySelectorBase.py:190