NueFCSensitivity.cxx File Reference

#include <string>
#include "NueAna/NueAnaTools/NueConvention.h"
#include "NueFCSensitivity.h"
#include "TMath.h"
#include "TChain.h"
#include "NueAna/NuePOT.h"
#include <iostream>
#include <fstream>
#include "TMinuit.h"

Go to the source code of this file.

Functions

double Poisson (double mean, int n, bool numOnly)
double Gaussian (double x, double mean, double sig)
void WrapperFunction (Int_t &, Double_t *, Double_t &f, Double_t *par, Int_t)

Function Documentation

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

Definition at line 30 of file NueFCSensitivity.cxx.

00031 { 
00032   double front = 1/TMath::Sqrt(2*3.1415926*sig);
00033   double exp = (x-mean)*(x-mean)/(2*sig);
00034   return front*TMath::Exp(-exp);
00035 } 

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

Definition at line 11 of file NueFCSensitivity.cxx.

References Poisson().

00012 {
00013    double numerator = 1;
00014    if(mean > 100 || n > 100){
00015       // use roots protected function -
00016       if(!numOnly) return TMath::Poisson(n, mean);
00017 
00018       // else     pull a trick to prevent explosions
00019       double logN = n*TMath::Log(mean) - mean;
00020       numerator = TMath::Exp(logN);
00021    } 
00022    else{
00023     numerator = TMath::Power(mean,n)*TMath::Exp(-mean);   
00024    }
00025    double denom = 1.0;
00026    if(!numOnly) denom = TMath::Factorial(n);
00027    return numerator/denom;
00028 } 

void WrapperFunction ( Int_t &  ,
Double_t *  ,
Double_t &  f,
Double_t *  par,
Int_t   
)

Definition at line 37 of file NueFCSensitivity.cxx.

References NueFCSensitivity::MinimizationFunction().

00038 {
00039    NueFCSensitivity * fcs = dynamic_cast<NueFCSensitivity *>(gMinuit->GetObjectFit());
00040 
00041 //   std::cout<<"In the wrapper"<<par[0]<<"  "<<par[1]<<std::endl;
00042    f = fcs->MinimizationFunction(par);
00043 }


Generated on 8 Jul 2019 for loon by  doxygen 1.6.1