CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Private Attributes
matplotRender.matplotRender Class Reference

Public Member Functions

def __init__ (self, fig)
 
def drawHTTPstring (self)
 
def drawInteractive (self)
 
def drawPNG (self, filename)
 
def plotInst_RunLS (self, rawxdata, rawydata, nticks=6, textoutput=None)
 
def plotPeakPerday_Time (self, rawdata={}, resultlines=[], minTime=None, maxTime=None, nticks=6, withannotation=False, yscale='linear', referenceLabel='Delivered', labels=['Delivered'], textoutput=None)
 
def plotPerdayX_Time (self, rawdata={}, resultlines=[], minTime=None, maxTime=None, nticks=6, yscale='linear', withannotation=False, referenceLabel='Delivered', labels=['Delivered', Recorded, textoutput=None)
 
def plotSumX_Fill (self, rawdata={}, resultlines=[], minFill=None, maxFill=None, nticks=6, yscale='linear', withannotation=False, referenceLabel='Delivered', labels=['Delivered', Recorded, textoutput=None)
 
def plotSumX_Run (self, rawdata={}, resultlines=[], minRun=None, maxRun=None, nticks=6, yscale='linear', withannotation=False, referenceLabel='Delivered', labels=['Delivered', Recorded, textoutput=None)
 
def plotSumX_Time (self, rawdata={}, resultlines=[], minTime=None, maxTime=None, nticks=6, yscale='linear', withannotation=False, referenceLabel='Delivered', labels=['Delivered', Recorded, textoutput=None)
 

Public Attributes

 colormap
 

Private Attributes

 __canvas
 
 __fig
 

Detailed Description

Definition at line 96 of file matplotRender.py.

Constructor & Destructor Documentation

def matplotRender.matplotRender.__init__ (   self,
  fig 
)

Definition at line 97 of file matplotRender.py.

97  def __init__(self,fig):
98  self.__fig=fig
99  self.__canvas=''
100  self.colormap={}
101  self.colormap['Delivered']='r'
102  self.colormap['Recorded']='b'
103  self.colormap['Effective']='g'
104  self.colormap['Max Inst']='r'
105 

Member Function Documentation

def matplotRender.matplotRender.drawHTTPstring (   self)

Definition at line 793 of file matplotRender.py.

References matplotRender.matplotRender.__canvas, and matplotRender.matplotRender.__fig.

793  def drawHTTPstring(self):
794  self.__canvas=CanvasBackend(self.__fig)
795  cherrypy.response.headers['Content-Type']='image/png'
796  buf=StringIO()
797  self.__canvas.print_png(buf)
798  return buf.getvalue()
799 
def matplotRender.matplotRender.drawInteractive (   self)

Definition at line 804 of file matplotRender.py.

References matplotRender.matplotRender.__fig, and edm.print().

804  def drawInteractive(self):
805  if batchonly:
806  print('interactive mode is not available for your setup, exit')
807  sys.exit()
809  aw.show()
810  aw.destroy()
811 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def matplotRender.matplotRender.drawPNG (   self,
  filename 
)

Definition at line 800 of file matplotRender.py.

References matplotRender.matplotRender.__canvas, and matplotRender.matplotRender.__fig.

800  def drawPNG(self,filename):
801  self.__canvas=CanvasBackend(self.__fig)
802  self.__canvas.print_figure(filename)
803 
def drawPNG(self, filename)
def matplotRender.matplotRender.plotInst_RunLS (   self,
  rawxdata,
  rawydata,
  nticks = 6,
  textoutput = None 
)
Input: rawxdata [run,fill,starttime,stoptime,totalls,ncmsls]
       rawydata {label:[lumi]}

Definition at line 717 of file matplotRender.py.

References matplotRender.matplotRender.colormap, cmsPerfStripChart.dict, matplotRender.guessLumiUnit(), list(), SiStripPI.max, and str.

717  def plotInst_RunLS(self,rawxdata,rawydata,nticks=6,textoutput=None):
718  '''
719  Input: rawxdata [run,fill,starttime,stoptime,totalls,ncmsls]
720  rawydata {label:[lumi]}
721  '''
722  lslength=23.357
723  lut=lumiTime.lumiTime()
724  runnum=rawxdata[0]
725  fill=rawxdata[1]
726  starttime=lut.DatetimeToStr(rawxdata[2],customfm='%m/%d/%y %H:%M:%S')
727  stoptime=lut.DatetimeToStr(rawxdata[3],customfm='%m/%d/%y %H:%M:%S')
728  totalls=rawxdata[-2]
729  ncmsls=rawxdata[-1]
730  peakinst=max(rawydata['Delivered'])/lslength
731  totaldelivered=sum(rawydata['Delivered'])
732  totalrecorded=sum(rawydata['Recorded'])
733  xpoints=list(range(1,totalls+1))
734  #print len(xpoints)
735  ypoints={}
736  ymax={}
737  for ylabel,yvalue in rawydata.items():
738  ypoints[ylabel]=[y/lslength for y in yvalue]
739  ymax[ylabel]=max(yvalue)/lslength
740  left=0.15
741  width=0.7
742  bottom=0.1
743  height=0.65
744  bottom_h=bottom+height
745  rect_scatter=[left,bottom,width,height]
746  rect_table=[left,bottom_h,width,0.25]
747 
748  nullfmt=matplotlib.ticker.NullFormatter()
749  nullloc=matplotlib.ticker.NullLocator()
750  axtab=self.__fig.add_axes(rect_table,frameon=False)
751  axtab.set_axis_off()
752  axtab.xaxis.set_major_formatter(nullfmt)
753  axtab.yaxis.set_major_formatter(nullfmt)
754  axtab.xaxis.set_major_locator(nullloc)
755  axtab.yaxis.set_major_locator(nullloc)
756 
757  ax=self.__fig.add_axes(rect_scatter)
758 
759  majorLoc=matplotlib.ticker.LinearLocator(numticks=nticks)
760  minorLoc=matplotlib.ticker.LinearLocator(numticks=nticks*4)
761  ax.set_xlabel(r'LS',position=(0.96,0))
762  ax.set_ylabel(r'L $\mu$b$^{-1}$s$^{-1}$',position=(0,0.9))
763  ax.xaxis.set_major_locator(majorLoc)
764  ax.xaxis.set_minor_locator(minorLoc)
765  ax.set_xbound(lower=xpoints[0],upper=xpoints[-1])
766  xticklabels=ax.get_xticklabels()
767  for tx in xticklabels:
768  tx.set_horizontalalignment('right')
769  ax.grid(True)
770  keylist=sorted(ypoints.keys())
771  legendlist=[]
772 
773  for ylabel in keylist:
774  cl='k'
775  if ylabel in self.colormap:
776  cl=self.colormap[ylabel]
777  ax.plot(xpoints,ypoints[ylabel],'.',label=ylabel,color=cl)
778  legendlist.append(ylabel)
779  #ax.axhline(0,color='green',linewidth=0.2)
780  ax.axvline(xpoints[ncmsls-1],color='green',linewidth=0.2)
781  (unitstring,denomitor)=guessLumiUnit(totaldelivered)
782  colLabels=('run','fill','max inst(/$\mu$b/s)','delivered('+unitstring+')','recorded('+unitstring+')')
783  cellText=[[str(runnum),str(fill),'%.3f'%(peakinst),'%.3f'%(totaldelivered/denomitor),'%.3f'%(totalrecorded/denomitor)]]
784 
785  sumtable=axtab.table(cellText=cellText,colLabels=colLabels,colWidths=[0.12,0.1,0.27,0.27,0.27],cellLoc='center',loc='center')
786  trans=matplotlib.transforms.BlendedGenericTransform(ax.transData,ax.transAxes)
787  axtab.add_table(sumtable)
788 
789  ax.text(xpoints[0],1.02,starttime[0:17],transform=trans,horizontalalignment='left',size='x-small',color='green',bbox=dict(facecolor='white'))
790  ax.text(xpoints[ncmsls-1],1.02,stoptime[0:17],transform=trans,horizontalalignment='left',size='x-small',color='green',bbox=dict(facecolor='white'))
791  ax.legend(tuple(legendlist),loc='upper right',numpoints=1)
792 
def plotInst_RunLS(self, rawxdata, rawydata, nticks=6, textoutput=None)
def guessLumiUnit(t)
#define str(s)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
def matplotRender.matplotRender.plotPeakPerday_Time (   self,
  rawdata = {},
  resultlines = [],
  minTime = None,
  maxTime = None,
  nticks = 6,
  withannotation = False,
  yscale = 'linear',
  referenceLabel = 'Delivered',
  labels = ['Delivered'],
  textoutput = None 
)
THIS PLOT IS DELIVERED ONLY
Input:
rawdata={'Delivered':[(day,run,ls,instlumi)]}
resultlines=[[day,run,ls,maxinstlum],[]]
minTime (python DateTime) : min *begin* time to draw: format %m/%d/%y %H:%M:%S
maxTime (python DateTime): max *begin* time to draw %m/%d/%y %H:%M:%S
withannotation: wheather the boundary points should be annotated
referenceLabel: the one variable that decides the total unit and the plot x-axis range
labels: labels of the variables to plot

Definition at line 574 of file matplotRender.py.

References mps_setup.append, matplotRender.matplotRender.colormap, cmsPerfStripChart.dict, objects.autophobj.float, matplotRender.guessInstLumiUnit(), createfilelist.int, list(), SiStripPI.max, min(), edm.print(), split, str, and ComparisonHelper.zip().

574  def plotPeakPerday_Time(self,rawdata={},resultlines=[],minTime=None,maxTime=None,nticks=6,withannotation=False,yscale='linear',referenceLabel='Delivered',labels=['Delivered'],textoutput=None):
575  '''
576  THIS PLOT IS DELIVERED ONLY
577  Input:
578  rawdata={'Delivered':[(day,run,ls,instlumi)]}
579  resultlines=[[day,run,ls,maxinstlum],[]]
580  minTime (python DateTime) : min *begin* time to draw: format %m/%d/%y %H:%M:%S
581  maxTime (python DateTime): max *begin* time to draw %m/%d/%y %H:%M:%S
582  withannotation: wheather the boundary points should be annotated
583  referenceLabel: the one variable that decides the total unit and the plot x-axis range
584  labels: labels of the variables to plot
585  '''
586  xpoints=[]
587  ypoints={}
588  legendlist=[]
589  maxinfo=''
590  ymax={}
591  lut=lumiTime.lumiTime()
592  if not minTime:
593  minTime='03/01/10 00:00:00'
594  minTime=lut.StrToDatetime(minTime,customfm='%m/%d/%y %H:%M:%S')
595  if not maxTime:
596  maxTime=datetime.datetime.utcnow()
597  else:
598  maxTime=lut.StrToDatetime(maxTime,customfm='%m/%d/%y %H:%M:%S')
599  for r in resultlines:
600  day=int(r[0])
601  runnumber=int(r[1])
602  lsnum=int(r[2].split('.')[0])
603  if rawdata and day in [int(t[0]) for t in rawdata[referenceLabel]]:continue
604  if day < minTime.date().toordinal():continue
605  if day > maxTime.date().toordinal():continue
606  for i,lab in enumerate(labels):
607  v=float(r[-(len(labels)-i)-1])
608  rawdata.setdefault(lab,[]).append((day,runnumber,lsnum,v))
609  if not rawdata:
610  print('[WARNING]: no data, do nothing')
611  return
612  maxlum=max([t[3] for t in rawdata[referenceLabel]])
613  minlum=min([t[3] for t in rawdata[referenceLabel] if t[3]>0]) #used only for log scale, fin the non-zero bottom
614  (unitstring,denomitor)=guessInstLumiUnit(maxlum)
615 
616  csvreport=None
617  rows=[]
618  flat=[]
619  MinDay=minTime.date().toordinal()
620  MaxDay=maxTime.date().toordinal()
621  fulldays=list(range(MinDay,MaxDay+1))
622  for label in rawdata.keys():
623  yvalues=sorted(rawdata[label])
624  alldays=[t[0] for t in yvalues]
625  alldates=[str(datetime.date.fromordinal(t)) for t in alldays]
626  ypoints[label]=[]
627  lumivals=[t[3] for t in yvalues]
628  flat.append(lumivals)
629  for d in fulldays:
630  if not d in alldays:
631  ypoints[label].append(0.0)
632  else:
633  thisdaylumi=[t[3] for t in yvalues if t[0]==d][0]
634  if yscale=='log':
635  if thisdaylumi<minlum:
636  thisdaylumi=minlum/denomitor
637  else:
638  thisdaylumi=thisdaylumi/denomitor
639  else:
640  thisdaylumi=thisdaylumi/denomitor
641  ypoints[label].append(thisdaylumi)
642  ymax[label]=max(lumivals)/denomitor
643  'ymax ',max(lumivals)
644  xpoints=fulldays
645  if textoutput:
646  csvreport=csvReporter.csvReporter(textoutput)
647  head=['#day','run','lsnum','maxinstlumi','date']
648  csvreport.writeRow(head)
649  flat.insert(0,alldays)
650  allruns=[ t[1] for t in rawdata[referenceLabel]]
651  allls=[ t[2] for t in rawdata[referenceLabel]]
652  flat.insert(1,allruns)
653  flat.insert(2,allls)
654  flat.append(alldates)
655  rows=list(zip(*flat))
656  csvreport.writeRows([list(t) for t in rows])
657 
658  yearStrMin=minTime.strftime('%Y')
659  yearStrMax=maxTime.strftime('%Y')
660  if yearStrMin==yearStrMax:
661  dateFmt=matplotlib.dates.DateFormatter('%d/%m')
662  else:
663  dateFmt=matplotlib.dates.DateFormatter('%d/%m/%y')
664  ax=self.__fig.add_subplot(111)
665  if yscale=='linear':
666  ax.set_yscale('linear')
667  elif yscale=='log':
668  ax.set_yscale('log')
669  else:
670  raise RuntimeError('unsupported yscale '+yscale)
671  majorLoc=matplotlib.ticker.LinearLocator(numticks=nticks)
672  minorLoc=matplotlib.ticker.LinearLocator(numticks=nticks*4)
673  ax.xaxis.set_major_formatter(dateFmt)
674  ax.set_xlabel(r'Date',position=(0.84,0))
675  ax.set_ylabel(r'L '+unitstring,position=(0,0.9))
676  ax.xaxis.set_major_locator(majorLoc)
677  ax.xaxis.set_minor_locator(minorLoc)
678  xticklabels=ax.get_xticklabels()
679  for tx in xticklabels:
680  tx.set_horizontalalignment('right')
681  ax.grid(True)
682  cl=self.colormap['Max Inst']
683  textsummaryhead=['#TotalRunningDays']
684  textsummaryline=['#'+str(len(alldays))]
685  for ylabel in labels:
686  cl='k'
687  if ylabel in self.colormap:
688  cl=self.colormap[ylabel]
689  ax.plot(xpoints,ypoints[ylabel],label='Max Inst',color=cl,drawstyle='steps')
690  legendlist.append('Max Inst %.3f'%(ymax[ylabel])+' '+unitstring)
691  textsummaryhead.append('Max Inst'+ylabel)
692  textsummaryline.append('%.3f'%(ymax[ylabel])+' '+unitstring)
693  if textoutput:
694  csvreport.writeRow(textsummaryhead)
695  csvreport.writeRow(textsummaryline)
696  ax.legend(tuple(legendlist),loc='upper left')
697  ax.set_xbound(lower=matplotlib.dates.date2num(minTime),upper=matplotlib.dates.date2num(maxTime))
698  if withannotation:
699  #annotations
700  trans=matplotlib.transforms.BlendedGenericTransform(ax.transData,ax.transAxes)
701  ax.text(xpoints[0],1.025,beginfo,transform=trans,horizontalalignment='left',size='x-small',color='green',bbox=dict(facecolor='white'))
702  ax.text(xpoints[-1],1.025,endinfo,transform=trans,horizontalalignment='left',size='x-small',color='green',bbox=dict(facecolor='white'))
703  ax.annotate(maxinfo,xy=(xmax,ymax),xycoords='data',xytext=(0,13),textcoords='offset points',arrowprops=dict(facecolor='green',shrink=0.05),size='x-small',horizontalalignment='center',color='green',bbox=dict(facecolor='white'))
704 
705  firstday=datetime.date.fromordinal(rawdata[referenceLabel][0][0])
706  lastday=datetime.date.fromordinal(rawdata[referenceLabel][-1][0])
707  firstdayStr=firstday.strftime('%Y %b %d')
708  lastdayStr=lastday.strftime('%Y %b %d')
709  ax.set_title('CMS Peak Luminosity/Day ('+firstdayStr+' - '+lastdayStr+')',size='small')
710 
711  #ax.autoscale(tight=True)
712  ax.autoscale_view(tight=True,scalex=True,scaley=False)
713  #ax.set_xmargin(0.015)
714  self.__fig.autofmt_xdate(bottom=0.18,rotation=15,ha='right')
715  self.__fig.subplots_adjust(bottom=0.2,left=0.15)
716 
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def guessInstLumiUnit(t)
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
T min(T a, T b)
Definition: MathUtil.h:58
def plotPeakPerday_Time(self, rawdata={}, resultlines=[], minTime=None, maxTime=None, nticks=6, withannotation=False, yscale='linear', referenceLabel='Delivered', labels=['Delivered'], textoutput=None)
#define str(s)
double split
Definition: MVATrainer.cc:139
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
def matplotRender.matplotRender.plotPerdayX_Time (   self,
  rawdata = {},
  resultlines = [],
  minTime = None,
  maxTime = None,
  nticks = 6,
  yscale = 'linear',
  withannotation = False,
  referenceLabel = 'Delivered',
  labels = ['Delivered',
  Recorded,
  textoutput = None 
)
Input:
rawdata={'Delivered':[(day,begrun:ls,endrun:ls,lumi)],'Recorded':[(dayofyear,begrun:ls,endrun:ls,lumi)]}
resultlines=[[day,begrun:ls,endrun:ls,deliveredperday,recordedperday],[]]
minTime (python DateTime) : min *begin* time to draw: format %m/%d/%y %H:%M:%S
maxTime (python DateTime): max *begin* time to draw %m/%d/%y %H:%M:%S
withannotation: wheather the boundary points should be annotated
referenceLabel: the one variable that decides the total unit and the plot x-axis range
labels: labels of the variables to plot

Definition at line 431 of file matplotRender.py.

References mps_setup.append, matplotRender.matplotRender.colormap, objects.autophobj.float, matplotRender.guessLumiUnit(), createfilelist.int, list(), SiStripPI.max, min(), edm.print(), str, and ComparisonHelper.zip().

431  def plotPerdayX_Time(self,rawdata={},resultlines=[],minTime=None,maxTime=None,nticks=6,yscale='linear',withannotation=False,referenceLabel='Delivered',labels=['Delivered','Recorded'],textoutput=None):
432  '''
433  Input:
434  rawdata={'Delivered':[(day,begrun:ls,endrun:ls,lumi)],'Recorded':[(dayofyear,begrun:ls,endrun:ls,lumi)]}
435  resultlines=[[day,begrun:ls,endrun:ls,deliveredperday,recordedperday],[]]
436  minTime (python DateTime) : min *begin* time to draw: format %m/%d/%y %H:%M:%S
437  maxTime (python DateTime): max *begin* time to draw %m/%d/%y %H:%M:%S
438  withannotation: wheather the boundary points should be annotated
439  referenceLabel: the one variable that decides the total unit and the plot x-axis range
440  labels: labels of the variables to plot
441  '''
442  xpoints=[]
443  ypoints={}
444  ymax={}
445  lut=lumiTime.lumiTime()
446  if not minTime:
447  minTime='03/01/10 00:00:00'
448  minTime=lut.StrToDatetime(minTime,customfm='%m/%d/%y %H:%M:%S')
449  if not maxTime:
450  maxTime=datetime.datetime.utcnow()
451  else:
452  maxTime=lut.StrToDatetime(maxTime,customfm='%m/%d/%y %H:%M:%S')
453  for r in resultlines:
454  day=int(r[0])
455  begrunls=r[1]
456  endrunls=r[2]
457  #[begrun,begls]=[int(s) for s in r[1].split(':')]
458  if rawdata and day in [t[0] for t in rawdata[referenceLabel]]:continue
459  if day < minTime.date().toordinal():continue
460  if day > maxTime.date().toordinal():continue
461  for i,lab in enumerate(labels):
462  v=float(r[-(len(labels)-i)-1])
463  rawdata.setdefault(lab,[]).append((day,begrunls,endrunls,v))
464  if not rawdata:
465  print('[WARNING]: no data, do nothing')
466  return
467  maxlum=max([t[3] for t in rawdata[referenceLabel]])
468  minlum=min([t[3] for t in rawdata[referenceLabel] if t[3]>0]) #used only for log scale, fin the non-zero bottom
469  (unitstring,denomitor)=guessLumiUnit(maxlum)
470  csvreport=None
471  rows=[]
472  flat=[]
473  MinDay=minTime.date().toordinal()
474  MaxDay=maxTime.date().toordinal()
475  fulldays=list(range(MinDay,MaxDay+1))
476  allstarts=[]
477  allstops=[]
478  for label,yvalues in rawdata.items():
479  yvalues.sort()
480  flat.append([t[3] for t in yvalues])
481  alldays=[t[0] for t in yvalues]
482  alldates=[str(datetime.date.fromordinal(t)) for t in alldays]
483  ypoints[label]=[]
484  lumivals=[t[3] for t in yvalues]
485  for d in fulldays:
486  if not d in alldays:
487  ypoints[label].append(0.0)
488  else:
489  thisdaylumi=[t[3] for t in yvalues if t[0]==d][0]
490  if yscale=='log':
491  if thisdaylumi<minlum:
492  thisdaylumi=minlum/denomitor
493  else:
494  thisdaylumi=thisdaylumi/denomitor
495  else:
496  thisdaylumi=thisdaylumi/denomitor
497  ypoints[label].append(thisdaylumi)
498  ymax[label]=max(lumivals)/denomitor
499  xpoints=fulldays
500  if textoutput:
501  csvreport=csvReporter.csvReporter(textoutput)
502  head=['#day','begrunls','endrunls','delivered','recorded','date']
503  csvreport.writeRow(head)
504  flat.insert(0,alldays)
505  allstarts=[ t[1] for t in rawdata[referenceLabel]]
506  allstops=[ t[2] for t in rawdata[referenceLabel]]
507  #print 'allstarts ',allstarts
508  flat.insert(1,allstarts)
509  flat.insert(2,allstops)
510  flat.append(alldates)
511  rows=list(zip(*flat))
512  csvreport.writeRows([list(t) for t in rows])
513  yearStrMin=minTime.strftime('%Y')
514  yearStrMax=maxTime.strftime('%Y')
515  if yearStrMin==yearStrMax:
516  dateFmt=matplotlib.dates.DateFormatter('%d/%m')
517  else:
518  dateFmt=matplotlib.dates.DateFormatter('%d/%m/%y')
519  ax=self.__fig.add_subplot(111)
520  if yscale=='linear':
521  ax.set_yscale('linear')
522  elif yscale=='log':
523  ax.set_yscale('log')
524  else:
525  raise RuntimeError('unsupported yscale '+yscale)
526  majorLoc=matplotlib.ticker.LinearLocator(numticks=nticks)
527  minorLoc=matplotlib.ticker.LinearLocator(numticks=nticks*4)
528  ax.xaxis.set_major_formatter(dateFmt)
529  ax.set_xlabel(r'Date',position=(0.84,0))
530  ax.xaxis.set_major_locator(majorLoc)
531  ax.xaxis.set_minor_locator(minorLoc)
532  xticklabels=ax.get_xticklabels()
533  for tx in xticklabels:
534  tx.set_horizontalalignment('right')
535  ax.grid(True)
536  legendlist=[]
537  ax.set_ylabel(r'L '+unitstring,position=(0,0.9))
538  textsummaryhead=['#TotalRunningDays']
539  textsummaryline=['#'+str(len(alldays))]
540  for ylabel in labels:
541  cl='k'
542  if ylabel in self.colormap:
543  cl=self.colormap[ylabel]
544  ax.plot(xpoints,ypoints[ylabel],label=ylabel,color=cl,drawstyle='steps')
545  legendlist.append(ylabel+' Max '+'%.3f'%(ymax[ylabel])+' '+unitstring)
546  textsummaryhead.append('Max'+ylabel)
547  textsummaryline.append('%.3f'%(ymax[ylabel])+' '+unitstring)
548  if textoutput:
549  csvreport.writeRow(textsummaryhead)
550  csvreport.writeRow(textsummaryline)
551  ax.legend(tuple(legendlist),loc='upper left')
552  ax.set_xbound(lower=matplotlib.dates.date2num(minTime),upper=matplotlib.dates.date2num(maxTime))
553  #if withannotation:
554  # begtime=boundaryInfo[0][0]
555  # beginfo=boundaryInfo[0][1]
556  # endtime=boundaryInfo[1][0]
557  # endinfo=boundaryInfo[1][1]
558  # #annotations
559  # trans=matplotlib.transforms.BlendedGenericTransform(ax.transData,ax.transAxes)
560  # ax.text(matplotlib.dates.date2num(begtime),1.025,beginfo,transform=trans,horizontalalignment='left',size='x-small',color='green',bbox=dict(facecolor='white'))
561  # ax.text(matplotlib.dates.date2num(endtime),1.025,endinfo,transform=trans,horizontalalignment='left',size='x-small',color='green',bbox=dict(facecolor='white'))
562 
563  firstday=datetime.date.fromordinal(rawdata[referenceLabel][0][0])
564  lastday=datetime.date.fromordinal(rawdata[referenceLabel][-1][0])
565  firstdayStr=firstday.strftime('%Y %b %d')
566  lastdayStr=lastday.strftime('%Y %b %d')
567  ax.set_title('CMS Integrated Luminosity/Day ('+firstdayStr+' - '+lastdayStr+')',size='small')
568  #ax.autoscale(tight=True)
569  ax.autoscale_view(tight=True,scalex=True,scaley=False)
570  #ax.set_xmargin(0.015)
571  self.__fig.autofmt_xdate(bottom=0.18,rotation=15,ha='right')
572  self.__fig.subplots_adjust(bottom=0.2,left=0.15)
573 
def guessLumiUnit(t)
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
def plotPerdayX_Time(self, rawdata={}, resultlines=[], minTime=None, maxTime=None, nticks=6, yscale='linear', withannotation=False, referenceLabel='Delivered', labels=['Delivered', Recorded, textoutput=None)
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
T min(T a, T b)
Definition: MathUtil.h:58
#define str(s)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
def matplotRender.matplotRender.plotSumX_Fill (   self,
  rawdata = {},
  resultlines = [],
  minFill = None,
  maxFill = None,
  nticks = 6,
  yscale = 'linear',
  withannotation = False,
  referenceLabel = 'Delivered',
  labels = ['Delivered',
  Recorded,
  textoutput = None 
)
input:
rawdata = {'Delivered':[(fill,runnumber,lumiperrun)],'Recorded':[(fill,runnumber,lumiperrun)]}
resultlines = [[fillnumber,runnumber,dellumiperrun,reclumiperrun],[fillnumber,runnumber,dellumiperrun,reclumiperrun],]
minFill : min fill to draw
maxFill : max fill to draw
yscale: linear,log or both
withannotation: wheather the boundary points should be annotated
textoutput: text output file name. 

Definition at line 204 of file matplotRender.py.

References mps_setup.append, matplotRender.matplotRender.colormap, cmsPerfStripChart.dict, objects.autophobj.float, matplotRender.guessLumiUnit(), createfilelist.int, list(), edm.print(), str, and ComparisonHelper.zip().

204  def plotSumX_Fill(self,rawdata={},resultlines=[],minFill=None,maxFill=None,nticks=6,yscale='linear',withannotation=False,referenceLabel='Delivered',labels=['Delivered','Recorded'],textoutput=None):
205  '''
206  input:
207  rawdata = {'Delivered':[(fill,runnumber,lumiperrun)],'Recorded':[(fill,runnumber,lumiperrun)]}
208  resultlines = [[fillnumber,runnumber,dellumiperrun,reclumiperrun],[fillnumber,runnumber,dellumiperrun,reclumiperrun],]
209  minFill : min fill to draw
210  maxFill : max fill to draw
211  yscale: linear,log or both
212  withannotation: wheather the boundary points should be annotated
213  textoutput: text output file name.
214  '''
215  ytotal={}
216  ypoints={}
217  for r in resultlines: #parse old text data
218  fillnum=int(r[0])
219  runnum=int(r[1])
220  if rawdata and (fillnum,runnum) in [(t[0],t[1]) for t in rawdata[referenceLabel]]:continue
221  if minFill and fillnum<minFill:continue
222  if maxFill and fillnum>maxFill:continue
223  for i,lab in enumerate(labels) :
224  v=float(r[-(len(labels)-i)])#the values to plot are always the last n fields
225  rawdata.setdefault(lab,[]).append((fillnum,runnum,v))
226  #print 'fillrunDict ',fillrunDict
227  if not rawdata:
228  print('[WARNING]: no data, do nothing')
229  return
230  tot=sum([t[2] for t in rawdata[referenceLabel]])
231  beginfo=''
232  endinfo=''
233  (unitstring,denomitor)=guessLumiUnit(tot)
234  csvreport=None
235  rows=[]
236  flat=[]
237  for label,yvalues in rawdata.items():
238  yvalues.sort()
239  flat.append([t[2] for t in yvalues])
240  ypoints[label]=[]
241  ytotal[label]=0.0
242  lumivals=[t[2] for t in yvalues]
243  for i,val in enumerate(lumivals):
244  ypoints[label].append(sum(lumivals[0:i+1])/denomitor)
245  ytotal[label]=sum(lumivals)/denomitor
246  xpoints=[t[0] for t in rawdata[referenceLabel]]#after sort
247  ax=self.__fig.add_subplot(111)
248  ax.set_xlabel(r'LHC Fill Number',position=(0.84,0))
249  ax.set_ylabel(r'L '+unitstring,position=(0,0.9))
250  ax.set_xbound(lower=xpoints[0],upper=xpoints[-1])
251  if yscale=='linear':
252  ax.set_yscale('linear')
253  elif yscale=='log':
254  ax.set_yscale('log')
255  else:
256  raise RuntimeError('unsupported yscale '+yscale)
257  xticklabels=ax.get_xticklabels()
258  majorLocator=matplotlib.ticker.LinearLocator( nticks )
259  majorFormatter=matplotlib.ticker.FormatStrFormatter('%d')
260  #minorLocator=matplotlib.ticker.MultipleLocator(sampleinterval)
261  ax.xaxis.set_major_locator(majorLocator)
262  ax.xaxis.set_major_formatter(majorFormatter)
263  #ax.xaxis.set_minor_locator(minorLocator)
264  ax.grid(True)
265  keylist=sorted(ypoints.keys())
266  keylist.insert(0,keylist.pop(keylist.index(referenceLabel)))#move refereceLabel to front from now on
267  legendlist=[]
268  head=['#fill','run']
269  textsummaryhead=['#TotalFill']
270  textsummaryline=['#'+str(len(xpoints))]
271  for ylabel in keylist:
272  cl='k'
273  if ylabel in self.colormap:
274  cl=self.colormap[ylabel]
275  ax.plot(xpoints,ypoints[ylabel],label=ylabel,color=cl,drawstyle='steps')
276  legendlist.append(ylabel+' '+'%.3f'%(ytotal[ylabel])+' '+unitstring)
277  textsummaryhead.append('Total'+ylabel)
278  textsummaryline.append('%.3f'%(ytotal[ylabel])+' '+unitstring)
279  head.append(ylabel)
280  if textoutput:
281  csvreport=csvReporter.csvReporter(textoutput)
282  allfills=[int(t[0]) for t in rawdata[referenceLabel]]
283  allruns=[int(t[1]) for t in rawdata[referenceLabel]]
284  flat.insert(0,allfills)
285  flat.insert(1,allruns)
286  rows=list(zip(*flat))
287  csvreport.writeRow(head)
288  csvreport.writeRows([list(t) for t in rows])
289  csvreport.writeRow(textsummaryhead)
290  csvreport.writeRow(textsummaryline)
291  #font=FontProperties(size='medium',weight='demibold')
292  #annotations
293  if withannotation:
294  trans=matplotlib.transforms.BlendedGenericTransform(ax.transData,ax.transAxes)
295  ax.text(xpoints[0],1.025,beginfo,transform=trans,horizontalalignment='left',size='x-small',color='green',bbox=dict(facecolor='white'))
296  ax.text(xpoints[-1],1.025,endinfo,transform=trans,horizontalalignment='left',size='x-small',color='green',bbox=dict(facecolor='white'))
297  #legend
298  ax.legend(tuple(legendlist),loc='upper left')
299  #adjust
300  self.__fig.subplots_adjust(bottom=0.1,left=0.1)
301 
def guessLumiUnit(t)
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
def plotSumX_Fill(self, rawdata={}, resultlines=[], minFill=None, maxFill=None, nticks=6, yscale='linear', withannotation=False, referenceLabel='Delivered', labels=['Delivered', Recorded, textoutput=None)
#define str(s)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
def matplotRender.matplotRender.plotSumX_Run (   self,
  rawdata = {},
  resultlines = [],
  minRun = None,
  maxRun = None,
  nticks = 6,
  yscale = 'linear',
  withannotation = False,
  referenceLabel = 'Delivered',
  labels = ['Delivered',
  Recorded,
  textoutput = None 
)
input:
  rawdata = {'Delivered':[(runnumber,lumiperrun),..],'Recorded':[(runnumber,lumiperrun),..]}
  resultlines = [[runnumber,dellumiperrun,reclumiperrun],[runnumber,dellumiperrun,reclumiperrun],]
  minRun : minimal runnumber required
  maxRun : max runnumber required
  yscale: linear,log or both
  withannotation: wheather the boundary points should be annotated
  referenceLabel: the one variable that decides the total unit and the plot x-axis range
  labels: labels of the variables to plot
  textoutput: text output file name. 

Definition at line 106 of file matplotRender.py.

References mps_setup.append, matplotRender.matplotRender.colormap, cmsPerfStripChart.dict, objects.autophobj.float, matplotRender.guessLumiUnit(), createfilelist.int, list(), edm.print(), str, and ComparisonHelper.zip().

106  def plotSumX_Run(self,rawdata={},resultlines=[],minRun=None,maxRun=None,nticks=6,yscale='linear',withannotation=False,referenceLabel='Delivered',labels=['Delivered','Recorded'],textoutput=None):
107  '''
108  input:
109  rawdata = {'Delivered':[(runnumber,lumiperrun),..],'Recorded':[(runnumber,lumiperrun),..]}
110  resultlines = [[runnumber,dellumiperrun,reclumiperrun],[runnumber,dellumiperrun,reclumiperrun],]
111  minRun : minimal runnumber required
112  maxRun : max runnumber required
113  yscale: linear,log or both
114  withannotation: wheather the boundary points should be annotated
115  referenceLabel: the one variable that decides the total unit and the plot x-axis range
116  labels: labels of the variables to plot
117  textoutput: text output file name.
118  '''
119  ypoints={}
120  ytotal={}
121  for r in resultlines:#parse old text data
122  runnumber=int(r[0])
123  if rawdata and runnumber in [t[0] for t in rawdata[referenceLabel]]:continue#use text input only if not in selected data
124  if minRun and runnumber<minRun: continue
125  if maxRun and runnumber>maxRun: continue
126  for i,lab in enumerate(labels) :
127  v=float(r[-(len(labels)-i)-1])#the values to plot are always the last n fields
128  rawdata.setdefault(lab,[]).append((runnumber,v))
129  if not rawdata:
130  print('[WARNING]: no data to plot , exit')
131  return
132 
133  tot=sum([t[1] for t in rawdata[referenceLabel]])
134  (unitstring,denomitor)=guessLumiUnit(tot)
135  csvreport=None
136  rows=[]
137  flat=[]
138  for label,yvalues in rawdata.items():
139  yvalues.sort()
140  flat.append([t[1] for t in yvalues])
141  ypoints[label]=[]
142  ytotal[label]=0.0
143  lumivals=[t[1] for t in yvalues]
144  for i,val in enumerate(lumivals):
145  ypoints[label].append(sum(lumivals[0:i+1])/denomitor)#integrated lumi
146  ytotal[label]=sum(lumivals)/denomitor
147  xpoints=[t[0] for t in rawdata[referenceLabel]]
148  ax=self.__fig.add_subplot(111)
149  if yscale=='linear':
150  ax.set_yscale('linear')
151  elif yscale=='log':
152  ax.set_yscale('log')
153  else:
154  raise RuntimeError('unsupported yscale '+yscale)
155  ax.set_xlabel(r'Run',position=(0.95,0))
156  ax.set_ylabel(r'L '+unitstring,position=(0,0.9))
157  xticklabels=ax.get_xticklabels()
158  for tx in xticklabels:
159  tx.set_rotation(30)
160  majorLocator=matplotlib.ticker.LinearLocator( nticks )
161  majorFormatter=matplotlib.ticker.FormatStrFormatter('%d')
162  minorLocator=matplotlib.ticker.LinearLocator(numticks=4*nticks)
163  ax.xaxis.set_major_locator(majorLocator)
164  ax.xaxis.set_major_formatter(majorFormatter)
165  ax.xaxis.set_minor_locator(minorLocator)
166  ax.set_xbound(lower=xpoints[0],upper=xpoints[-1])
167  ax.grid(True)
168  keylist=sorted(ypoints.keys())
169  keylist.insert(0,keylist.pop(keylist.index(referenceLabel)))#move refereceLabel to front from now on
170  legendlist=[]
171  head=['#Run']
172  textsummaryhead=['#TotalRun']
173  textsummaryline=['#'+str(len(xpoints))]
174  for ylabel in keylist:
175  cl='k'
176  if ylabel in self.colormap:
177  cl=self.colormap[ylabel]
178  ax.plot(xpoints,ypoints[ylabel],label=ylabel,color=cl,drawstyle='steps')
179  legendlist.append(ylabel+' '+'%.3f'%(ytotal[ylabel])+' '+unitstring)
180  textsummaryhead.append('Total'+ylabel)
181  textsummaryline.append('%.3f'%(ytotal[ylabel])+' '+unitstring)
182  head.append(ylabel)
183  if textoutput:
184  csvreport=csvReporter.csvReporter(textoutput)
185  csvreport.writeRow(head)
186  allruns=[int(t[0]) for t in rawdata[referenceLabel]]
187  flat.insert(0,allruns)
188  rows=list(zip(*flat))
189  csvreport.writeRows([list(t) for t in rows])
190  csvreport.writeRow(textsummaryhead)
191  csvreport.writeRow(textsummaryline)
192  #font=FontProperties(size='medium',weight='demibold')
193  #legend
194  ax.legend(tuple(legendlist),loc='upper left')
195  #adjust
196  self.__fig.subplots_adjust(bottom=0.18,left=0.1)
197  #annotations
198  if withannotation:
199  trans=matplotlib.transforms.BlendedGenericTransform(ax.transData,ax.transAxes)
200  ax.text(xpoints[0],1.025,str(xpoints[0]),transform=trans,horizontalalignment='left',size='x-small',color='green',bbox=dict(facecolor='white'))
201  ax.text(xpoints[-1],1.025,str(xpoints[-1]),transform=trans,horizontalalignment='left',size='x-small',color='green',bbox=dict(facecolor='white'))
202 
203 
def guessLumiUnit(t)
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
#define str(s)
def plotSumX_Run(self, rawdata={}, resultlines=[], minRun=None, maxRun=None, nticks=6, yscale='linear', withannotation=False, referenceLabel='Delivered', labels=['Delivered', Recorded, textoutput=None)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run
def matplotRender.matplotRender.plotSumX_Time (   self,
  rawdata = {},
  resultlines = [],
  minTime = None,
  maxTime = None,
  nticks = 6,
  yscale = 'linear',
  withannotation = False,
  referenceLabel = 'Delivered',
  labels = ['Delivered',
  Recorded,
  textoutput = None 
)
input:
rawdata = {'Delivered':[(runnumber,starttimestamp,stoptimestamp,lumiperrun)],'Recorded':[(runnumber,starttimestamp,stoptimestamp,lumiperrun)]}
resultlines = [[runnumber,starttimestampStr,stoptimestampStr,dellumiperrun,reclumiperrun],[runnumber,starttimestampStr,stoptimestampStr,dellumiperrun,reclumiperrun],]
minTime (python DateTime) : min *begin* time to draw: format %m/%d/%y %H:%M:%S
maxTime (python DateTime): max *begin* time to draw %m/%d/%y %H:%M:%S
yscale: linear,log or both
withannotation: wheather the boundary points should be annotated
referenceLabel: the one variable that decides the total unit and the plot x-axis range
labels: labels of the variables to plot

Definition at line 302 of file matplotRender.py.

References mps_setup.append, matplotRender.matplotRender.colormap, cmsPerfStripChart.dict, objects.autophobj.float, matplotRender.guessLumiUnit(), createfilelist.int, list(), edm.print(), split, str, and ComparisonHelper.zip().

302  def plotSumX_Time(self,rawdata={},resultlines=[],minTime=None,maxTime=None,nticks=6,yscale='linear',withannotation=False,referenceLabel='Delivered',labels=['Delivered','Recorded'],textoutput=None):
303  '''
304  input:
305  rawdata = {'Delivered':[(runnumber,starttimestamp,stoptimestamp,lumiperrun)],'Recorded':[(runnumber,starttimestamp,stoptimestamp,lumiperrun)]}
306  resultlines = [[runnumber,starttimestampStr,stoptimestampStr,dellumiperrun,reclumiperrun],[runnumber,starttimestampStr,stoptimestampStr,dellumiperrun,reclumiperrun],]
307  minTime (python DateTime) : min *begin* time to draw: format %m/%d/%y %H:%M:%S
308  maxTime (python DateTime): max *begin* time to draw %m/%d/%y %H:%M:%S
309  yscale: linear,log or both
310  withannotation: wheather the boundary points should be annotated
311  referenceLabel: the one variable that decides the total unit and the plot x-axis range
312  labels: labels of the variables to plot
313  '''
314  xpoints=[]
315  ypoints={}
316  ytotal={}
317  lut=lumiTime.lumiTime()
318  if not minTime:
319  minTime='03/01/10 00:00:00'
320  minTime=lut.StrToDatetime(minTime,customfm='%m/%d/%y %H:%M:%S')
321  if not maxTime:
322  maxTime=datetime.datetime.utcnow()
323  else:
324  maxTime=lut.StrToDatetime(maxTime,customfm='%m/%d/%y %H:%M:%S')
325  for r in resultlines:
326  runnumber=int(r[0])
327  starttimeStr=r[1].split('.')[0]
328  starttime=lut.StrToDatetime(starttimeStr,customfm='%Y-%m-%d %H:%M:%S')
329  stoptimeStr=r[2].split('.')[0]
330  stoptime=lut.StrToDatetime(stoptimeStr,customfm='%Y-%m-%d %H:%M:%S')
331  if rawdata and runnumber in [t[0] for t in rawdata[referenceLabel]]:continue
332  if starttime<minTime:continue
333  if starttime>maxTime:continue
334 
335  for i,lab in enumerate(labels):
336  v=float(r[-(len(labels)-i)])
337  rawdata.setdefault(lab,[]).append((runnumber,starttime,stoptime,v))
338  if not rawdata:
339  print('[WARNING]: no data, do nothing')
340  return
341  tot=sum([t[3] for t in rawdata[referenceLabel]])
342  (unitstring,denomitor)=guessLumiUnit(tot)
343  csvreport=None
344  rows=[]
345  flat=[]
346  for label,yvalues in rawdata.items():
347  yvalues.sort()
348  flat.append([t[3] for t in yvalues])
349  if label==referenceLabel:
350  minTime=yvalues[0][1]
351  maxTime=yvalues[-1][1]
352  ypoints[label]=[]
353  lumivals=[t[3] for t in yvalues]
354  for i,val in enumerate(lumivals):
355  ypoints[label].append(sum(lumivals[0:i+1])/denomitor)
356  ytotal[label]=sum(lumivals)/denomitor
357  xpoints=[matplotlib.dates.date2num(t[1]) for t in rawdata[referenceLabel]]
358  ax=self.__fig.add_subplot(111)
359  ax.set_yscale(yscale)
360  yearStrMin=minTime.strftime('%Y')
361  yearStrMax=maxTime.strftime('%Y')
362  if yearStrMin==yearStrMax:
363  dateFmt=matplotlib.dates.DateFormatter('%d/%m')
364  else:
365  dateFmt=matplotlib.dates.DateFormatter('%d/%m/%y')
366  majorLoc=matplotlib.ticker.LinearLocator(numticks=nticks)
367  ax.xaxis.set_major_locator(majorLoc)
368  minorLoc=matplotlib.ticker.LinearLocator(numticks=nticks*4)
369  ax.xaxis.set_major_formatter(dateFmt)
370  ax.set_xlabel(r'Date',position=(0.84,0))
371  ax.set_ylabel(r'L '+unitstring,position=(0,0.9))
372  ax.xaxis.set_minor_locator(minorLoc)
373  ax.set_xbound(lower=xpoints[0],upper=xpoints[-1])
374  xticklabels=ax.get_xticklabels()
375  for tx in xticklabels:
376  tx.set_horizontalalignment('left')
377  ax.grid(True)
378  keylist=sorted(ypoints.keys())
379  keylist.insert(0,keylist.pop(keylist.index(referenceLabel)))#move refereceLabel to front from now on
380  legendlist=[]
381  head=['#Run','StartTime','StopTime']
382  textsummaryhead=['#TotalRun']
383  textsummaryline=['#'+str(len(xpoints))]
384  for ylabel in keylist:
385  cl='k'
386  if ylabel in self.colormap:
387  cl=self.colormap[ylabel]
388  ax.plot(xpoints,ypoints[ylabel],label=ylabel,color=cl,drawstyle='steps')
389  legendlist.append(ylabel+' '+'%.3f'%(ytotal[ylabel])+' '+unitstring)
390  textsummaryhead.append('Total'+ylabel)
391  textsummaryline.append('%.3f'%(ytotal[ylabel])+' '+unitstring)
392  head.append(ylabel)
393  if textoutput:
394  csvreport=csvReporter.csvReporter(textoutput)
395  csvreport.writeRow(head)
396  allruns=[int(t[0]) for t in rawdata[referenceLabel]]
397  allstarts=[ lut.DatetimeToStr(t[1],customfm='%Y-%m-%d %H:%M:%S') for t in rawdata[referenceLabel] ]
398  allstops=[ lut.DatetimeToStr(t[2],customfm='%Y-%m-%d %H:%M:%S') for t in rawdata[referenceLabel] ]
399  flat.insert(0,allruns)
400  flat.insert(1,allstarts)
401  flat.insert(2,allstops)
402  rows=list(zip(*flat))
403  csvreport.writeRows([list(t) for t in rows])
404  csvreport.writeRow(textsummaryhead)
405  csvreport.writeRow(textsummaryline)
406  #annotations
407  trans=matplotlib.transforms.BlendedGenericTransform(ax.transData,ax.transAxes)
408  #print 'run boundary ',runs[0],runs[-1]
409  #print 'xpoints boundary ',xpoints[0],xpoints[-1]
410  #annotation
411  if withannotation:
412  runs=[t[0] for t in rawdata[referenceLabel]]
413  ax.text(xpoints[0],1.025,str(runs[0]),transform=trans,horizontalalignment='left',size='x-small',color='green',bbox=dict(facecolor='white'))
414  ax.text(xpoints[-1],1.025,str(runs[-1]),transform=trans,horizontalalignment='left',size='x-small',color='green',bbox=dict(facecolor='white'))
415 
416  if yearStrMin==yearStrMax:
417  firsttimeStr=rawdata[referenceLabel][1][1].strftime('%b %d %H:%M') #time range(start) in the title is the first run beg time
418  lasttimeStr=rawdata[referenceLabel][-1][2].strftime('%b %d %H:%M') #time range(stop) in the tile is the last run stop time
419  #firstimeStr=minTime.strftime('%b %d %H:%M')
420  #lasttimeStr=maxTime.strftime('%b %d %H:%M')
421  #ax.set_title('CMS Total Integrated Luminosity '+yearStrMin+' ('+firstimeStr+' - '+lasttimeStr+' UTC)',size='small',family='fantasy')
422  ax.set_title('CMS Total Integrated Luminosity '+yearStrMin+' ('+firsttimeStr+' - '+lasttimeStr+' UTC)',size='small')
423  else:
424  #ax.set_title('CMS Total Integrated Luminosity '+yearStrMin+'-'+yearStrMax,size='small',family='fantasy')
425  ax.set_title('CMS Total Integrated Luminosity '+yearStrMin+'-'+yearStrMax,size='small')
426  ax.legend(tuple(legendlist),loc='upper left')
427  ax.autoscale_view(tight=True,scalex=True,scaley=False)
428  self.__fig.autofmt_xdate(bottom=0.18,rotation=15,ha='right')
429  self.__fig.subplots_adjust(bottom=0.2,left=0.15)
430 
def plotSumX_Time(self, rawdata={}, resultlines=[], minTime=None, maxTime=None, nticks=6, yscale='linear', withannotation=False, referenceLabel='Delivered', labels=['Delivered', Recorded, textoutput=None)
def guessLumiUnit(t)
S & print(S &os, JobReport::InputFile const &f)
Definition: JobReport.cc:66
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
#define str(s)
double split
Definition: MVATrainer.cc:139
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger list("!*","!HLTx*"if it matches 2 triggers or more) will accept the event if all the matching triggers are FAIL.It will reject the event if any of the triggers are PASS or EXCEPTION(this matches the behavior of"!*"before the partial wildcard feature was incorporated).Triggers which are in the READY state are completely ignored.(READY should never be returned since the trigger paths have been run

Member Data Documentation

matplotRender.matplotRender.__canvas
private
matplotRender.matplotRender.__fig
private
matplotRender.matplotRender.colormap