ShwFit.cxx File Reference

#include "MessageService/MsgService.h"
#include "TMinuit.h"
#include "TMath.h"
#include "ShwFit.h"
#include "TCanvas.h"
#include "TLatex.h"
#include <math.h>
#include <iostream>
#include <fstream>
#include "Plex/PlexPlaneId.h"
#include "UgliGeometry/UgliGeomHandle.h"
#include "UgliGeometry/UgliScintPlnHandle.h"
#include "Plex/PlexStripEndId.h"
#include "UgliGeometry/UgliStripHandle.h"
#include "UgliGeometry/UgliSteelPlnHandle.h"

Go to the source code of this file.

Defines

#define EMDEBUG   1

Functions

 CVSID ("$Id: ShwFit.cxx,v 1.5 2009/07/02 18:31:32 scavan Exp $")
static Double_t shwfunc3d (Double_t *x, Double_t *par)

Define Documentation

#define EMDEBUG   1

Definition at line 3 of file ShwFit.cxx.


Function Documentation

CVSID ( "$Id: ShwFit.  cxx,
v 1.5 2009/07/02 18:31:32 scavan Exp $"   
)
static Double_t shwfunc3d ( Double_t *  x,
Double_t *  par 
) [static]

Definition at line 285 of file ShwFit.cxx.

References MuELoss::e.

Referenced by ShwFit::Fit3d().

00286 {
00287 
00288         // function to be fitted for em showers par[0]=a par[1]=E0
00289         //Double_t Rsteel = 1.445; // for steel
00290         //    Double_t R = 1.46676;
00291         Double_t Rscint=0.0241; //for scint only
00292 
00293         //Double_t R = Rscint+Rsteel;
00294         // Double_t xx=R*x[0];
00295         Double_t xx=x[0];//+par[3]; //uncomment for offset fitting
00296 
00297         //MSG("ShwFit",Msg::kWarning)<<"at "<<xx<<endl;
00298 
00299         if(xx<=0 || xx >1e9 )
00300         {
00301                 //cout<<"badx "<<xx<<"\n";
00302 
00303                 //      MSG("ShwFit",Msg::kError)<<"removing hit at "<<xx<<endl;
00304                 return 0;//to fix a bug..... we don't expect anything here anyways..
00305         }
00306 
00307 
00308         //      Double_t xx=R*(x[0]+par[3]);
00309 
00310         // cout<<"In shwfunc "<<xx<<" par[0] "<<par[0]<<" par[1] "<<par[1]<<" par[2] "<<par[2]<<endl;
00311 
00312         if(TMath::Abs(par[0])<1e-6)return 0;
00313 
00314         Double_t lnf = TMath::Log(Rscint*par[2]*par[1])+(par[0]-1)*TMath::Log(xx*par[1])-
00315         par[1]*xx-TMath::LnGamma(par[0]);
00316 
00317         
00318      
00319         //     Double_t lnf = TMath::Log(par[2]*par[1])+(par[0]-1)*TMath::Log(xx*par[1])-
00320         //   par[1]*xx-TMath::LnGamma(par[0]);
00321 
00322 
00323         //      xx+=Rscint;
00324         //       Double_t lnfh = TMath::Log(par[2]*par[1])+(par[0]-1)*TMath::Log(xx*par[1])-
00325         //   par[1]*xx-TMath::LnGamma(par[0]);
00326 
00327         //cout <<"eval "<<lnf<<" ";
00328         Double_t f = exp(lnf);
00329         
00330 
00331         //    cout <<f<<"\n";
00332  
00333         //if the number is close to 0... there are FPEs on minos machines,      probably due to lost precision 
00334         if(f<1e-10)return 0;
00335 
00336 
00337 
00338         //Double_t fh=exp(lnfh);
00339         
00340         //return (fh+f)/2*Rscint;
00341 
00342 
00343         //  Double_t f = 1.46676*par[2]*TMath::Power(par[1],par[0])*
00344         //               TMath::Power(xx,par[0]-1)*
00345         //               TMath::Exp(-par[1]*(xx))/TMath::Gamma(par[0]);
00346         return f;
00347 }


Generated on 8 Jul 2019 for loon by  doxygen 1.6.1