BOSS 7.0.4
BESIII Offline Software System
Loading...
Searching...
No Matches
TPhoton_o.h
Go to the documentation of this file.
1#ifndef RAD_TPhoton_o
2#define RAD_TPhoton_o
3
4#include "TRandom.h"
5#include "TLorentzVector.h"
6namespace rb{
7class TPhoton{
8protected:
9 TLorentzVector fk;
10 double fknorm;
11 double fNorm;
12 double fE;
13 double fP0; // auxilary parameter 0
14 double fP1; // auxilary parameter 1
15 double fX; // emitted energy
16 double fCosTheta; // cosine of photon on a big angle
17 double fLnD; // ln((1-beta*c1)/(1+beta*c1))
18 double fBetaI; // velocity of final particles
19 double fiBetaI; // inverse velocity of final particles
20 double fLnD_n; // ln((1-beta*c1)/(1+beta*c1)*(1+beta*c2)/(1-beta*c2))
21 double fBt; // (1+beta*c1)/(1-beta*c1)
22public:
24 TPhoton(double E);
25 TPhoton(double E, double Emin, double Emax);
27
28 void SetEnergyRange(double Emin, double Emax);
29 void SetThetaRange(double thmin, double thmax);
30 void SetCosThetaRange(double c1, double c2);
31
32 const TLorentzVector &GetPhoton(){
33 return fk;
34 }
35
36 const TLorentzVector &GetNewPhoton();
37 inline double GetPhotNorm(){return fknorm;}
38 inline double GetEnergy(){
39 fX = fP0*exp(gRandom->Rndm()*fP1);
40 return fX;
41 }
42 inline double GetENorm(){return fX*fNorm;}
43 inline double GetCosThetaF(){
44 double d = fBt*exp(fLnD_n*gRandom->Rndm());
45 fCosTheta = (d - 1)/(fBetaI*(d + 1));
46 return fCosTheta;
47 }
48 inline double GetThNormF(){
49 double k = fBetaI*fCosTheta;
50 return 0.5*fiBetaI*fLnD_n*(1 - k*k);
51 }
52 inline double GetPhi(){
53 return 2*M_PI*gRandom->Rndm();
54 }
55 inline double GetPhiNorm(){return 2*M_PI;}
56};
57
58class TPhotonD: public TPhoton{
59public:
61 void Init(const double & delta, const double & beta){
62 // Initializing photons in final state
63 // by distribution 1/x
64 fP0 = delta;
65 fP1 = 2/beta;
66 fNorm = pow(delta,beta/2);
67 }
68 inline double GetEnergy(){
69 double t1 = log(gRandom->Rndm())*fP1;
70 fX = fP0*exp(t1);
71 return fX;
72 }
73 inline double GetENorm(){return fNorm;}
74};
75}
76#endif// RAD_TPhoton
EvtComplex exp(const EvtComplex &c)
Definition: EvtComplex.hh:252
double Emin
#define M_PI
Definition: TConstant.h:4
double GetENorm()
Definition: TPhoton_o.h:73
double GetEnergy()
Definition: TPhoton_o.h:68
void Init(const double &delta, const double &beta)
Definition: TPhoton_o.h:61
const TLorentzVector & GetPhoton()
Definition: TPhoton_o.h:32
double GetPhotNorm()
Definition: TPhoton_o.h:37
double fLnD_n
Definition: TPhoton_o.h:20
double fiBetaI
Definition: TPhoton_o.h:19
double fLnD
Definition: TPhoton_o.h:17
double fX
Definition: TPhoton_o.h:15
double fP0
Definition: TPhoton_o.h:13
double GetENorm()
Definition: TPhoton_o.h:42
double fP1
Definition: TPhoton_o.h:14
void SetCosThetaRange(double c1, double c2)
double fCosTheta
Definition: TPhoton_o.h:16
double fknorm
Definition: TPhoton_o.h:10
void SetEnergyRange(double Emin, double Emax)
double fE
Definition: TPhoton_o.h:12
double fNorm
Definition: TPhoton_o.h:11
double GetEnergy()
Definition: TPhoton_o.h:38
TPhoton(double E, double Emin, double Emax)
double fBt
Definition: TPhoton_o.h:21
double GetThNormF()
Definition: TPhoton_o.h:48
double GetCosThetaF()
Definition: TPhoton_o.h:43
double GetPhiNorm()
Definition: TPhoton_o.h:55
const TLorentzVector & GetNewPhoton()
TPhoton(double E)
void SetThetaRange(double thmin, double thmax)
TLorentzVector fk
Definition: TPhoton_o.h:9
double fBetaI
Definition: TPhoton_o.h:18
double GetPhi()
Definition: TPhoton_o.h:52
Definition: TConstant.h:3