Extacting Likelihood for a fit to TH1

From: Jeanne Wilson <J.Wilson_at_sussex.ac.uk>
Date: Fri, 1 Jul 2005 16:14:11 +0100 (BST)


Hello,

        I am running root Version 4.01/03 on Fedora Core 2 and am performing a likelihood fit on a histogram. Since chisquared breaks down in the low statistics limit, I want to extract the maximum likelihood as a figure of merit for the fit. MINUIT returns the value I want to screen "FCN=..." but how do I access this value in a macro?

Here is a simplified example:

    TF1 *func = new TF1("func", "[0]",0,100);     TH1F* htot = new TH1F("htot "," ",100,0,100);     for(Int_t j=0;j<200;j++){
      htot->Fill(100*gRandom->Uniform(0.0,1.0));     }
    htot->Fit("func","L");

which outputs to screen:

 FCN=340.813 FROM MIGRAD STATUS=CONVERGED 56 CALLS 57 TOTAL

                     EDM=7.22708e-12    STRATEGY= 1      ERROR MATRIX
ACCURATE
  EXT PARAMETER                                   STEP         FIRST
  NO.   NAME      VALUE            ERROR          SIZE      DERIVATIVE
   1  p0           2.00000e+00   1.41421e-01   1.27663e-03  -2.68832e-05

I would like to access FCN=340.813.

Cheers,

        Jeanne Wilson Received on Fri Jul 01 2005 - 17:14:17 MEST

This archive was generated by hypermail 2.2.0 : Tue Jan 02 2007 - 14:45:10 MET