27 |
|
def getRatio(hist,reference,min,max,yTitle="",maxUncertainty = 0.2,restrict=True): |
28 |
|
from ROOT import gROOT |
29 |
|
theHist, theReference = renewHist(hist,reference,min,max) |
30 |
< |
gROOT.LoadMacro('./Ratio.C+') |
30 |
> |
ROOT.gSystem.Load('./Ratio_C.so') |
31 |
|
from ROOT import coolRatio |
32 |
|
thePlotter = coolRatio() |
33 |
|
theRatio = thePlotter.make_rebinned_ratios(theHist,theReference,maxUncertainty,False,0) |
51 |
|
theRatio.GetYaxis().CenterTitle(ROOT.kTRUE) |
52 |
|
theRatio.GetYaxis().SetDrawOption("M") |
53 |
|
theRatio.SetXTitle(yTitle) |
54 |
< |
if yTitle == "": |
55 |
< |
theRatio.SetYTitle("Data/MC") |
56 |
< |
print 'Data mean = %.2f' %(theHist.GetMean()) |
57 |
< |
print 'MC mean = %.2f' %(theReference.GetMean()) |
58 |
< |
ksScore = theHist.KolmogorovTest( theReference ) |
59 |
< |
chiScore = theHist.Chi2Test( theReference , "UW") |
60 |
< |
return theRatio, refError, ksScore, chiScore |
54 |
> |
theRatio.SetYTitle("Data/MC") |
55 |
> |
return theRatio, refError |
56 |
|
|