1 #ifndef STHBT_GAMOVCORRECT
2 #define STHBT_GAMOVCORRECT
5 #include "StHbtMaker/Infrastructure/StHbtTypes.hh"
6 #include "StHbtMaker/Infrastructure/StHbtPair.hh"
7 #include "PhysicalConstants.h"
11 double gamovCorrect(
const StHbtPair* pair,
12 const double& charge) {
13 static double px1,py1,pz1,px2,py2,pz2;
14 static double px1new,py1new,pz1new;
15 static double px2new,py2new,pz2new;
16 static double vx1cms,vy1cms,vz1cms;
17 static double vx2cms,vy2cms,vz2cms;
18 static double VcmsX,VcmsY,VcmsZ;
19 static double dv = 0.0;
20 static double e1,e2,e1new,e2new;
21 static double psi,theta;
22 static double beta,gamma;
23 static double VcmsXnew;
27 px1 = pair->track1()->FourMomentum().px();
28 py1 = pair->track1()->FourMomentum().py();
29 pz1 = pair->track1()->FourMomentum().pz();
30 e1 = pair->track1()->FourMomentum().e();
31 px2 = pair->track2()->FourMomentum().px();
32 py2 = pair->track2()->FourMomentum().py();
33 pz2 = pair->track2()->FourMomentum().pz();
34 e2 = pair->track2()->FourMomentum().e();
36 VcmsX = ( px1+px2 )/( e1+e2 );
37 VcmsY = ( py1+py2 )/( e1+e2 );
38 VcmsZ = ( pz1+pz2 )/( e1+e2 );
40 psi = atan(VcmsY/VcmsX);
41 VcmsXnew = VcmsX*cos(psi)+VcmsY*sin(psi);
43 theta = atan(VcmsZ/VcmsX);
44 VcmsXnew = VcmsX*cos(theta)+VcmsZ*sin(theta);
48 gamma = 1.0/::sqrt( 1.0-beta*beta );
51 px1new = px1*cos(psi)+py1*sin(psi);
52 py1new = -px1*sin(psi)+py1*cos(psi);
54 px1new = px1*cos(theta)+pz1*sin(theta);
55 pz1new = -px1*sin(theta)+pz1*cos(theta);
60 px2new = px2*cos(psi)+py2*sin(psi);
61 py2new = -px2*sin(psi)+py2*cos(psi);
63 px2new = px2*cos(theta)+pz2*sin(theta);
64 pz2new = -px2*sin(theta)+pz2*cos(theta);
70 e1new = gamma*e1 - gamma*beta*px1;
71 px1new = -gamma*beta*e1 + gamma*px1;
72 e2new = gamma*e2 - gamma*beta*px2;
73 px2new = -gamma*beta*e2 + gamma*px2;
86 dv = ::sqrt( (vx1cms-vx2cms)*(vx1cms-vx2cms) +
87 (vy1cms-vy2cms)*(vy1cms-vy2cms) +
88 (vz1cms-vz2cms)*(vz1cms-vz2cms) );
91 double eta = charge*fine_structure_const/( dv );
92 double gamov = twopi*eta/(exp(twopi*eta)-1);