NueFit2D.cxx File Reference

#include "NueAna/MultiBinAna/NueFit2D.h"

Go to the source code of this file.

Defines

#define NueFit2D_C

Functions

static void dlnlFunction (int &npar, double *, double &result, double *par, int)
static void binFunction (int &npar, double *, double &result, double *par, int)
double Poisson (double mean, int n, bool numOnly)
double Gaussian (double x, double mean, double sig)

Define Documentation

#define NueFit2D_C

Definition at line 1 of file NueFit2D.cxx.


Function Documentation

static void binFunction ( int &  npar,
double *  ,
double &  result,
double *  par,
int   
) [static]

Definition at line 18 of file NueFit2D.cxx.

References NueFit2D::BinLikeComparison().

Referenced by NueFit2D::DoBinMinParam().

00018                                                                                                {
00019 
00020   std::vector<double> f;
00021   NueFit2D *nf2d = (NueFit2D*)gMinuit->GetObjectFit();
00022 
00023   for (Int_t i=0; i<npar; i++){
00024     f.push_back(par[i]);
00025   }
00026   result = nf2d->BinLikeComparison(f);
00027 
00028 }

static void dlnlFunction ( int &  npar,
double *  ,
double &  result,
double *  par,
int   
) [static]

Definition at line 6 of file NueFit2D.cxx.

References NueFit2D::StdLikeComparison().

Referenced by NueFit2D::DoStdMinParam().

00006                                                                                                 {
00007 
00008   std::vector<double> f;
00009   NueFit2D *nf2d = (NueFit2D*)gMinuit->GetObjectFit();
00010 
00011   for (Int_t i=0; i<npar; i++){
00012     f.push_back(par[i]);
00013   }
00014   result = nf2d->StdLikeComparison(f);
00015 
00016 }

double Gaussian ( double  x,
double  mean,
double  sig 
)

Definition at line 50 of file NueFit2D.cxx.

Referenced by NueFCSensitivity::EvaluateOmega(), and NueFit2D::EvaluateOmega().

00051 { 
00052   double front = 1/TMath::Sqrt(2*3.1415926*sig);
00053   double exp = (x-mean)*(x-mean)/(2*sig);
00054   return front*TMath::Exp(-exp);
00055 } 

double Poisson ( double  mean,
int  n,
bool  numOnly 
)

Definition at line 31 of file NueFit2D.cxx.

Referenced by NueFCSensitivity::EvaluateOmega(), NueFit2D::EvaluateOmega(), and Poisson().

00032 {
00033   double numerator = 1;
00034   if(mean > 100 || n > 100){
00035       // use roots protected function -
00036     if(!numOnly) return TMath::Poisson(n, mean);
00037 
00038       // else     pull a trick to prevent explosions
00039     double logN = n*TMath::Log(mean) - mean;
00040     numerator = TMath::Exp(logN);
00041   } 
00042   else{
00043     numerator = TMath::Power(mean,n)*TMath::Exp(-mean);   
00044   }
00045   double denom = 1.0;
00046   if(!numOnly) denom = TMath::Factorial(n);
00047   return numerator/denom;
00048 } 


Generated on 8 Jul 2019 for loon by  doxygen 1.6.1