StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
BetheBlochFunction.hh
1 /***************************************************************************
2  *
3  * $Id: BetheBlochFunction.hh,v 1.5 2007/07/12 19:35:07 fisyak Exp $
4  *
5  * Author: Aihong Tang & Richard Witt (FORTRAN Version),Kent State U.
6  * Send questions to aihong@cnr.physics.kent.edu
7  ***************************************************************************
8  *
9  * Description:part of StPidAmpMaker package
10  * function describing Bethe-Block curve
11  ***************************************************************************
12  *
13  * $Log: BetheBlochFunction.hh,v $
14  * Revision 1.5 2007/07/12 19:35:07 fisyak
15  * Change includes for ROOT 5.16
16  *
17  * Revision 1.4 2005/11/01 18:38:37 aihong
18  * switch to functions from TMath
19  *
20  * Revision 1.3 2003/10/25 00:35:33 perev
21  * Defence against non physical region added
22  *
23  * Revision 1.2 2003/09/02 17:58:09 perev
24  * gcc 3.2 updates + WarnOff
25  *
26  * Revision 1.1 2000/07/22 22:27:14 aihong
27  * move files from StPidAmpMaker to StEventUtilities
28  *
29  * Revision 1.1 2000/07/12 15:38:32 aihong
30  * update for real data
31  *
32  * Revision 1.2 2000/05/01 16:59:48 aihong
33  * clean up
34  *
35  * Revision 1.1 2000/04/14 15:52:07 aihong
36  * change name from BetheBlock to BetheBloch
37  *
38  * Revision 1.1.1.1 2000/03/09 17:48:34 aihong
39  * Installation of package
40  *
41  **************************************************************************/
42 //This is identical to BetheBloch.hh
43 //change the name to BetheBlochFunction to avoid name corruption from StarClassLibary
44 
45 #ifndef BetheBlochFunction_hh
46 #define BetheBlochFunction_hh
47 #include "TMath.h"
48 double BetheBlochFunction(double *rig,double *par) {
49 
50 
51  double charge=double(fabs(par[3]));
52  double m=double(par[4]);//mass
53  double calib=par[5];//calibFactor
54  double satura=par[6];//saturation
55 
56  double prefactor=par[0];
57  double postfactor=par[1];
58  double mFactor=par[2];
59  double myValue;
60  double b2, gb2;
61  double myDedx;
62 
63 
64 
65  myValue =5059.0;
66 
67 
68  gb2=(rig[0]*charge/m)*(rig[0]*charge/m);
69 
70  if (gb2 > 0.0) b2=1.0/(1.0 + 1.0/gb2);
71  else return 0.0;
72  if (myValue*gb2<=1.) return 0; //VP non physical region
73  myDedx=calib*charge*charge*(1.0/TMath::Power(b2,prefactor))*(TMath::Power(TMath::Log(myValue*gb2),0.7) - postfactor*b2 )- mFactor;
74  if (myDedx > satura) myDedx=satura;
75 
76  return myDedx;
77  };
78 
79 #endif
80 
81  //can not declare BetheBloch as a member of StPidAmpNet.
82  //coz TF1(..) ask a pointer for a function, not for a pointer for a member func.
83  //a type of pointer to a function ::* is diff. from a type of pointer to a member function.(*)
84 
85