ATLAS Offline Software
Public Member Functions | Public Attributes | Static Public Attributes | Static Private Attributes | List of all members
python.AtlRunQueryRun.Run Class Reference
Collaboration diagram for python.AtlRunQueryRun.Run:

Public Member Functions

def AddToShowOrder (cls, key)
 
def addGlobalToolTip (cls, var, content)
 
def __init__ (self, runNr=0)
 
def runNrS (self)
 
def data_current_lb (self)
 
def NrLBs (self)
 
def nr_lb (self)
 
def addToolTip (self, var, content)
 
def getStableBeamsVector (self)
 
def SortedShowOrder (cls)
 
def headerkeys (cls)
 
def header (cls)
 
def addResult (self, resDictKey, value, iov=None, reject=False, valueForStorage=None)
 
def runlinks (self)
 
def timestr (self, format='html', closed=True)
 
def durationstr (self)
 
def prettyChain (cls, tr, ps)
 
def splitTriggerChains (self, chainlist)
 
def __str__ (self)
 
def __lt__ (self, other)
 
def __eq__ (self, other)
 
def astxt (self)
 

Public Attributes

 runNr
 
 lhcRun
 
 sor
 
 eor
 
 lastlb
 
 selDataIncomplete
 
 showDataIncomplete
 
 xvecStb
 
 hasStableBeamsInfo
 
 result
 
 stats
 
 lbtimes
 
 tooltips
 
 data
 
 lumiunit
 
 lumiunittxt
 
 instlumiunittxt
 
 givepeakmuinfo
 

Static Public Attributes

list ShowOrder = []
 
 DisplayOrder = map(re.compile,['#Events','Ready','lhc:|olc:', 'TriggerMenu|SMK|Release|L1 PSK|HLT PSK|BGS|TriggerRates', 'bs:', 'STR:', 'DQ|SHIFTOFL:|LBSUMM:', 'lar:', 'Detector','.*'])
 
list PromptCalibRuns = []
 
dictionary NemoTasks = {}
 
bool showrunnr = False
 
bool showtime = False
 
bool showduration = False
 
bool writehtml = False
 
string bgcolor = "1"
 
list totevents = [0, 0]
 
int runnropen = -1
 
bool showCAFLinks = False
 
string Datapath = ''
 
dictionary Fieldinfo = {}
 
list GlobalTooltips = []
 
string BeamspotSource = ''
 
 runPeriods = RunPeriods()
 
string TmpBoxContent = ''
 

Static Private Attributes

 _SortedShowOrder = None
 

Detailed Description

Definition at line 317 of file AtlRunQueryRun.py.

Constructor & Destructor Documentation

◆ __init__()

def python.AtlRunQueryRun.Run.__init__ (   self,
  runNr = 0 
)

Definition at line 348 of file AtlRunQueryRun.py.

348  def __init__(self, runNr=0):
349  self.runNr = runNr
350  self.lhcRun = 0
351  self.sor = 0
352  self.eor = 0
353  self.lastlb = 0
354  self.selDataIncomplete = False
355  self.showDataIncomplete = False
356  self.xvecStb = []
357  self.hasStableBeamsInfo = False
358  # the results of the query index by query key
359  self.result = {}
360  # the run statistics index by query key (filled in selector.runAfterQuery)
361  self.stats = {}
362  # the start times of all lumiblocks [start_LB1, start_LB2, start_LB3, ..., start_LBN]
363  self.lbtimes = []
364  self.tooltips = []
365  self.data = RunData(run=self)
366  # luminosity unil
367  self.lumiunit = 1.0 # default unit
368  self.lumiunittxt = 'nb'
369  self.instlumiunittxt = '30'
370  self.givepeakmuinfo = True
371  if self.runNr > 378000:
372  # last Run-2 run with SMK 2787 and release AthenaP1,21.1.56 is 376153
373  # first Run-3 with SMK 59 and release 22.0.13 is 379453
374  self.lhcRun = 3
375  elif self.runNr > 249000:
376  # last Run-1 run with SMK 1670 and release AtlasP1HLT,19.3.0.4 is 248373
377  # first Run-2 run with SMK 2002 and release AtlasP1HLT,20.1.0.1 is 249785
378  self.lhcRun = 2
379  else:
380  self.lhcRun = 1
381 
382  if self.runNr > 168206 and self.runNr <= 170482:
383  self.lumiunit = 1.0e6 # unit is mbarn for heavy ions
384  self.lumiunittxt = 'mb'
385  self.instlumiunittxt = '24'
386  self.givepeakmuinfo = False
387 
388 

Member Function Documentation

◆ __eq__()

def python.AtlRunQueryRun.Run.__eq__ (   self,
  other 
)

Definition at line 916 of file AtlRunQueryRun.py.

916  def __eq__(self,other):
917  if isinstance(other,Run):
918  return self.runNr == other.runNr
919  return self.runNr == other
920 
921 

◆ __lt__()

def python.AtlRunQueryRun.Run.__lt__ (   self,
  other 
)

Definition at line 911 of file AtlRunQueryRun.py.

911  def __lt__(self,other):
912  if isinstance(other,Run):
913  return self.runNr < other.runNr
914  return self.runNr < other
915 

◆ __str__()

def python.AtlRunQueryRun.Run.__str__ (   self)

Definition at line 901 of file AtlRunQueryRun.py.

901  def __str__(self):
902  if Run.writehtml:
903  s = ashtml(self)
904  return s
905  else:
906  s = self.astxt()
907  for lbr in self.data:
908  s+= "\n" + lbr.astxt()
909  return s
910 

◆ addGlobalToolTip()

def python.AtlRunQueryRun.Run.addGlobalToolTip (   cls,
  var,
  content 
)

Definition at line 345 of file AtlRunQueryRun.py.

345  def addGlobalToolTip(cls, var, content):
346  cls.GlobalTooltips += ['dw_Tooltip.content_vars["%s"] = {content: \'%s\'};' % (var, content.replace("'","&#39;"))]
347 

◆ addResult()

def python.AtlRunQueryRun.Run.addResult (   self,
  resDictKey,
  value,
  iov = None,
  reject = False,
  valueForStorage = None 
)

Definition at line 742 of file AtlRunQueryRun.py.

742  def addResult(self, resDictKey, value, iov=None, reject=False, valueForStorage=None):
743  if resDictKey=='DQ' and value=='n.a.':
744  return
745  if resDictKey not in self.result:
746  self.result[resDictKey] = value
747  if iov:
748  if iov.startTime.lb>self.lastlb:
749  return # sometimes there are IOVs completely outside the run e.g. run 165821 DQ SHIFTOFL
750  iov.endTime = min(iov.endTime, IOVTime(self.runNr,self.lastlb+1) )
751  self.data.addResult(iov, resDictKey, value, reject, valueForStorage=valueForStorage)
752 

◆ addToolTip()

def python.AtlRunQueryRun.Run.addToolTip (   self,
  var,
  content 
)

Definition at line 405 of file AtlRunQueryRun.py.

405  def addToolTip(self, var, content):
406  self.tooltips += ['dw_Tooltip.content_vars["%s\"] = {content: \'%s\'};' % (var, content.replace("'","&#39;"))]
407 

◆ AddToShowOrder()

def python.AtlRunQueryRun.Run.AddToShowOrder (   cls,
  key 
)

Definition at line 339 of file AtlRunQueryRun.py.

339  def AddToShowOrder(cls,key):
340  #print ("ADDING TO SHOWORDER %r" % key)
341  if key not in cls.ShowOrder:
342  cls.ShowOrder += [ key ]
343 

◆ astxt()

def python.AtlRunQueryRun.Run.astxt (   self)

Definition at line 922 of file AtlRunQueryRun.py.

922  def astxt(self):
923  s = ""
924  if Run.showrunnr:
925  s += "run %*s %*s " % (_fW['Run']-4,self.runNrS, _fW['NLB'], self.NrLBs)
926  s += " "
927 
928  if Run.showtime:
929  s += "%*s " % (_fW['Time'],self.timestr('txt'))
930 
931  if Run.showduration:
932  dt = time.gmtime((self.eor-self.sor)/1.E9)[2:6]
933  if dt[0]>1:
934  s += "%id %ih %im %is " % ((dt[0]-1,) + dt[1:])
935  else:
936  s += "%2ih %2im %2is " % dt[1:]
937 
938  for k in Run.SortedShowOrder():
939  w = 10
940  if k in _fW:
941  w = _fW[k]
942  v = self.result[k.ResultKey]
943  ostr=v
944  if k == "#Events":
945  ostr = addKommaToNumber(v)
946  elif k.Type == DataKey.STREAM:
947  w=max(len(k.Header)-k.Header.find('_'),_fW['Stream'])
948  if isinstance(ostr,tuple):
949  ostr = ostr[0]
950  elif k=="TriggerMenu":
951  pv = [Run.prettyChain(tr,pslist) for (tr,pslist) in v.items() if tr.forshow]
952  ostr = ", ".join(pv)
953  elif k=="TriggerRates":
954  ostr = "NOT YET"
955  elif k=="olc:bcidmask":
956  ostr = "NOT YET"
957 
958  s += "%*s " % (w,ostr)
959 
960  return s
961 
962 
963 

◆ data_current_lb()

def python.AtlRunQueryRun.Run.data_current_lb (   self)

Definition at line 394 of file AtlRunQueryRun.py.

394  def data_current_lb(self):
395  return self.data.data_current_lb
396 

◆ durationstr()

def python.AtlRunQueryRun.Run.durationstr (   self)

Definition at line 850 of file AtlRunQueryRun.py.

850  def durationstr(self):
851  dt = time.gmtime((self.eor-self.sor)/1.E9)[2:6]
852  if dt[0]>1:
853  return "%id %ih %im %is" % ((dt[0]-1,) + dt[1:])
854  else:
855  return "%ih %im %is" % dt[1:]
856 

◆ getStableBeamsVector()

def python.AtlRunQueryRun.Run.getStableBeamsVector (   self)

Definition at line 408 of file AtlRunQueryRun.py.

408  def getStableBeamsVector(self):
409  if len(self.xvecStb)==0 and 'lhc:stablebeams' in Run.ShowOrder and 'lhc:stablebeams' in self.data:
410  entries = self.data['lhc:stablebeams']
411  for entry in entries:
412  if entry.startlb == 0:
413  continue
414  if 'true' in entry.value.lower():
415  self.xvecStb += range(entry.startlb,entry.endlb)
416  self.hasStableBeamsInfo = len(self.xvecStb)>0
417  return self.hasStableBeamsInfo, self.xvecStb
418 

◆ header()

def python.AtlRunQueryRun.Run.header (   cls)

Definition at line 456 of file AtlRunQueryRun.py.

456  def header(cls):
457  if Run.writehtml:
458  # flags...
459  ofllumiFlag = False
460  s = '<tr>\n'
461  if Run.showrunnr:
462  s += ' <th>Run</th><th>Links</th><th>#LB</th>\n'
463  if Run.showtime:
464  s += ' <th>Start and endtime (%s)</th>\n' % QC.localStr()
465  if Run.showduration:
466  s += ' <th>Duration</th>\n'
467  for ik, data_key in enumerate(Run.SortedShowOrder()):
468  k = data_key.ResultKey
469  if k[0:4] == 'STR:':
470  s += ' <th><font size="-2">%s_<BR>%s</font></th>' % tuple(k[4:].split('_',1))
471  elif k[0:8] == "Detector":
472  s += ' <th>%s</th>' % k
473  elif "SolCurrent" in k:
474  s += ' <th>Solenoid<br>current&nbsp;(A)</th>'
475  elif "TorCurrent" in k:
476  s += ' <th>Toroid<br>current&nbsp;(A)</th>'
477  elif 'DQ' == k:
478  s += ' '
479  matching_names = dict(Run.Fieldinfo['DQ']['DefMatch'])
480  first = True
481  for channelname in Run.Fieldinfo['DQ']['DefChannels']:
482  tip = "defect_match_%s" % channelname
483  info = "%s # %s" % (channelname if channelname!="" else "*",data_key._second_internal_key if data_key._second_internal_key!="" else "HEAD")
484  s += '<th style="align:center; white-space:nowrap; padding-right: 10px; padding-left: 10px; ">'
485  s += 'Data Quality<br><span class="showTip %s tooltip" style="font-weight:normal; font-size:80%%">(%s)</span>' % (tip, info)
486  if first:
487  s += '<div style="font-size: xx-small; cursor: pointer;" onclick="toggle_dq(this)">[show tolerable]</div>'
488  first = False
489  s += '</th>'
490 
491  allDefects = sorted(matching_names[channelname])
492  n = 4*[len(allDefects)//4]
493  for x in range(len(allDefects) % 4):
494  n[x]+=1
495 
496  # put the list of all defects into 4 columns
497  cx = 0
498  columns = []
499  for x in n:
500  columns.append( allDefects[slice(cx,cx+x)] )
501  cx+=x
502 
503  for x in columns[1:]: # padding at the end of each column except the first to make zip include the last line
504  x += ['']
505 
506  columnsTransposed = zip(*columns) # transpose
507 
508  tts = ''
509  for z in columnsTransposed:
510  tts += '<tr>%s</tr>' % ''.join(["<td>%s</td>"% x for x in z])
511  content = '<table style="width:500px; font-size:80%%;">%s</table>' % tts
512  Run.addGlobalToolTip(tip,content)
513 
514  elif isDQ(k):
515  foldertag,flag = k.split(':')
516 
517  if flag in Run.Fieldinfo:
518  tipname = 'dqvfdesc_%s' % flag
519  commentbox = '%s' % (Run.Fieldinfo[flag])
520  Run.addGlobalToolTip(tipname, commentbox)
521  s += '<th class="showTip %s tooltip" style="cursor:pointer">' % tipname
522  else:
523  s += ' <th>'
524 
525  s += '<font size="-1">%s</font><BR><font style="font-weight:normal;font-size:70%%">' % flag
526  if '#' in foldertag:
527  s += '(%s #<br>%s)' % tuple(foldertag.split('#',1))
528  else:
529  s += '(%s)' % (foldertag)
530  s += '</font></th>'
531 
532  elif k == "L1 PSK":
533  continue
534  elif k == "HLT PSK":
535  s += ' <th>Prescale keys</th>'
536  elif k == "Release":
537  s += ' <th>HLT Release</th>'
538  elif k == "Datasets":
539  s += ' <th>Tier-0 Datasets</th>'
540  elif k == '#Events (incl. calib.)':
541  s += ' <th>#Events<br><font size="-2">(incl.&nbsp;calib.)</font></th>'
542  elif k == '#Events (streamed)' :
543  s += ' <th>#Events<br><font size="-2">(streamed)</font></th>'
544  elif 'lar:' in k:
545  if 'runtype' in k:
546  s += ' <th><font size="-2">Run type</font></th>'
547  elif 'nsamples' in k:
548  s += ' <th><font size="-2">#Samples</font></th>'
549  elif 'firstsample' in k:
550  s += ' <th><font size="-2">1st sample</font></th>'
551  elif 'format' in k:
552  s += ' <th><font size="-2">Format</font></th>'
553  else:
554  print ('ERROR: unknown LAr option "%s"' % k)
555  sys.exit(1)
556  elif 'lhc:' in k:
557  if 'fillnumber' in k:
558  s += ' <th> LHC Fill</th>'
559  elif 'stablebeams' in k:
560  s += ' <th>Stable beams</th>'
561  if 'lhc:beammode' in Run.ShowOrder:
562  s += ' <th>Beam mode</th>'
563  if 'lhc:beamenergy' in Run.ShowOrder:
564  s += ' <th>Beam&nbsp;energy and&nbsp;intensities</th>'
565 
566  elif 'beamenergy' in k:
567  continue # included in 'fillbeams' summary
568  elif 'nbunch1' in k:
569  s += ' <th>#Bunches B1 <br><font size="-2"><b>(NOT YET RELIABLE)</b></font></th>'
570  elif 'nbunch2' in k:
571  s += ' <th>#Bunches B2 <br><font size="-2"><b>(NOT YET RELIABLE)</b></font></th>'
572  elif 'nbunchcoll' in k:
573  s += ' <th>#Bunches<br>colliding <br><font size="-2"><b>(NOT YET RELIABLE)</b></font></th>'
574  elif 'beamtype1' in k:
575  s += ' <th>Beam type&nbsp;B1</th>'
576  elif 'beamtype2' in k:
577  s += ' <th>Beam type&nbsp;B2</th>'
578  elif 'machinemode' in k:
579  s += ' <th>LHC mode</th>'
580  elif 'beammode' in k:
581  continue
582  else:
583  print ('ERROR: unknown LHC option "%s"' % k)
584  sys.exit(1)
585  elif 'ofllumi:' in k:
586  if not ofllumiFlag:
587  s += ' <th>Offline Luminosity<br><font style="font-weight:normal">(%s)</font></font></th>' % k.split(':')[-1]
588  ofllumiFlag = True
589  elif 'bs:' in k:
590  kt = k.replace('bs:','')
591  if 'bs:Pos' in k or 'bs:Sig' in k:
592  s += ' <th><font size="-2">%s<br><font style="font-weight:normal">(mm)</font></font></th>' % kt
593  elif 'bs:Tilt' in k:
594  s += ' <th><font size="-2">%s<br><font style="font-weight:normal">(rad)</font></font></th>' % kt
595  else:
596  s += ' <th><font size="-2">%s</font></th>' % kt
597  elif 'BPM' in k:
598  s += ' <th>Beam&nbsp;Position Monitors&nbsp;(BPM)</th>'
599  elif 'olc:' in k:
600  if 'olc:lumi' in k:
601  tp1, tp2, chan = k.split(':')
602  try:
603  chan = float(chan)
604  except ValueError:
605  chan = -1
606  if chan in OLCAlgorithms:
607  chanstr = OLCAlgorithms[chan]
608  else:
609  chanstr = 'UNKNOWN'
610  s += ' <th>Online&nbsp;del.&nbsp;Luminosity&nbsp;<font size="-2"><br><font style="font-weight:normal">[%s]</font></font></th>' % chanstr
611  elif 'beam1bunches' in k:
612  continue # not used anymore
613  elif 'beam2bunches' in k:
614  continue # not used anymore
615  elif 'collbunches' in k:
616  continue # not used anymore
617  elif 'bcidmask' in k:
618  s += ' <th>Bunch&nbsp;structure</th>'
619  elif 'beam1intensity' in k:
620  continue # included in 'fillbeams' summary
621  elif 'beam2intensity' in k:
622  continue # included in 'fillbeams' summary
623  else:
624  s += ' <th>%s</th>' % k
625 
626  elif 'BGS Key' in k:
627  s += ' <th>Bunch group key</th>'
628 
629  else:
630  s += ' <th>%s</th>' % k
631  s += '\n'
632  s += '</tr>'
633 
634  # generate a second header line
635  secondheader = ''
636  patterns = [ ('lar:', 'LAr configuration'),
637  ('lhc:|olc:', 'LHC and online luminosity information' if any(['olc:' in x for x in Run.headerkeys()]) else 'LHC information' ),
638  ('bs:', 'Beam spot parameters (%s)' % Run.BeamspotSource),
639  ('STR:', 'Data stream statistics'),
640  ('TriggerMenu|SMK|Release|L1 PSK|HLT PSK|BGS|TriggerRates', 'Trigger information'),
641  ('SHIFTOFL:', 'Data quality (SHIFTOFL)'),
642  ('LBSUMM:', 'Data quality (LBSUMM)')
643  ]
644 
645  order = []
646  for (p,hdesc) in patterns:
647  matchedpositions = [idx for (idx,head) in enumerate(Run.headerkeys()) if re.match(p,head)]
648  #print ("pattern",p,matchedpositions)
649  if matchedpositions:
650  order += [(min(matchedpositions),max(matchedpositions),hdesc)]
651  order.sort()
652 
653  mergeempty = True
654  if len(order)>0:
655  current=0
656  for th in order:
657  if mergeempty:
658  if th[0]>current:
659  secondheader += '<th colspan="%s"></th>' % (th[0]-current)
660  else:
661  for x in range(th[0]-current):
662  secondheader += '<th></th>'
663  secondheader += '<th colspan="%s">%s</th>' % (th[1]-th[0]+1,th[2])
664  current=th[1]+1
665  if len(Run.headerkeys())>current:
666  if mergeempty:
667  secondheader += '<th colspan="%s"></th>' % (len(Run.headerkeys())-current)
668  else:
669  for x in range(len(Run.headerkeys())-current):
670  secondheader += '<th></th>'
671  secondheader = "<tr>%s</tr>" % secondheader
672 
673 
674  s = '<thead>' + secondheader + s + '</thead>\n'
675 
676  # Global (run independent) tooltips
677 
678  # OLC
679  if any([k for k in Run.ShowOrder if "olc:lumi" in k.ResultKey]):
680  boxcontent = '<font color="#AA0000">Click&nbsp;to&nbsp;enlarge&nbsp;figure and&nbsp;to&nbsp;obtain&nbsp;online&nbsp;integrated&nbsp;luminosity&nbsp;versus&nbsp;LB</font>'
681  Run.addGlobalToolTip("OLCLumi", boxcontent)
682 
683  # OFLLumi
684  if any([k for k in Run.ShowOrder if "ofllumi" in k.ResultKey]):
685  boxcontent = '<font color="#AA0000">Click to obtain offline integrated luminosity versus LB</font>'
686  Run.addGlobalToolTip("OFLLumi", boxcontent)
687 
688  # OFLBS - beamspot
689  if any([k for k in Run.ShowOrder if "bs:" in k.ResultKey]):
690  boxcontent = '<font color="#AA0000">Click to obtain %s beamspot versus LB</font>' % (Run.BeamspotSource.split()[0])
691  Run.addGlobalToolTip("OFLBS", boxcontent)
692 
693  # BPM info
694  if any([k for k in Run.ShowOrder if "BPM" == k.ResultKey]):
695  boxcontent = '<font color="#AA0000">Click to enlarge figure</font>'
696  Run.addGlobalToolTip("BPM", boxcontent)
697 
698  # LHC Summary
699  if any([k for k in Run.ShowOrder if "lhc:fillnumber" in k.ResultKey]):
700  boxcontent = '<font color="#AA0000">Click to enlarge figure</font>'
701  Run.addGlobalToolTip("LHCSummary", boxcontent)
702 
703  else:
704  s = ''
705  for lll in [1,2]:
706  if Run.showrunnr:
707  if lll==0:
708  s += '%-*s %*s ' % (_fW['Run'],'Run',_fW['NLB'],'#LB')
709  if lll==1:
710  s += '%-*s %*s ' % (_fW['Run'],' ',_fW['NLB'],' ')
711  s+=" " # accept/reject flag
712  if Run.showtime:
713  hstr = 'Start and endtime (%s)' % QC.localStr()
714  if lll==0:
715  s += '%*s ' %(_fW['Time'],hstr)
716  if lll==1:
717  s += '%*s ' %(_fW['Time'],' ')
718  if Run.showduration:
719  if lll==0:
720  s += '%*s ' % (10,'Duration')
721  if lll==1:
722  s += '%*s ' % (10,' ')
723  for k in Run.SortedShowOrder():
724  if k.Type == DataKey.STREAM:
725  w = max(len(k.Header)-k.Header.find('_'),_fW['Stream'])
726  if lll==0:
727  s += '%*s ' % (w,k.Header[4:k.Header.find('_')])
728  if lll==1:
729  s += '%*s ' % (w,k.Header[k.Header.find('_')+1:])
730  else:
731  w = 10
732  if k in _fW:
733  w = _fW[k.ResultKey]
734  if lll==0:
735  s += '%*s ' % (w,k.Header)
736  if lll==1:
737  s += '%*s ' % (w,' ')
738  if lll==0:
739  s+='\n'
740  return s
741 

◆ headerkeys()

def python.AtlRunQueryRun.Run.headerkeys (   cls)

Definition at line 439 of file AtlRunQueryRun.py.

439  def headerkeys(cls):
440  hk = []
441  if Run.showrunnr:
442  hk += ['Run','Links','#LB']
443  if Run.showtime:
444  hk += ['Start and endtime (%s)' % QC.localStr()]
445  if Run.showduration:
446  hk += ['Duration']
447  for x in cls.SortedShowOrder():
448  x = x.ResultKey
449  if 'L1 PSK' in x or ('olc:' in x and ('beam1bunches' in x or 'beam2bunches' in x or 'collbunches' in x or 'beam1intensity' in x or 'beam2intensity' in x)):
450  continue
451  hk += [x]
452  return hk
453 
454 

◆ nr_lb()

def python.AtlRunQueryRun.Run.nr_lb (   self)

Definition at line 402 of file AtlRunQueryRun.py.

402  def nr_lb(self):
403  return self.lastlb
404 

◆ NrLBs()

def python.AtlRunQueryRun.Run.NrLBs (   self)

Definition at line 398 of file AtlRunQueryRun.py.

398  def NrLBs(self):
399  return "%i" % self.lastlb
400 

◆ prettyChain()

def python.AtlRunQueryRun.Run.prettyChain (   cls,
  tr,
  ps 
)

Definition at line 858 of file AtlRunQueryRun.py.

858  def prettyChain(cls,tr,ps):
859  i = len(ps)-1
860  while i>0:
861  if ps[i]==ps[i-1]:
862  ps[i]=' '
863  elif ps[i]<0:
864  ps[i]='x'
865  else:
866  ps[i]=str(ps[i])
867  i-=1
868  if ps[0] is None:
869  ps[0]='n.a.'
870  elif ps[0]<0:
871  ps[0]='x'
872  else:
873  ps[0]=str(ps[0])
874 
875  pss = '-'.join(ps)
876  s = "%s (%s)" % (tr.name,pss)
877  return s
878 

◆ runlinks()

def python.AtlRunQueryRun.Run.runlinks (   self)

Definition at line 753 of file AtlRunQueryRun.py.

753  def runlinks(self):
754  s = ''
755  # DS
756  if time.gmtime(self.sor/1.E9).tm_year >= 2010:
757  s += ' <a href="http://atlas.web.cern.ch/Atlas/GROUPS/DATAPREPARATION/DataSummary/%i/run.py?run=%i" target="_blank" title="Data summary information for run %i"><font size="-3">DS</font></a>,&nbsp;\n' % (time.gmtime(self.sor/1.E9).tm_year, self.runNr, self.runNr)
758  # RS
759  s += ' <a href="http://atlas-service-db-runlist.web.cern.ch/atlas-service-db-runlist/php/runDetails.php?run=%i" target="_blank" title="Run summary information for run %i"><font size="-3">RS</font></a>,&nbsp;\n' % (self.runNr, self.runNr)
760  # BS
761  s += ' <a href="https://atlas-beamspot.cern.ch/webapp/jobs/?r=%i" target="_blank" title="Beam spot fit information for run %i"><font size="-3">BS</font></a>,&nbsp;\n' % (self.runNr, self.runNr)
762  # AMI
763  s += ' <a href="https://ami.in2p3.fr/AMI/servlet/net.hep.atlas.Database.Bookkeeping.AMI.Servlet.Command?Converter=/AMIXmlToAMIProdHtml.xsl&Command=FormBrowseDatasetPerRun+-runNumber=%i" target="_blank" title="AMI reference for run %i"><font size="-3">AMI</font></a>,&nbsp;\n' % (self.runNr, self.runNr)
764  # DQ
765  s += ' <a href="https://atlasdqm.web.cern.ch/atlasdqm/DQBrowser/makeMatrix.php?selection=All&run=%i&runup=&dbinstance=COMP200_SHIFTOFL&tag=HEAD" target="_blank" title="Browse detailed data quality entries for run %i (uses SHIFTOFL folder in COMP200 conditions database)"><font size="-3">DQ</font></a>,<br>\n' % (self.runNr, self.runNr)
766  # ELOG
767  s += ' <a href="https://atlasop.cern.ch/elog/ATLAS/ATLAS/?mode=full&reverse=0&reverse=1&npp=20&ma=1&ya=2008&last=3064&subtext=%i&sall=0" target="_blank" title="Search for ELOG entries on run %i"><font size="-3">ELOG</font></a>,&nbsp;\n' % (self.runNr, self.runNr)
768  # DCS reference, format: http://atlas-dcs.cern.ch/navigation.php?datestring=2009-07-26-10-12
769  tbeg = time.strftime("%Y-%m-%d-%H-%M-%S", time.gmtime(self.sor/1.E9))
770  t = time.gmtime(self.eor/1.E9)
771  tend = "%4i-%02i-%02i-%02i-%02i" % (t[0], t[1], t[2], t[3], t[4])
772  s += ' <a href="http://atlas-dcs.cern.ch/navigation.php?date2=%s" target="_blank" title="DCS status at begin of run %i"><font size="-3">DCS:SoR</font></a>/' % (tbeg, self.runNr)
773  s += '<a href="http://atlas-dcs.cern.ch/navigation.php?date2=%s" target="_blank" title="DCS status at end of run %i"><font size="-3">EoR</font></a>,&nbsp;\n ' % (tend, self.runNr)
774  #s += ' <a href="https://atlas-dcs.cern.ch/navigation.php?date2=2008-09-29-19-01-42">DCS:SoR</font></a>/' % (tbeg, self.runNr)
775  #s += '<a href="https://atlas-dcs.cern.ch/navigation.php?date2=2008-09-30-08-17"><font size="-3">EoR</font></a>,&nbsp;\n ' % (tend, self.runNr)
776 
777  # OKS
778  if self.data['oks']:
779  if self.lhcRun<3:
780  s += ' <a href="http://cern.ch/atlas-project-tdaq-cc/cgi/getdata.sh?tdaq-05-05-00&oracle://atlas_oks/r&atlas_oks_archive&%i&%i&ATLAS" target="_blank" title="Download online configuration for run %i"><font size="-3">OKS</font></a>\n' % ( self.data['oks'][0].value + (self.runNr,) )
781  else:
782  (hash, release) = self.data["oks"][0].value
783  s+= f' <a href="https://gitlab.cern.ch/atlas-tdaq-oks/p1/{release}/-/tree/{hash[5:]}" target="_blank" title="Browse online configuration for run {self.runNr}"><font size="-3">OKS</font></a>\n'
784  # lumi summary
785  # typical address: https://atlas.web.cern.ch/Atlas/GROUPS/DATAPREPARATION/RunSummary/run142308_summary.html
786  # OLD: fname = 'https://atlas.web.cern.ch/Atlas/GROUPS/DATAPREPARATION/RunSummary/run%i_summary.html' % (self.runNr)
787  fname = 'http://atlas.web.cern.ch/Atlas/GROUPS/DATAPREPARATION/DataSummary/runsum.py?run=%i\n' % (self.runNr)
788  fwget = urllib.request.urlopen(fname)
789 
790  wincontent = ''
791  for line in fwget:
792  if '</head>' in str(line) and '<base href' not in wincontent:
793  wincontent += '<base href="http://atlas.web.cern.ch/Atlas/GROUPS/DATAPREPARATION/DataSummary/2010/"></base>'
794  wincontent += str(line)
795  wincontent = wincontent.replace('href="css/atlas-datasummary.css"', 'href="http://atlas.web.cern.ch/Atlas/GROUPS/DATAPREPARATION/DataSummary/css/atlas-datasummary.css"')
796 
797  # remove temporarily second plot with integration
798  wincontent = wincontent.replace( '<td>\n<a href="rundata/run%i/run%i_ilumr.png"><img src="rundata/run%i/run%i_ilumr.png" alt="InstLumi" style="width: 200px; "></a></td>' % (self.runNr,self.runNr,self.runNr,self.runNr),'')
799  wincontent = wincontent.replace('"','&quot;')
800  wincontent = wincontent.replace('./RunSummary/figs','https://atlas.web.cern.ch/Atlas/GROUPS/DATAPREPARATION/RunSummary/figs')
801  wincontent = wincontent.replace('<a href','<a target=&quot;_blank&quot; href')
802  wincontent = wincontent.replace('width: 200px','width: 350px')
803  wincontent = wincontent.replace('width: 250px','width: 350px')
804 
805 
806  openwincmd = 'javascript:openLumiWindow('
807  openwincmd += "'Print','<!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;><html xmlns:&quot;my&quot;><head><title>Luminosity information for run %i</title></head><body style=&quot;background-color:#ffffff&quot;>" % self.runNr
808  openwincmd += wincontent
809  openwincmd += '</body></html>'
810  openwincmd += "')"
811 
812  return s
813 
814 

◆ runNrS()

def python.AtlRunQueryRun.Run.runNrS (   self)

Definition at line 390 of file AtlRunQueryRun.py.

390  def runNrS(self):
391  return "%i" % self.runNr
392 

◆ SortedShowOrder()

def python.AtlRunQueryRun.Run.SortedShowOrder (   cls)

Definition at line 420 of file AtlRunQueryRun.py.

420  def SortedShowOrder(cls):
421  if Run._SortedShowOrder is not None:
422  if len(Run._SortedShowOrder) != len(Run.ShowOrder):
423  raise RuntimeError ("Sorting not up-to-date %i %i" % (len(Run._SortedShowOrder), len(Run.ShowOrder) ))
424  return Run._SortedShowOrder
425  hk = []
426  for order in Run.DisplayOrder:
427  for x in Run.ShowOrder:
428  if not order.match(x.ResultKey):
429  continue
430  if x in hk:
431  continue
432  hk += [x]
433  Run._SortedShowOrder = hk
434  if len(Run._SortedShowOrder) != len(Run.ShowOrder):
435  raise RuntimeError ("Sorting not up-to-date after creation %i %i" % (len(Run._SortedShowOrder), len(Run.ShowOrder) ))
436  return Run._SortedShowOrder
437 

◆ splitTriggerChains()

def python.AtlRunQueryRun.Run.splitTriggerChains (   self,
  chainlist 
)

Definition at line 879 of file AtlRunQueryRun.py.

879  def splitTriggerChains(self, chainlist):
880  res = { 'L1': [], 'L2': [], 'EF': [] }
881  for tr,pslist in chainlist.items():
882  if not tr.forshow:
883  continue
884  k = tr.name[0:2]
885  res[k] += [Run.prettyChain(tr,pslist)]
886  res['L1'].sort()
887  res['L2'].sort()
888  res['EF'].sort()
889  l1chains = '<br> '.join(res['L1'])
890  l2chains = '<br> '.join(res['L2'])
891  efchains = '<br> '.join(res['EF'])
892  ret = ()
893  if l1chains:
894  ret += (l1chains.replace('.0',''), )
895  if l2chains:
896  ret += (l2chains.replace('.0',''), )
897  if efchains:
898  ret += (efchains.replace('.0',''), )
899  return ret
900 

◆ timestr()

def python.AtlRunQueryRun.Run.timestr (   self,
  format = 'html',
  closed = True 
)
sor and eor is always in UTC, so sor=0 means the run started 1.1.1970 at 00:00:00

Definition at line 815 of file AtlRunQueryRun.py.

815  def timestr(self,format='html',closed=True):
816  """ sor and eor is always in UTC, so sor=0 means the run started 1.1.1970 at 00:00:00"""
817  if QC.localtime:
818  begin = time.localtime(self.sor/1.E9)
819  end = time.localtime(self.eor/1.E9)
820  else:
821  begin = time.gmtime(self.sor/1.E9)
822  end = time.gmtime(self.eor/1.E9)
823 
824  # begin string
825  beginstr = time.strftime("%a %b %d %Y %X",begin)
826 
827  # end format
828  endformat = "%X"
829  if end[0]>begin[0]:
830  endformat = "%a %b %d, %Y %X"
831  elif end[1]>begin[1] or end[2]>begin[2]:
832  endformat = "%a %b %d, %X"
833 
834  # end string
835  if closed:
836  endstr = time.strftime(endformat,end)
837  else:
838  endstr = '<font color=#BB0000>ongoing</font>' if format=='html' else 'ongoing'
839 
840  # output
841  if format=='html':
842  return '%s&nbsp;&minus;&nbsp;%s' % (beginstr,endstr)
843  elif format=='seconds': #mainly for dictionary
844  return '%12.3f, %12.3f' % (self.sor/1.E9, self.eor/1.E9)
845  elif format=='secondsNum': #mainly for dictionary
846  return self.sor/1.E9, self.eor/1.E9
847  else:
848  return '%s - %s' % (beginstr,endstr)
849 

Member Data Documentation

◆ _SortedShowOrder

python.AtlRunQueryRun.Run._SortedShowOrder = None
staticprivate

Definition at line 319 of file AtlRunQueryRun.py.

◆ BeamspotSource

string python.AtlRunQueryRun.Run.BeamspotSource = ''
static

Definition at line 334 of file AtlRunQueryRun.py.

◆ bgcolor

string python.AtlRunQueryRun.Run.bgcolor = "1"
static

Definition at line 327 of file AtlRunQueryRun.py.

◆ data

python.AtlRunQueryRun.Run.data

Definition at line 365 of file AtlRunQueryRun.py.

◆ Datapath

string python.AtlRunQueryRun.Run.Datapath = ''
static

Definition at line 331 of file AtlRunQueryRun.py.

◆ DisplayOrder

python.AtlRunQueryRun.Run.DisplayOrder = map(re.compile,['#Events','Ready','lhc:|olc:', 'TriggerMenu|SMK|Release|L1 PSK|HLT PSK|BGS|TriggerRates', 'bs:', 'STR:', 'DQ|SHIFTOFL:|LBSUMM:', 'lar:', 'Detector','.*'])
static

Definition at line 320 of file AtlRunQueryRun.py.

◆ eor

python.AtlRunQueryRun.Run.eor

Definition at line 352 of file AtlRunQueryRun.py.

◆ Fieldinfo

dictionary python.AtlRunQueryRun.Run.Fieldinfo = {}
static

Definition at line 332 of file AtlRunQueryRun.py.

◆ givepeakmuinfo

python.AtlRunQueryRun.Run.givepeakmuinfo

Definition at line 370 of file AtlRunQueryRun.py.

◆ GlobalTooltips

list python.AtlRunQueryRun.Run.GlobalTooltips = []
static

Definition at line 333 of file AtlRunQueryRun.py.

◆ hasStableBeamsInfo

python.AtlRunQueryRun.Run.hasStableBeamsInfo

Definition at line 357 of file AtlRunQueryRun.py.

◆ instlumiunittxt

python.AtlRunQueryRun.Run.instlumiunittxt

Definition at line 369 of file AtlRunQueryRun.py.

◆ lastlb

python.AtlRunQueryRun.Run.lastlb

Definition at line 353 of file AtlRunQueryRun.py.

◆ lbtimes

python.AtlRunQueryRun.Run.lbtimes

Definition at line 363 of file AtlRunQueryRun.py.

◆ lhcRun

python.AtlRunQueryRun.Run.lhcRun

Definition at line 350 of file AtlRunQueryRun.py.

◆ lumiunit

python.AtlRunQueryRun.Run.lumiunit

Definition at line 367 of file AtlRunQueryRun.py.

◆ lumiunittxt

python.AtlRunQueryRun.Run.lumiunittxt

Definition at line 368 of file AtlRunQueryRun.py.

◆ NemoTasks

dictionary python.AtlRunQueryRun.Run.NemoTasks = {}
static

Definition at line 322 of file AtlRunQueryRun.py.

◆ PromptCalibRuns

list python.AtlRunQueryRun.Run.PromptCalibRuns = []
static

Definition at line 321 of file AtlRunQueryRun.py.

◆ result

python.AtlRunQueryRun.Run.result

Definition at line 359 of file AtlRunQueryRun.py.

◆ runNr

python.AtlRunQueryRun.Run.runNr

Definition at line 349 of file AtlRunQueryRun.py.

◆ runnropen

int python.AtlRunQueryRun.Run.runnropen = -1
static

Definition at line 329 of file AtlRunQueryRun.py.

◆ runPeriods

python.AtlRunQueryRun.Run.runPeriods = RunPeriods()
static

Definition at line 335 of file AtlRunQueryRun.py.

◆ selDataIncomplete

python.AtlRunQueryRun.Run.selDataIncomplete

Definition at line 354 of file AtlRunQueryRun.py.

◆ showCAFLinks

bool python.AtlRunQueryRun.Run.showCAFLinks = False
static

Definition at line 330 of file AtlRunQueryRun.py.

◆ showDataIncomplete

python.AtlRunQueryRun.Run.showDataIncomplete

Definition at line 355 of file AtlRunQueryRun.py.

◆ showduration

bool python.AtlRunQueryRun.Run.showduration = False
static

Definition at line 325 of file AtlRunQueryRun.py.

◆ ShowOrder

list python.AtlRunQueryRun.Run.ShowOrder = []
static

Definition at line 318 of file AtlRunQueryRun.py.

◆ showrunnr

bool python.AtlRunQueryRun.Run.showrunnr = False
static

Definition at line 323 of file AtlRunQueryRun.py.

◆ showtime

bool python.AtlRunQueryRun.Run.showtime = False
static

Definition at line 324 of file AtlRunQueryRun.py.

◆ sor

python.AtlRunQueryRun.Run.sor

Definition at line 351 of file AtlRunQueryRun.py.

◆ stats

python.AtlRunQueryRun.Run.stats

Definition at line 361 of file AtlRunQueryRun.py.

◆ TmpBoxContent

string python.AtlRunQueryRun.Run.TmpBoxContent = ''
static

Definition at line 336 of file AtlRunQueryRun.py.

◆ tooltips

python.AtlRunQueryRun.Run.tooltips

Definition at line 364 of file AtlRunQueryRun.py.

◆ totevents

list python.AtlRunQueryRun.Run.totevents = [0, 0]
static

Definition at line 328 of file AtlRunQueryRun.py.

◆ writehtml

bool python.AtlRunQueryRun.Run.writehtml = False
static

Definition at line 326 of file AtlRunQueryRun.py.

◆ xvecStb

python.AtlRunQueryRun.Run.xvecStb

Definition at line 356 of file AtlRunQueryRun.py.


The documentation for this class was generated from the following file:
max
#define max(a, b)
Definition: cfImp.cxx:41
python.utils.AtlRunQueryUtils.addKommaToNumber
def addKommaToNumber(no)
Definition: AtlRunQueryUtils.py:190
python.utils.AtlRunQueryLookup.isDQ
def isDQ(name)
Definition: AtlRunQueryLookup.py:136
IOVTime
Basic time unit for IOVSvc. Hold time as a combination of run and event numbers.
Definition: IOVTime.h:33
perfmonmt-refit.slice
slice
Definition: perfmonmt-refit.py:52
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
grepfile.durationstr
def durationstr(sec)
Definition: grepfile.py:16
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.
min
#define min(a, b)
Definition: cfImp.cxx:40
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.processes.powheg.ZZ.ZZ.__init__
def __init__(self, base_directory, **kwargs)
Constructor: all process options are set here.
Definition: ZZ.py:18
python.AtlRunQueryRun.ashtml
def ashtml(run)
Definition: AtlRunQueryRun.py:964
str
Definition: BTagTrackIpAccessor.cxx:11
makeTOC.header
header
Definition: makeTOC.py:28
readCCLHist.float
float
Definition: readCCLHist.py:83
Trk::split
@ split
Definition: LayerMaterialProperties.h:38