BOSS 8.0.0
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 setIntFlag (std::vector< int > vi)
std::vector< int > getIntFlag ()
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

Static Public Attributes inherited from EvtParticle
static int _NextLevelDauNum = 0
static EvtId _NextLevelId [20]
static EvtVector4R _NextLevelP4 [20]
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 34 of file EvtPhotonParticle.hh.

34{}

◆ ~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 50 of file EvtPhotonParticle.cc.

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

95 {
96
97 report( ERROR, "EvtGen" ) << "EvtPhotonParticle.cc: Can not get "
98 << "state in photons restframe." << endl;
99 ;
100 ::abort();
101 return EvtVector4C();
102}

◆ 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 ), p4.get( 2 ), p4.get( 3 ) );
36}
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 38 of file EvtPhotonParticle.cc.

38 {
39
40 _validP4 = true;
41 setp( e, px, py, pz );
42 setpart_num( part_n );
43
45
46 // defere calculation of basis vectors untill they are needed!
47 _evalBasis = 0;
48}
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 104 of file EvtPhotonParticle.cc.

104 {
105
106 EvtVector4C eplus( 0.0, -1.0 / sqrt( 2.0 ), EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
107 EvtVector4C eminus( 0.0, 1.0 / sqrt( 2.0 ), EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
108
109 // Really uggly have to cast away constness because the
110 // function epsParentPhoton caches the state vectors...
111 EvtVector4C e1 = ( (EvtParticle*)this )->epsParentPhoton( 0 );
112 EvtVector4C e2 = ( (EvtParticle*)this )->epsParentPhoton( 1 );
113
114 EvtSpinDensity R;
115 R.SetDim( 2 );
116
117 R.Set( 0, 0, ( eplus.conj() ) * e1 );
118 R.Set( 0, 1, ( eplus.conj() ) * e2 );
119
120 R.Set( 1, 0, ( eminus.conj() ) * e1 );
121 R.Set( 1, 1, ( eminus.conj() ) * e2 );
122
123 return R;
124}
Double_t e1
Double_t e2
complex_t R(double Q2, double M2, double G, double Mp2, double Mm2)
Definition TUtil.h:22

◆ rotateToHelicityBasis() [2/2]

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

Implements EvtParticle.

Definition at line 126 of file EvtPhotonParticle.cc.

127 {
128
129 EvtVector4C eplus( 0.0, -1.0 / sqrt( 2.0 ), EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
130 EvtVector4C eminus( 0.0, 1.0 / sqrt( 2.0 ), EvtComplex( 0.0, -1.0 / sqrt( 2.0 ) ), 0.0 );
131
132 eplus.applyRotateEuler( alpha, beta, gamma );
133 eminus.applyRotateEuler( alpha, beta, gamma );
134
135 // Really uggly have to cast away constness because the
136 // function epsParentPhoton caches the state vectors...
137 EvtVector4C e1 = ( (EvtParticle*)this )->epsParentPhoton( 0 );
138 EvtVector4C e2 = ( (EvtParticle*)this )->epsParentPhoton( 1 );
139
140 EvtSpinDensity R;
141 R.SetDim( 2 );
142
143 R.Set( 0, 0, ( eplus.conj() ) * e1 );
144 R.Set( 0, 1, ( eplus.conj() ) * e2 );
145
146 R.Set( 1, 0, ( eminus.conj() ) * e1 );
147 R.Set( 1, 1, ( eminus.conj() ) * e2 );
148
149 return R;
150}
double alpha

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