Re: using TFractionFitter class

From: nasim <nasim_at_hep.man.ac.uk>
Date: Sun, 19 Feb 2006 14:52:29 +0000 (GMT)

Thank you Frank! That was really useful.

Nasim.

On Sun, 19 Feb 2006, Frank Filthaut wrote:

> Dear Nasim,
>
> yes, use GetResult(), as in:
>
> double, value, error;
> fit->GetResult(1, value, error);
> cout << "fitted fraction for source 1 = " << value << " +- "
> << error << endl;
>
> Regards,
> Frank
>
> On Sun, 19 Feb 2006, nasim wrote:
>
> >
> > Hi,
> >
> > I would like to use TFractionFitter class to find the fraction of
> > background events and signal events in the data.
> >
> > Therefore I fited the data with background mc and signal mc.
> >
> > I used GetPlot() function to fit data with MCs
> > and ploted the fitted histogram. But I do not know how to find the
> > actual fraction value of background and signal. ( for example I would
> > like to have output in this from: 0.9 signal and 0.1 background).
> >
> > I think I should use GetResult function. But I don' t know how?
> >
> > Thanks for any help,
> >
> > Nasim
> >
> >
> > finalsum1->Add(energy_dis[0],addingsum_wbi207,1,-1);
> > TObjArray *mc=new TObjArray(2);
> > mc->Add(energy_dis[1]);
> > mc->Add(energy_dis[8]);
> >
> > TFractionFitter* fit=new TFractionFitter(finalsum1,mc);
> > Int_t status=fit->Fit();
> > cout<<"fit status: " <<status<<endl;
> > finalsum1->SetMinimum(0.);
> > if (status == 0) { // check on fit status
> > TH1F* result= (TH1F*) fit->GetPlot();
> > finalsum1->Draw("E");
> > //fit->GetResult(1, 1.68363e-01,5.18030e-02);
> >
> > mc->Draw("same");
> > result->SetLineColor(8);
> > result->Draw("same");
> >
> > }
> >
> >
>
Received on Sun Feb 19 2006 - 15:52:34 MET

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:31:57 MET