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

◆ applyLegendSettings()

def DisplayManager.applyLegendSettings (   leg)

Definition at line 6 of file DisplayManager.py.

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

◆ checkDifferences()

def DisplayManager.checkDifferences (   histos)

Definition at line 44 of file DisplayManager.py.

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

References FastTimerService_cff.range.

Referenced by DisplayManager.DisplayManager.Draw().

◆ createRatioCanvas()

def DisplayManager.createRatioCanvas (   name,
  errorBandFillColor = 14,
  errorBandStyle = 3354 
)

Definition at line 14 of file DisplayManager.py.

14 def createRatioCanvas(name, errorBandFillColor=14, errorBandStyle=3354):
15  cv = ROOT.TCanvas(name.replace('.pdf', ''), name.replace('.pdf', ''), 10, 10, 700, 600)
16 
18  cv.Divide(1, 2, 0.0, 0.0)
19 
20  cv.GetPad(1).SetPad(0.0, 0.32, 1., 1.0)
21  cv.GetPad(2).SetPad(0.0, 0.00, 1., 0.34)
22  cv.GetPad(1).SetFillStyle(4000)
23  cv.GetPad(2).SetFillStyle(4000)
24 
25  cv.cd(1)
26  ROOT.gPad.SetTopMargin(0.08)
27  ROOT.gPad.SetLeftMargin(0.12)
28  ROOT.gPad.SetBottomMargin(0.03)
29  ROOT.gPad.SetRightMargin(0.1)
30 
31  cv.cd(2)
32  ROOT.gPad.SetBottomMargin(0.35)
33  ROOT.gPad.SetLeftMargin(0.12)
34  ROOT.gPad.SetRightMargin(0.1)
35 
36  bogyHist = ROOT.TH1F("legendPseudoHist", "", 1, 1., 2.)
37  bogyHist.SetFillColor(errorBandFillColor)
38  bogyHist.SetFillStyle(errorBandStyle)
39  bogyHist.SetLineColor(0)
40 
41  cv.cd(1)
42  return cv
43 
DisplayManager.createRatioCanvas
def createRatioCanvas(name, errorBandFillColor=14, errorBandStyle=3354)
Definition: DisplayManager.py:14
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
DisplayManager.applyLegendSettings
def applyLegendSettings(leg)
Definition: DisplayManager.py:6
DisplayManager.checkDifferences
def checkDifferences(histos)
Definition: DisplayManager.py:44