CMS 3D CMS Logo

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

Public Member Functions

def __init__ (self, pad, bounds, histos, ratioOrig, ratioFactor)
 
def adjustMarginLeft (self, adjust)
 
def adjustMarginRight (self, adjust)
 
def redrawAxis (self)
 
def setGridx (self, grid)
 
def setGridy (self, grid)
 
def setLogx (self, log)
 
def setLogy (self, log)
 
def setTitle (self, title)
 
def setXLabelSize (self, size)
 
def setXTitle (self, title)
 
def setXTitleOffset (self, size)
 
def setXTitleSize (self, size)
 
def setYTitle (self, title)
 
def setYTitleOffset (self, offset)
 
def setYTitleSize (self, size)
 
def setZTitle (self, title)
 
def setZTitleOffset (self, offset)
 

Private Attributes

 _firstHisto
 
 _pad
 
 _xlabelsize
 
 _xtitle
 
 _xtitleoffset
 
 _xtitlesize
 
 _ytitle
 
 _ytitleoffset
 
 _ytitlesize
 

Detailed Description

Class for creating and managing a frame for a plot from TGraph2D

Definition at line 1410 of file plotting.py.

Constructor & Destructor Documentation

◆ __init__()

def plotting.FrameTGraph2D.__init__ (   self,
  pad,
  bounds,
  histos,
  ratioOrig,
  ratioFactor 
)

Definition at line 1412 of file plotting.py.

1412  def __init__(self, pad, bounds, histos, ratioOrig, ratioFactor):
1413  self._pad = pad
1414  if ratioOrig:
1415  self._pad = pad.cd(1)
1416 
1417  # adjust margins because of not having the ratio, we want
1418  # the same bottom margin, so some algebra gives this
1419  (xlow, ylow, width, height) = (self._pad.GetXlowNDC(), self._pad.GetYlowNDC(), self._pad.GetWNDC(), self._pad.GetHNDC())
1420  xup = xlow+width
1421  yup = ylow+height
1422 
1423  bottomMargin = self._pad.GetBottomMargin()
1424  bottomMarginNew = ROOT.gStyle.GetPadBottomMargin()
1425 
1426  ylowNew = yup - (1-bottomMargin)/(1-bottomMarginNew) * (yup-ylow)
1427  topMarginNew = self._pad.GetTopMargin() * (yup-ylow)/(yup-ylowNew)
1428 
1429  self._pad.SetPad(xlow, ylowNew, xup, yup)
1430  self._pad.SetTopMargin(topMarginNew)
1431  self._pad.SetBottomMargin(bottomMarginNew)
1432 
1433  self._xtitleoffset = 1.8
1434  self._ytitleoffset = 2.3
1435 
1436  self._firstHisto = histos[0]
1437 
def __init__(self, dataset, job_number, job_id, job_name, isDA, isMC, applyBOWS, applyEXTRACOND, extraconditions, runboundary, lumilist, intlumi, maxevents, gt, allFromGT, alignmentDB, alignmentTAG, apeDB, apeTAG, bowDB, bowTAG, vertextype, tracktype, refittertype, ttrhtype, applyruncontrol, ptcut, CMSSW_dir, the_dir)

Member Function Documentation

◆ adjustMarginLeft()

def plotting.FrameTGraph2D.adjustMarginLeft (   self,
  adjust 
)

Definition at line 1450 of file plotting.py.

1450  def adjustMarginLeft(self, adjust):
1451  self._pad.SetLeftMargin(self._pad.GetLeftMargin()+adjust)
1452  self._pad.cd()
1453 

◆ adjustMarginRight()

def plotting.FrameTGraph2D.adjustMarginRight (   self,
  adjust 
)

Definition at line 1454 of file plotting.py.

References plotting.Frame._pad, plotting.FrameRatio._pad, plotting.FrameTGraph2D._pad, and hippyaddtobaddatafiles.cd().

1454  def adjustMarginRight(self, adjust):
1455  self._pad.SetRightMargin(self._pad.GetRightMargin()+adjust)
1456  self._pad.cd()
1457 

◆ redrawAxis()

def plotting.FrameTGraph2D.redrawAxis (   self)

Definition at line 1488 of file plotting.py.

References plotting.FrameTGraph2D._firstHisto, plotting.Frame._pad, plotting.FrameRatio._pad, plotting.FrameTGraph2D._pad, plotting.FrameTGraph2D._xtitle, plotting.FrameTGraph2D._xtitleoffset, plotting.FrameTGraph2D._xtitlesize, plotting.FrameTGraph2D._ytitle, plotting.FrameTGraph2D._ytitleoffset, and plotting.FrameTGraph2D._ytitlesize.

1488  def redrawAxis(self):
1489  # set top view
1490  epsilon = 1e-7
1491  self._pad.SetPhi(epsilon)
1492  self._pad.SetTheta(90+epsilon)
1493 
1494  self._firstHisto.GetXaxis().SetTitleOffset(self._xtitleoffset)
1495  self._firstHisto.GetYaxis().SetTitleOffset(self._ytitleoffset)
1496 
1497  if hasattr(self, "_xtitle"):
1498  self._firstHisto.GetXaxis().SetTitle(self._xtitle)
1499  if hasattr(self, "_xtitlesize"):
1500  self._firstHisto.GetXaxis().SetTitleSize(self._xtitlesize)
1501  if hasattr(self, "_xlabelsize"):
1502  self._firstHisto.GetXaxis().SetLabelSize(self._labelsize)
1503  if hasattr(self, "_ytitle"):
1504  self._firstHisto.GetYaxis().SetTitle(self._ytitle)
1505  if hasattr(self, "_ytitlesize"):
1506  self._firstHisto.GetYaxis().SetTitleSize(self._ytitlesize)
1507  if hasattr(self, "_ytitleoffset"):
1508  self._firstHisto.GetYaxis().SetTitleOffset(self._ytitleoffset)
1509 

◆ setGridx()

def plotting.FrameTGraph2D.setGridx (   self,
  grid 
)

Definition at line 1444 of file plotting.py.

1444  def setGridx(self, grid):
1445  pass
1446 

◆ setGridy()

def plotting.FrameTGraph2D.setGridy (   self,
  grid 
)

Definition at line 1447 of file plotting.py.

1447  def setGridy(self, grid):
1448  pass
1449 

◆ setLogx()

def plotting.FrameTGraph2D.setLogx (   self,
  log 
)

Definition at line 1438 of file plotting.py.

1438  def setLogx(self, log):
1439  pass
1440 

◆ setLogy()

def plotting.FrameTGraph2D.setLogy (   self,
  log 
)

Definition at line 1441 of file plotting.py.

1441  def setLogy(self, log):
1442  pass
1443 

◆ setTitle()

def plotting.FrameTGraph2D.setTitle (   self,
  title 
)

Definition at line 1458 of file plotting.py.

1458  def setTitle(self, title):
1459  pass
1460 

◆ setXLabelSize()

def plotting.FrameTGraph2D.setXLabelSize (   self,
  size 
)

Definition at line 1470 of file plotting.py.

1470  def setXLabelSize(self, size):
1471  self._xlabelsize = size
1472 

◆ setXTitle()

def plotting.FrameTGraph2D.setXTitle (   self,
  title 
)

Definition at line 1461 of file plotting.py.

1461  def setXTitle(self, title):
1462  self._xtitle = title
1463 

◆ setXTitleOffset()

def plotting.FrameTGraph2D.setXTitleOffset (   self,
  size 
)

Definition at line 1467 of file plotting.py.

References plotting.FrameTGraph2D._xtitleoffset.

1467  def setXTitleOffset(self, size):
1468  self._xtitleoffset = size
1469 

◆ setXTitleSize()

def plotting.FrameTGraph2D.setXTitleSize (   self,
  size 
)

Definition at line 1464 of file plotting.py.

1464  def setXTitleSize(self, size):
1465  self._xtitlesize = size
1466 

◆ setYTitle()

def plotting.FrameTGraph2D.setYTitle (   self,
  title 
)

Definition at line 1473 of file plotting.py.

1473  def setYTitle(self, title):
1474  self._ytitle = title
1475 

◆ setYTitleOffset()

def plotting.FrameTGraph2D.setYTitleOffset (   self,
  offset 
)

Definition at line 1479 of file plotting.py.

References plotting.FrameTGraph2D._ytitleoffset.

1479  def setYTitleOffset(self, offset):
1480  self._ytitleoffset = offset
1481 

◆ setYTitleSize()

def plotting.FrameTGraph2D.setYTitleSize (   self,
  size 
)

Definition at line 1476 of file plotting.py.

1476  def setYTitleSize(self, size):
1477  self._ytitlesize = size
1478 

◆ setZTitle()

def plotting.FrameTGraph2D.setZTitle (   self,
  title 
)

Definition at line 1482 of file plotting.py.

References plotting.FrameTGraph2D._firstHisto.

1482  def setZTitle(self, title):
1483  self._firstHisto.GetZaxis().SetTitle(title)
1484 

◆ setZTitleOffset()

def plotting.FrameTGraph2D.setZTitleOffset (   self,
  offset 
)

Definition at line 1485 of file plotting.py.

References plotting.FrameTGraph2D._firstHisto.

1485  def setZTitleOffset(self, offset):
1486  self._firstHisto.GetZaxis().SetTitleOffset(offset)
1487 

Member Data Documentation

◆ _firstHisto

plotting.FrameTGraph2D._firstHisto
private

◆ _pad

plotting.FrameTGraph2D._pad
private

◆ _xlabelsize

plotting.FrameTGraph2D._xlabelsize
private

Definition at line 1471 of file plotting.py.

◆ _xtitle

plotting.FrameTGraph2D._xtitle
private

Definition at line 1462 of file plotting.py.

Referenced by plotting.FrameTGraph2D.redrawAxis().

◆ _xtitleoffset

plotting.FrameTGraph2D._xtitleoffset
private

◆ _xtitlesize

plotting.FrameTGraph2D._xtitlesize
private

Definition at line 1465 of file plotting.py.

Referenced by plotting.FrameTGraph2D.redrawAxis().

◆ _ytitle

plotting.FrameTGraph2D._ytitle
private

Definition at line 1474 of file plotting.py.

Referenced by plotting.FrameTGraph2D.redrawAxis().

◆ _ytitleoffset

plotting.FrameTGraph2D._ytitleoffset
private

◆ _ytitlesize

plotting.FrameTGraph2D._ytitlesize
private

Definition at line 1477 of file plotting.py.

Referenced by plotting.FrameTGraph2D.redrawAxis().