BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
TEvent.h
Go to the documentation of this file.
1#ifndef RAD_TEvent
2#define RAD_TEvent
3
4#include "TConstants.h"
5#include "TLorentzVector.h"
6#include "TPhoton.h"
7#include "TRandom.h"
8#include <iostream>
9#define Ne 0
10#define Np 1
11#define Ng1 2
12
13class TEvent {
14protected:
15 double fen[3]; // energy of final particle
16 double fp[3]; // momentum of final particle
17 double fY[3]; // energy of particles before interaction for cross
18 // section relativistic shift
19
20 double fth[3]; // theta of final particle
21 double fcth[3]; // cos(theta) of final particle
22 double fsth[3]; // sin(theta) of final particle
23
24 double fph[3]; // phi of final particle
25 double fcph[3]; // cos(phi) of final particle
26 double fsph[3]; // sin(phi) of final particle
27 bool fIsSmear; // to smear or not to smear that is a question
28 double fdPar[9]; // smearing parameters for delta theta and delta phi
29 double fxg[4];
30 double fCosPsi;
31 unsigned int fNSelStat;
32 unsigned int* fSelStat; //[fNSelStat]
33public:
35 virtual ~TEvent();
36 void Init();
37 // two photons radiation on arbitrary angles
38 bool MakeEvent( const double&, const double&, const double&, const double&, const double&,
39 const double&, const double&, const double& );
40 // two photons radiation in collinear region for initial particles with masses
41 bool MakeEvent( const double&, const double&, const double& );
42 bool MakeEventgg( const double&, const double&, const double& );
43 // two photons radiation in collinear region for final particles in massless approximation
44 bool MakeEventN( const double&, const double& );
45 // four photons radiation in collinear region for initial&final particles in massless
46 // approximation
47 bool MakeEvent( const double&, const double&, const double&, const double&, const double& );
48 // Collinear event
49 bool MakeEvent( const double& );
50 // One hard photon on big angle
51 bool MakeEvent( const double&, TPhoton*, const unsigned int );
52 // Kinematics cut
53 bool Select();
54 bool Selectgg();
55 inline void GetEvent( double& p0, double& t0, double& ph0, double& p1, double& t1,
56 double& ph1 ) {
57 p0 = fp[Ne];
58 t0 = fth[Ne];
59 ph0 = fph[Ne];
60 p1 = fp[Np];
61 t1 = fth[Np];
62 ph1 = fph[Np];
63 }
64 inline double GetPhi() { return gRandom->Rndm() * 2 * gConst->Pi(); }
65 inline double GetY( unsigned int i ) { return fY[i]; }
66 void Print();
68 for ( unsigned int i = 0; i < fNSelStat; i++ )
69 std::cout << "Cut #" << i << " " << fSelStat[i] << std::endl;
70 }
71 inline double GetCosPsi() { return fCosPsi; };
72 inline void GetPPar( unsigned int i, double& e, double& p, double& c ) {
73 e = fen[i];
74 p = fp[i];
75 c = fcth[i];
76 }
77 inline TLorentzVector Get4Vector( unsigned int i ) {
78 return TLorentzVector( fp[i] * fsth[i] * fcph[i], fp[i] * fsth[i] * fsph[i],
79 fp[i] * fcth[i], fen[i] );
80 }
81 inline double GetChiPrime( unsigned int i ) {
82 return fen[i] * fen[Ng1] -
83 fp[i] * fp[Ng1] *
84 ( fsth[i] * fsth[Ng1] * ( fcph[i] * fcph[Ng1] + fsph[i] * fsph[Ng1] ) +
85 fcth[i] * fcth[Ng1] );
86 }
87 inline double GetSumComponent( unsigned int i ) {
88 switch ( i )
89 {
90 case 0: return fen[Ne] + fen[Np] + fen[Ng1]; break;
91 case 1:
92 return fp[Ne] * fsth[Ne] * fcph[Ne] + fp[Np] * fsth[Np] * fcph[Np] +
93 fp[Ng1] * fsth[Ng1] * fcph[Ng1];
94 break;
95 case 2:
96 return fp[Ne] * fsth[Ne] * fsph[Ne] + fp[Np] * fsth[Np] * fsph[Np] +
97 fp[Ng1] * fsth[Ng1] * fsph[Ng1];
98 break;
99 case 3: return fp[Ne] * fcth[Ne] + fp[Np] * fcth[Np] + fp[Ng1] * fcth[Ng1]; break;
100 }
101 return 0;
102 }
103 void Swap();
104 void CosPrint();
105 void SetdPar( double* p ) {
106 fIsSmear = true;
107 for ( int i = 0; i < 9; i++ ) fdPar[i] = p[i];
108 }
109
110 inline double dDeltaTheta() {
111 if ( !fIsSmear ) return 0;
112 double sigma = 0;
113 if ( gRandom->Rndm() < fdPar[0] ) sigma = fdPar[1];
114 else sigma = fdPar[2];
115 return gRandom->Gaus( 0, sigma );
116 }
117 inline double dDeltaPhi() {
118 if ( !fIsSmear ) return 0;
119 double sigma = 0;
120 if ( gRandom->Rndm() < fdPar[3] ) sigma = fdPar[4];
121 else sigma = fdPar[5];
122 return gRandom->Gaus( 0, sigma );
123 }
124 inline double dATheta() {
125 if ( !fIsSmear ) return 0;
126 double sigma = 0;
127 if ( gRandom->Rndm() < fdPar[6] ) sigma = fdPar[7];
128 else sigma = fdPar[8];
129 return gRandom->Gaus( 0, sigma );
130 }
131 void GetEvent( double*, int& );
132};
133
134#endif // #ifndef RAD_TEvent
double p1[4]
int ph0
TConstants * gConst
Definition Mcgpj.cxx:49
#define Ng1
Definition TEvent.h:11
#define Np
Definition TEvent.h:10
#define Ne
Definition TEvent.h:9
double fsph[3]
Definition TEvent.h:26
void GetEvent(double *, int &)
double fCosPsi
Definition TEvent.h:30
double fcth[3]
Definition TEvent.h:21
double fph[3]
Definition TEvent.h:24
bool Selectgg()
void GetPPar(unsigned int i, double &e, double &p, double &c)
Definition TEvent.h:72
double fth[3]
Definition TEvent.h:20
double fdPar[9]
Definition TEvent.h:28
double dATheta()
Definition TEvent.h:124
double GetChiPrime(unsigned int i)
Definition TEvent.h:81
double GetY(unsigned int i)
Definition TEvent.h:65
bool MakeEvent(const double &)
double dDeltaTheta()
Definition TEvent.h:110
double GetSumComponent(unsigned int i)
Definition TEvent.h:87
double fp[3]
Definition TEvent.h:16
void GetEvent(double &p0, double &t0, double &ph0, double &p1, double &t1, double &ph1)
Definition TEvent.h:55
void Print()
double dDeltaPhi()
Definition TEvent.h:117
double GetPhi()
Definition TEvent.h:64
void CosPrint()
double fxg[4]
Definition TEvent.h:29
bool Select()
bool MakeEvent(const double &, TPhoton *, const unsigned int)
unsigned int fNSelStat
Definition TEvent.h:31
void SetdPar(double *p)
Definition TEvent.h:105
void Swap()
bool MakeEvent(const double &, const double &, const double &, const double &, const double &, const double &, const double &, const double &)
double fen[3]
Definition TEvent.h:15
double fcph[3]
Definition TEvent.h:25
TLorentzVector Get4Vector(unsigned int i)
Definition TEvent.h:77
bool MakeEvent(const double &, const double &, const double &, const double &, const double &)
double fY[3]
Definition TEvent.h:17
virtual ~TEvent()
void Init()
bool MakeEventgg(const double &, const double &, const double &)
bool fIsSmear
Definition TEvent.h:27
unsigned int * fSelStat
Definition TEvent.h:32
double fsth[3]
Definition TEvent.h:22
void PrintSelectStat()
Definition TEvent.h:67
bool MakeEvent(const double &, const double &, const double &)
double GetCosPsi()
Definition TEvent.h:71
bool MakeEventN(const double &, const double &)