[ROOT] Fitting problems

From: Emily Nurse (emily@hep.man.ac.uk)
Date: Thu Mar 14 2002 - 12:01:58 MET


Hello,
I have a couple of questions involving the Fit function.
Firstly when I use it it normalises my user defined function for me to
give the loest possible chisquared value when fitted to my data points. I
was wandering if I could switch this action off and just get a straight
forward chisquared value as I will be fitting different ranges seperately
that need to be normalised by the same amount even though this may not
give the lowest chi-squared value.
Secondly I am getting an error message when I run my macro which includes
the function:

 Double_t norm ( Double_t *x, Double_t *par)
            {
	    Double_t xx=x[0];
            Int_t bin = w_pte1->GetXaxis()->FindBin(xx);
            return par[0]*(w_pte1->GetBinContent(bin));
            }

(where w_pte1 is a TH1D object). Then at the root prompt I type:

root [3] TF1 *f1 = new TF1("norm",norm,0.,50.,1)
root [5] f1->SetParameter(0,1)
root [6] f1->Draw()
<TCanvas::MakeDefCanvas>: created default TCanvas with name c1
Error: non class,struct,union object $w_pte1 used with . or ->Error: non
class,struct,union object $w_pte1 used with . or ->Error: non
class,struct,union object $w_pte1 used with . or ->root [7]

Things do seem to work but I was wandering what I was doing wrong,
thanks for your help,
Emily.



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