BOSS 7.0.9
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 "TPhoton.h"
6#include "TRandom.h"
7#include "TLorentzVector.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 &,
39 const double &, const double &, const double &,
40 const double &, const double &);
41 // two photons radiation in collinear region for initial particles with masses
42 bool MakeEvent(const double &, const double &, const double &);
43 bool MakeEventgg(const double &, const double &, const double &);
44 // two photons radiation in collinear region for final particles in massless approximation
45 bool MakeEventN(const double &, const double &);
46 // four photons radiation in collinear region for initial&final particles in massless approximation
47 bool MakeEvent(const double &, const double &, const double &,
48 const double &, const double &);
49 // Collinear event
50 bool MakeEvent(const double &);
51 // One hard photon on big angle
52 bool MakeEvent(const double &, TPhoton*, const unsigned int);
53 // Kinematics cut
54 bool Select();
55 bool Selectgg();
56 inline void GetEvent(double &p0, double &t0, double &ph0,
57 double &p1, double &t1, double &ph1){
58 p0 = fp[Ne]; t0 = fth[Ne]; ph0 = fph[Ne];
59 p1 = fp[Np]; t1 = fth[Np]; ph1 = fph[Np];
60 }
61 inline double GetPhi(){return gRandom->Rndm()*2*gConst->Pi();}
62 inline double GetY(unsigned int i){return fY[i];}
63 void Print();
65 for(unsigned int i=0; i<fNSelStat; i++)std::cout<<"Cut #"<<i<<" "<<fSelStat[i]<<std::endl;
66 }
67 inline double GetCosPsi(){return fCosPsi;};
68 inline void GetPPar(unsigned int i, double &e, double &p, double &c){
69 e = fen[i]; p = fp[i]; c = fcth[i];
70 }
71 inline TLorentzVector Get4Vector(unsigned int i){
72 return TLorentzVector(fp[i]*fsth[i]*fcph[i],fp[i]*fsth[i]*fsph[i],fp[i]*fcth[i],fen[i]);
73 }
74 inline double GetChiPrime(unsigned int i){
75 return fen[i]*fen[Ng1] - fp[i]*fp[Ng1]*(fsth[i]*fsth[Ng1]*(fcph[i]*fcph[Ng1]+fsph[i]*fsph[Ng1])+fcth[i]*fcth[Ng1]);
76 }
77 inline double GetSumComponent(unsigned int i){
78 switch(i){
79 case 0:
80 return fen[Ne] + fen[Np] + fen[Ng1];
81 break;
82 case 1:
83 return fp[Ne]*fsth[Ne]*fcph[Ne] + fp[Np]*fsth[Np]*fcph[Np] + fp[Ng1]*fsth[Ng1]*fcph[Ng1];
84 break;
85 case 2:
86 return fp[Ne]*fsth[Ne]*fsph[Ne] + fp[Np]*fsth[Np]*fsph[Np] + fp[Ng1]*fsth[Ng1]*fsph[Ng1];
87 break;
88 case 3:
89 return fp[Ne]*fcth[Ne] + fp[Np]*fcth[Np] + fp[Ng1]*fcth[Ng1];
90 break;
91 }
92 return 0;
93 }
94 void Swap();
95 void CosPrint();
96 void SetdPar(double *p){
97 fIsSmear = true;
98 for(int i=0; i<9; i++) fdPar[i] = p[i];
99 }
100
101 inline double dDeltaTheta(){
102 if ( !fIsSmear ) return 0;
103 double sigma = 0;
104 if(gRandom->Rndm()<fdPar[0])
105 sigma = fdPar[1];
106 else
107 sigma = fdPar[2];
108 return gRandom->Gaus(0,sigma);
109 }
110 inline double dDeltaPhi(){
111 if ( !fIsSmear ) return 0;
112 double sigma = 0;
113 if(gRandom->Rndm()<fdPar[3])
114 sigma = fdPar[4];
115 else
116 sigma = fdPar[5];
117 return gRandom->Gaus(0,sigma);
118 }
119 inline double dATheta(){
120 if ( !fIsSmear ) return 0;
121 double sigma = 0;
122 if(gRandom->Rndm()<fdPar[6])
123 sigma = fdPar[7];
124 else
125 sigma = fdPar[8];
126 return gRandom->Gaus(0,sigma);
127 }
128 void GetEvent(double*, int&);
129};
130
131#endif //#ifndef RAD_TEvent
TTree * sigma
TConstants * gConst
Definition: Mcgpj.cxx:49
#define Ng1
Definition: TEvent.h:11
#define Np
Definition: TEvent.h:10
#define Ne
Definition: TEvent.h:9
static double Pi()
Definition: TConstants.h:39
Definition: TEvent.h:13
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:68
double fth[3]
Definition: TEvent.h:20
double fdPar[9]
Definition: TEvent.h:28
double dATheta()
Definition: TEvent.h:119
double GetChiPrime(unsigned int i)
Definition: TEvent.h:74
double GetY(unsigned int i)
Definition: TEvent.h:62
bool MakeEvent(const double &)
double dDeltaTheta()
Definition: TEvent.h:101
double GetSumComponent(unsigned int i)
Definition: TEvent.h:77
double fp[3]
Definition: TEvent.h:16
void GetEvent(double &p0, double &t0, double &ph0, double &p1, double &t1, double &ph1)
Definition: TEvent.h:56
void Print()
double dDeltaPhi()
Definition: TEvent.h:110
double GetPhi()
Definition: TEvent.h:61
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:96
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:71
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:64
bool MakeEvent(const double &, const double &, const double &)
double GetCosPsi()
Definition: TEvent.h:67
bool MakeEventN(const double &, const double &)
Definition: TPhoton.h:7