CMS 3D CMS Logo

Classes | Functions
DisplayManager Namespace Reference

Classes

class  DisplayManager
 

Functions

def applyLegendSettings (leg)
 
def checkDifferences (histos)
 
def createRatioCanvas (name, errorBandFillColor=14, errorBandStyle=3354)
 

Function Documentation

def DisplayManager.applyLegendSettings (   leg)

Definition at line 5 of file DisplayManager.py.

6  leg.SetBorderSize(0)
7  leg.SetFillColor(10)
8  leg.SetLineColor(0)
9  leg.SetFillStyle(0)
10 # leg.SetTextSize(0.035)
11 # leg.SetTextFont(42)
12 
def applyLegendSettings(leg)
def DisplayManager.checkDifferences (   histos)

Definition at line 43 of file DisplayManager.py.

Referenced by DisplayManager.DisplayManager.Draw().

43 def checkDifferences(histos):
44  rel_diff = 0
45  if len(histos)>0:
46  for ib in range(0, histos[0].GetNbinsX()):
47  for ih, h in enumerate(histos):
48  if not ih == 0:
49  if not histos[0].GetBinContent(ib+1) == 0:
50  rel_diff+=((h.GetBinContent(ib+1)-histos[0].GetBinContent(ib+1))/histos[0].GetBinContent(ib+1))*((h.GetBinContent(ib+1)-histos[0].GetBinContent(ib+1))/histos[0].GetBinContent(ib+1))
51  return math.sqrt(rel_diff)
52 
def checkDifferences(histos)
def DisplayManager.createRatioCanvas (   name,
  errorBandFillColor = 14,
  errorBandStyle = 3354 
)

Definition at line 13 of file DisplayManager.py.

13 def createRatioCanvas(name, errorBandFillColor=14, errorBandStyle=3354):
14  cv = ROOT.TCanvas(name.replace('.pdf', ''), name.replace('.pdf', ''), 10, 10, 700, 600)
15  ## this is the tricky part...
16  ## Divide with correct margins
17  cv.Divide(1, 2, 0.0, 0.0)
18  ## Set Pad sizes
19  cv.GetPad(1).SetPad(0.0, 0.32, 1., 1.0)
20  cv.GetPad(2).SetPad(0.0, 0.00, 1., 0.34)
21  cv.GetPad(1).SetFillStyle(4000)
22  cv.GetPad(2).SetFillStyle(4000)
23  ## Set pad margins 1
24  cv.cd(1)
25  ROOT.gPad.SetTopMargin(0.08)
26  ROOT.gPad.SetLeftMargin(0.12)
27  ROOT.gPad.SetBottomMargin(0.03)
28  ROOT.gPad.SetRightMargin(0.1)
29  ## Set pad margins 2
30  cv.cd(2)
31  ROOT.gPad.SetBottomMargin(0.35)
32  ROOT.gPad.SetLeftMargin(0.12)
33  ROOT.gPad.SetRightMargin(0.1)
34 
35  bogyHist = ROOT.TH1F("legendPseudoHist", "", 1, 1., 2.)
36  bogyHist.SetFillColor(errorBandFillColor)
37  bogyHist.SetFillStyle(errorBandStyle)
38  bogyHist.SetLineColor(0)
39 
40  cv.cd(1)
41  return cv
42 
def createRatioCanvas(name, errorBandFillColor=14, errorBandStyle=3354)