8 #ifndef Pythia8_HelicityBasics_H
9 #define Pythia8_HelicityBasics_H
11 #include "Pythia8/Basics.h"
12 #include "Pythia8/Event.h"
13 #include "Pythia8/PythiaComplex.h"
14 #include "Pythia8/PythiaStdlib.h"
30 Wave4(complex v0, complex v1, complex v2, complex v3) {val[0] = v0;
31 val[1] = v1; val[2] = v2; val[3] = v3;}
32 Wave4(Vec4 v) {val[0] = v.e(); val[1] = v.px(); val[2] = v.py();
37 complex& operator() (
int i) {
return val[i];}
40 Wave4 operator+(Wave4 w) {
return Wave4( val[0] + w.val[0],
41 val[1] + w.val[1], val[2] + w.val[2], val[3] + w.val[3]);}
44 Wave4 operator-(Wave4 w) {
return Wave4( val[0] - w.val[0],
45 val[1] - w.val[1], val[2] - w.val[2], val[3] - w.val[3]);}
48 Wave4 operator-() {
return Wave4(-val[0], -val[1], -val[2], -val[3]);}
51 complex operator*(Wave4 w) {
return val[0] * w.val[0]
52 + val[1] * w.val[1] + val[2] * w.val[2] + val[3] * w.val[3];}
55 Wave4 operator*(complex s) {
return Wave4(val[0] * s, val[1] * s,
56 val[2] * s, val[3] * s);}
59 friend Wave4 operator*(complex s,
const Wave4& w);
62 Wave4 operator*(
double s) {
return Wave4(val[0] * s, val[1] * s,
63 val[2] * s, val[3] * s);}
66 friend Wave4 operator*(
double s,
const Wave4& w);
69 Wave4 operator/(complex s) {
return Wave4(val[0] / s, val[1] / s,
70 val[2] / s, val[3] / s);}
73 Wave4 operator/(
double s) {
return Wave4(val[0] / s, val[1] / s,
77 friend Wave4 conj(Wave4 w);
80 friend Wave4 epsilon(Wave4 w1, Wave4 w2, Wave4 w3);
83 friend double m2(Wave4 w);
84 friend double m2(Wave4 w1, Wave4 w2);
89 friend ostream& operator<<(ostream& output, Wave4 w);
100 Wave4 operator*(complex s,
const Wave4& w);
101 Wave4 operator*(
double s,
const Wave4& w);
103 Wave4 epsilon(Wave4 w1, Wave4 w2, Wave4 w3);
105 double m2(Wave4 w1, Wave4 w2);
106 ostream& operator<<(ostream& os, Wave4 w);
123 GammaMatrix() : index() {};
128 complex& operator() (
int I,
int J) {
if (index[J] == I)
return val[J];
129 else return COMPLEXZERO; }
132 friend Wave4 operator*(Wave4 w, GammaMatrix g);
135 GammaMatrix operator*(complex s) {val[0] = s*val[0]; val[1] = s*val[1];
136 val[2] = s*val[2]; val[3] = s*val[3];
return *
this;}
139 friend GammaMatrix operator*(complex s, GammaMatrix g);
142 GammaMatrix operator-(complex s) {val[0] = val[0] - s; val[1] = val[1] - s;
143 val[2] = val[2] - s; val[3] = val[3] - s;
return *
this;}
146 friend GammaMatrix operator-(complex s, GammaMatrix g);
149 GammaMatrix operator+(complex s) {val[0] = val[0] + s; val[1] = val[1] + s;
150 val[2] = val[2] + s; val[3] = val[3] + s;
return *
this;}
153 friend GammaMatrix operator+(complex s, GammaMatrix g);
156 friend ostream& operator<<(ostream& os, GammaMatrix g);
171 Wave4 operator*(Wave4 w, GammaMatrix g);
172 GammaMatrix operator*(complex s, GammaMatrix g);
173 GammaMatrix operator-(complex s, GammaMatrix g);
174 GammaMatrix operator+(complex s, GammaMatrix g);
175 ostream& operator<<(ostream& os, GammaMatrix g);
182 class HelicityParticle :
public Particle {
187 HelicityParticle() : Particle(), indexSave() { direction = 1;}
188 HelicityParticle(
int idIn,
int statusIn = 0,
int mother1In = 0,
189 int mother2In = 0,
int daughter1In = 0,
int daughter2In = 0,
190 int colIn = 0,
int acolIn = 0,
double pxIn = 0.,
191 double pyIn = 0.,
double pzIn = 0.,
double eIn = 0.,
192 double mIn = 0.,
double scaleIn = 0., ParticleData* ptr = 0)
193 : Particle(idIn, statusIn, mother1In, mother2In, daughter1In, daughter2In,
194 colIn, acolIn, pxIn, pyIn, pzIn, eIn, mIn, scaleIn), indexSave() {
195 if (ptr) setPDEPtr( ptr->particleDataEntryPtr( idIn) );
198 HelicityParticle(
int idIn,
int statusIn,
int mother1In,
int mother2In,
199 int daughter1In,
int daughter2In,
int colIn,
int acolIn, Vec4 pIn,
200 double mIn = 0.,
double scaleIn = 0., ParticleData* ptr = 0)
201 : Particle(idIn, statusIn, mother1In, mother2In, daughter1In, daughter2In,
202 colIn, acolIn, pIn, mIn, scaleIn), indexSave() {
203 if (ptr) setPDEPtr( ptr->particleDataEntryPtr( idIn) );
206 HelicityParticle(
const Particle& ptIn, ParticleData* ptr = 0)
208 indexSave = ptIn.index();
209 if (ptr) setPDEPtr( ptr->particleDataEntryPtr(
id()) );
215 Wave4 waveBar(
int h);
216 void normalize(vector< vector<complex> >& m);
220 double m() {
return mSave;}
221 void m(
double mIn) {mSave = mIn; initRhoD();}
224 int index()
const {
return indexSave;}
225 void index(
int indexIn) {indexSave = indexIn;}
231 vector< vector<complex> > rho;
234 vector< vector<complex> > D;
240 rho = vector< vector<complex> >(spinStates(),
241 vector<complex>(spinStates(), 0));
242 D = vector< vector<complex> >(spinStates(),
243 vector<complex>(spinStates(), 0));
244 for (
int i = 0; i < spinStates(); i++) {
245 rho[i][i] = 1.0 / spinStates(); D[i][i] = 1;}
257 #endif // end Pythia8_HelicityBasics_H