Hi Carl,
An example below;
Rene Brun
void binomial() {
c1 = new TCanvas("c1","The FillRandom example",200,10,900,600);
gaus1 = new TFormula("gaus1","gaus");
gaus1->SetParameters(1000,10,3);
const int nbins = 20;
h1 = new TH1F("h1","Test random numbers",nbins,0,20);
h2 = new TH1F("h2","Test random numbers",nbins,0,20);
h1->Sumw2();
h2->Sumw2();
h1->FillRandom("gaus1",8000);
h2->FillRandom("gaus1",2000);
TH1F *result = new TH1F("binomial","Test binomial",nbins,0,20);
result->Divide(h1,h2,1.0,1.0,"b");
result->SetMarkerStyle(21);
result->Draw();
}
Carl Gwilliam wrote:
>
> Hi
>
> I want to plot a histogram with Binomial errors in the y direction, how
> can I do this in root?
>
> More specifically I am dividing two histograms which plot Ntrig and N
> as the height of each point to get the efficiency as:
>
> eff = Ntrig/N
>
> and on this divided histogram I want to plot the errors on each
> point according to the formula:
>
> eff_error = sqrt(Ntrig/(N*N)*(1-Ntrig/N)).
>
> At the same time I want to plot the markers as points with x-error bars
> which are the width of the bin.
>
> Cheers,
>
> Carl
This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:09 MET