NuFCFitterNuMuBar Class Reference

#include <NuFCFitterNuMuBar.h>

Inheritance diagram for NuFCFitterNuMuBar:
NuFCFittingInterface

List of all members.

Public Member Functions

 NuFCFitterNuMuBar (const NuMMParameters &pars)
virtual Bool_t Fit (void)
 Run the fitting routine. Returns true for success.

Private Attributes

NuMMParameters fBaseParameters

Detailed Description

Definition at line 8 of file NuFCFitterNuMuBar.h.


Constructor & Destructor Documentation

NuFCFitterNuMuBar::NuFCFitterNuMuBar ( const NuMMParameters pars  ) 

Member Function Documentation

Bool_t NuFCFitterNuMuBar::Fit ( void   )  [virtual]

Run the fitting routine. Returns true for success.

Reimplemented from NuFCFittingInterface.

Definition at line 45 of file NuFCFitterNuMuBar.cxx.

References NuMMParameters::Dm2(), NuMMParameters::Dm2Bar(), fBaseParameters, NuFCFittingInterface::fBestFit, NuSystFitter::FCMinimise(), NuFCFittingInterface::GetSystFitter(), gSystem(), Msg::kInfo, NuSystFitter::Likelihood(), NuSystFitter::Minimise(), NuMMParameters::MinuitPass(), MSG, NuMMParameters::Sn2(), and NuMMParameters::Sn2Bar().

00046 {
00047   // Turn off FPEs because Minuit is incredicly stupid and sometimes
00048   // tries to take sqrt(-1);
00049   Int_t FPEmask = gSystem->SetFPEMask(0);
00050   
00051   NuSystFitter *fitter = GetSystFitter();
00052   NuMMParameters fit = fitter->FCMinimise(fBaseParameters);
00053   
00054   // If this fit point was lower than our base parameters
00055   if (fitter->Likelihood(fit) > fitter->Likelihood(fBaseParameters))
00056   {
00057     MSG("NuFCFitterNuMuBar", Msg::kInfo) << "GOT NEGATIVE DELTA-CHI2: Refitting from base parameters" << endl;
00058     
00059     // Start a fit from our base parameters
00060     NuMMParameters mmFit = fitter->Minimise(fBaseParameters);
00061     fit = mmFit;
00062     
00063     // Work out the new deltachi2 to this reference and make sure it was lower
00064     Double_t newdelta = fitter->Likelihood(fBaseParameters) - fitter->Likelihood(mmFit);
00065     if (!mmFit.MinuitPass())
00066     {
00067         // Minuit failed to fit.
00068         MSG("NuFCFitterNuMuBar", Msg::kInfo) << "** FAILED MINUIT TRUTH REFIT **" << endl;
00069         MSG("NuFCFitterNuMuBar", Msg::kInfo) << "This is an error, but returning base parameters" << endl;
00070         fit = fBaseParameters;
00071     } else {
00072       // Print out what out refit was
00073       MSG("NuFCFitterNuMuBar", Msg::kInfo)
00074         << "Refit  found: dm2: " << mmFit.Dm2()
00075         << " sn2: " << mmFit.Sn2()
00076         << " dm2bar: " << mmFit.Dm2Bar()
00077         << " sn2bar: " << mmFit.Sn2Bar()
00078         << '\n';
00079     }
00080     if (newdelta < 0) {
00081       MSG("NuFCFitterNuMuBar", Msg::kInfo) << "New Minuit fit is still lower, returning base pars" << endl;
00082       fit = fBaseParameters;
00083     }
00084   }
00085   
00086   // Restore whatever FPE settings we had before
00087   gSystem->SetFPEMask(FPEmask);
00088 
00089   fBestFit = fit;
00090   // This function always returns a fit
00091   return true;
00092 }


Member Data Documentation

Definition at line 10 of file NuFCFitterNuMuBar.h.

Referenced by Fit(), and NuFCFitterNuMuBar().


The documentation for this class was generated from the following files:

Generated on 22 May 2017 for loon by  doxygen 1.6.1