chisquared Namespace Reference

## Functions

def CalcChi2 (hmc, hdata, alpha=1.)

## Variables

hpred = TH1D("hpred", "", 20, 0, 20)

hrand = TH1D("hrand", "", 20, 0, 20)

rand = TRandom3(27565)

int val = 100

c1 = TCanvas("c1","c1")

chi2 = CalcChi2(hpred, hrand)

Ndof = hpred.GetNbinsX()

p = TMath.Prob(chi2, Ndof)

halt = TH1D("halt", "", 20, 0, 20)

c2 = TCanvas("c2","c2")

hpred2 = hpred.Clone()

hpred3 = hpred.Clone()

c3 = TCanvas("c3","c3")

hlike = TH1D("hlike", ";#theta;#chi^{2}", 400, 0.8, 1.2)

int min = 1000

int minval = 0

theta = hlike.GetBinLowEdge(bin)

c4 = TCanvas("c4", "c4")

## Function Documentation

 def chisquared.CalcChi2 ( hmc, hdata, alpha = `1.` )

Definition at line 43 of file chisquared.py.

References PandAna.Demos.demo1.range, and std.sqrt().

43 def CalcChi2(hmc, hdata, alpha = 1.):
44  chi2 = 0
45  for i in range(1, hmc.GetNbinsX()+1):
46  ei = hmc.GetBinContent(i)*alpha
47  oi = hdata.GetBinContent(i)
48  sigma = sqrt(ei)
49  chi2 += (ei - oi)**2 / sigma**2
50  return chi2
51
T sqrt(T number)
Definition: d0nt_math.hpp:156
def CalcChi2(hmc, hdata, alpha=1.)
Definition: chisquared.py:43

## Variable Documentation

 chisquared.c1 = TCanvas("c1","c1")

Definition at line 36 of file chisquared.py.

 chisquared.c2 = TCanvas("c2","c2")

Definition at line 71 of file chisquared.py.

 chisquared.chi2 = CalcChi2(hpred, hrand)

Definition at line 52 of file chisquared.py.

 chisquared.halt = TH1D("halt", "", 20, 0, 20)

Definition at line 63 of file chisquared.py.

 chisquared.hlike = TH1D("hlike", ";#theta;#chi^{2}", 400, 0.8, 1.2)

Definition at line 110 of file chisquared.py.

 chisquared.hpred = TH1D("hpred", "", 20, 0, 20)

Definition at line 15 of file chisquared.py.

Referenced by DrawResBin(), and PlotNumuPredData().

 chisquared.hpred2 = hpred.Clone()

Definition at line 88 of file chisquared.py.

 chisquared.hpred3 = hpred.Clone()

Definition at line 90 of file chisquared.py.

 chisquared.hrand = TH1D("hrand", "", 20, 0, 20)

Definition at line 16 of file chisquared.py.

 chisquared.min = 1000

Definition at line 114 of file chisquared.py.

 chisquared.minval = 0

Definition at line 115 of file chisquared.py.

Referenced by ana.PlotMultiSyst(), PlotSyst(), ana.PlotSyst(), and PlotSysts().

 chisquared.Ndof = hpred.GetNbinsX()

Definition at line 53 of file chisquared.py.

 chisquared.p = TMath.Prob(chi2, Ndof)

Definition at line 54 of file chisquared.py.

 chisquared.rand = TRandom3(27565)

Definition at line 23 of file chisquared.py.

 int chisquared.val = 100

Definition at line 26 of file chisquared.py.