CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Classes | Functions
DisplayManager Namespace Reference

Classes

class  DisplayManager
 

Functions

def applyLegendSettings
 
def checkDifferences
 
def createRatioCanvas
 

Function Documentation

def DisplayManager.applyLegendSettings (   leg)

Definition at line 6 of file DisplayManager.py.

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

Definition at line 44 of file DisplayManager.py.

References sistrip::SpyUtilities.range().

Referenced by DisplayManager.DisplayManager.Draw().

44 
45 def checkDifferences(histos):
46  rel_diff = 0
47  if len(histos)>0:
48  for ib in range(0, histos[0].GetNbinsX()):
49  for ih, h in enumerate(histos):
50  if not ih == 0:
51  if not histos[0].GetBinContent(ib+1) == 0:
52  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))
53  return math.sqrt(rel_diff)
const uint16_t range(const Frame &aFrame)
def DisplayManager.createRatioCanvas (   name,
  errorBandFillColor = 14,
  errorBandStyle = 3354 
)

Definition at line 14 of file DisplayManager.py.

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