ATLAS Offline Software
Loading...
Searching...
No Matches
python.AtlRunQueryRun.Run Class Reference
Collaboration diagram for python.AtlRunQueryRun.Run:

Public Member Functions

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

Public Attributes

 runNr = runNr
int lhcRun = 0
int sor = 0
int eor = 0
int lastlb = 0
bool selDataIncomplete = False
bool showDataIncomplete = False
list xvecStb = []
bool hasStableBeamsInfo = False
dict result = {}
dict stats = {}
list lbtimes = []
list tooltips = []
 data = RunData(run=self)
float lumiunit = 1.0
str lumiunittxt = 'nb'
str instlumiunittxt = '30'
bool givepeakmuinfo = True

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 = []
dict NemoTasks = {}
bool showrunnr = False
bool showtime = False
bool showduration = False
bool writehtml = False
str bgcolor = "1"
list totevents = [0, 0]
int runnropen = -1
bool showCAFLinks = False
str Datapath = ''
dict Fieldinfo = {}
list GlobalTooltips = []
str BeamspotSource = ''
 runPeriods = RunPeriods()
str TmpBoxContent = ''

Static Protected Attributes

 _SortedShowOrder = None

Detailed Description

Definition at line 316 of file AtlRunQueryRun.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 347 of file AtlRunQueryRun.py.

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

Member Function Documentation

◆ __eq__()

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

Definition at line 915 of file AtlRunQueryRun.py.

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

◆ __lt__()

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

Definition at line 910 of file AtlRunQueryRun.py.

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

◆ __str__()

python.AtlRunQueryRun.Run.__str__ ( self)

Definition at line 900 of file AtlRunQueryRun.py.

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

◆ addGlobalToolTip()

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

Definition at line 344 of file AtlRunQueryRun.py.

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

◆ addResult()

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

Definition at line 741 of file AtlRunQueryRun.py.

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

◆ addToolTip()

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

Definition at line 404 of file AtlRunQueryRun.py.

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

◆ AddToShowOrder()

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

Definition at line 338 of file AtlRunQueryRun.py.

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

◆ astxt()

python.AtlRunQueryRun.Run.astxt ( self)

Definition at line 921 of file AtlRunQueryRun.py.

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

◆ data_current_lb()

python.AtlRunQueryRun.Run.data_current_lb ( self)

Definition at line 393 of file AtlRunQueryRun.py.

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

◆ durationstr()

python.AtlRunQueryRun.Run.durationstr ( self)

Definition at line 849 of file AtlRunQueryRun.py.

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

◆ getStableBeamsVector()

python.AtlRunQueryRun.Run.getStableBeamsVector ( self)

Definition at line 407 of file AtlRunQueryRun.py.

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

◆ header()

python.AtlRunQueryRun.Run.header ( cls)

Definition at line 455 of file AtlRunQueryRun.py.

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

◆ headerkeys()

python.AtlRunQueryRun.Run.headerkeys ( cls)

Definition at line 438 of file AtlRunQueryRun.py.

438 def headerkeys(cls):
439 hk = []
440 if Run.showrunnr:
441 hk += ['Run','Links','#LB']
442 if Run.showtime:
443 hk += ['Start and endtime (%s)' % QC.localStr()]
444 if Run.showduration:
445 hk += ['Duration']
446 for x in cls.SortedShowOrder():
447 x = x.ResultKey
448 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)):
449 continue
450 hk += [x]
451 return hk
452
453

◆ nr_lb()

python.AtlRunQueryRun.Run.nr_lb ( self)

Definition at line 401 of file AtlRunQueryRun.py.

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

◆ NrLBs()

python.AtlRunQueryRun.Run.NrLBs ( self)

Definition at line 397 of file AtlRunQueryRun.py.

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

◆ prettyChain()

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

Definition at line 857 of file AtlRunQueryRun.py.

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

◆ runlinks()

python.AtlRunQueryRun.Run.runlinks ( self)

Definition at line 752 of file AtlRunQueryRun.py.

752 def runlinks(self):
753 s = ''
754 # DS
755 if time.gmtime(self.sor/1.E9).tm_year >= 2010:
756 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)
757 # RS
758 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)
759 # BS
760 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)
761 # AMI
762 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)
763 # DQ
764 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)
765 # ELOG
766 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)
767 # DCS reference, format: http://atlas-dcs.cern.ch/navigation.php?datestring=2009-07-26-10-12
768 tbeg = time.strftime("%Y-%m-%d-%H-%M-%S", time.gmtime(self.sor/1.E9))
769 t = time.gmtime(self.eor/1.E9)
770 tend = "%4i-%02i-%02i-%02i-%02i" % (t[0], t[1], t[2], t[3], t[4])
771 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)
772 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)
773 #s += ' <a href="https://atlas-dcs.cern.ch/navigation.php?date2=2008-09-29-19-01-42">DCS:SoR</font></a>/' % (tbeg, self.runNr)
774 #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)
775
776 # OKS
777 if self.data['oks']:
778 if self.lhcRun<3:
779 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,) )
780 else:
781 (hash, release) = self.data["oks"][0].value
782 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'
783 # lumi summary
784 # typical address: https://atlas.web.cern.ch/Atlas/GROUPS/DATAPREPARATION/RunSummary/run142308_summary.html
785 # OLD: fname = 'https://atlas.web.cern.ch/Atlas/GROUPS/DATAPREPARATION/RunSummary/run%i_summary.html' % (self.runNr)
786 fname = 'http://atlas.web.cern.ch/Atlas/GROUPS/DATAPREPARATION/DataSummary/runsum.py?run=%i\n' % (self.runNr)
787 fwget = urllib.request.urlopen(fname)
788
789 wincontent = ''
790 for line in fwget:
791 if '</head>' in str(line) and '<base href' not in wincontent:
792 wincontent += '<base href="http://atlas.web.cern.ch/Atlas/GROUPS/DATAPREPARATION/DataSummary/2010/"></base>'
793 wincontent += str(line)
794 wincontent = wincontent.replace('href="css/atlas-datasummary.css"', 'href="http://atlas.web.cern.ch/Atlas/GROUPS/DATAPREPARATION/DataSummary/css/atlas-datasummary.css"')
795
796 # remove temporarily second plot with integration
797 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),'')
798 wincontent = wincontent.replace('"','&quot;')
799 wincontent = wincontent.replace('./RunSummary/figs','https://atlas.web.cern.ch/Atlas/GROUPS/DATAPREPARATION/RunSummary/figs')
800 wincontent = wincontent.replace('<a href','<a target=&quot;_blank&quot; href')
801 wincontent = wincontent.replace('width: 200px','width: 350px')
802 wincontent = wincontent.replace('width: 250px','width: 350px')
803
804
805 openwincmd = 'javascript:openLumiWindow('
806 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
807 openwincmd += wincontent
808 openwincmd += '</body></html>'
809 openwincmd += "')"
810
811 return s
812
813

◆ runNrS()

python.AtlRunQueryRun.Run.runNrS ( self)

Definition at line 389 of file AtlRunQueryRun.py.

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

◆ SortedShowOrder()

python.AtlRunQueryRun.Run.SortedShowOrder ( cls)

Definition at line 419 of file AtlRunQueryRun.py.

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

◆ splitTriggerChains()

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

Definition at line 878 of file AtlRunQueryRun.py.

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

◆ timestr()

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 814 of file AtlRunQueryRun.py.

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

Member Data Documentation

◆ _SortedShowOrder

python.AtlRunQueryRun.Run._SortedShowOrder = None
staticprotected

Definition at line 318 of file AtlRunQueryRun.py.

◆ BeamspotSource

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

Definition at line 333 of file AtlRunQueryRun.py.

◆ bgcolor

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

Definition at line 326 of file AtlRunQueryRun.py.

◆ data

python.AtlRunQueryRun.Run.data = RunData(run=self)

Definition at line 364 of file AtlRunQueryRun.py.

◆ Datapath

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

Definition at line 330 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 319 of file AtlRunQueryRun.py.

◆ eor

int python.AtlRunQueryRun.Run.eor = 0

Definition at line 351 of file AtlRunQueryRun.py.

◆ Fieldinfo

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

Definition at line 331 of file AtlRunQueryRun.py.

◆ givepeakmuinfo

bool python.AtlRunQueryRun.Run.givepeakmuinfo = True

Definition at line 369 of file AtlRunQueryRun.py.

◆ GlobalTooltips

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

Definition at line 332 of file AtlRunQueryRun.py.

◆ hasStableBeamsInfo

python.AtlRunQueryRun.Run.hasStableBeamsInfo = False

Definition at line 356 of file AtlRunQueryRun.py.

◆ instlumiunittxt

str python.AtlRunQueryRun.Run.instlumiunittxt = '30'

Definition at line 368 of file AtlRunQueryRun.py.

◆ lastlb

int python.AtlRunQueryRun.Run.lastlb = 0

Definition at line 352 of file AtlRunQueryRun.py.

◆ lbtimes

list python.AtlRunQueryRun.Run.lbtimes = []

Definition at line 362 of file AtlRunQueryRun.py.

◆ lhcRun

int python.AtlRunQueryRun.Run.lhcRun = 0

Definition at line 349 of file AtlRunQueryRun.py.

◆ lumiunit

float python.AtlRunQueryRun.Run.lumiunit = 1.0

Definition at line 366 of file AtlRunQueryRun.py.

◆ lumiunittxt

str python.AtlRunQueryRun.Run.lumiunittxt = 'nb'

Definition at line 367 of file AtlRunQueryRun.py.

◆ NemoTasks

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

Definition at line 321 of file AtlRunQueryRun.py.

◆ PromptCalibRuns

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

Definition at line 320 of file AtlRunQueryRun.py.

◆ result

dict python.AtlRunQueryRun.Run.result = {}

Definition at line 358 of file AtlRunQueryRun.py.

◆ runNr

python.AtlRunQueryRun.Run.runNr = runNr

Definition at line 348 of file AtlRunQueryRun.py.

◆ runnropen

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

Definition at line 328 of file AtlRunQueryRun.py.

◆ runPeriods

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

Definition at line 334 of file AtlRunQueryRun.py.

◆ selDataIncomplete

bool python.AtlRunQueryRun.Run.selDataIncomplete = False

Definition at line 353 of file AtlRunQueryRun.py.

◆ showCAFLinks

bool python.AtlRunQueryRun.Run.showCAFLinks = False
static

Definition at line 329 of file AtlRunQueryRun.py.

◆ showDataIncomplete

bool python.AtlRunQueryRun.Run.showDataIncomplete = False

Definition at line 354 of file AtlRunQueryRun.py.

◆ showduration

bool python.AtlRunQueryRun.Run.showduration = False
static

Definition at line 324 of file AtlRunQueryRun.py.

◆ ShowOrder

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

Definition at line 317 of file AtlRunQueryRun.py.

◆ showrunnr

bool python.AtlRunQueryRun.Run.showrunnr = False
static

Definition at line 322 of file AtlRunQueryRun.py.

◆ showtime

bool python.AtlRunQueryRun.Run.showtime = False
static

Definition at line 323 of file AtlRunQueryRun.py.

◆ sor

int python.AtlRunQueryRun.Run.sor = 0

Definition at line 350 of file AtlRunQueryRun.py.

◆ stats

dict python.AtlRunQueryRun.Run.stats = {}

Definition at line 360 of file AtlRunQueryRun.py.

◆ TmpBoxContent

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

Definition at line 335 of file AtlRunQueryRun.py.

◆ tooltips

list python.AtlRunQueryRun.Run.tooltips = []

Definition at line 363 of file AtlRunQueryRun.py.

◆ totevents

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

Definition at line 327 of file AtlRunQueryRun.py.

◆ writehtml

bool python.AtlRunQueryRun.Run.writehtml = False
static

Definition at line 325 of file AtlRunQueryRun.py.

◆ xvecStb

python.AtlRunQueryRun.Run.xvecStb = []

Definition at line 355 of file AtlRunQueryRun.py.


The documentation for this class was generated from the following file: