CGEM BOSS 6.6.5.h
BESIII Offline Software System
Loading...
Searching...
No Matches
EvtPhotonParticle Class Reference

#include <EvtPhotonParticle.hh>

+ Inheritance diagram for EvtPhotonParticle:

Public Member Functions

 EvtPhotonParticle ()
 
virtual ~EvtPhotonParticle ()
 
void init (EvtId part_n, double e, double px, double py, double pz)
 
void init (EvtId part_n, const EvtVector4R &p4)
 
EvtVector4C epsParentPhoton (int i)
 
EvtVector4C epsPhoton (int i)
 
EvtSpinDensity rotateToHelicityBasis () const
 
EvtSpinDensity rotateToHelicityBasis (double alpha, double beta, double gamma) const
 
- Public Member Functions inherited from EvtParticle
 EvtParticle ()
 
virtual ~EvtParticle ()
 
virtual EvtVector4C epsParent (int i) const
 
virtual EvtVector4C eps (int i) const
 
virtual EvtDiracSpinor spParent (int) const
 
virtual EvtDiracSpinor sp (int) const
 
virtual EvtDiracSpinor spParentNeutrino () const
 
virtual EvtDiracSpinor spNeutrino () const
 
virtual EvtTensor4C epsTensorParent (int i) const
 
virtual EvtTensor4C epsTensor (int i) const
 
void addDaug (EvtParticle *node)
 
void decay ()
 
void deleteTree ()
 
void deleteDaughters (bool keepChannel=false)
 
void setChannel (int i)
 
void setGeneratorFlag (int flag)
 
int getGeneratorFlag ()
 
void makeDaughters (int ndaug, EvtId *id)
 
double initializePhaseSpace (int numdaughter, EvtId *daughters, double poleSize=-1., int whichTwo1=0, int whichTwo2=1)
 
EvtParticlegetDaug (int i)
 
EvtParticlenextIter (EvtParticle *rootOfTree=0)
 
void makeStdHep (EvtStdHep &stdhep, EvtSecondary &secondary, EvtId *stable_parent_ihep)
 
void makeStdHep (EvtStdHep &stdhep)
 
EvtVector4R getP4Lab ()
 
EvtVector4R getP4Restframe ()
 
EvtVector4R get4Pos ()
 
EvtParticlegetParent ()
 
void insertDaugPtr (int idaug, EvtParticle *partptr)
 
double mass () const
 
int firstornot () const
 
void setFirstOrNot ()
 
void resetFirstOrNot ()
 
EvtId getId () const
 
EvtSpinType::spintype getSpinType () const
 
int getSpinStates () const
 
const EvtVector4RgetP4 () const
 
void setP4 (const EvtVector4R &p4)
 
int getChannel () const
 
int getNDaug () const
 
void resetNDaug ()
 
void printTree () const
 
void printTreeRec (int level) const
 
std::string writeTreeRec (std::string) const
 
void dumpTree () const
 
void dumpTreeRec (int level, int dj) const
 
std::string treeStr () const
 
std::string treeStrRec (int level) const
 
void printParticle () const
 
void setLifetime (double tau)
 
void setLifetime ()
 
double getLifetime ()
 
void setDiagonalSpinDensity ()
 
void setVectorSpinDensity ()
 
void setPolarizedSpinDensity (double r00, double r11, double r22)
 
void setSpinDensityForward (const EvtSpinDensity &rho)
 
void setSpinDensityForwardHelicityBasis (const EvtSpinDensity &rho)
 
void setSpinDensityForwardHelicityBasis (const EvtSpinDensity &rho, double alpha, double beta, double gamma)
 
EvtSpinDensity getSpinDensityForward ()
 
void setSpinDensityBackward (const EvtSpinDensity &rho)
 
EvtSpinDensity getSpinDensityBackward ()
 
void noLifeTime ()
 
void setId (EvtId id)
 
void initDecay (bool useMinMass=false)
 
void generateMassTree ()
 
double compMassProb ()
 
void setMass (double m)
 
bool isInitialized ()
 
bool hasValidP4 ()
 
bool isDecayed ()
 
double * decayProb ()
 
void setDecayProb (double p)
 
void setInclusiveMode (int im)
 
int getInclusiveMode ()
 

Additional Inherited Members

- Protected Member Functions inherited from EvtParticle
void setp (double e, double px, double py, double pz)
 
void setp (const EvtVector4R &p4)
 
void setpart_num (EvtId particle_number)
 
- Protected Attributes inherited from EvtParticle
bool _validP4
 

Detailed Description

Definition at line 31 of file EvtPhotonParticle.hh.

Constructor & Destructor Documentation

◆ EvtPhotonParticle()

EvtPhotonParticle::EvtPhotonParticle ( )
inline

Definition at line 35 of file EvtPhotonParticle.hh.

35{}

◆ ~EvtPhotonParticle()

EvtPhotonParticle::~EvtPhotonParticle ( )
virtual

Definition at line 31 of file EvtPhotonParticle.cc.

31{}

Member Function Documentation

◆ epsParentPhoton()

EvtVector4C EvtPhotonParticle::epsParentPhoton ( int i)
virtual

Returns polarization vector in the parents restframe for a photon.

Reimplemented from EvtParticle.

Definition at line 53 of file EvtPhotonParticle.cc.

53 {
54
55 if (!_evalBasis){
56
57 _evalBasis=1;
58 eps1.set(EvtComplex(0.0,0.0), EvtComplex(-1.0/sqrt(2.0),0.0),
59 EvtComplex(0.0,-1.0/sqrt(2.0)), EvtComplex(0.0,0.0));
60 eps2.set(EvtComplex(0.0,0.0), EvtComplex(1.0/sqrt(2.0),0.0),
61 EvtComplex(0.0,-1.0/sqrt(2.0)), EvtComplex(0.0,0.0));
62
63 // These are for photon along z axis. Rotate to get
64 // correct direction...
65
66 double phi,theta;
67
68 EvtVector4R p=this->getP4();
69
70 double px=p.get(1);
71 double py=p.get(2);
72 double pz=p.get(3);
73
74 phi = atan2(py,px);
75 theta = acos(pz/sqrt(px*px+py*py+pz*pz));
76 eps1.applyRotateEuler(phi,theta,-phi);
77 eps2.applyRotateEuler(phi,theta,-phi);
78
79 }
80
81
82 EvtVector4C temp;
83
84 switch(i) {
85
86 case 0:
87 temp=eps1;
88 break;
89 case 1:
90 temp=eps2;
91 break;
92 default:
93 report(ERROR,"EvtGen") << "EvtPhotonParticle.cc: Asked "
94 << "for state:"<<i<<endl;
95 ::abort();
96 break;
97 }
98
99 return temp;
100}
ostream & report(Severity severity, const char *facility)
Definition EvtReport.cc:36
@ ERROR
Definition EvtReport.hh:49
const EvtVector4R & getP4() const
void applyRotateEuler(double alpha, double beta, double gamma)
void set(int, const EvtComplex &)
double get(int i) const

Referenced by EvtLambdaP_BarGamma::decay().

◆ epsPhoton()

EvtVector4C EvtPhotonParticle::epsPhoton ( int i)
virtual

Returns polarization vector in the particles own restframe for a photon.

Reimplemented from EvtParticle.

Definition at line 102 of file EvtPhotonParticle.cc.

102 {
103
104 report(ERROR,"EvtGen") << "EvtPhotonParticle.cc: Can not get "
105 << "state in photons restframe."<<endl;;
106 ::abort();
107 return EvtVector4C();
108
109}

◆ init() [1/2]

void EvtPhotonParticle::init ( EvtId part_n,
const EvtVector4R & p4 )
virtual

Initialiaze particle with id and 4momentum.

Implements EvtParticle.

Definition at line 33 of file EvtPhotonParticle.cc.

33 {
34
35 init(part_n,p4.get(0),p4.get(1),
36 p4.get(2),p4.get(3));
37}
void init(EvtId part_n, double e, double px, double py, double pz)

◆ init() [2/2]

void EvtPhotonParticle::init ( EvtId part_n,
double e,
double px,
double py,
double pz )

Definition at line 39 of file EvtPhotonParticle.cc.

39 {
40
41 _validP4=true;
42 setp(e,px,py,pz);
43 setpart_num(part_n);
44
46
47 //defere calculation of basis vectors untill they are needed!
48 _evalBasis=0;
49
50}
void setLifetime()
void setp(double e, double px, double py, double pz)
void setpart_num(EvtId particle_number)

Referenced by EvtKstarstargamma::decay(), EvtPHOTOS::doRadCorr(), init(), and EvtParticleFactory::particleFactory().

◆ rotateToHelicityBasis() [1/2]

EvtSpinDensity EvtPhotonParticle::rotateToHelicityBasis ( ) const
virtual

Returns a rotation matrix need to rotate the basis state to the helicity basis. The EvtSpinDensity matrix is just use as a matrix here. This function is to be implemented in each derived class.

Implements EvtParticle.

Definition at line 112 of file EvtPhotonParticle.cc.

112 {
113
114 EvtVector4C eplus(0.0,-1.0/sqrt(2.0),
115 EvtComplex(0.0,-1.0/sqrt(2.0)),0.0);
116 EvtVector4C eminus(0.0,1.0/sqrt(2.0),
117 EvtComplex(0.0,-1.0/sqrt(2.0)),0.0);
118
119 //Really uggly have to cast away constness because the
120 //function epsParentPhoton caches the state vectors...
121 EvtVector4C e1=((EvtParticle*)this)->epsParentPhoton(0);
122 EvtVector4C e2=((EvtParticle*)this)->epsParentPhoton(1);
123
124
126 R.SetDim(2);
127
128 R.Set(0,0,(eplus.conj())*e1);
129 R.Set(0,1,(eplus.conj())*e2);
130
131 R.Set(1,0,(eminus.conj())*e1);
132 R.Set(1,1,(eminus.conj())*e2);
133
134 return R;
135
136}
Double_t e1
Double_t e2
complex_t R(double Q2, double M2, double G, double Mp2, double Mm2)
Definition TUtil.h:27

◆ rotateToHelicityBasis() [2/2]

EvtSpinDensity EvtPhotonParticle::rotateToHelicityBasis ( double alpha,
double beta,
double gamma ) const
virtual

Implements EvtParticle.

Definition at line 139 of file EvtPhotonParticle.cc.

141 {
142
143 EvtVector4C eplus(0.0,-1.0/sqrt(2.0),
144 EvtComplex(0.0,-1.0/sqrt(2.0)),0.0);
145 EvtVector4C eminus(0.0,1.0/sqrt(2.0),
146 EvtComplex(0.0,-1.0/sqrt(2.0)),0.0);
147
148 eplus.applyRotateEuler(alpha,beta,gamma);
149 eminus.applyRotateEuler(alpha,beta,gamma);
150
151
152 //Really uggly have to cast away constness because the
153 //function epsParentPhoton caches the state vectors...
154 EvtVector4C e1=((EvtParticle*)this)->epsParentPhoton(0);
155 EvtVector4C e2=((EvtParticle*)this)->epsParentPhoton(1);
156
158 R.SetDim(2);
159
160 R.Set(0,0,(eplus.conj())*e1);
161 R.Set(0,1,(eplus.conj())*e2);
162
163 R.Set(1,0,(eminus.conj())*e1);
164 R.Set(1,1,(eminus.conj())*e2);
165
166 return R;
167
168}
const double alpha

The documentation for this class was generated from the following files: