00001 #include "TPhoton_o.h"
00002 #include "TConstant.h"
00003 using namespace rb;
00004 TPhoton::TPhoton(double E){
00005 double gamma = E/me;
00006 fE = E;
00007 fBetaI = sqrt(gamma-1)*sqrt(gamma+1)/gamma;
00008 fiBetaI = 1/fBetaI;
00009 double c1 = -1, c2 = 1;
00010 SetCosThetaRange(c1,c2);
00011 }
00012
00013 TPhoton::TPhoton(double E, double Emin, double Emax){
00014 double gamma = E/me;
00015 fE = E;
00016 fBetaI = sqrt(gamma-1)*sqrt(gamma+1)/gamma;
00017 fiBetaI = 1/fBetaI;
00018 double c1 = -1, c2 = 1;
00019 SetCosThetaRange(c1,c2);
00020 SetEnergyRange(Emin,Emax);
00021 }
00022
00023 void TPhoton::SetEnergyRange(double Emin, double Emax){
00024 fP0 = Emin/fE;
00025 fP1 = Emax/fE/fP0;
00026 fNorm = log(fP1);
00027 fP1 = fNorm;
00028
00029 }
00030
00031 void TPhoton::SetThetaRange(double thmin, double thmax){
00032 double c1 = cos(thmax), c2 = cos(thmin);
00033 SetCosThetaRange(c1,c2);
00034 }
00035
00036 void TPhoton::SetCosThetaRange(double c1, double c2){
00037 fLnD_n = log((1-fBetaI*c1)/(1+fBetaI*c1)*(1+fBetaI*c2)/(1-fBetaI*c2));
00038 fBt = (1+fBetaI*c1)/(1-fBetaI*c1);
00039
00040 }
00041
00042 const TLorentzVector &TPhoton::GetNewPhoton(){
00043 double E = fE*GetEnergy();
00044 double c = GetCosThetaF();
00045 double s = sqrt(1-c*c);
00046 double phi = GetPhi();
00047 double cp,sp;
00048 sincos(phi,&sp,&cp);
00049
00050 fk.SetPxPyPzE(E*cp*s,E*sp*s,E*c,E);
00051 fknorm = GetENorm()*GetThNormF()*GetPhiNorm();
00052 return fk;
00053 }