[ROOT] Modified Chi square

From: Alberto Garcia Raboso (Alberto.Garcia.Raboso@cern.ch)
Date: Thu Aug 15 2002 - 15:38:34 MEST


Hi ROOTers,

I need to do a fit with a modified Chi square function. As appers in the
class description of the TH1::Fit method, I used the "U" option having
previously done
  TVirtualFitter::Fitter(pDevGraph)->SetFCN(ModifiedChisquare)
where pDevGraph is a pointer to a TProfile object (inheriting from TH1),
and ModifiedChisquare is defined as
  extern void ModifiedChisquare(Int_t &npar, Double_t *gin, Double_t &f,
Double_t *u, Int_t flag);

Esentially, ModifiedChisquare is the same function as TH1FitChisquare (I
cut and pasted the code), with these four lines at the very end:
   if (gF1->EvalPar(1000,u) >= 300)
	  f += 1e10;
   if (gF1->EvalPar(-1000,u) >= 300)
	  f += 1e10;
Here, gF1 is pretended to be the fitting function and f the variable
containing the Chisquare of the fit.

The problem is, evidently, that gF1 (and other variables) are defined
globally in the TH1 class, and so ACLiC complains saying that gF1 (and
the others) are undeclared. So, does anybody know how I can use this
modified Chi square without having to deal directly with TMinuit?

I'm running ROOT 3.03.02 from the CVS repository, in lxplus at CERN.

Thanks in advance,

Alberto



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