[ROOT] Re: Removing points from the fit

From: Yuri Gershtein (gerstein@fnal.gov)
Date: Sun Jun 09 2002 - 21:37:16 MEST


Hi,

thanks for the reply.

However, it didn't work:
I made the function fline.C, and then tried

root [1] .L fline.C
root [2] TF1 *fline = new TF1("fline",fline,30,180,2)
... make histogram...
root [36] p0->Fit("fline","l")    
Error: class,struct,union or type $TF1 not defined
Error: class,struct,union or type $TF1 not defined  FILE:fline.C LINE:5
Error: No symbol TF1::RejectPoint() in current scope  FILE:fline.C LINE:5
 FCN=14024.8 FROM MIGRAD    STATUS=CONVERGED      75 CALLS          76 TOTAL
                     EDM=0    STRATEGY= 1  ERROR MATRIX UNCERTAINTY 100.0 per cent
  EXT PARAMETER                APPROXIMATE        STEP         FIRST   
  NO.   NAME      VALUE            ERROR          SIZE      DERIVATIVE 
   1  p0           0.00000e+00   1.41421e+00   0.00000e+00   0.00000e+00
   2  p1           0.00000e+00   1.41421e+00   0.00000e+00   0.00000e+00
*** Interpreter error recovered ***
Error: class,struct,union or type $TF1 not defined  FILE:fline.C LINE:5
Error: No symbol TF1::RejectPoint() in current scope  FILE:fline.C LINE:5
root [37] 

Thanks much,
-y


----------
Dr. Yuri Gershtein, Physics, Brown University.
Based at Fermilab. Tel: (630)-840-3784. Fax: (630)-840-8886
E-Mail: Gerstein@fnal.gov

On Sat, 8 Jun 2002, Rene Brun wrote:

> Hi Yuri,
> 
> An example exclude.C:
> //file exclude.C
> Double_t fline(Double_t *x, Double_t *par)
> {
>     if (x[0] > 2.5 && x[0] < 3.5) {
>       TF1::RejectPoint();
>       return 0;
>    }
>    return par[0] + par[1]*x[0];
> }
> 
> void exclude() {
>    TF1 *f1 = new TF1("f1","[0] +[1]*x +gaus(2)",0,5);
>    f1->SetParameters(6,-1,5,3,0.2);
>    TH1F *h = new TH1F("h","background + signal",100,0,5);
>    h->FillRandom("f1",2000);
>    TF1 *fline = new TF1("fline",fline,0,5,2);
>    fline->SetParameters(2,-1);
>    h->Fit("fline","l");
> }
> 
> 
> Rene Brun
> 
> On Sat, 8 Jun 2002, Yuri Gershtein wrote:
> 
> > Hi,
> > 
> > so I have a peak which sits on a low statistics background, so
> > I should use log likelihood.
> > I want to fit just background without the peak, say with [1]*x+[0].
> > 
> > Can I define a non-contiguos range for the fit?
> > Setting errors to zero doesn't seem to work for the log likelihood (I
> > think in PAW it used to work, i.e. non-zero bin with zero error was
> > excluded from the fit).
> > 
> > Also, in PAW I knew how to control the FCN calculation, and though this
> > was not graceful, it worked...
> > 
> > Thanks for your help,
> > Yuri
> > 
> > 
> > ----------
> > Dr. Yuri Gershtein, Physics, Brown University.
> > Based at Fermilab. Tel: (630)-840-3784. Fax: (630)-840-8886
> > E-Mail: Gerstein@fnal.gov
> > 
> 
> 



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:56 MET