00001 #ifndef RAD_TPhoton_o 00002 #define RAD_TPhoton_o 00003 00004 #include "TRandom.h" 00005 #include "TLorentzVector.h" 00006 namespace rb{ 00007 class TPhoton{ 00008 protected: 00009 TLorentzVector fk; 00010 double fknorm; 00011 double fNorm; 00012 double fE; 00013 double fP0; // auxilary parameter 0 00014 double fP1; // auxilary parameter 1 00015 double fX; // emitted energy 00016 double fCosTheta; // cosine of photon on a big angle 00017 double fLnD; // ln((1-beta*c1)/(1+beta*c1)) 00018 double fBetaI; // velocity of final particles 00019 double fiBetaI; // inverse velocity of final particles 00020 double fLnD_n; // ln((1-beta*c1)/(1+beta*c1)*(1+beta*c2)/(1-beta*c2)) 00021 double fBt; // (1+beta*c1)/(1-beta*c1) 00022 public: 00023 TPhoton(){} 00024 TPhoton(double E); 00025 TPhoton(double E, double Emin, double Emax); 00026 ~TPhoton(){} 00027 00028 void SetEnergyRange(double Emin, double Emax); 00029 void SetThetaRange(double thmin, double thmax); 00030 void SetCosThetaRange(double c1, double c2); 00031 00032 const TLorentzVector &GetPhoton(){ 00033 return fk; 00034 } 00035 00036 const TLorentzVector &GetNewPhoton(); 00037 inline double GetPhotNorm(){return fknorm;} 00038 inline double GetEnergy(){ 00039 fX = fP0*exp(gRandom->Rndm()*fP1); 00040 return fX; 00041 } 00042 inline double GetENorm(){return fX*fNorm;} 00043 inline double GetCosThetaF(){ 00044 double d = fBt*exp(fLnD_n*gRandom->Rndm()); 00045 fCosTheta = (d - 1)/(fBetaI*(d + 1)); 00046 return fCosTheta; 00047 } 00048 inline double GetThNormF(){ 00049 double k = fBetaI*fCosTheta; 00050 return 0.5*fiBetaI*fLnD_n*(1 - k*k); 00051 } 00052 inline double GetPhi(){ 00053 return 2*M_PI*gRandom->Rndm(); 00054 } 00055 inline double GetPhiNorm(){return 2*M_PI;} 00056 }; 00057 00058 class TPhotonD: public TPhoton{ 00059 public: 00060 TPhotonD():TPhoton(){}; 00061 void Init(const double & delta, const double & beta){ 00062 // Initializing photons in final state 00063 // by distribution 1/x 00064 fP0 = delta; 00065 fP1 = 2/beta; 00066 fNorm = pow(delta,beta/2); 00067 } 00068 inline double GetEnergy(){ 00069 double t1 = log(gRandom->Rndm())*fP1; 00070 fX = fP0*exp(t1); 00071 return fX; 00072 } 00073 inline double GetENorm(){return fNorm;} 00074 }; 00075 } 00076 #endif// RAD_TPhoton