Re: TH1::Fit options

From: Rene Brun (Rene.Brun@cern.ch)
Date: Fri Mar 03 2000 - 16:48:24 MET


Hi Colin,
If you read carefully the documentation of TH1::Fit, it says;

  "R" Use the Range specified in the function range
  "N" Do not store the graphics function, do not draw
  "0" Do not plot the result of the fit. By default the fitted function
          is drawn unless the option"N" above is specified.
  "+" Add this new fitted function to the list of fitted functions
         (by default, any previous function is deleted)

When executing the example multifit.C, you can achieve what you want
by replacing the 3 statements:
   h->Fit("g1","R0+");
   h->Fit("g2","R0+");
   h->Fit("g3","R0+");
by

   h->Fit("g1","RN");
   h->Fit("g2","RN");
   h->Fit("g3","RN");

Rene Brun

C. Bernet wrote:
> 
> Hello,
> 
> I'm really sorry for saturating roottalk today, but I have another problem
> : I want to fit in a subrange of a 1D histo, WITHOUT drawing the function.
> I tried something similar to the tutorial macro :
> 
> http://root.cern.ch/root/html/examples/multifit.C.html
> 
> In this macro, the option given to TH1::Fit is "R0" (I tried both zero
> and O), wich means you don't want the resulting function to be drawn. But
> if you look at the output :
> http://root.cern.ch/root/html/examples/gif/multifit.gif
> 
> the functions are drawn (in black) !
> 
> Actually, it looks like the "0" option is never taken into account when
> you call the method in a context. If you do it in cint, the function is
> not drawn.
> 
> Do you know what's happening ?
> 
> Thanks !
> 
>                 Colin



This archive was generated by hypermail 2b29 : Tue Jan 02 2001 - 11:50:20 MET