00001 /*************************************************************************** 00002 * 00003 * $Id: BetheBlochFunction.hh,v 1.5 2007/07/12 19:35:07 fisyak Exp $ 00004 * 00005 * Author: Aihong Tang & Richard Witt (FORTRAN Version),Kent State U. 00006 * Send questions to aihong@cnr.physics.kent.edu 00007 *************************************************************************** 00008 * 00009 * Description:part of StPidAmpMaker package 00010 * function describing Bethe-Block curve 00011 *************************************************************************** 00012 * 00013 * $Log: BetheBlochFunction.hh,v $ 00014 * Revision 1.5 2007/07/12 19:35:07 fisyak 00015 * Change includes for ROOT 5.16 00016 * 00017 * Revision 1.4 2005/11/01 18:38:37 aihong 00018 * switch to functions from TMath 00019 * 00020 * Revision 1.3 2003/10/25 00:35:33 perev 00021 * Defence against non physical region added 00022 * 00023 * Revision 1.2 2003/09/02 17:58:09 perev 00024 * gcc 3.2 updates + WarnOff 00025 * 00026 * Revision 1.1 2000/07/22 22:27:14 aihong 00027 * move files from StPidAmpMaker to StEventUtilities 00028 * 00029 * Revision 1.1 2000/07/12 15:38:32 aihong 00030 * update for real data 00031 * 00032 * Revision 1.2 2000/05/01 16:59:48 aihong 00033 * clean up 00034 * 00035 * Revision 1.1 2000/04/14 15:52:07 aihong 00036 * change name from BetheBlock to BetheBloch 00037 * 00038 * Revision 1.1.1.1 2000/03/09 17:48:34 aihong 00039 * Installation of package 00040 * 00041 **************************************************************************/ 00042 //This is identical to BetheBloch.hh 00043 //change the name to BetheBlochFunction to avoid name corruption from StarClassLibary 00044 00045 #ifndef BetheBlochFunction_hh 00046 #define BetheBlochFunction_hh 00047 #include "TMath.h" 00048 double BetheBlochFunction(double *rig,double *par) { 00049 00050 00051 double charge=double(fabs(par[3])); 00052 double m=double(par[4]);//mass 00053 double calib=par[5];//calibFactor 00054 double satura=par[6];//saturation 00055 00056 double prefactor=par[0]; 00057 double postfactor=par[1]; 00058 double mFactor=par[2]; 00059 double myValue; 00060 double b2, gb2; 00061 double myDedx; 00062 00063 00064 00065 myValue =5059.0; 00066 00067 00068 gb2=(rig[0]*charge/m)*(rig[0]*charge/m); 00069 00070 if (gb2 > 0.0) b2=1.0/(1.0 + 1.0/gb2); 00071 else return 0.0; 00072 if (myValue*gb2<=1.) return 0; //VP non physical region 00073 myDedx=calib*charge*charge*(1.0/TMath::Power(b2,prefactor))*(TMath::Power(TMath::Log(myValue*gb2),0.7) - postfactor*b2 )- mFactor; 00074 if (myDedx > satura) myDedx=satura; 00075 00076 return myDedx; 00077 }; 00078 00079 #endif 00080 00081 //can not declare BetheBloch as a member of StPidAmpNet. 00082 //coz TF1(..) ask a pointer for a function, not for a pointer for a member func. 00083 //a type of pointer to a function ::* is diff. from a type of pointer to a member function.(*) 00084 00085
1.5.9