// @(#)root/minuit:$Id$
// Author: Rene Brun   31/08/99
/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

#include "TMinuit.h"
#include "TFitter.h"
#include "TH1.h"
#include "TF1.h"
#include "TF2.h"
#include "TF3.h"
#include "TList.h"
#include "TGraph.h"
#include "TGraph2D.h"
#include "TMultiGraph.h"
#include "TMath.h"

extern void H1FitChisquare(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag);
extern void H1FitLikelihood(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag);
extern void GraphFitChisquare(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag);
extern void Graph2DFitChisquare(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag);
extern void MultiGraphFitChisquare(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag);
extern void F2Fit(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag);
extern void F3Fit(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag);

ClassImp(TFitter)

//______________________________________________________________________________
TFitter::TFitter(Int_t maxpar)
{
//*-*-*-*-*-*-*-*-*-*-*default constructor*-*-*-*-*-*-*-*-*-*-*-*-*
//*-*                  ===================

   fMinuit = new TMinuit(maxpar);
   fNlog = 0;
   fSumLog = 0;
   fCovar = 0;
   SetName("MinuitFitter");
}

//______________________________________________________________________________
TFitter::~TFitter()
{
//*-*-*-*-*-*-*-*-*-*-*default destructor*-*-*-*-*-*-*-*-*-*-*-*-*-*
//*-*                  ==================

   if (fCovar)  delete [] fCovar;
   if (fSumLog) delete [] fSumLog;
   delete fMinuit;
}

//______________________________________________________________________________
Double_t TFitter::Chisquare(Int_t npar, Double_t *params) const
{
   // return a chisquare equivalent

   Double_t amin = 0;
   H1FitChisquare(npar,params,amin,params,1);
   return amin;
}

//______________________________________________________________________________
void TFitter::Clear(Option_t *)
{
   // reset the fitter environment

   if (fCovar)  {delete [] fCovar; fCovar = 0;}
   fMinuit->mncler();

   //reset the internal Minuit random generator to its initial state
   Double_t val = 3;
   Int_t inseed = 12345;
   fMinuit->mnrn15(val,inseed);
}

//______________________________________________________________________________
Int_t TFitter::ExecuteCommand(const char *command, Double_t *args, Int_t nargs)
{
   // Execute a fitter command;
   //   command : command string
   //   args    : list of nargs command arguments

   if (fCovar)  {delete [] fCovar; fCovar = 0;}
   Int_t ierr = 0;
   fMinuit->mnexcm(command,args,nargs,ierr);
   return ierr;
}

//______________________________________________________________________________
void TFitter::FixParameter(Int_t ipar)
{
   // Fix parameter ipar.

   if (fCovar)  {delete [] fCovar; fCovar = 0;}
   fMinuit->FixParameter(ipar);
}

//______________________________________________________________________________
void TFitter::GetConfidenceIntervals(Int_t n, Int_t ndim, const Double_t *x, Double_t *ci, Double_t cl)
{
//Computes point-by-point confidence intervals for the fitted function
//Parameters:
//n - number of points
//ndim - dimensions of points
//x - points, at which to compute the intervals, for ndim > 1
//    should be in order: (x0,y0, x1, y1, ... xn, yn)
//ci - computed intervals are returned in this array
//cl - confidence level, default=0.95
//NOTE, that the intervals are approximate for nonlinear(in parameters) models

   TF1 *f = (TF1*)fUserFunc;
   Int_t npar = f->GetNumberFreeParameters();
   Int_t npar_real = f->GetNpar();
   Double_t *grad = new Double_t[npar_real];
   Double_t *sum_vector = new Double_t[npar];
   Bool_t *fixed=0;
   Double_t al, bl;
   if (npar_real != npar){
      fixed = new Bool_t[npar_real];
      memset(fixed,0,npar_real*sizeof(Bool_t));

      for (Int_t ipar=0; ipar<npar_real; ipar++){
         fixed[ipar]=0;
         f->GetParLimits(ipar,al,bl);
         if (al*bl != 0 && al >= bl) {
            //this parameter is fixed
            fixed[ipar]=1;
         }
      }
   }
   Double_t c=0;

   Double_t *matr = GetCovarianceMatrix();
   if (!matr)
      return;
   Double_t t = TMath::StudentQuantile(0.5 + cl/2, f->GetNDF());
   Double_t chidf = TMath::Sqrt(f->GetChisquare()/f->GetNDF());
   Int_t igrad, ifree=0;
   for (Int_t ipoint=0; ipoint<n; ipoint++){
      c=0;
      f->GradientPar(x+ndim*ipoint, grad);
      //multiply the covariance matrix by gradient
      for (Int_t irow=0; irow<npar; irow++){
         sum_vector[irow]=0;
         igrad = 0;
         for (Int_t icol=0; icol<npar; icol++){
            igrad = 0;
            ifree=0;
            if (fixed) {
               //find the free parameter #icol
               while (ifree<icol+1){
                  if (fixed[igrad]==0) ifree++;
                  igrad++;
               }
               igrad--;
               //now the [igrad] element of gradient corresponds to [icol] element of cov.matrix
            } else {
               igrad = icol;
            }
            sum_vector[irow]+=matr[irow*npar_real+icol]*grad[igrad];
         }
      }
      igrad = 0;
      for (Int_t i=0; i<npar; i++){
         igrad = 0; ifree=0;
         if (fixed) {
            //find the free parameter #icol
            while (ifree<i+1){
               if (fixed[igrad]==0) ifree++;
               igrad++;
            }
            igrad--;
         } else {
            igrad = i;
         }
         c+=grad[igrad]*sum_vector[i];
      }

      c=TMath::Sqrt(c);
      ci[ipoint]=c*t*chidf;
   }

   delete [] grad;
   delete [] sum_vector;
   if (fixed)
      delete [] fixed;
}

//______________________________________________________________________________
void TFitter::GetConfidenceIntervals(TObject *obj, Double_t cl)
{
//Computes confidence intervals at level cl. Default is 0.95
//The TObject parameter can be a TGraphErrors, a TGraph2DErrors or a TH1,2,3.
//For Graphs, confidence intervals are computed for each point,
//the value of the graph at that point is set to the function value at that
//point, and the graph y-errors (or z-errors) are set to the value of
//the confidence interval at that point.
//For Histograms, confidence intervals are computed for each bin center
//The bin content of this bin is then set to the function value at the bin
//center, and the bin error is set to the confidence interval value.
//NOTE: confidence intervals are approximate for nonlinear models!
//
//Allowed combinations:
//Fitted object               Passed object
//TGraph                      TGraphErrors, TH1
//TGraphErrors, AsymmErrors   TGraphErrors, TH1
//TH1                         TGraphErrors, TH1
//TGraph2D                    TGraph2DErrors, TH2
//TGraph2DErrors              TGraph2DErrors, TH2
//TH2                         TGraph2DErrors, TH2
//TH3                         TH3

   if (obj->InheritsFrom(TGraph::Class())) {
      TGraph *gr = (TGraph*)obj;
      if (!gr->GetEY()){
         Error("GetConfidenceIntervals", "A TGraphErrors should be passed instead of a graph");
         return;
      }
      if (fObjectFit->InheritsFrom(TGraph2D::Class())){
         Error("GetConfidenceIntervals", "A TGraph2DErrors should be passed instead of a graph");
         return;
      }
      if (fObjectFit->InheritsFrom(TH1::Class())){
         if (((TH1*)(fObjectFit))->GetDimension()>1){
            Error("GetConfidenceIntervals", "A TGraph2DErrors or a TH23 should be passed instead of a graph");
            return;
         }
      }
      GetConfidenceIntervals(gr->GetN(),1,gr->GetX(), gr->GetEY(), cl);
      for (Int_t i=0; i<gr->GetN(); i++)
         gr->SetPoint(i, gr->GetX()[i], ((TF1*)(fUserFunc))->Eval(gr->GetX()[i]));
   }

   //TGraph2D/////////////////
   else if (obj->InheritsFrom(TGraph2D::Class())) {
      TGraph2D *gr2 = (TGraph2D*)obj;
      if (!gr2->GetEZ()){
         Error("GetConfidenceIntervals", "A TGraph2DErrors should be passed instead of a TGraph2D");
         return;
      }
      if (fObjectFit->InheritsFrom(TGraph::Class())){
         Error("GetConfidenceIntervals", "A TGraphErrors should be passed instead of a TGraph2D");
         return;
      }
      if (fObjectFit->InheritsFrom(TH1::Class())){
         if (((TH1*)(fObjectFit))->GetDimension()==1){
            Error("GetConfidenceIntervals", "A TGraphErrors or a TH1 should be passed instead of a graph");
            return;
         }
      }
      TF2 *f=(TF2*)fUserFunc;
      Double_t xy[2];
      Int_t np = gr2->GetN();
      Int_t npar = f->GetNpar();
      Double_t *grad = new Double_t[npar];
      Double_t *sum_vector = new Double_t[npar];
      Double_t *x = gr2->GetX();
      Double_t *y = gr2->GetY();
      Double_t t = TMath::StudentQuantile(0.5 + cl/2, f->GetNDF());
      Double_t chidf = TMath::Sqrt(f->GetChisquare()/f->GetNDF());
      Double_t *matr=GetCovarianceMatrix();
      Double_t c = 0;
      for (Int_t ipoint=0; ipoint<np; ipoint++){
         xy[0]=x[ipoint];
         xy[1]=y[ipoint];
         f->GradientPar(xy, grad);
         for (Int_t irow=0; irow<f->GetNpar(); irow++){
            sum_vector[irow]=0;
            for (Int_t icol=0; icol<npar; icol++)
               sum_vector[irow]+=matr[irow*npar+icol]*grad[icol];
         }
         c = 0;
         for (Int_t i=0; i<npar; i++)
            c+=grad[i]*sum_vector[i];
         c=TMath::Sqrt(c);
         gr2->SetPoint(ipoint, xy[0], xy[1], f->EvalPar(xy));
         gr2->GetEZ()[ipoint]=c*t*chidf;

      }
      delete [] grad;
      delete [] sum_vector;
   }

   //TH1/////////////////////////
   else if (obj->InheritsFrom(TH1::Class())) {
      if (fObjectFit->InheritsFrom(TGraph::Class())){
         if (((TH1*)obj)->GetDimension()>1){
            Error("GetConfidenceIntervals", "Fitted graph and passed histogram have different number of dimensions");
            return;
         }
      }
      if (fObjectFit->InheritsFrom(TGraph2D::Class())){
         if (((TH1*)obj)->GetDimension()!=2){
            Error("GetConfidenceIntervals", "Fitted graph and passed histogram have different number of dimensions");
            return;
         }
      }
      if (fObjectFit->InheritsFrom(TH1::Class())){
         if (((TH1*)(fObjectFit))->GetDimension()!=((TH1*)(obj))->GetDimension()){
            Error("GetConfidenceIntervals", "Fitted and passed histograms have different number of dimensions");
            return;
         }
      }


      TH1 *hfit = (TH1*)obj;
      TF1 *f = (TF1*)GetUserFunc();
      Int_t npar = f->GetNpar();
      Double_t *grad = new Double_t[npar];
      Double_t *sum_vector = new Double_t[npar];
      Double_t x[3];

      Int_t hxfirst = hfit->GetXaxis()->GetFirst();
      Int_t hxlast  = hfit->GetXaxis()->GetLast();
      Int_t hyfirst = hfit->GetYaxis()->GetFirst();
      Int_t hylast  = hfit->GetYaxis()->GetLast();
      Int_t hzfirst = hfit->GetZaxis()->GetFirst();
      Int_t hzlast  = hfit->GetZaxis()->GetLast();

      TAxis *xaxis  = hfit->GetXaxis();
      TAxis *yaxis  = hfit->GetYaxis();
      TAxis *zaxis  = hfit->GetZaxis();
      Double_t t = TMath::StudentQuantile(0.5 + cl/2, f->GetNDF());
      Double_t chidf = TMath::Sqrt(f->GetChisquare()/f->GetNDF());
      Double_t *matr=GetCovarianceMatrix();
      Double_t c=0;
      for (Int_t binz=hzfirst; binz<=hzlast; binz++){
         x[2]=zaxis->GetBinCenter(binz);
         for (Int_t biny=hyfirst; biny<=hylast; biny++) {
            x[1]=yaxis->GetBinCenter(biny);
            for (Int_t binx=hxfirst; binx<=hxlast; binx++) {
               x[0]=xaxis->GetBinCenter(binx);
               f->GradientPar(x, grad);
               for (Int_t irow=0; irow<npar; irow++){
                  sum_vector[irow]=0;
                  for (Int_t icol=0; icol<npar; icol++)
                     sum_vector[irow]+=matr[irow*npar+icol]*grad[icol];
               }
               c = 0;
               for (Int_t i=0; i<npar; i++)
                  c+=grad[i]*sum_vector[i];
               c=TMath::Sqrt(c);
               hfit->SetBinContent(binx, biny, binz, f->EvalPar(x));
               hfit->SetBinError(binx, biny, binz, c*t*chidf);
            }
         }
      }
      delete [] grad;
      delete [] sum_vector;
   }
   else {
      Error("GetConfidenceIntervals", "This object type is not supported");
      return;
   }

}

//______________________________________________________________________________
Double_t *TFitter::GetCovarianceMatrix() const
{
   // return a pointer to the covariance matrix

   if (fCovar) return fCovar;
   Int_t npars = fMinuit->GetNumPars();
   ((TFitter*)this)->fCovar = new Double_t[npars*npars];
   fMinuit->mnemat(fCovar,npars);
   return fCovar;
}

//______________________________________________________________________________
Double_t TFitter::GetCovarianceMatrixElement(Int_t i, Int_t j) const
{
   // return element i,j from the covariance matrix

   GetCovarianceMatrix();
   Int_t npars = fMinuit->GetNumPars();
   if (i < 0 || i >= npars || j < 0 || j >= npars) {
      Error("GetCovarianceMatrixElement","Illegal arguments i=%d, j=%d",i,j);
      return 0;
   }
   return fCovar[j+npars*i];
}

//______________________________________________________________________________
Int_t TFitter::GetErrors(Int_t ipar,Double_t &eplus, Double_t &eminus, Double_t &eparab, Double_t &globcc) const
{
   // return current errors for a parameter
   //   ipar     : parameter number
   //   eplus    : upper error
   //   eminus   : lower error
   //   eparab   : parabolic error
   //   globcc   : global correlation coefficient


   Int_t ierr = 0;
   fMinuit->mnerrs(ipar, eplus,eminus,eparab,globcc);
   return ierr;
}


//______________________________________________________________________________
Int_t TFitter::GetNumberTotalParameters() const
{
   // return the total number of parameters (free + fixed)

   return fMinuit->fNpar + fMinuit->fNpfix;
}

//______________________________________________________________________________
Int_t TFitter::GetNumberFreeParameters() const
{
   // return the number of free parameters

   return fMinuit->fNpar;
}


//______________________________________________________________________________
Double_t TFitter::GetParError(Int_t ipar) const
{
   // return error of parameter ipar

   Int_t ierr = 0;
   TString pname;
   Double_t value,verr,vlow,vhigh;

   fMinuit->mnpout(ipar, pname,value,verr,vlow,vhigh,ierr);
   return verr;
}


//______________________________________________________________________________
Double_t TFitter::GetParameter(Int_t ipar) const
{
   // return current value of parameter ipar

   Int_t ierr = 0;
   TString pname;
   Double_t value,verr,vlow,vhigh;

   fMinuit->mnpout(ipar, pname,value,verr,vlow,vhigh,ierr);
   return value;
}

//______________________________________________________________________________
Int_t TFitter::GetParameter(Int_t ipar, char *parname,Double_t &value,Double_t &verr,Double_t &vlow, Double_t &vhigh) const
{
   // return current values for a parameter
   //   ipar     : parameter number
   //   parname  : parameter name
   //   value    : initial parameter value
   //   verr     : initial error for this parameter
   //   vlow     : lower value for the parameter
   //   vhigh    : upper value for the parameter
   //  WARNING! parname must be suitably dimensionned in the calling function.

   Int_t ierr = 0;
   TString pname;
   fMinuit->mnpout(ipar, pname,value,verr,vlow,vhigh,ierr);
   strcpy(parname,pname.Data());
   return ierr;
}

//______________________________________________________________________________
const char *TFitter::GetParName(Int_t ipar) const
{
   // return name of parameter ipar

   if (!fMinuit || ipar < 0 || ipar > fMinuit->fNu) return "";
   return fMinuit->fCpnam[ipar];
}

//______________________________________________________________________________
Int_t TFitter::GetStats(Double_t &amin, Double_t &edm, Double_t &errdef, Int_t &nvpar, Int_t &nparx) const
{
   // return global fit parameters
   //   amin     : chisquare
   //   edm      : estimated distance to minimum
   //   errdef
   //   nvpar    : number of variable parameters
   //   nparx    : total number of parameters

   Int_t ierr = 0;
   fMinuit->mnstat(amin,edm,errdef,nvpar,nparx,ierr);
   return ierr;
}

//______________________________________________________________________________
Double_t TFitter::GetSumLog(Int_t n)
{
   // return Sum(log(i) i=0,n
   // used by log likelihood fits

   if (n < 0) return 0;
   if (n > fNlog) {
      if (fSumLog) delete [] fSumLog;
      fNlog = 2*n+1000;
      fSumLog = new Double_t[fNlog+1];
      Double_t fobs = 0;
      for (Int_t j=0;j<=fNlog;j++) {
         if (j > 1) fobs += TMath::Log(j);
         fSumLog[j] = fobs;
      }
   }
   if (fSumLog) return fSumLog[n];
   return 0;
}


//______________________________________________________________________________
Bool_t TFitter::IsFixed(Int_t ipar) const
{
   //return kTRUE if parameter ipar is fixed, kFALSE othersise)

   if (fMinuit->fNiofex[ipar] == 0 ) return kTRUE;
   return kFALSE;
}


//______________________________________________________________________________
void  TFitter::PrintResults(Int_t level, Double_t amin) const
{
   // Print fit results

   fMinuit->mnprin(level,amin);
}

//______________________________________________________________________________
void TFitter::ReleaseParameter(Int_t ipar)
{
   // Release parameter ipar.

   if (fCovar)  {delete [] fCovar; fCovar = 0;}
   fMinuit->Release(ipar);
}

//______________________________________________________________________________
void TFitter::SetFCN(void *fcn)
{
   // Specify the address of the fitting algorithm (from the interpreter)

   if (fCovar)  {delete [] fCovar; fCovar = 0;}
   TVirtualFitter::SetFCN(fcn);
   fMinuit->SetFCN(fcn);

}

//______________________________________________________________________________
void TFitter::SetFCN(void (*fcn)(Int_t &, Double_t *, Double_t &f, Double_t *, Int_t))
{
   // Specify the address of the fitting algorithm

   if (fCovar)  {delete [] fCovar; fCovar = 0;}
   TVirtualFitter::SetFCN(fcn);
   fMinuit->SetFCN(fcn);
}

//______________________________________________________________________________
void TFitter::SetFitMethod(const char *name)
{
   // ret fit method (chisquare or loglikelihood)

   if (fCovar)  {delete [] fCovar; fCovar = 0;}
   if (!strcmp(name,"H1FitChisquare"))    SetFCN(H1FitChisquare);
   if (!strcmp(name,"H1FitLikelihood"))   SetFCN(H1FitLikelihood);
   if (!strcmp(name,"GraphFitChisquare")) SetFCN(GraphFitChisquare);
   if (!strcmp(name,"Graph2DFitChisquare")) SetFCN(Graph2DFitChisquare);
   if (!strcmp(name,"MultiGraphFitChisquare")) SetFCN(MultiGraphFitChisquare);
   if (!strcmp(name,"F2Minimizer")) SetFCN(F2Fit);
   if (!strcmp(name,"F3Minimizer")) SetFCN(F3Fit);
}

//______________________________________________________________________________
Int_t TFitter::SetParameter(Int_t ipar,const char *parname,Double_t value,Double_t verr,Double_t vlow, Double_t vhigh)
{
   // set initial values for a parameter
   //   ipar     : parameter number
   //   parname  : parameter name
   //   value    : initial parameter value
   //   verr     : initial error for this parameter
   //   vlow     : lower value for the parameter
   //   vhigh    : upper value for the parameter

   if (fCovar)  {delete [] fCovar; fCovar = 0;}
   Int_t ierr = 0;
   fMinuit->mnparm(ipar,parname,value,verr,vlow,vhigh,ierr);
   return ierr;
}

//______________________________________________________________________________
void TFitter::FitChisquare(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag)
{
   //  Minimization function for H1s using a Chisquare method
   //  Default method (function evaluated at center of bin)
   //  for each point the cache contains the following info
   //    -1D : bc,e, xc  (bin content, error, x of center of bin)
   //    -2D : bc,e, xc,yc
   //    -3D : bc,e, xc,yc,zc

   Foption_t fitOption = GetFitOption();
   if (fitOption.Integral) {
      FitChisquareI(npar,gin,f,u,flag);
      return;
   }
   Double_t cu,eu,fu,fsum;
   Double_t dersum[100], grad[100];
   memset(grad,0,800);
   Double_t x[3];

   TH1 *hfit = (TH1*)GetObjectFit();
   TF1 *f1   = (TF1*)GetUserFunc();
   Int_t nd  = hfit->GetDimension();
   Int_t j;

   f1->InitArgs(x,u);
   npar = f1->GetNpar();
   if (flag == 2) for (j=0;j<npar;j++) dersum[j] = gin[j] = 0;
   f = 0;

   Int_t npfit = 0;
   Double_t *cache = fCache;
   for (Int_t i=0;i<fNpoints;i++) {
      if (nd > 2) x[2]     = cache[4];
      if (nd > 1) x[1]     = cache[3];
      x[0]     = cache[2];
      cu  = cache[0];
      TF1::RejectPoint(kFALSE);
      fu = f1->EvalPar(x,u);
      if (TF1::RejectedPoint()) {cache += fPointSize; continue;}
      eu = cache[1];
      if (flag == 2) {
         for (j=0;j<npar;j++) dersum[j] += 1; //should be the derivative
         for (j=0;j<npar;j++) grad[j] += dersum[j]*(fu-cu)/eu; dersum[j] = 0;
      }
      fsum = (cu-fu)/eu;
      f += fsum*fsum;
      npfit++;
      cache += fPointSize;
   }
   f1->SetNumberFitPoints(npfit);
}

//______________________________________________________________________________
void TFitter::FitChisquareI(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag)
{
   //  Minimization function for H1s using a Chisquare method
   //  The "I"ntegral method is used
   //  for each point the cache contains the following info
   //    -1D : bc,e, xc,xw  (bin content, error, x of center of bin, x bin width of bin)
   //    -2D : bc,e, xc,xw,yc,yw
   //    -3D : bc,e, xc,xw,yc,yw,zc,zw

   Double_t cu,eu,fu,fsum;
   Double_t dersum[100], grad[100];
   memset(grad,0,800);
   Double_t x[3];

   TH1 *hfit = (TH1*)GetObjectFit();
   TF1 *f1   = (TF1*)GetUserFunc();
   Int_t nd = hfit->GetDimension();
   Int_t j;

   f1->InitArgs(x,u);
   npar = f1->GetNpar();
   if (flag == 2) for (j=0;j<npar;j++) dersum[j] = gin[j] = 0;
   f = 0;

   Int_t npfit = 0;
   Double_t *cache = fCache;
   for (Int_t i=0;i<fNpoints;i++) {
      cu  = cache[0];
      TF1::RejectPoint(kFALSE);
      f1->SetParameters(u);
      if (nd < 2) {
         fu = f1->Integral(cache[2] - 0.5*cache[3],cache[2] + 0.5*cache[3])/cache[3];
      } else if (nd < 3) {
         fu = ((TF2*)f1)->Integral(cache[2] - 0.5*cache[3],cache[2] + 0.5*cache[3],cache[4] - 0.5*cache[5],cache[4] + 0.5*cache[5])/(cache[3]*cache[5]);
      } else {
         fu = ((TF3*)f1)->Integral(cache[2] - 0.5*cache[3],cache[2] + 0.5*cache[3],cache[4] - 0.5*cache[5],cache[4] + 0.5*cache[5],cache[6] - 0.5*cache[7],cache[6] + 0.5*cache[7])/(cache[3]*cache[5]*cache[7]);
      }
      if (TF1::RejectedPoint()) {cache += fPointSize; continue;}
      eu = cache[1];
      if (flag == 2) {
         for (j=0;j<npar;j++) dersum[j] += 1; //should be the derivative
         for (j=0;j<npar;j++) grad[j] += dersum[j]*(fu-cu)/eu; dersum[j] = 0;
      }
      fsum = (cu-fu)/eu;
      f += fsum*fsum;
      npfit++;
      cache += fPointSize;
   }
   f1->SetNumberFitPoints(npfit);
}


//______________________________________________________________________________
void TFitter::FitLikelihood(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag)
{
   //  Minimization function for H1s using a Likelihood method*-*-*-*-*-*
   //     Basically, it forms the likelihood by determining the Poisson
   //     probability that given a number of entries in a particular bin,
   //     the fit would predict it's value.  This is then done for each bin,
   //     and the sum of the logs is taken as the likelihood.
   //  Default method (function evaluated at center of bin)
   //  for each point the cache contains the following info
   //    -1D : bc,e, xc  (bin content, error, x of center of bin)
   //    -2D : bc,e, xc,yc
   //    -3D : bc,e, xc,yc,zc

   Foption_t fitOption = GetFitOption();
   if (fitOption.Integral) {
      FitLikelihoodI(npar,gin,f,u,flag);
      return;
   }
   Double_t cu,fu,fobs,fsub;
   Double_t dersum[100];
   Double_t x[3];
   Int_t icu;

   TH1 *hfit = (TH1*)GetObjectFit();
   TF1 *f1   = (TF1*)GetUserFunc();
   Int_t nd = hfit->GetDimension();
   Int_t j;

   f1->InitArgs(x,u);
   npar = f1->GetNpar();
   if (flag == 2) for (j=0;j<npar;j++) dersum[j] = gin[j] = 0;
   f = 0;

   Int_t npfit = 0;
   Double_t *cache = fCache;
   for (Int_t i=0;i<fNpoints;i++) {
      if (nd > 2) x[2] = cache[4];
      if (nd > 1) x[1] = cache[3];
      x[0]     = cache[2];
      cu  = cache[0];
      TF1::RejectPoint(kFALSE);
      fu = f1->EvalPar(x,u);
      if (TF1::RejectedPoint()) {cache += fPointSize; continue;}
      if (flag == 2) {
         for (j=0;j<npar;j++) {
            dersum[j] += 1; //should be the derivative
            //grad[j] += dersum[j]*(fu-cu)/eu; dersum[j] = 0;
         }
      }
      if (fu < 1.e-9) fu = 1.e-9;
      if (fitOption.Like == 1) {
         icu  = Int_t(cu);
         fsub = -fu +cu*TMath::Log(fu);
         if (icu <10000) fobs = GetSumLog(icu);
         else            fobs = TMath::LnGamma(cu+1);
      } else {
         fsub = -fu +cu*TMath::Log(fu);
         fobs = TMath::LnGamma(cu+1);
      }
      fsub -= fobs;
      f -= fsub;
      npfit++;
      cache += fPointSize;
   }
   f *= 2;
   f1->SetNumberFitPoints(npfit);
}


//______________________________________________________________________________
void TFitter::FitLikelihoodI(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag)
{
   //  Minimization function for H1s using a Likelihood method*-*-*-*-*-*
   //     Basically, it forms the likelihood by determining the Poisson
   //     probability that given a number of entries in a particular bin,
   //     the fit would predict it's value.  This is then done for each bin,
   //     and the sum of the logs is taken as the likelihood.
   //  The "I"ntegral method is used
   //  for each point the cache contains the following info
   //    -1D : bc,e, xc,xw  (bin content, error, x of center of bin, x bin width of bin)
   //    -2D : bc,e, xc,xw,yc,yw
   //    -3D : bc,e, xc,xw,yc,yw,zc,zw

   Double_t cu,fu,fobs,fsub;
   Double_t dersum[100];
   Double_t x[3];
   Int_t icu;

   TH1 *hfit = (TH1*)GetObjectFit();
   TF1 *f1   = (TF1*)GetUserFunc();
   Foption_t fitOption = GetFitOption();
   Int_t nd = hfit->GetDimension();
   Int_t j;

   f1->InitArgs(x,u);
   npar = f1->GetNpar();
   if (flag == 2) for (j=0;j<npar;j++) dersum[j] = gin[j] = 0;
   f = 0;

   Int_t npfit = 0;
   Double_t *cache = fCache;
   for (Int_t i=0;i<fNpoints;i++) {
      if (nd > 2) x[2] = cache[6];
      if (nd > 1) x[1] = cache[4];
      x[0]     = cache[2];
      cu  = cache[0];
      TF1::RejectPoint(kFALSE);
      f1->SetParameters(u);
      if (nd < 2) {
         fu = f1->Integral(cache[2] - 0.5*cache[3],cache[2] + 0.5*cache[3])/cache[3];
      } else if (nd < 3) {
         fu = ((TF2*)f1)->Integral(cache[2] - 0.5*cache[3],cache[2] + 0.5*cache[3],cache[4] - 0.5*cache[5],cache[4] + 0.5*cache[5])/(cache[3]*cache[5]);
      } else {
         fu = ((TF3*)f1)->Integral(cache[2] - 0.5*cache[3],cache[2] + 0.5*cache[3],cache[4] - 0.5*cache[5],cache[4] + 0.5*cache[5],cache[6] - 0.5*cache[7],cache[6] + 0.5*cache[7])/(cache[3]*cache[5]*cache[7]);
      }
      if (TF1::RejectedPoint()) {cache += fPointSize; continue;}
      if (flag == 2) {
         for (j=0;j<npar;j++) {
            dersum[j] += 1; //should be the derivative
            //grad[j] += dersum[j]*(fu-cu)/eu; dersum[j] = 0;
         }
      }
      if (fu < 1.e-9) fu = 1.e-9;
      if (fitOption.Like == 1) {
         icu  = Int_t(cu);
         fsub = -fu +cu*TMath::Log(fu);
         if (icu <10000) fobs = GetSumLog(icu);
         else            fobs = TMath::LnGamma(cu+1);
      } else {
         fsub = -fu +cu*TMath::Log(fu);
         fobs = TMath::LnGamma(cu+1);
      }
      fsub -= fobs;
      f -= fsub;
      npfit++;
      cache += fPointSize;
   }
   f *= 2;
   f1->SetNumberFitPoints(npfit);
}



//______________________________________________________________________________
void H1FitChisquare(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag)
{
//           Minimization function for H1s using a Chisquare method
//           ======================================================

   TFitter *hFitter = (TFitter*)TVirtualFitter::GetFitter();
   hFitter->FitChisquare(npar, gin, f, u, flag);
}

//______________________________________________________________________________
void H1FitLikelihood(Int_t &npar, Double_t *gin, Double_t &f, Double_t *u, Int_t flag)
{
//   -*-*-*-*Minimization function for H1s using a Likelihood method*-*-*-*-*-*
//           =======================================================
//     Basically, it forms the likelihood by determining the Poisson
//     probability that given a number of entries in a particular bin,
//     the fit would predict it's value.  This is then done for each bin,
//     and the sum of the logs is taken as the likelihood.

   TFitter *hFitter = (TFitter*)TVirtualFitter::GetFitter();
   hFitter->FitLikelihood(npar, gin, f, u, flag);
}

//______________________________________________________________________________
void GraphFitChisquare(Int_t &npar, Double_t * /*gin*/, Double_t &f,
                       Double_t *u, Int_t /*flag*/)
{
//*-*-*-*-*-*Minimization function for Graphs using a Chisquare method*-*-*-*-*
//*-*        =========================================================
//
// In case of a TGraphErrors object, ex, the error along x,  is projected
// along the y-direction by calculating the function at the points x-exlow and
// x+exhigh.
//
// The chisquare is computed as the sum of the quantity below at each point:
//
//                     (y - f(x))**2
//         -----------------------------------
//         ey**2 + (0.5*(exl + exh)*f'(x))**2
//
// where x and y are the point coordinates and f'(x) is the derivative of function f(x).
// This method to approximate the uncertainty in y because of the errors in x, is called
// "effective variance" method.
// The improvement, compared to the previously used  method (f(x+ exhigh) - f(x-exlow))/2
// is of (error of x)**2 order.
//
// In case the function lies below (above) the data point, ey is ey_low (ey_high).
//
//  thanks to Andy Haas (haas@yahoo.com) for adding the case with TGraphAsymmErrors
//            University of Washington
//            February 3, 2004
//
//  NOTE:
//  1) By using the "effective variance" method a simple linear regression
//      becomes a non-linear case , which takes several iterations
//      instead of 0 as in the linear case .
//
//  2) The effective variance technique assumes that there is no correlation
//      between the x and y coordinate .
//
//    The book by Sigmund Brandt (Data  Analysis) contains an interesting
//    section how to solve the problem when correclations do exist .

   Double_t cu,eu,exh,exl,ey,eux,fu,fsum;
   Double_t x[1];
   //Double_t xm,xp;
   Int_t bin, npfits=0;

   TVirtualFitter *grFitter = TVirtualFitter::GetFitter();
   TGraph *gr     = (TGraph*)grFitter->GetObjectFit();
   TF1 *f1   = (TF1*)grFitter->GetUserFunc();
   Foption_t fitOption = grFitter->GetFitOption();
   Int_t n        = gr->GetN();
   Double_t *gx   = gr->GetX();
   Double_t *gy   = gr->GetY();
   //Double_t fxmin = f1->GetXmin();
   //Double_t fxmax = f1->GetXmax();
   npar           = f1->GetNpar();

   f      = 0;
   for (bin=0;bin<n;bin++) {
      f1->InitArgs(x,u); //must be inside the loop because of TF1::Derivative calling InitArgs
      x[0] = gx[bin];
      if (!f1->IsInside(x)) continue;
      cu   = gy[bin];
      TF1::RejectPoint(kFALSE);
      fu   = f1->EvalPar(x,u);
      if (TF1::RejectedPoint()) continue;
      fsum = (cu-fu);
      npfits++;
      if (fitOption.W1) {
         f += fsum*fsum;
         continue;
      }

      exh = gr->GetErrorXhigh(bin);
      exl = gr->GetErrorXlow(bin);
      if (fsum < 0)
         ey = gr->GetErrorYhigh(bin);
      else
         ey = gr->GetErrorYlow(bin);
      if (exl < 0) exl = 0;
      if (exh < 0) exh = 0;
      if (ey < 0)  ey  = 0;
      if (exh > 0 || exl > 0) {
         //Without the "variance method", we had the 6 next lines instead
         // of the line above.
          //xm = x[0] - exl; if (xm < fxmin) xm = fxmin;
          //xp = x[0] + exh; if (xp > fxmax) xp = fxmax;
          //Double_t fm,fp;
          //x[0] = xm; fm = f1->EvalPar(x,u);
          //x[0] = xp; fp = f1->EvalPar(x,u);
          //eux = 0.5*(fp-fm);

         //"Effective Variance" method introduced by Anna Kreshuk
         // in version 4.00/08.
         eux = 0.5*(exl + exh)*f1->Derivative(x[0], u);
      } else
         eux = 0.;
      eu = ey*ey+eux*eux;
      if (eu <= 0) eu = 1;
      f += fsum*fsum/eu;
   }
   f1->SetNumberFitPoints(npfits);
   //
}


//______________________________________________________________________________
void Graph2DFitChisquare(Int_t &npar, Double_t * /*gin*/, Double_t &f,
                       Double_t *u, Int_t /*flag*/)
{
//*-*-*-*-*Minimization function for 2D Graphs using a Chisquare method*-*-*-*-*
//*-*      ============================================================

   Double_t cu,eu,ex,ey,ez,eux,euy,fu,fsum,fm,fp;
   Double_t x[2];
   Double_t xm,xp,ym,yp;
   Int_t bin, npfits=0;

   TVirtualFitter *grFitter = TVirtualFitter::GetFitter();
   TGraph2D *gr     = (TGraph2D*)grFitter->GetObjectFit();
   TF2 *f2   = (TF2*)grFitter->GetUserFunc();
   Foption_t fitOption = grFitter->GetFitOption();

   Int_t n        = gr->GetN();
   Double_t *gx   = gr->GetX();
   Double_t *gy   = gr->GetY();
   Double_t *gz   = gr->GetZ();
   Double_t fxmin = f2->GetXmin();
   Double_t fxmax = f2->GetXmax();
   Double_t fymin = f2->GetYmin();
   Double_t fymax = f2->GetYmax();
   npar           = f2->GetNpar();
   f      = 0;
   for (bin=0;bin<n;bin++) {
      f2->InitArgs(x,u);
      x[0] = gx[bin];
      x[1] = gy[bin];
      if (!f2->IsInside(x)) continue;
      cu   = gz[bin];
      TF2::RejectPoint(kFALSE);
      fu   = f2->EvalPar(x,u);
      if (TF2::RejectedPoint()) continue;
      fsum = (cu-fu);
      npfits++;
      if (fitOption.W1) {
         f += fsum*fsum;
         continue;
      }
      ex  = gr->GetErrorX(bin);
      ey  = gr->GetErrorY(bin);
      ez  = gr->GetErrorZ(bin);
      if (ex < 0) ex = 0;
      if (ey < 0) ey = 0;
      if (ez < 0) ez = 0;
      eux = euy = 0;
      if (ex > 0) {
         xm = x[0] - ex; if (xm < fxmin) xm = fxmin;
         xp = x[0] + ex; if (xp > fxmax) xp = fxmax;
         x[0] = xm; fm = f2->EvalPar(x,u);
         x[0] = xp; fp = f2->EvalPar(x,u);
         eux = fp-fm;
      }
      if (ey > 0) {
         x[0] = gx[bin];
         ym = x[1] - ey; if (ym < fymin) ym = fxmin;
         yp = x[1] + ey; if (yp > fymax) yp = fymax;
         x[1] = ym; fm = f2->EvalPar(x,u);
         x[1] = yp; fp = f2->EvalPar(x,u);
         euy = fp-fm;
      }
      eu = ez*ez+eux*eux+euy*euy;
      if (eu <= 0) eu = 1;
      f += fsum*fsum/eu;
   }
   f2->SetNumberFitPoints(npfits);
}

//______________________________________________________________________________
void MultiGraphFitChisquare(Int_t &npar, Double_t * /*gin*/, Double_t &f,
                       Double_t *u, Int_t /*flag*/)
{

   Double_t cu,eu,exh,exl,ey,eux,fu,fsum;
   Double_t x[1];
   //Double_t xm,xp;
   Int_t bin, npfits=0;

   TVirtualFitter *grFitter = TVirtualFitter::GetFitter();
   TMultiGraph *mg     = (TMultiGraph*)grFitter->GetObjectFit();
   TF1 *f1   = (TF1*)grFitter->GetUserFunc();
   Foption_t fitOption = grFitter->GetFitOption();
   TGraph *gr;
   TIter next(mg->GetListOfGraphs());

   Int_t n;
   Double_t *gx;
   Double_t *gy;
   //Double_t fxmin = f1->GetXmin();
   //Double_t fxmax = f1->GetXmax();
   npar           = f1->GetNpar();

   f      = 0;

   while ((gr = (TGraph*) next())) {
      n        = gr->GetN();
      gx   = gr->GetX();
      gy   = gr->GetY();
      for (bin=0;bin<n;bin++) {
         f1->InitArgs(x,u); //must be inside the loop because of TF1::Derivative calling InitArgs
         x[0] = gx[bin];
         if (!f1->IsInside(x)) continue;
         cu   = gy[bin];
         TF1::RejectPoint(kFALSE);
         fu   = f1->EvalPar(x,u);
         if (TF1::RejectedPoint()) continue;
         fsum = (cu-fu);
         npfits++;
         if (fitOption.W1) {
            f += fsum*fsum;
            continue;
         }
         exh = gr->GetErrorXhigh(bin);
         exl = gr->GetErrorXlow(bin);
         ey  = gr->GetErrorY(bin);
         if (exl < 0) exl = 0;
         if (exh < 0) exh = 0;
         if (ey < 0)  ey  = 0;
         if (exh > 0 && exl > 0) {
            //Without the "variance method", we had the 6 next lines instead
            // of the line above.
            //xm = x[0] - exl; if (xm < fxmin) xm = fxmin;
            //xp = x[0] + exh; if (xp > fxmax) xp = fxmax;
            //Double_t fm,fp;
            //x[0] = xm; fm = f1->EvalPar(x,u);
            //x[0] = xp; fp = f1->EvalPar(x,u);
            //eux = 0.5*(fp-fm);

            //"Effective Variance" method introduced by Anna Kreshuk
            // in version 4.00/08.
            eux = 0.5*(exl + exh)*f1->Derivative(x[0], u);
         } else
            eux = 0.;
         eu = ey*ey+eux*eux;
         if (eu <= 0) eu = 1;
         f += fsum*fsum/eu;
      }
   }
   f1->SetNumberFitPoints(npfits);
}

//______________________________________________________________________________
void F2Fit(Int_t &/*npar*/, Double_t * /*gin*/, Double_t &f,Double_t *u, Int_t /*flag*/)
{
   TVirtualFitter *fitter = TVirtualFitter::GetFitter();
   TF2 *f2 = (TF2*)fitter->GetObjectFit();
   f2->InitArgs(u, f2->GetParameters() );
   f = f2->EvalPar(u);
}

//______________________________________________________________________________
void F3Fit(Int_t &/*npar*/, Double_t * /*gin*/, Double_t &f,Double_t *u, Int_t /*flag*/)
{
   TVirtualFitter *fitter = TVirtualFitter::GetFitter();
   TF3 *f3 = (TF3*)fitter->GetObjectFit();
   f3->InitArgs(u, f3->GetParameters() );
   f = f3->EvalPar(u);
}
 TFitter.cxx:1
 TFitter.cxx:2
 TFitter.cxx:3
 TFitter.cxx:4
 TFitter.cxx:5
 TFitter.cxx:6
 TFitter.cxx:7
 TFitter.cxx:8
 TFitter.cxx:9
 TFitter.cxx:10
 TFitter.cxx:11
 TFitter.cxx:12
 TFitter.cxx:13
 TFitter.cxx:14
 TFitter.cxx:15
 TFitter.cxx:16
 TFitter.cxx:17
 TFitter.cxx:18
 TFitter.cxx:19
 TFitter.cxx:20
 TFitter.cxx:21
 TFitter.cxx:22
 TFitter.cxx:23
 TFitter.cxx:24
 TFitter.cxx:25
 TFitter.cxx:26
 TFitter.cxx:27
 TFitter.cxx:28
 TFitter.cxx:29
 TFitter.cxx:30
 TFitter.cxx:31
 TFitter.cxx:32
 TFitter.cxx:33
 TFitter.cxx:34
 TFitter.cxx:35
 TFitter.cxx:36
 TFitter.cxx:37
 TFitter.cxx:38
 TFitter.cxx:39
 TFitter.cxx:40
 TFitter.cxx:41
 TFitter.cxx:42
 TFitter.cxx:43
 TFitter.cxx:44
 TFitter.cxx:45
 TFitter.cxx:46
 TFitter.cxx:47
 TFitter.cxx:48
 TFitter.cxx:49
 TFitter.cxx:50
 TFitter.cxx:51
 TFitter.cxx:52
 TFitter.cxx:53
 TFitter.cxx:54
 TFitter.cxx:55
 TFitter.cxx:56
 TFitter.cxx:57
 TFitter.cxx:58
 TFitter.cxx:59
 TFitter.cxx:60
 TFitter.cxx:61
 TFitter.cxx:62
 TFitter.cxx:63
 TFitter.cxx:64
 TFitter.cxx:65
 TFitter.cxx:66
 TFitter.cxx:67
 TFitter.cxx:68
 TFitter.cxx:69
 TFitter.cxx:70
 TFitter.cxx:71
 TFitter.cxx:72
 TFitter.cxx:73
 TFitter.cxx:74
 TFitter.cxx:75
 TFitter.cxx:76
 TFitter.cxx:77
 TFitter.cxx:78
 TFitter.cxx:79
 TFitter.cxx:80
 TFitter.cxx:81
 TFitter.cxx:82
 TFitter.cxx:83
 TFitter.cxx:84
 TFitter.cxx:85
 TFitter.cxx:86
 TFitter.cxx:87
 TFitter.cxx:88
 TFitter.cxx:89
 TFitter.cxx:90
 TFitter.cxx:91
 TFitter.cxx:92
 TFitter.cxx:93
 TFitter.cxx:94
 TFitter.cxx:95
 TFitter.cxx:96
 TFitter.cxx:97
 TFitter.cxx:98
 TFitter.cxx:99
 TFitter.cxx:100
 TFitter.cxx:101
 TFitter.cxx:102
 TFitter.cxx:103
 TFitter.cxx:104
 TFitter.cxx:105
 TFitter.cxx:106
 TFitter.cxx:107
 TFitter.cxx:108
 TFitter.cxx:109
 TFitter.cxx:110
 TFitter.cxx:111
 TFitter.cxx:112
 TFitter.cxx:113
 TFitter.cxx:114
 TFitter.cxx:115
 TFitter.cxx:116
 TFitter.cxx:117
 TFitter.cxx:118
 TFitter.cxx:119
 TFitter.cxx:120
 TFitter.cxx:121
 TFitter.cxx:122
 TFitter.cxx:123
 TFitter.cxx:124
 TFitter.cxx:125
 TFitter.cxx:126
 TFitter.cxx:127
 TFitter.cxx:128
 TFitter.cxx:129
 TFitter.cxx:130
 TFitter.cxx:131
 TFitter.cxx:132
 TFitter.cxx:133
 TFitter.cxx:134
 TFitter.cxx:135
 TFitter.cxx:136
 TFitter.cxx:137
 TFitter.cxx:138
 TFitter.cxx:139
 TFitter.cxx:140
 TFitter.cxx:141
 TFitter.cxx:142
 TFitter.cxx:143
 TFitter.cxx:144
 TFitter.cxx:145
 TFitter.cxx:146
 TFitter.cxx:147
 TFitter.cxx:148
 TFitter.cxx:149
 TFitter.cxx:150
 TFitter.cxx:151
 TFitter.cxx:152
 TFitter.cxx:153
 TFitter.cxx:154
 TFitter.cxx:155
 TFitter.cxx:156
 TFitter.cxx:157
 TFitter.cxx:158
 TFitter.cxx:159
 TFitter.cxx:160
 TFitter.cxx:161
 TFitter.cxx:162
 TFitter.cxx:163
 TFitter.cxx:164
 TFitter.cxx:165
 TFitter.cxx:166
 TFitter.cxx:167
 TFitter.cxx:168
 TFitter.cxx:169
 TFitter.cxx:170
 TFitter.cxx:171
 TFitter.cxx:172
 TFitter.cxx:173
 TFitter.cxx:174
 TFitter.cxx:175
 TFitter.cxx:176
 TFitter.cxx:177
 TFitter.cxx:178
 TFitter.cxx:179
 TFitter.cxx:180
 TFitter.cxx:181
 TFitter.cxx:182
 TFitter.cxx:183
 TFitter.cxx:184
 TFitter.cxx:185
 TFitter.cxx:186
 TFitter.cxx:187
 TFitter.cxx:188
 TFitter.cxx:189
 TFitter.cxx:190
 TFitter.cxx:191
 TFitter.cxx:192
 TFitter.cxx:193
 TFitter.cxx:194
 TFitter.cxx:195
 TFitter.cxx:196
 TFitter.cxx:197
 TFitter.cxx:198
 TFitter.cxx:199
 TFitter.cxx:200
 TFitter.cxx:201
 TFitter.cxx:202
 TFitter.cxx:203
 TFitter.cxx:204
 TFitter.cxx:205
 TFitter.cxx:206
 TFitter.cxx:207
 TFitter.cxx:208
 TFitter.cxx:209
 TFitter.cxx:210
 TFitter.cxx:211
 TFitter.cxx:212
 TFitter.cxx:213
 TFitter.cxx:214
 TFitter.cxx:215
 TFitter.cxx:216
 TFitter.cxx:217
 TFitter.cxx:218
 TFitter.cxx:219
 TFitter.cxx:220
 TFitter.cxx:221
 TFitter.cxx:222
 TFitter.cxx:223
 TFitter.cxx:224
 TFitter.cxx:225
 TFitter.cxx:226
 TFitter.cxx:227
 TFitter.cxx:228
 TFitter.cxx:229
 TFitter.cxx:230
 TFitter.cxx:231
 TFitter.cxx:232
 TFitter.cxx:233
 TFitter.cxx:234
 TFitter.cxx:235
 TFitter.cxx:236
 TFitter.cxx:237
 TFitter.cxx:238
 TFitter.cxx:239
 TFitter.cxx:240
 TFitter.cxx:241
 TFitter.cxx:242
 TFitter.cxx:243
 TFitter.cxx:244
 TFitter.cxx:245
 TFitter.cxx:246
 TFitter.cxx:247
 TFitter.cxx:248
 TFitter.cxx:249
 TFitter.cxx:250
 TFitter.cxx:251
 TFitter.cxx:252
 TFitter.cxx:253
 TFitter.cxx:254
 TFitter.cxx:255
 TFitter.cxx:256
 TFitter.cxx:257
 TFitter.cxx:258
 TFitter.cxx:259
 TFitter.cxx:260
 TFitter.cxx:261
 TFitter.cxx:262
 TFitter.cxx:263
 TFitter.cxx:264
 TFitter.cxx:265
 TFitter.cxx:266
 TFitter.cxx:267
 TFitter.cxx:268
 TFitter.cxx:269
 TFitter.cxx:270
 TFitter.cxx:271
 TFitter.cxx:272
 TFitter.cxx:273
 TFitter.cxx:274
 TFitter.cxx:275
 TFitter.cxx:276
 TFitter.cxx:277
 TFitter.cxx:278
 TFitter.cxx:279
 TFitter.cxx:280
 TFitter.cxx:281
 TFitter.cxx:282
 TFitter.cxx:283
 TFitter.cxx:284
 TFitter.cxx:285
 TFitter.cxx:286
 TFitter.cxx:287
 TFitter.cxx:288
 TFitter.cxx:289
 TFitter.cxx:290
 TFitter.cxx:291
 TFitter.cxx:292
 TFitter.cxx:293
 TFitter.cxx:294
 TFitter.cxx:295
 TFitter.cxx:296
 TFitter.cxx:297
 TFitter.cxx:298
 TFitter.cxx:299
 TFitter.cxx:300
 TFitter.cxx:301
 TFitter.cxx:302
 TFitter.cxx:303
 TFitter.cxx:304
 TFitter.cxx:305
 TFitter.cxx:306
 TFitter.cxx:307
 TFitter.cxx:308
 TFitter.cxx:309
 TFitter.cxx:310
 TFitter.cxx:311
 TFitter.cxx:312
 TFitter.cxx:313
 TFitter.cxx:314
 TFitter.cxx:315
 TFitter.cxx:316
 TFitter.cxx:317
 TFitter.cxx:318
 TFitter.cxx:319
 TFitter.cxx:320
 TFitter.cxx:321
 TFitter.cxx:322
 TFitter.cxx:323
 TFitter.cxx:324
 TFitter.cxx:325
 TFitter.cxx:326
 TFitter.cxx:327
 TFitter.cxx:328
 TFitter.cxx:329
 TFitter.cxx:330
 TFitter.cxx:331
 TFitter.cxx:332
 TFitter.cxx:333
 TFitter.cxx:334
 TFitter.cxx:335
 TFitter.cxx:336
 TFitter.cxx:337
 TFitter.cxx:338
 TFitter.cxx:339
 TFitter.cxx:340
 TFitter.cxx:341
 TFitter.cxx:342
 TFitter.cxx:343
 TFitter.cxx:344
 TFitter.cxx:345
 TFitter.cxx:346
 TFitter.cxx:347
 TFitter.cxx:348
 TFitter.cxx:349
 TFitter.cxx:350
 TFitter.cxx:351
 TFitter.cxx:352
 TFitter.cxx:353
 TFitter.cxx:354
 TFitter.cxx:355
 TFitter.cxx:356
 TFitter.cxx:357
 TFitter.cxx:358
 TFitter.cxx:359
 TFitter.cxx:360
 TFitter.cxx:361
 TFitter.cxx:362
 TFitter.cxx:363
 TFitter.cxx:364
 TFitter.cxx:365
 TFitter.cxx:366
 TFitter.cxx:367
 TFitter.cxx:368
 TFitter.cxx:369
 TFitter.cxx:370
 TFitter.cxx:371
 TFitter.cxx:372
 TFitter.cxx:373
 TFitter.cxx:374
 TFitter.cxx:375
 TFitter.cxx:376
 TFitter.cxx:377
 TFitter.cxx:378
 TFitter.cxx:379
 TFitter.cxx:380
 TFitter.cxx:381
 TFitter.cxx:382
 TFitter.cxx:383
 TFitter.cxx:384
 TFitter.cxx:385
 TFitter.cxx:386
 TFitter.cxx:387
 TFitter.cxx:388
 TFitter.cxx:389
 TFitter.cxx:390
 TFitter.cxx:391
 TFitter.cxx:392
 TFitter.cxx:393
 TFitter.cxx:394
 TFitter.cxx:395
 TFitter.cxx:396
 TFitter.cxx:397
 TFitter.cxx:398
 TFitter.cxx:399
 TFitter.cxx:400
 TFitter.cxx:401
 TFitter.cxx:402
 TFitter.cxx:403
 TFitter.cxx:404
 TFitter.cxx:405
 TFitter.cxx:406
 TFitter.cxx:407
 TFitter.cxx:408
 TFitter.cxx:409
 TFitter.cxx:410
 TFitter.cxx:411
 TFitter.cxx:412
 TFitter.cxx:413
 TFitter.cxx:414
 TFitter.cxx:415
 TFitter.cxx:416
 TFitter.cxx:417
 TFitter.cxx:418
 TFitter.cxx:419
 TFitter.cxx:420
 TFitter.cxx:421
 TFitter.cxx:422
 TFitter.cxx:423
 TFitter.cxx:424
 TFitter.cxx:425
 TFitter.cxx:426
 TFitter.cxx:427
 TFitter.cxx:428
 TFitter.cxx:429
 TFitter.cxx:430
 TFitter.cxx:431
 TFitter.cxx:432
 TFitter.cxx:433
 TFitter.cxx:434
 TFitter.cxx:435
 TFitter.cxx:436
 TFitter.cxx:437
 TFitter.cxx:438
 TFitter.cxx:439
 TFitter.cxx:440
 TFitter.cxx:441
 TFitter.cxx:442
 TFitter.cxx:443
 TFitter.cxx:444
 TFitter.cxx:445
 TFitter.cxx:446
 TFitter.cxx:447
 TFitter.cxx:448
 TFitter.cxx:449
 TFitter.cxx:450
 TFitter.cxx:451
 TFitter.cxx:452
 TFitter.cxx:453
 TFitter.cxx:454
 TFitter.cxx:455
 TFitter.cxx:456
 TFitter.cxx:457
 TFitter.cxx:458
 TFitter.cxx:459
 TFitter.cxx:460
 TFitter.cxx:461
 TFitter.cxx:462
 TFitter.cxx:463
 TFitter.cxx:464
 TFitter.cxx:465
 TFitter.cxx:466
 TFitter.cxx:467
 TFitter.cxx:468
 TFitter.cxx:469
 TFitter.cxx:470
 TFitter.cxx:471
 TFitter.cxx:472
 TFitter.cxx:473
 TFitter.cxx:474
 TFitter.cxx:475
 TFitter.cxx:476
 TFitter.cxx:477
 TFitter.cxx:478
 TFitter.cxx:479
 TFitter.cxx:480
 TFitter.cxx:481
 TFitter.cxx:482
 TFitter.cxx:483
 TFitter.cxx:484
 TFitter.cxx:485
 TFitter.cxx:486
 TFitter.cxx:487
 TFitter.cxx:488
 TFitter.cxx:489
 TFitter.cxx:490
 TFitter.cxx:491
 TFitter.cxx:492
 TFitter.cxx:493
 TFitter.cxx:494
 TFitter.cxx:495
 TFitter.cxx:496
 TFitter.cxx:497
 TFitter.cxx:498
 TFitter.cxx:499
 TFitter.cxx:500
 TFitter.cxx:501
 TFitter.cxx:502
 TFitter.cxx:503
 TFitter.cxx:504
 TFitter.cxx:505
 TFitter.cxx:506
 TFitter.cxx:507
 TFitter.cxx:508
 TFitter.cxx:509
 TFitter.cxx:510
 TFitter.cxx:511
 TFitter.cxx:512
 TFitter.cxx:513
 TFitter.cxx:514
 TFitter.cxx:515
 TFitter.cxx:516
 TFitter.cxx:517
 TFitter.cxx:518
 TFitter.cxx:519
 TFitter.cxx:520
 TFitter.cxx:521
 TFitter.cxx:522
 TFitter.cxx:523
 TFitter.cxx:524
 TFitter.cxx:525
 TFitter.cxx:526
 TFitter.cxx:527
 TFitter.cxx:528
 TFitter.cxx:529
 TFitter.cxx:530
 TFitter.cxx:531
 TFitter.cxx:532
 TFitter.cxx:533
 TFitter.cxx:534
 TFitter.cxx:535
 TFitter.cxx:536
 TFitter.cxx:537
 TFitter.cxx:538
 TFitter.cxx:539
 TFitter.cxx:540
 TFitter.cxx:541
 TFitter.cxx:542
 TFitter.cxx:543
 TFitter.cxx:544
 TFitter.cxx:545
 TFitter.cxx:546
 TFitter.cxx:547
 TFitter.cxx:548
 TFitter.cxx:549
 TFitter.cxx:550
 TFitter.cxx:551
 TFitter.cxx:552
 TFitter.cxx:553
 TFitter.cxx:554
 TFitter.cxx:555
 TFitter.cxx:556
 TFitter.cxx:557
 TFitter.cxx:558
 TFitter.cxx:559
 TFitter.cxx:560
 TFitter.cxx:561
 TFitter.cxx:562
 TFitter.cxx:563
 TFitter.cxx:564
 TFitter.cxx:565
 TFitter.cxx:566
 TFitter.cxx:567
 TFitter.cxx:568
 TFitter.cxx:569
 TFitter.cxx:570
 TFitter.cxx:571
 TFitter.cxx:572
 TFitter.cxx:573
 TFitter.cxx:574
 TFitter.cxx:575
 TFitter.cxx:576
 TFitter.cxx:577
 TFitter.cxx:578
 TFitter.cxx:579
 TFitter.cxx:580
 TFitter.cxx:581
 TFitter.cxx:582
 TFitter.cxx:583
 TFitter.cxx:584
 TFitter.cxx:585
 TFitter.cxx:586
 TFitter.cxx:587
 TFitter.cxx:588
 TFitter.cxx:589
 TFitter.cxx:590
 TFitter.cxx:591
 TFitter.cxx:592
 TFitter.cxx:593
 TFitter.cxx:594
 TFitter.cxx:595
 TFitter.cxx:596
 TFitter.cxx:597
 TFitter.cxx:598
 TFitter.cxx:599
 TFitter.cxx:600
 TFitter.cxx:601
 TFitter.cxx:602
 TFitter.cxx:603
 TFitter.cxx:604
 TFitter.cxx:605
 TFitter.cxx:606
 TFitter.cxx:607
 TFitter.cxx:608
 TFitter.cxx:609
 TFitter.cxx:610
 TFitter.cxx:611
 TFitter.cxx:612
 TFitter.cxx:613
 TFitter.cxx:614
 TFitter.cxx:615
 TFitter.cxx:616
 TFitter.cxx:617
 TFitter.cxx:618
 TFitter.cxx:619
 TFitter.cxx:620
 TFitter.cxx:621
 TFitter.cxx:622
 TFitter.cxx:623
 TFitter.cxx:624
 TFitter.cxx:625
 TFitter.cxx:626
 TFitter.cxx:627
 TFitter.cxx:628
 TFitter.cxx:629
 TFitter.cxx:630
 TFitter.cxx:631
 TFitter.cxx:632
 TFitter.cxx:633
 TFitter.cxx:634
 TFitter.cxx:635
 TFitter.cxx:636
 TFitter.cxx:637
 TFitter.cxx:638
 TFitter.cxx:639
 TFitter.cxx:640
 TFitter.cxx:641
 TFitter.cxx:642
 TFitter.cxx:643
 TFitter.cxx:644
 TFitter.cxx:645
 TFitter.cxx:646
 TFitter.cxx:647
 TFitter.cxx:648
 TFitter.cxx:649
 TFitter.cxx:650
 TFitter.cxx:651
 TFitter.cxx:652
 TFitter.cxx:653
 TFitter.cxx:654
 TFitter.cxx:655
 TFitter.cxx:656
 TFitter.cxx:657
 TFitter.cxx:658
 TFitter.cxx:659
 TFitter.cxx:660
 TFitter.cxx:661
 TFitter.cxx:662
 TFitter.cxx:663
 TFitter.cxx:664
 TFitter.cxx:665
 TFitter.cxx:666
 TFitter.cxx:667
 TFitter.cxx:668
 TFitter.cxx:669
 TFitter.cxx:670
 TFitter.cxx:671
 TFitter.cxx:672
 TFitter.cxx:673
 TFitter.cxx:674
 TFitter.cxx:675
 TFitter.cxx:676
 TFitter.cxx:677
 TFitter.cxx:678
 TFitter.cxx:679
 TFitter.cxx:680
 TFitter.cxx:681
 TFitter.cxx:682
 TFitter.cxx:683
 TFitter.cxx:684
 TFitter.cxx:685
 TFitter.cxx:686
 TFitter.cxx:687
 TFitter.cxx:688
 TFitter.cxx:689
 TFitter.cxx:690
 TFitter.cxx:691
 TFitter.cxx:692
 TFitter.cxx:693
 TFitter.cxx:694
 TFitter.cxx:695
 TFitter.cxx:696
 TFitter.cxx:697
 TFitter.cxx:698
 TFitter.cxx:699
 TFitter.cxx:700
 TFitter.cxx:701
 TFitter.cxx:702
 TFitter.cxx:703
 TFitter.cxx:704
 TFitter.cxx:705
 TFitter.cxx:706
 TFitter.cxx:707
 TFitter.cxx:708
 TFitter.cxx:709
 TFitter.cxx:710
 TFitter.cxx:711
 TFitter.cxx:712
 TFitter.cxx:713
 TFitter.cxx:714
 TFitter.cxx:715
 TFitter.cxx:716
 TFitter.cxx:717
 TFitter.cxx:718
 TFitter.cxx:719
 TFitter.cxx:720
 TFitter.cxx:721
 TFitter.cxx:722
 TFitter.cxx:723
 TFitter.cxx:724
 TFitter.cxx:725
 TFitter.cxx:726
 TFitter.cxx:727
 TFitter.cxx:728
 TFitter.cxx:729
 TFitter.cxx:730
 TFitter.cxx:731
 TFitter.cxx:732
 TFitter.cxx:733
 TFitter.cxx:734
 TFitter.cxx:735
 TFitter.cxx:736
 TFitter.cxx:737
 TFitter.cxx:738
 TFitter.cxx:739
 TFitter.cxx:740
 TFitter.cxx:741
 TFitter.cxx:742
 TFitter.cxx:743
 TFitter.cxx:744
 TFitter.cxx:745
 TFitter.cxx:746
 TFitter.cxx:747
 TFitter.cxx:748
 TFitter.cxx:749
 TFitter.cxx:750
 TFitter.cxx:751
 TFitter.cxx:752
 TFitter.cxx:753
 TFitter.cxx:754
 TFitter.cxx:755
 TFitter.cxx:756
 TFitter.cxx:757
 TFitter.cxx:758
 TFitter.cxx:759
 TFitter.cxx:760
 TFitter.cxx:761
 TFitter.cxx:762
 TFitter.cxx:763
 TFitter.cxx:764
 TFitter.cxx:765
 TFitter.cxx:766
 TFitter.cxx:767
 TFitter.cxx:768
 TFitter.cxx:769
 TFitter.cxx:770
 TFitter.cxx:771
 TFitter.cxx:772
 TFitter.cxx:773
 TFitter.cxx:774
 TFitter.cxx:775
 TFitter.cxx:776
 TFitter.cxx:777
 TFitter.cxx:778
 TFitter.cxx:779
 TFitter.cxx:780
 TFitter.cxx:781
 TFitter.cxx:782
 TFitter.cxx:783
 TFitter.cxx:784
 TFitter.cxx:785
 TFitter.cxx:786
 TFitter.cxx:787
 TFitter.cxx:788
 TFitter.cxx:789
 TFitter.cxx:790
 TFitter.cxx:791
 TFitter.cxx:792
 TFitter.cxx:793
 TFitter.cxx:794
 TFitter.cxx:795
 TFitter.cxx:796
 TFitter.cxx:797
 TFitter.cxx:798
 TFitter.cxx:799
 TFitter.cxx:800
 TFitter.cxx:801
 TFitter.cxx:802
 TFitter.cxx:803
 TFitter.cxx:804
 TFitter.cxx:805
 TFitter.cxx:806
 TFitter.cxx:807
 TFitter.cxx:808
 TFitter.cxx:809
 TFitter.cxx:810
 TFitter.cxx:811
 TFitter.cxx:812
 TFitter.cxx:813
 TFitter.cxx:814
 TFitter.cxx:815
 TFitter.cxx:816
 TFitter.cxx:817
 TFitter.cxx:818
 TFitter.cxx:819
 TFitter.cxx:820
 TFitter.cxx:821
 TFitter.cxx:822
 TFitter.cxx:823
 TFitter.cxx:824
 TFitter.cxx:825
 TFitter.cxx:826
 TFitter.cxx:827
 TFitter.cxx:828
 TFitter.cxx:829
 TFitter.cxx:830
 TFitter.cxx:831
 TFitter.cxx:832
 TFitter.cxx:833
 TFitter.cxx:834
 TFitter.cxx:835
 TFitter.cxx:836
 TFitter.cxx:837
 TFitter.cxx:838
 TFitter.cxx:839
 TFitter.cxx:840
 TFitter.cxx:841
 TFitter.cxx:842
 TFitter.cxx:843
 TFitter.cxx:844
 TFitter.cxx:845
 TFitter.cxx:846
 TFitter.cxx:847
 TFitter.cxx:848
 TFitter.cxx:849
 TFitter.cxx:850
 TFitter.cxx:851
 TFitter.cxx:852
 TFitter.cxx:853
 TFitter.cxx:854
 TFitter.cxx:855
 TFitter.cxx:856
 TFitter.cxx:857
 TFitter.cxx:858
 TFitter.cxx:859
 TFitter.cxx:860
 TFitter.cxx:861
 TFitter.cxx:862
 TFitter.cxx:863
 TFitter.cxx:864
 TFitter.cxx:865
 TFitter.cxx:866
 TFitter.cxx:867
 TFitter.cxx:868
 TFitter.cxx:869
 TFitter.cxx:870
 TFitter.cxx:871
 TFitter.cxx:872
 TFitter.cxx:873
 TFitter.cxx:874
 TFitter.cxx:875
 TFitter.cxx:876
 TFitter.cxx:877
 TFitter.cxx:878
 TFitter.cxx:879
 TFitter.cxx:880
 TFitter.cxx:881
 TFitter.cxx:882
 TFitter.cxx:883
 TFitter.cxx:884
 TFitter.cxx:885
 TFitter.cxx:886
 TFitter.cxx:887
 TFitter.cxx:888
 TFitter.cxx:889
 TFitter.cxx:890
 TFitter.cxx:891
 TFitter.cxx:892
 TFitter.cxx:893
 TFitter.cxx:894
 TFitter.cxx:895
 TFitter.cxx:896
 TFitter.cxx:897
 TFitter.cxx:898
 TFitter.cxx:899
 TFitter.cxx:900
 TFitter.cxx:901
 TFitter.cxx:902
 TFitter.cxx:903
 TFitter.cxx:904
 TFitter.cxx:905
 TFitter.cxx:906
 TFitter.cxx:907
 TFitter.cxx:908
 TFitter.cxx:909
 TFitter.cxx:910
 TFitter.cxx:911
 TFitter.cxx:912
 TFitter.cxx:913
 TFitter.cxx:914
 TFitter.cxx:915
 TFitter.cxx:916
 TFitter.cxx:917
 TFitter.cxx:918
 TFitter.cxx:919
 TFitter.cxx:920
 TFitter.cxx:921
 TFitter.cxx:922
 TFitter.cxx:923
 TFitter.cxx:924
 TFitter.cxx:925
 TFitter.cxx:926
 TFitter.cxx:927
 TFitter.cxx:928
 TFitter.cxx:929
 TFitter.cxx:930
 TFitter.cxx:931
 TFitter.cxx:932
 TFitter.cxx:933
 TFitter.cxx:934
 TFitter.cxx:935
 TFitter.cxx:936
 TFitter.cxx:937
 TFitter.cxx:938
 TFitter.cxx:939
 TFitter.cxx:940
 TFitter.cxx:941
 TFitter.cxx:942
 TFitter.cxx:943
 TFitter.cxx:944
 TFitter.cxx:945
 TFitter.cxx:946
 TFitter.cxx:947
 TFitter.cxx:948
 TFitter.cxx:949
 TFitter.cxx:950
 TFitter.cxx:951
 TFitter.cxx:952
 TFitter.cxx:953
 TFitter.cxx:954
 TFitter.cxx:955
 TFitter.cxx:956
 TFitter.cxx:957
 TFitter.cxx:958
 TFitter.cxx:959
 TFitter.cxx:960
 TFitter.cxx:961
 TFitter.cxx:962
 TFitter.cxx:963
 TFitter.cxx:964
 TFitter.cxx:965
 TFitter.cxx:966
 TFitter.cxx:967
 TFitter.cxx:968
 TFitter.cxx:969
 TFitter.cxx:970
 TFitter.cxx:971
 TFitter.cxx:972
 TFitter.cxx:973
 TFitter.cxx:974
 TFitter.cxx:975
 TFitter.cxx:976
 TFitter.cxx:977
 TFitter.cxx:978
 TFitter.cxx:979
 TFitter.cxx:980
 TFitter.cxx:981
 TFitter.cxx:982
 TFitter.cxx:983
 TFitter.cxx:984
 TFitter.cxx:985
 TFitter.cxx:986
 TFitter.cxx:987
 TFitter.cxx:988
 TFitter.cxx:989
 TFitter.cxx:990
 TFitter.cxx:991
 TFitter.cxx:992
 TFitter.cxx:993
 TFitter.cxx:994
 TFitter.cxx:995
 TFitter.cxx:996
 TFitter.cxx:997
 TFitter.cxx:998
 TFitter.cxx:999
 TFitter.cxx:1000
 TFitter.cxx:1001
 TFitter.cxx:1002
 TFitter.cxx:1003
 TFitter.cxx:1004
 TFitter.cxx:1005
 TFitter.cxx:1006
 TFitter.cxx:1007
 TFitter.cxx:1008
 TFitter.cxx:1009
 TFitter.cxx:1010
 TFitter.cxx:1011
 TFitter.cxx:1012
 TFitter.cxx:1013
 TFitter.cxx:1014
 TFitter.cxx:1015
 TFitter.cxx:1016
 TFitter.cxx:1017
 TFitter.cxx:1018
 TFitter.cxx:1019
 TFitter.cxx:1020
 TFitter.cxx:1021
 TFitter.cxx:1022
 TFitter.cxx:1023
 TFitter.cxx:1024
 TFitter.cxx:1025
 TFitter.cxx:1026
 TFitter.cxx:1027
 TFitter.cxx:1028
 TFitter.cxx:1029
 TFitter.cxx:1030
 TFitter.cxx:1031
 TFitter.cxx:1032
 TFitter.cxx:1033
 TFitter.cxx:1034
 TFitter.cxx:1035
 TFitter.cxx:1036
 TFitter.cxx:1037
 TFitter.cxx:1038
 TFitter.cxx:1039
 TFitter.cxx:1040
 TFitter.cxx:1041
 TFitter.cxx:1042
 TFitter.cxx:1043
 TFitter.cxx:1044
 TFitter.cxx:1045
 TFitter.cxx:1046
 TFitter.cxx:1047
 TFitter.cxx:1048
 TFitter.cxx:1049
 TFitter.cxx:1050
 TFitter.cxx:1051
 TFitter.cxx:1052
 TFitter.cxx:1053
 TFitter.cxx:1054
 TFitter.cxx:1055
 TFitter.cxx:1056
 TFitter.cxx:1057
 TFitter.cxx:1058
 TFitter.cxx:1059
 TFitter.cxx:1060
 TFitter.cxx:1061
 TFitter.cxx:1062
 TFitter.cxx:1063
 TFitter.cxx:1064
 TFitter.cxx:1065
 TFitter.cxx:1066
 TFitter.cxx:1067
 TFitter.cxx:1068
 TFitter.cxx:1069
 TFitter.cxx:1070
 TFitter.cxx:1071
 TFitter.cxx:1072
 TFitter.cxx:1073
 TFitter.cxx:1074
 TFitter.cxx:1075
 TFitter.cxx:1076
 TFitter.cxx:1077
 TFitter.cxx:1078
 TFitter.cxx:1079
 TFitter.cxx:1080
 TFitter.cxx:1081
 TFitter.cxx:1082
 TFitter.cxx:1083
 TFitter.cxx:1084
 TFitter.cxx:1085
 TFitter.cxx:1086
 TFitter.cxx:1087
 TFitter.cxx:1088
 TFitter.cxx:1089
 TFitter.cxx:1090
 TFitter.cxx:1091
 TFitter.cxx:1092
 TFitter.cxx:1093
 TFitter.cxx:1094
 TFitter.cxx:1095
 TFitter.cxx:1096
 TFitter.cxx:1097
 TFitter.cxx:1098
 TFitter.cxx:1099
 TFitter.cxx:1100
 TFitter.cxx:1101
 TFitter.cxx:1102
 TFitter.cxx:1103
 TFitter.cxx:1104
 TFitter.cxx:1105
 TFitter.cxx:1106
 TFitter.cxx:1107
 TFitter.cxx:1108
 TFitter.cxx:1109
 TFitter.cxx:1110
 TFitter.cxx:1111
 TFitter.cxx:1112
 TFitter.cxx:1113
 TFitter.cxx:1114
 TFitter.cxx:1115
 TFitter.cxx:1116
 TFitter.cxx:1117
 TFitter.cxx:1118
 TFitter.cxx:1119
 TFitter.cxx:1120
 TFitter.cxx:1121
 TFitter.cxx:1122
 TFitter.cxx:1123
 TFitter.cxx:1124
 TFitter.cxx:1125
 TFitter.cxx:1126
 TFitter.cxx:1127
 TFitter.cxx:1128
 TFitter.cxx:1129
 TFitter.cxx:1130
 TFitter.cxx:1131
 TFitter.cxx:1132
 TFitter.cxx:1133
 TFitter.cxx:1134