BOSS 7.0.6
BESIII Offline Software System
Loading...
Searching...
No Matches
TPhoton.h
Go to the documentation of this file.
1#ifndef RAD_TPhoton
2#define RAD_TPhoton
3
4#include "TRandom.h"
5#include "TRadGlobal.h"
6
7class TPhoton{
8protected:
9 double fNorm; // normalization factor
10 double fP0; // auxilary parameter 0
11 double fP1; // auxilary parameter 1
12 double fP2; // auxilary parameter 2
13 double fP3; // auxilary parameter 3
14 double fxmin; // minimum emitted energy
15 double fxmax; // maximum emitted energy
16 double fX; // emitted energy
17 double fCosTheta; // cosine of photon on a big angle
18 double fLnD; // ln((1-beta*c1)/(1+beta*c1))
19 double fBetaI; // velocity of final particles
20 double fiBetaI; // inverse velocity of final particles
21 double fLnD_n; // ln((1-beta*c1)/(1+beta*c1)*(1+beta*c2)/(1-beta*c2))
22 double fBt; // (1+beta*c1)/(1-beta*c1)
23 double fLnD_n2; // ln((1-beta*c1)/(1-beta*c2))
24 double fBt2; // (1-beta*c1)
25public:
27 virtual ~TPhoton(){};
28 virtual void Init(){};
29 double GetMinimum(){return fxmin;}
30 double GetMaximum(){return fxmax;}
31
32 virtual inline double GetCosTheta(){
33 double d = exp(fLnD*(2*gRandom->Rndm() - 1));
34 fCosTheta = (d - 1)/(fBetaI*(d + 1));
35 return fCosTheta;
36 }
37 virtual inline double GetThNorm(){
38 double k = fBetaI*fCosTheta;
39 return fLnD*(1 - k*k);
40 }
41
42 virtual inline double GetCosThetaF(){
43 double d = fBt*exp(fLnD_n*gRandom->Rndm());
44 fCosTheta = (d - 1)/(fBetaI*(d + 1));
45 return fCosTheta;
46 }
47 virtual inline double GetThNormF(){
48 double k = fBetaI*fCosTheta;
49 return -0.5*fiBetaI*fLnD_n*(1 - k*k);
50 }
51
52 virtual inline double GetCosThetaF2(){
53 double d = fBt2*exp(fLnD_n2*gRandom->Rndm());
54 fCosTheta = (1-d)*fiBetaI;
55 return fCosTheta;
56 }
57 virtual inline double GetThNormF2(){
58 double k = fBetaI*fCosTheta;
59 return fiBetaI*fLnD_n2*(1 - k);
60 }
61
62 static double GetPhi(){
63 return 2*gRandom->Rndm()*M_PI;
64 }
65 static double GetPhiNorm(){return 2*M_PI;}
66
67 inline double GetPhE(){return fX;}
68 inline double GetPhC(){return fCosTheta;}
69 virtual inline double GetENorm(){return 1;};
70 virtual inline double GetEnergy(){return 0;};
71
72 void SetCosTheta(const double& x){fCosTheta = x;}
73 void SetEnergy(const double& x){fX = x;}
74};
75
76// photons in Initial state
77// by distribution 1/x/(1-x)
78class TPhotonI:public TPhoton{
79public:
81 void Init();
82 inline double GetEnergy(){
83 double d = fP0*exp(gRandom->Rndm()*fP1);
84 fX = d/(1+d);
85 return fX;
86 }
87 inline double GetENorm(){return fNorm*fX*(1-fX);}
88};
89
90// photons in final state
91// by distribution 1/x
92class TPhotonF:public TPhoton{
93public:
95 void Init();
96 inline double GetEnergy(){
97 fX = fP0*exp(gRandom->Rndm()*fP1);
98 return fX;
99 }
100 inline double GetENorm(){return fNorm*fX;}
101};
102
103
104// photons in final state
105// with uniform angle distribution
106class TPhotonFS:public TPhotonF{
107protected:
109public:
111 fCosThetaMin = 0.995;
112 };
113 inline double GetCosTheta(){
114 fCosTheta = (2*gRandom->Rndm()-1)*fCosThetaMin;
115 return fCosTheta;
116 }
117 inline double GetThNorm(){
118 return 2*fCosThetaMin;
119 }
120};
121
122
123// soft and virtual photons
124// by distribution 1/x^b/2 from 0 to Delta_E
125class TPhotonS:public TPhoton{
126protected:
127 double fP2, fP3;
128public:
130 void Init();
131 void Init(const double&, const double&);
132 inline double GetEnergy(){return 0;};
133 inline void GetEnergy(double &x1, double &x2, double &x3, double &x4){
134 double t1 = log(gRandom->Rndm())*fP1;
135 x1 = fP0*exp(t1);
136
137 double t2 = log(gRandom->Rndm())*fP1;
138 x2 = fP0*exp(t2);
139
140 double t3 = log(gRandom->Rndm())*fP1;
141 x3 = fP0*exp(t3);
142
143 double t4 = log(gRandom->Rndm())*fP1;
144 x4 = fP0*exp(t4);
145
146 fX = t1 + t2 + t3 + t4;
147
148 }
149 inline double GetENorm(){return fNorm;}
150 inline double GetXNorm(){return fP2*exp(fP3*fX);}
151 inline double GetX(){return fX;}
152};
153
154// soft and virtual photons
155// by distribution 1/x^b/2 from 0 to Delta_E
156class TPhotonD:public TPhoton{
157public:
159 void Init();
160 void Init(const double&, const double&);
161 inline double GetEnergy(){
162 double t1 = log(gRandom->Rndm())*fP1;
163 fX = fP0*exp(t1);
164 return fX;
165 }
166
167 inline double GetEnergy(const double &delta, const double &b2){
168 fNorm = pow(delta,b2);
169 fX = delta*exp(log(gRandom->Rndm())/b2);
170 return fX;
171 }
172
173 inline double GetENorm(){return fNorm;}
174};
175
176#endif //#ifndef RAD_TPhoton
const double delta
EvtComplex exp(const EvtComplex &c)
Definition: EvtComplex.hh:252
#define M_PI
Definition: TConstant.h:4
double GetENorm()
Definition: TPhoton.h:173
double GetEnergy()
Definition: TPhoton.h:161
void Init(const double &, const double &)
TPhotonD()
Definition: TPhoton.h:158
double GetEnergy(const double &delta, const double &b2)
Definition: TPhoton.h:167
void Init()
double GetCosTheta()
Definition: TPhoton.h:113
double fCosThetaMin
Definition: TPhoton.h:108
TPhotonFS()
Definition: TPhoton.h:110
double GetThNorm()
Definition: TPhoton.h:117
TPhotonF()
Definition: TPhoton.h:94
double GetEnergy()
Definition: TPhoton.h:96
void Init()
double GetENorm()
Definition: TPhoton.h:100
TPhotonI()
Definition: TPhoton.h:80
double GetENorm()
Definition: TPhoton.h:87
double GetEnergy()
Definition: TPhoton.h:82
void Init()
double GetX()
Definition: TPhoton.h:151
double fP3
Definition: TPhoton.h:127
TPhotonS()
Definition: TPhoton.h:129
double fP2
Definition: TPhoton.h:127
double GetEnergy()
Definition: TPhoton.h:132
void GetEnergy(double &x1, double &x2, double &x3, double &x4)
Definition: TPhoton.h:133
double GetENorm()
Definition: TPhoton.h:149
void Init(const double &, const double &)
double GetXNorm()
Definition: TPhoton.h:150
void Init()
Definition: TPhoton.h:7
double fxmin
Definition: TPhoton.h:14
double fLnD_n2
Definition: TPhoton.h:23
double fLnD
Definition: TPhoton.h:18
double GetMaximum()
Definition: TPhoton.h:30
void SetCosTheta(const double &x)
Definition: TPhoton.h:72
static double GetPhiNorm()
Definition: TPhoton.h:65
double fBt
Definition: TPhoton.h:22
double GetMinimum()
Definition: TPhoton.h:29
void SetEnergy(const double &x)
Definition: TPhoton.h:73
virtual double GetCosTheta()
Definition: TPhoton.h:32
virtual ~TPhoton()
Definition: TPhoton.h:27
double GetPhE()
Definition: TPhoton.h:67
virtual double GetCosThetaF2()
Definition: TPhoton.h:52
virtual double GetCosThetaF()
Definition: TPhoton.h:42
virtual double GetThNormF()
Definition: TPhoton.h:47
TPhoton()
Definition: TPhoton.h:26
virtual double GetThNorm()
Definition: TPhoton.h:37
double fX
Definition: TPhoton.h:16
double fCosTheta
Definition: TPhoton.h:17
double fxmax
Definition: TPhoton.h:15
double fLnD_n
Definition: TPhoton.h:21
static double GetPhi()
Definition: TPhoton.h:62
virtual double GetENorm()
Definition: TPhoton.h:69
virtual double GetEnergy()
Definition: TPhoton.h:70
double fP2
Definition: TPhoton.h:12
double fBetaI
Definition: TPhoton.h:19
double fBt2
Definition: TPhoton.h:24
double fP0
Definition: TPhoton.h:10
double fP1
Definition: TPhoton.h:11
double fP3
Definition: TPhoton.h:13
double fNorm
Definition: TPhoton.h:9
virtual double GetThNormF2()
Definition: TPhoton.h:57
double fiBetaI
Definition: TPhoton.h:20
double GetPhC()
Definition: TPhoton.h:68
virtual void Init()
Definition: TPhoton.h:28
double x[1000]