ShwfitAna.cxx File Reference

#include "TH1F.h"
#include "TF1.h"
#include "TCanvas.h"
#include "TClonesArray.h"
#include "TMinuit.h"
#include "StandardNtuple/NtpStRecord.h"
#include "CandNtupleSR/NtpSRRecord.h"
#include "CandNtupleSR/NtpSREvent.h"
#include "CandNtupleSR/NtpSRTrack.h"
#include "CandNtupleSR/NtpSRStrip.h"
#include "MessageService/MsgService.h"
#include "NueAna/NueAnaTools/SntpHelpers.h"
#include "NueAna/ShwfitAna.h"
#include "AnalysisNtuples/ANtpDefaultValue.h"
#include "VertexFinder/NtpVtxFinder/NtpVtxFinder.h"

Go to the source code of this file.

Functions

 CVSID ("$Id: ShwfitAna.cxx,v 1.39 2011/10/07 20:04:33 wingmc Exp $")
static Double_t shwfunc (Double_t *x, Double_t *par)
static Double_t hadfunc (Double_t *x, Double_t *par)
static Double_t maxwell (Double_t *x, Double_t *par)
static Double_t maxwell3 (Double_t *x, Double_t *par)

Function Documentation

CVSID ( "$Id: ShwfitAna.  cxx,
v 1.39 2011/10/07 20:04:33 wingmc Exp $"   
)
static Double_t hadfunc ( Double_t *  x,
Double_t *  par 
) [static]

Definition at line 38 of file ShwfitAna.cxx.

Referenced by ShwfitAna::Reset().

00039 {
00040   // function to be fitted for em showers par[0]=a par[1]=b par[2]=E0
00041   // added hadronic part, new params par[3]=c par[4]=d par[5]=fzero
00042   Float_t xx=x[0];
00043   Double_t f1 = par[2]*TMath::Power(par[1],par[0])*
00044                 TMath::Power(xx*1.46676,par[0]-1)*
00045                 TMath::Exp(-par[1]*(xx*1.46676))/TMath::Gamma(par[0]);
00046   Double_t f2 = par[2]*TMath::Power(par[4],par[3])*
00047                 TMath::Power(xx*0.1694,par[3]-1)*
00048                 TMath::Exp(-par[4]*(xx*0.1694))/TMath::Gamma(par[3]);
00049   Double_t f=(par[5]*f1+(1-par[5])*0.1154*f2)*1.46676;
00050   return f;
00051 }

static Double_t maxwell ( Double_t *  x,
Double_t *  par 
) [static]

Definition at line 55 of file ShwfitAna.cxx.

Referenced by ShwfitAna::Reset().

00056 {
00057   //Fit to Maxwell function N(E*b) x^2 exp{-b*x^2}
00058   //par[0] = b, par[1] = E = Energy
00059   Float_t xx = x[0];
00060                                                                                                    
00061   Double_t f = par[1]*(4/TMath::Sqrt(TMath::Pi()))*TMath::Power(par[0],(3/2))*TMath::Power(xx,2)*TMath::Exp(-par[0]*TMath::Power(xx,2));
00062                                                                                                    
00063   return f;
00064 }

static Double_t maxwell3 ( Double_t *  x,
Double_t *  par 
) [static]

Definition at line 65 of file ShwfitAna.cxx.

Referenced by ShwfitAna::Reset().

00066 {
00067   //Fit to Maxwell-like function N(E*b) x^3 exp{-b*x^2}
00068   //par[0] = b, par[1] = E = Energy
00069   Float_t xx = x[0];
00070                                                                                                    
00071   Double_t f = par[1]*2*TMath::Power(par[0],2)*TMath::Power(xx,3)*TMath::Exp(-par[0]*TMath::Power(xx,2));
00072                                                                                                    
00073   return f;
00074 }

static Double_t shwfunc ( Double_t *  x,
Double_t *  par 
) [static]

Definition at line 19 of file ShwfitAna.cxx.

References MuELoss::R.

Referenced by ShwfitAna::Reset().

00020 {
00021 
00022   // function to be fitted for em showers par[0]=a par[1]=E0
00023   Float_t R = 1.46676;
00024   Float_t xx=R*x[0];
00025 //  cout<<"In shwfunc "<<xx<<" par[0] "<<par[0]<<" par[1] "<<par[1]<<" par[2] "<<par[2]<<endl;
00026 
00027   Double_t lnf = TMath::Log(R*par[2]*par[1])+(par[0]-1)*TMath::Log(xx*par[1])-
00028      par[1]*xx-TMath::LnGamma(par[0]);
00029 
00030   Double_t f = exp(lnf);
00031 
00032 //  Double_t f = 1.46676*par[2]*TMath::Power(par[1],par[0])*
00033 //               TMath::Power(xx,par[0]-1)*
00034 //               TMath::Exp(-par[1]*(xx))/TMath::Gamma(par[0]);
00035   return f;
00036 }


Generated on 8 Jul 2019 for loon by  doxygen 1.6.1