00001 #ifndef STHBT_GAMOVCORRECT
00002 #define STHBT_GAMOVCORRECT
00003
00004
00005 #include "StHbtMaker/Infrastructure/StHbtTypes.hh"
00006 #include "StHbtMaker/Infrastructure/StHbtPair.hh"
00007 #include "PhysicalConstants.h"
00008
00009
00010
00011 double gamovCorrect(const StHbtPair* pair,
00012 const double& charge) {
00013 static double px1,py1,pz1,px2,py2,pz2;
00014 static double px1new,py1new,pz1new;
00015 static double px2new,py2new,pz2new;
00016 static double vx1cms,vy1cms,vz1cms;
00017 static double vx2cms,vy2cms,vz2cms;
00018 static double VcmsX,VcmsY,VcmsZ;
00019 static double dv = 0.0;
00020 static double e1,e2,e1new,e2new;
00021 static double psi,theta;
00022 static double beta,gamma;
00023 static double VcmsXnew;
00024
00025
00026
00027 px1 = pair->track1()->FourMomentum().px();
00028 py1 = pair->track1()->FourMomentum().py();
00029 pz1 = pair->track1()->FourMomentum().pz();
00030 e1 = pair->track1()->FourMomentum().e();
00031 px2 = pair->track2()->FourMomentum().px();
00032 py2 = pair->track2()->FourMomentum().py();
00033 pz2 = pair->track2()->FourMomentum().pz();
00034 e2 = pair->track2()->FourMomentum().e();
00035
00036 VcmsX = ( px1+px2 )/( e1+e2 );
00037 VcmsY = ( py1+py2 )/( e1+e2 );
00038 VcmsZ = ( pz1+pz2 )/( e1+e2 );
00039
00040 psi = atan(VcmsY/VcmsX);
00041 VcmsXnew = VcmsX*cos(psi)+VcmsY*sin(psi);
00042 VcmsX = VcmsXnew;
00043 theta = atan(VcmsZ/VcmsX);
00044 VcmsXnew = VcmsX*cos(theta)+VcmsZ*sin(theta);
00045 VcmsX = VcmsXnew;
00046
00047 beta = VcmsX;
00048 gamma = 1.0/::sqrt( 1.0-beta*beta );
00049
00050
00051 px1new = px1*cos(psi)+py1*sin(psi);
00052 py1new = -px1*sin(psi)+py1*cos(psi);
00053 px1 = px1new;
00054 px1new = px1*cos(theta)+pz1*sin(theta);
00055 pz1new = -px1*sin(theta)+pz1*cos(theta);
00056 px1 = px1new;
00057 py1 = py1new;
00058 pz1 = pz1new;
00059
00060 px2new = px2*cos(psi)+py2*sin(psi);
00061 py2new = -px2*sin(psi)+py2*cos(psi);
00062 px2 = px2new;
00063 px2new = px2*cos(theta)+pz2*sin(theta);
00064 pz2new = -px2*sin(theta)+pz2*cos(theta);
00065 px2 = px2new;
00066 py2 = py2new;
00067 pz2 = pz2new;
00068
00069
00070 e1new = gamma*e1 - gamma*beta*px1;
00071 px1new = -gamma*beta*e1 + gamma*px1;
00072 e2new = gamma*e2 - gamma*beta*px2;
00073 px2new = -gamma*beta*e2 + gamma*px2;
00074 px1 = px1new;
00075 px2 = px2new;
00076
00077
00078 vx1cms = px1/e1new;
00079 vy1cms = py1/e1new;
00080 vz1cms = pz1/e1new;
00081 vx2cms = px2/e2new;
00082 vy2cms = py2/e2new;
00083 vz2cms = pz2/e2new;
00084
00085
00086 dv = ::sqrt( (vx1cms-vx2cms)*(vx1cms-vx2cms) +
00087 (vy1cms-vy2cms)*(vy1cms-vy2cms) +
00088 (vz1cms-vz2cms)*(vz1cms-vz2cms) );
00089
00090
00091 double eta = charge*fine_structure_const/( dv );
00092 double gamov = twopi*eta/(exp(twopi*eta)-1);
00093 return (gamov);
00094 }
00095
00096 #endif