[ROOT] How to take the diff. b/w histo contents and fit

From: kirti@fnal.gov
Date: Wed Nov 19 2003 - 08:32:00 MET


Hi again!
I have one more query:

I am plotting one dim. histogram and then fit it with linear(po1) fit in
some specified range.

>TH1D *h = (TH1D*) h_ave->ProjectionY("", 29, 29);

//where h_ave is 2D histogram. There are 50 bins and the maximum value
in this plot goes up to 20000.

>TF1 *pol1 = new TF1("pol1","pol1",0,2000);
h->Fit("pol1","R");

I would now like to take the difference between the two i.e., Fit and
original Histogram, and plot it. 

For histogram I can find the Bin Content by using:
>for(bin=0; bin<50;bin++)
h1->SetBinContent(1+bin,h->GetBinContent(1+bin));

But I do not understand how to find the bin content for Fit and then
take the differnce.
Please suggest.
Kirti
     

 



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:16 MET