ATLAS Offline Software
Public Member Functions | List of all members
python.html.AtlRunQueryDQSummary.DQSummary Class Reference
Collaboration diagram for python.html.AtlRunQueryDQSummary.DQSummary:

Public Member Functions

def makeHTML (cls, dic, dicsum, doPickle=True, doDQSummary=True, doDQPlots=True, dqsumGRL="PHYS_StandardGRL_All_Good_25ns", dbbTag=("HEAD", "HEAD"))
 

Detailed Description

Definition at line 537 of file AtlRunQueryDQSummary.py.

Member Function Documentation

◆ makeHTML()

def python.html.AtlRunQueryDQSummary.DQSummary.makeHTML (   cls,
  dic,
  dicsum,
  doPickle = True,
  doDQSummary = True,
  doDQPlots = True,
  dqsumGRL = "PHYS_StandardGRL_All_Good_25ns",
  dbbTag = ("HEAD", "HEAD") 
)
method returns a string (unicode is fine) of html code, with out tag <div>...</div> 

Definition at line 540 of file AtlRunQueryDQSummary.py.

540  def makeHTML(cls, dic, dicsum, doPickle=True, doDQSummary=True, doDQPlots=True, dqsumGRL="PHYS_StandardGRL_All_Good_25ns", dbbTag=("HEAD", "HEAD")):
541  """ method returns a string (unicode is fine) of html code, with out tag <div>...</div> """
542 
543 
547 
548 
549  warning = ''
550 
551 
552  with timer("DQSummary"):
553 
554 
555  global usenb
556  usenb = False
557  global livetrigger
558  livetrigger ='L1_EM30'
559  for r,run in enumerate(dic[DataKey('Run')]):
560  ptag = dic[DataKey('Project tag')][r][0].value
561  if 'data13' in ptag:
562  usenb = True
563  livetrigger = 'L1_EM5'
564  elif 'data16_hip5TeV' in ptag or 'data16_hip8TeV' in ptag:
565  usenb = True
566  livetrigger = 'L1_EM12'
567  elif 'data15' in ptag or 'data16' in ptag or 'data17' in ptag or 'data18' in ptag:
568  usenb = False
569  livetrigger = 'L1_EM12'
570 
571 
573  if len(dbbTag) != 2:
574  warning += '<font color="red"> WARNING (DQSummary): The defect database tag "%s" must be a 2-element sequence. Will use "HEAD" tag instead!</font><br>' %(dbbTag)
575  dbbTag = ("HEAD", "HEAD")
576  #Create dbb dummy with HEAD tag
577  ddb = DefectsDB()
578  #check if defect tag is defined in defect database
579  if dbbTag[0] not in ['HEAD'] + ddb.defects_tags:
580  warning += '<font color="red"> WARNING (DQSummary): The defined defect tag "%s" is not defined in defect database. Will use "HEAD" tag instead!</font><br>' %(dbbTag[0])
581  dbbTag = ("HEAD", dbbTag[1])
582  #check if defect and logic tag is defined in defect database
583  if dbbTag[1] not in ['HEAD'] + ddb.logics_tags:
584  warning += '<font color="red"> WARNING (DQSummary): The defined logic tag "%s" is not defined in defect database. Will use "HEAD" tag instead!</font><br>' %(dbbTag[1])
585  dbbTag = (dbbTag[0], "HEAD")
586  #Now set tags
587  ddb = DefectsDB(tag=(dbbTag[0], dbbTag[1]))
588  #Check if virtual defect is defined in logic
589  if dqsumGRL in ddb.virtual_defect_logics.keys():
590  defects_primary_grl = ddb.resolve_primary_defects(ddb._resolve_evaluation_order([dqsumGRL]))
591  else:
592  warning += '<font color="red"> WARNING (DQSummary): The defined virtual defect or GRL "%s" is not defined in logic. Will use no GRL for calculation!</font><br>' %(dqsumGRL)
593  dqsumGRL = 'no'
594 
595  #Check if cosmic run
596  cosmics = False
597  if 'Cosmics' in dqsumGRL:
598  cosmics = True
599 
600  global unit
601  unit = 'pb^{-1}'
602  if usenb:
603  unit ='nb^{-1}'
604  if cosmics:
605  unit = '%'
606 
607 
608  dicsum[DataKey('TotalLumi')] = [0.,0.]
609 
610 
611  dicsum[DataKey('TotalNotReady')] = 0.
612  dicsum[DataKey('TotalBusy')] = 0.
613 
614 
615  detectors = ['ALFA','LCD','ZDC','BCM','PIXEL','SCT','TRT','LAR','TILE',
616  'MS_CSC','MS_RPC','MS_TGC','MS_MDT','MBTS','TRIG','GLOBAL']
617  detectors_color = {'ALFA':kYellow-9,'LCD':kYellow-7,'ZDC':kYellow-4,
618  'BCM':kOrange+1,'PIXEL':kOrange-3,'SCT':kOrange+7,'TRT':kRed-3,
619  'LAR':kRed+2,'TILE':kPink-7,
620  'MS_CSC':kBlue+4,'MS_RPC':kBlue-2,'MS_MDT':kAzure+3,'MS_TGC':kBlue-9,'MBTS':kBlue-6,
621  'TRIG':kGreen-3,'GLOBAL':kGreen+3,'_TOTAL':TColor.GetColor("#585858")}
622  detectors_lumiloss = {}
623  detectors_affectedLBs = {}
624 
625  for d in detectors:
626  detectors_lumiloss[d]={}
627  detectors_affectedLBs[d]={}
628 
629 
630  detectors_lumiloss['_TOTAL']={}
631  detectors_affectedLBs['_TOTAL']={}
632 
633 
634  performances = ['LUMI','ID','CALO','TAU','EGAMMA','JET','MET','MCP','BTAG']
635  performances_color = {'LUMI':kYellow-9,'ID':kOrange+7,'CALO':kRed+2,'TAU':kBlue+2,
636  'EGAMMA':kGreen-3,'JET':kAzure+3,'MET':kGreen-6,'MCP':kBlue-3,
637  'BTAG':kPink,'_TOTAL':TColor.GetColor("#585858")}
638  performances_lumiloss = {}
639  performances_affectedLBs = {}
640 
641  for p in performances:
642  performances_lumiloss[p]={}
643  performances_affectedLBs[p]={}
644 
645 
646  performances_lumiloss['_TOTAL']={}
647  performances_affectedLBs['_TOTAL']={}
648 
649 
650  columns = []
651  global_systems = []
652  columns = ['Run Info','ES1','BLK']
653  global_systems = ['Calo','Tracking','Muon','Trigger & Lumi']
654  columns += global_systems
655 
656 
657  with timer('Create summary results table'):
658 
659  summarytable = '<div><table id="resulttable" class="resulttable" style="margin-left: 13px; margin-right: 13px;" >'
660 
661  summarytable += '<tr>'
662  summarytable += '<th colspan="1"></th>' # run info column
663 
664  #summarytable += '<th colspan="2">Tier0 Reco Status</th>'
665  summarytable += '<th colspan="2">Missing Sign-Off</th>'
666 
667  summarytable += '<th colspan="%i">Defects in ATLAS Ready<br>'%len(global_systems)
668  summarytable += '<div style="font-size: xx-small; cursor: pointer;" onclick="toggle_dq(this)">[show tolerable]</div></th>'
669  summarytable += '</tr>'
670 
671 
672  summarytable += '<tr>'
673  #for item in columns: summarytable += '<th>%s</th>'%item.split(":")[0]
674  for item in columns:
675  summarytable += '<th>%s</th>'%item
676  summarytable += '</tr>'
677 
678  totalNumberOfReadyLB = 0
679 
680  tot_nlb = 0
681  #determine total number of lbs in case of cosmics
682  if cosmics:
683  for r,run in enumerate(dic[DataKey('Run')]):
684  tot_nlb += dic[DataKey('#LB')][r][0]
685 
686  runsWithoutReadyForPhysics = []
687  runsWithoutOfflineLumiInfo = []
688 
689 
690  for r,run in enumerate(dic[DataKey('Run')]):
691 
692 
693  global readylb
694  #ignore ATLAS not ready for Cosmics
695  nlb = dic[DataKey('#LB')][r][0]
696 
697  if cosmics:
698  readylb = range(1,nlb+1)
699  else:
700  readylb = GetLBReady(dic,r)
701 
702  totalNumberOfReadyLB += len(readylb)
703 
704 
705  if len(readylb) == 0:
706  runsWithoutReadyForPhysics += [ str(run) ]
707  continue
708 
709 
711  if cosmics:
712  lumiperlb = dict(zip(readylb, [100./tot_nlb] * nlb))
713  livefrac = dict(zip(readylb, [1] * nlb))
714  else:
715  lumiperlb = GetLBLumi(dic,r)
716  livefrac = GetLBLiveFraction(dic,r)
717 
718  if len(lumiperlb) == 0:
719  runsWithoutOfflineLumiInfo += [ str(run) ]
720  continue
721 
722 
724  for lbl in lumiperlb:
725  # IF statement used when len(lumiperlb)!= len(livefrac)
726  if lbl not in readylb:
727  continue
728  if lbl not in livefrac:
729  pass # in run 3 we don't have trigger rates yet, as they are no longer in COOL
730  # print ("--> Warning: live fraction not available for LB %i. Setting live fraction to 1." % lbl)
731  else:
732  lumiperlb[lbl]*=livefrac[lbl]
733 
734 
735 
736  content = {}
737  for i,item in enumerate(columns):
738  content[item]=''
739 
740 
741  dp = '?'
742  ptag = dic[DataKey('Project tag')][r][0].value
743  year = '20'+ptag.split('_')[0][4:]
744  DP = ARQ_COMA.get_periods_for_run(run)
745  if len(DP)>0:
746  dp=DP[0]
747  content['Run Info'] = '<b>%s</b>&nbsp;<font style="font-size:10px;">data period <b>%s</b></font><br>'%(str(run),dp)
748 
749 
750  tobeignored = ['ALFA','ZDC','LCD']
751  import re
752  if re.match('data1[3-9]', ptag[0:6]):
753  tobeignored = []
754 
755 
756  target='target="blank"'
757  somelinks = '<font style="font-size:10px;color:#0000FF">'
758  somelinks += '<a href="https://atlas-tagservices.cern.ch/tagservices/RunBrowser/runBrowserReport/runBrowserReport.php?runs=%s&pn=%s&fnt=%s" %s>COMA</a>'%(run,dp,ptag,target)
759  somelinks += ', <a href="https://atlasdqm.web.cern.ch/atlasdqm/DQBrowser/makeMatrix.php?selection=All&run=%s&runup=&dbinstance=CONDBR2_DCS&tag=DEFAULT" %s>DCS</a>'%(run,target)
760  somelinks += ', <a href="https://atlas.web.cern.ch/Atlas/GROUPS/DATAPREPARATION/DataSummary/%s/run.py?run=%s" %s>DS</a>'%(year,run,target)
761  somelinks += ', <a href="https://atlasdqm.cern.ch/defectentry/?run=%s" %s>defects</a>'%(run,target)
762  somelinks += '<br><a href="https://atlasdqm.cern.ch/dqsignoff/%s/" %s>DQlogbook</a>'%(run,target)
763  somelinks += ', <a href="https://atlasdqm.cern.ch/webdisplay/tier0?lowrun=%s&highrun=%s&show_all=on" %s>DQWebDisplay</a>'%(run,run,target)
764  somelinks += '</font><br>'
765 
766  content['Run Info'] += somelinks
767 
768 
769  rundate = dic[DataKey('Start and endtime')][r].split(",")
770  tstart = time.strftime("%a, %d %b %Y %H:%M:%S",time.localtime(float(rundate[0])))
771  tend = time.strftime("%a, %d %b %Y %H:%M:%S",time.localtime(float(rundate[1])))
772  content['Run Info'] += '<font style="font-size:10px;">'
773  content['Run Info'] += '<br>Start:&nbsp;<font style="color:#4C7D7E;">%s</font>'%tstart
774  content['Run Info'] += '<br>End:&nbsp;<font style="color:#4C7D7E;">%s</font>'%tend
775  content['Run Info'] += '</font>'
776 
777  #nevents = str(dic[DataKey('#Events')][r][0].value)
778  #content['Run Info'] += 'Recorded events: '+nevents+'<br>'
779  #content['Run Info'] += 'Number of LBs : '+dic[DataKey('#LB')][r][0]+'<br>'
780  #content['Run Info'] += 'LHC Fill : %s<br>'%(dic[DataKey('lhc:fillnumber')][r][0].value)+'<br>'
781 
782 
783  lhctable = '<br><font style="font-size:10px;">'
784  lhctable += '<table><tr><td>'
785  lhctable += '<b>Stable&nbsp;Beam</b><br>%s'%'<br>'.join([ '%s-%s:&nbsp<font style="color:#4C7D7E">%s</font>'%(b.startlb,b.endlb,b.value) for b in dic[DataKey('lhc:stablebeams')][r]])
786  lhctable += '</td><td>'
787  lhctable += '<b>ATLAS&nbsp;Ready</b><br>%s'% '<br>'.join([ '%s-%s:&nbsp<font style="color:#4C7D7E">%s</font>'%(b.startlb,b.endlb,b.value) for b in dic[DataKey('Ready for physics')][r]])
788  lhctable += '</td></tr></table>'
789  lhctable += '</font>'
790  content['Run Info'] += lhctable
791 
792 
793  lumitot = ComputeRunLumi(dic,r,lumiperlb)
794  dicsum[DataKey('TotalLumi')][0]+= lumitot
795  content['Run Info'] += '<font style="font-size:10px;">'
796  content['Run Info'] += 'Ready Recorded: <b>%.2f</b> %s'%(lumitot,unit)
797  content['Run Info'] += '</font><br>'
798 
799 
800  defects = dic[DataKey('DQ')][r]
801 
802  defects_primary = [d for d in defects if d.value.primary]
803 
804 
806  for d in detectors:
807  detectors_lumiloss[d][run]= 0.
808  detectors_affectedLBs[d][run]=[]
809  for p in performances:
810  performances_lumiloss[p][run]=0.
811  performances_affectedLBs[p][run]=[]
812 
813  # Total per run
814  detectors_lumiloss['_TOTAL'][run]= 0.
815  detectors_affectedLBs['_TOTAL'][run]=[]
816  performances_lumiloss['_TOTAL'][run]= 0.
817  performances_affectedLBs['_TOTAL'][run]=[]
818 
819  # And the big sums
820  total_affectedLBs = []
821  GlobalNotReady = []
822  GlobalBusy = []
823 
824 
825  ListOfIntolerableDefects = {}
826  ListOfTolerableDefects = {}
827  ListOfIgnoredDefects = {}
828 
829 
830  for item in defects_primary:
831  defect = item.value.defect
832  comment = item.value.comment
833  user = item.value.user
834  startlb = item.startlb
835  endlb = item.endlb
836  tolerable = item.value.tolerable
837  system = MapToSystem(defect)
838  grl_ignored = False
839 
840  #Make it relative to GRL
841  if not dqsumGRL == 'no' and not tolerable:
842  if defect not in defects_primary_grl:
843  grl_ignored = True
844 
845 
846  if 'GLOBAL_NOTREADY' in defect:
847  GlobalNotReady += [ lb for lb in range(startlb,endlb)]
848 
849  if 'GLOBAL_BUSY' in defect:
850  GlobalBusy += [ lb for lb in range(startlb,endlb) if lb in readylb]
851 
852 
853 
854 
855  if 'UNCHECKED_FINAL' in defect:
856  continue
857 
858 
859  if 'BULK_UNCHECKED' in defect:
860  short = defect.split('_UNCHECKED')[0]
861  content['BLK']+='<font style="font-size:8px;font-weight:bold;">%s</font><br>'%short
862  continue
863 
864  if 'UNCHECKED' in defect:
865  short = defect.split('_UNCHECKED')[0]
866  content['ES1']+='<font style="font-size:8px;font-weight:bold;">%s</font><br>'%short
867  continue
868 
869 
870  if system =='':
871  print ('run %s: this defect is fishy %s '%(run,defect))
872  continue
873 
874 
875  word = defect.split('_')
876  cpdet = word[0]
877  if word[0]=='MS':
878  cpdet += "_"+word[1] # MS systems
879  if cpdet not in detectors and cpdet not in performances:
880  print ('This system is not included: %s (%s)'%(cpdet,defect))
881  continue
882 
883 
884  if not tolerable:
885  RangeDefect = [ lb for lb in range(startlb,endlb) if lb in readylb ]
886  if len(RangeDefect)>0:
887  if not grl_ignored:
888  if defect not in ListOfIntolerableDefects:
889  ListOfIntolerableDefects[defect]= [[],'']
890  ListOfIntolerableDefects[defect][0] = RangeDefect
891  ListOfIntolerableDefects[defect][1] = user+':'+comment
892  else:
893  ListOfIntolerableDefects[defect][0]+= RangeDefect
894  if comment not in ListOfIntolerableDefects[defect][1]:
895  ListOfIntolerableDefects[defect][1]+= ' '+user+':'+comment
896  # This is used to compute lumilosses
897  # Here, we do not include systems "to be ignored"
898  if cpdet in tobeignored:
899  continue
900  # Store list of affected LBs per detector/cp group
901  # we can have a double counting of LBs if defects overlap - fixed later
902  if cpdet in detectors:
903  detectors_affectedLBs[cpdet][run]+=RangeDefect
904  if cpdet in performances:
905  performances_affectedLBs[cpdet][run]+=RangeDefect
906  total_affectedLBs += RangeDefect
907  #treat differently if ignored by GRL although intolerable
908  elif grl_ignored:
909  if defect not in ListOfIgnoredDefects:
910  ListOfIgnoredDefects[defect]= [[],'']
911  ListOfIgnoredDefects[defect][0]= RangeDefect
912  ListOfIgnoredDefects[defect][1]= '[%s]:%s '%(user,comment)
913  else:
914  ListOfIgnoredDefects[defect][0]+= RangeDefect
915  if comment not in ListOfIgnoredDefects[defect][1]:
916  ListOfIgnoredDefects[defect][1] += '[%s]:%s '%(user,comment)
917 
918  else:
919  RangeDefect = [ lb for lb in range(startlb,endlb) if lb in readylb]
920  if len(RangeDefect)>0:
921  if defect not in ListOfTolerableDefects:
922  ListOfTolerableDefects[defect]= [[],'']
923  ListOfTolerableDefects[defect][0]= RangeDefect
924  ListOfTolerableDefects[defect][1]= '[%s]:%s '%(user,comment)
925  else:
926  ListOfTolerableDefects[defect][0]+= RangeDefect
927  if comment not in ListOfTolerableDefects[defect][1]:
928  ListOfTolerableDefects[defect][1] += '[%s]:%s '%(user,comment)
929 
930 
931 
932  for item in global_systems:
933  content[item]='<table class="dqdefects">'
934 
935  for item in ListOfIntolerableDefects:
936  system = MapToSystem(item)
937  if system not in global_systems:
938  continue
939  lbs = listify(ListOfIntolerableDefects[item][0])
940  tip = ListOfIntolerableDefects[item][1]
941  tipkey = "dqcomment_int_%s_%s"%(item,run)
942  Run.addGlobalToolTip(tipkey,tip)
943  content[system]+='<tr class="showTip %s" >'%(tipkey)
944  content[system]+='<td class="intolerable">%s</td>'%(item)
945  content[system]+='<td class="lb">%s</td>'%(lbs)
946  content[system]+='</tr>'
947 
948  for item in ListOfIgnoredDefects:
949  system = MapToSystem(item)
950  if system not in global_systems:
951  continue
952  lbs = listify(ListOfIgnoredDefects[item][0])
953  tip = ListOfIgnoredDefects[item][1]
954  tipkey = "dqcomment_ign_%s_%s"%(item,run)
955  Run.addGlobalToolTip(tipkey,tip)
956  content[system]+='<tr class="showTip %s" >'%(tipkey)
957  content[system]+='<td class="ignored">%s</td>'%(item)
958  content[system]+='<td class="lb">%s</td>'%(lbs)
959  content[system]+='</tr>'
960 
961  for item in ListOfTolerableDefects:
962  system = MapToSystem(item)
963  if system not in global_systems:
964  continue
965  lbs = listify(ListOfTolerableDefects[item][0])
966  tip = ListOfTolerableDefects[item][1]
967  tipkey = "dqcomment_tol_%s_%s"%(item,run)
968  Run.addGlobalToolTip(tipkey,tip)
969  content[system]+='<tr class="showTip %s tolerable" style="visibility:collapse;">'%(tipkey)
970  content[system]+='<td>%s</td>'%(item)
971  content[system]+='<td class="lb">%s</td>'%(lbs)
972  content[system]+='</tr>'
973 
974 
975  for item in global_systems:
976  content[item]+='</table><br>'
977 
978 
979  thumbsize = 70
980  imgsize = 600
981  for gsys in global_systems:
982  tol = {}
983  int = {}
984  ign = {}
985  for defect in ListOfTolerableDefects:
986  # remove systems to be ignored from the plots
987  word = defect.split('_')
988  cpdet = word[0]
989  if word[0]=='MS':
990  cpdet += "_"+word[1] # MS systems
991  if cpdet in tobeignored:
992  continue
993  if gsys==MapToSystem(defect):
994  tol[defect]=ListOfTolerableDefects[defect][0]
995  for defect in ListOfIntolerableDefects:
996  # remove systems to be ignored from the plots
997  word = defect.split('_')
998  cpdet = word[0]
999  if word[0]=='MS':
1000  cpdet += "_"+word[1] # MS systems
1001  if cpdet in tobeignored:
1002  continue
1003  if gsys==MapToSystem(defect):
1004  int[defect]=ListOfIntolerableDefects[defect][0]
1005  for defect in ListOfIgnoredDefects:
1006  # remove systems to be ignored from the plots
1007  word = defect.split('_')
1008  cpdet = word[0]
1009  if word[0]=='MS':
1010  cpdet += "_"+word[1] # MS systems
1011  if cpdet in tobeignored:
1012  continue
1013  if gsys==MapToSystem(defect):
1014  ign[defect]=ListOfIgnoredDefects[defect][0]
1015 
1016  hname = MakePlot_DefectsPerSystem(gsys,int,tol,ign,dic,r)
1017  for h in hname:
1018  if len(h)== 0:
1019  continue
1020  title = "Click to zoom"
1021  wincontent = "<img src=&quot;%s&quot; height=%s/>"%(h,imgsize)
1022  openwin = "javascript:openLargeWindow('Print1','"
1023  openwin += "<!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;>"
1024  openwin += "<html xmlns:&quot;my&quot;><head><title>Defects for run %s</title></head>"%run
1025  openwin += "<body style=&quot;background-color:#ffffff&quot;>%s</body></html>"%wincontent
1026  openwin += "')"
1027  content[gsys]+='<a title="%s" href="%s" ><img src="%s" height=%s/></a>'%(title,openwin,h,thumbsize)
1028 
1029 
1030  _lblumi = 0.
1031  if not GlobalNotReady:
1032  for lb in GlobalNotReady:
1033  _lblumi += lumiperlb[lb]
1034  dicsum[DataKey('TotalNotReady')] += _lblumi
1035  content['Run Info'] += '<font style="font-size:10px;">'
1036  content['Run Info'] += 'Global Not Ready: <b>%.2f</b> %s'%(_lblumi,unit)
1037  content['Run Info'] += '</font><br>'
1038 
1039 
1040  _lblumi = 0.
1041  for lb in GlobalBusy:
1042  _lblumi += lumiperlb[lb]
1043  dicsum[DataKey('TotalBusy')]+= _lblumi
1044  content['Run Info'] += '<font style="font-size:10px;">'
1045  content['Run Info'] += 'Global Busy: <b>%.2f</b> %s'%(_lblumi,unit)
1046  content['Run Info'] += '</font><br>'
1047 
1048 
1049  for d in detectors:
1050  if len(detectors_affectedLBs[d][run]) == 0:
1051  continue
1052  # Remove double counting (defects overlap)
1053  dll = list(set(detectors_affectedLBs[d][run]))
1054  detectors_affectedLBs['_TOTAL'][run]+= dll
1055  for lb in dll:
1056  detectors_lumiloss[d][run]+= lumiperlb[lb]
1057  for p in performances:
1058  if len(performances_affectedLBs[p][run]) == 0:
1059  continue
1060  # Remove double counting (defects overlap)
1061  pll = list(set(performances_affectedLBs[p][run]))
1062  performances_affectedLBs['_TOTAL'][run]+= pll
1063  for lb in pll:
1064  performances_lumiloss[p][run]+= lumiperlb[lb]
1065 
1066 
1068  detectors_affectedLBs['_TOTAL'][run]=list(set(detectors_affectedLBs['_TOTAL'][run]))
1069  performances_affectedLBs['_TOTAL'][run]=list(set(performances_affectedLBs['_TOTAL'][run]))
1070  total_affectedLBs = list(set(total_affectedLBs))
1071  totallossperrun = 0.
1072  # Store the values
1073  for lb in total_affectedLBs:
1074  totallossperrun += lumiperlb[lb]
1075  dicsum[DataKey('TotalLumi')][1] += totallossperrun
1076  # Store the values
1077  for lb in detectors_affectedLBs['_TOTAL'][run]:
1078  detectors_lumiloss['_TOTAL'][run] += lumiperlb[lb]
1079  # Store the values
1080  for lb in performances_affectedLBs['_TOTAL'][run]:
1081  performances_lumiloss['_TOTAL'][run] += lumiperlb[lb]
1082 
1083 
1084  content['Run Info'] += '<font style="font-size:10px;">'
1085  content['Run Info'] += 'DQ Lumi Loss: <b>%.2f</b> %s'%(totallossperrun,unit)
1086  content['Run Info'] += '</font><br>'
1087 
1088 
1089  summarytable+='<tr class="out2">'
1090  for item in columns:
1091  summarytable+='<td>%s</td>'%content[item]
1092  summarytable+='</tr>'
1093 
1094 
1095  summarytable += '</table></div><br>'
1096 
1097  if runsWithoutReadyForPhysics:
1098  warning += '<div style="margin-left: 13px; color: darkred; width: 90%%;">WARNING! The following runs have no lumi block with ATLAS Ready: %s</div><br>' % ", ".join(runsWithoutReadyForPhysics)
1099  if runsWithoutOfflineLumiInfo:
1100  warning += '<div style="margin-left: 13px; color: darkred; width: 90%%;">WARNING! The following runs have no offline lumi info: %s</div><br>' % ", ".join(runsWithoutOfflineLumiInfo)
1101 
1102 
1103 
1104 
1107 
1108  summaryplot = ''
1109  plots = []
1110  if totalNumberOfReadyLB > 0:
1111  plots.append(MakePlot_SummaryLumiLoss(detectors_lumiloss,detectors_color,dicsum,'detectors'))
1112  plots.append(MakePlot_SummaryLumiLoss(performances_lumiloss,performances_color,dicsum,'performances'))
1113  plots.append(MakePlot_PerRunLumiLoss(detectors_lumiloss,detectors_color,dicsum,'detectors'))
1114  plots.append(MakePlot_PerRunLumiLoss(performances_lumiloss,performances_color,dicsum,'performances'))
1115 
1116  imgsize=500
1117  thumbsize=300
1118  title = "Click to zoom"
1119 
1120 
1121  summaryplot += '<table align="center" width="90%">'
1122  summaryplot += '<th>'
1123 
1124  for p in plots:
1125 
1126  wincontent = "<img src=&quot;%s&quot; width=%s/>"%(p,imgsize)
1127 
1128  #openwincmd = "javascript:openLargeWindow('Print%i','"%(r)
1129  openwincmd = "javascript:openWindow('Print%i','"%(run)
1130  openwincmd += "<!DOCTYPE html PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;>"
1131  openwincmd += "<html xmlns:&quot;my&quot;><head><title>DQ Summary Plot - Run %s</title></head>"%(run)
1132  openwincmd += "<body style=&quot;background-color:#ffffff&quot;>%s</body></html>"%wincontent
1133  openwincmd += "')"
1134 
1135  summaryplot+='<td><a title="%s" href="%s" ><img src="%s" height=%s/></a></td>'%(title,openwincmd,p,thumbsize)
1136 
1137 
1138  summaryplot += '</th></table>'
1139 
1140 
1144 
1145 
1148 
1149  totalLumiRecorded = dicsum[DataKey('TotalLumi')][0]
1150  totalLumiLoss = dicsum[DataKey('TotalLumi')][1]
1151  lumiLossFraction = (100. * totalLumiLoss / totalLumiRecorded) if totalLumiRecorded > 0 else 0
1152 
1153 
1154  print ('+++++++++++++++++++++++++ Summary +++++++++++++++++++')
1155  print (' Total Ready Recorded Luminosity: %.2f %s-1' % ( totalLumiRecorded, unit ))
1156  print (' Total Luminosity Loss (ATLAS Ready) : %.2f %s-1' % ( totalLumiLoss, unit ))
1157  print (' Total Global Not Ready (Stable Beams): %.2f %s-1'%(dicsum[DataKey('TotalNotReady')],unit))
1158  print (' Total Global Busy (Stable Beams): %.2f %s-1'%(dicsum[DataKey('TotalBusy')],unit))
1159  print ('+++++++++++++++++++++++++++++++++++++++++++++++++++++')
1160 
1161  if totalNumberOfReadyLB>0:
1162  summaryinfo = '<table align="center" style="font-size:80%;"><tr>'
1163  summaryinfo += '<td> Total Luminosity Loss: <b>%.2f %s</b> (%.2f%%)' % ( totalLumiLoss, unit, lumiLossFraction )
1164  summaryinfo += '<br>Excluded Systems: %s</td></tr>' % tobeignored
1165  if not cosmics:
1166  summaryinfo += '<tr><td style="font-size:70%%">using %s // %s</td></tr>'%(lumifolder.split(':')[2],livetrigger)
1167  summaryinfo += '</table>'
1168  else:
1169  summaryinfo = '<table align="center" style="font-size:80%;"><tr>'
1170  summaryinfo += '<td> No ready lumi block </td>'
1171  summaryinfo += '</tr></table>'
1172 
1173 
1176 
1177  pagecontent = summaryplot +'<br>'
1178  pagecontent += summaryinfo +'<br>'
1179  if doDQSummary:
1180  pagecontent += summarytable
1181  pagecontent += warning
1182  return pagecontent
1183 
1184 
1185 
1186 

The documentation for this class was generated from the following file:
python.html.AtlRunQueryDQSummary.MakePlot_SummaryLumiLoss
def MakePlot_SummaryLumiLoss(loss, colors, dicsum, name)
Definition: AtlRunQueryDQSummary.py:120
python.html.AtlRunQueryDQSummary.listify
def listify(lbl)
Definition: AtlRunQueryDQSummary.py:518
python.utils.AtlRunQueryTimer.timer
def timer(name, disabled=False)
Definition: AtlRunQueryTimer.py:85
python.html.AtlRunQueryDQSummary.ComputeRunLumi
def ComputeRunLumi(dic, run, lumiperlb)
Definition: AtlRunQueryDQSummary.py:54
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
histSizes.list
def list(name, path='/')
Definition: histSizes.py:38
python.html.AtlRunQueryDQSummary.MapToSystem
def MapToSystem(defect)
Definition: AtlRunQueryDQSummary.py:32
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
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
python.html.AtlRunQueryDQSummary.MakePlot_PerRunLumiLoss
def MakePlot_PerRunLumiLoss(loss, colors, dicsum, name)
Definition: AtlRunQueryDQSummary.py:222
python.html.AtlRunQueryDQSummary.GetLBLiveFraction
def GetLBLiveFraction(dic, run)
Definition: AtlRunQueryDQSummary.py:94
python.html.AtlRunQueryDQSummary.GetLBReady
def GetLBReady(dic, run)
Definition: AtlRunQueryDQSummary.py:110
python.html.AtlRunQueryDQSummary.GetLBLumi
def GetLBLumi(dic, run)
Definition: AtlRunQueryDQSummary.py:64
str
Definition: BTagTrackIpAccessor.cxx:11
python.html.AtlRunQueryDQSummary.MakePlot_DefectsPerSystem
def MakePlot_DefectsPerSystem(sys, intolerable, tolerable, ignored, dic, run)
Definition: AtlRunQueryDQSummary.py:358
Trk::split
@ split
Definition: LayerMaterialProperties.h:38
python.LArMinBiasAlgConfig.float
float
Definition: LArMinBiasAlgConfig.py:65