BOSS 8.0.0
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 "TLorentzVector.h"
5#include "TRandom.h"
6namespace rb {
7 class TPhoton {
8 protected:
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)
22 public:
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() { return fk; }
33
34 const TLorentzVector& GetNewPhoton();
35 inline double GetPhotNorm() { return fknorm; }
36 inline double GetEnergy() {
37 fX = fP0 * exp( gRandom->Rndm() * fP1 );
38 return fX;
39 }
40 inline double GetENorm() { return fX * fNorm; }
41 inline double GetCosThetaF() {
42 double d = fBt * exp( fLnD_n * gRandom->Rndm() );
43 fCosTheta = ( d - 1 ) / ( fBetaI * ( d + 1 ) );
44 return fCosTheta;
45 }
46 inline double GetThNormF() {
47 double k = fBetaI * fCosTheta;
48 return 0.5 * fiBetaI * fLnD_n * ( 1 - k * k );
49 }
50 inline double GetPhi() { return 2 * M_PI * gRandom->Rndm(); }
51 inline double GetPhiNorm() { return 2 * M_PI; }
52 };
53
54 class TPhotonD : public TPhoton {
55 public:
57 void Init( const double& delta, const double& beta ) {
58 // Initializing photons in final state
59 // by distribution 1/x
60 fP0 = delta;
61 fP1 = 2 / beta;
62 fNorm = pow( delta, beta / 2 );
63 }
64 inline double GetEnergy() {
65 double t1 = log( gRandom->Rndm() ) * fP1;
66 fX = fP0 * exp( t1 );
67 return fX;
68 }
69 inline double GetENorm() { return fNorm; }
70 };
71} // namespace rb
72#endif // RAD_TPhoton
EvtComplex exp(const EvtComplex &c)
double Emin
#define M_PI
Definition TConstant.h:4
double GetENorm()
Definition TPhoton_o.h:69
double GetEnergy()
Definition TPhoton_o.h:64
void Init(const double &delta, const double &beta)
Definition TPhoton_o.h:57
const TLorentzVector & GetPhoton()
Definition TPhoton_o.h:32
double GetPhotNorm()
Definition TPhoton_o.h:35
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:40
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:36
TPhoton(double E, double Emin, double Emax)
double fBt
Definition TPhoton_o.h:21
double GetThNormF()
Definition TPhoton_o.h:46
double GetCosThetaF()
Definition TPhoton_o.h:41
double GetPhiNorm()
Definition TPhoton_o.h:51
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:50
Definition TConstant.h:3