File indexing completed on 2025-01-18 10:06:24
0001
0002
0003
0004
0005
0006
0007
0008 #ifndef Pythia8_HelicityBasics_H
0009 #define Pythia8_HelicityBasics_H
0010
0011 #include "Pythia8/Basics.h"
0012 #include "Pythia8/Event.h"
0013 #include "Pythia8/PythiaComplex.h"
0014 #include "Pythia8/PythiaStdlib.h"
0015
0016 namespace Pythia8 {
0017
0018
0019
0020
0021
0022
0023
0024 class Wave4 {
0025
0026 public:
0027
0028
0029 Wave4() {};
0030 Wave4(complex v0, complex v1, complex v2, complex v3) {val[0] = v0;
0031 val[1] = v1; val[2] = v2; val[3] = v3;}
0032 Wave4(Vec4 v) {val[0] = v.e(); val[1] = v.px(); val[2] = v.py();
0033 val[3] = v.pz();}
0034 ~Wave4() {};
0035
0036
0037 complex& operator() (int i) {return val[i];}
0038
0039
0040 Wave4 operator+(Wave4 w) {return Wave4( val[0] + w.val[0],
0041 val[1] + w.val[1], val[2] + w.val[2], val[3] + w.val[3]);}
0042
0043
0044 Wave4 operator-(Wave4 w) {return Wave4( val[0] - w.val[0],
0045 val[1] - w.val[1], val[2] - w.val[2], val[3] - w.val[3]);}
0046
0047
0048 Wave4 operator-() {return Wave4(-val[0], -val[1], -val[2], -val[3]);}
0049
0050
0051 complex operator*(Wave4 w) {return val[0] * w.val[0]
0052 + val[1] * w.val[1] + val[2] * w.val[2] + val[3] * w.val[3];}
0053
0054
0055 Wave4 operator*(complex s) {return Wave4(val[0] * s, val[1] * s,
0056 val[2] * s, val[3] * s);}
0057
0058
0059 friend Wave4 operator*(complex s, const Wave4& w);
0060
0061
0062 Wave4 operator*(double s) {return Wave4(val[0] * s, val[1] * s,
0063 val[2] * s, val[3] * s);}
0064
0065
0066 friend Wave4 operator*(double s, const Wave4& w);
0067
0068
0069 Wave4 operator/(complex s) {return Wave4(val[0] / s, val[1] / s,
0070 val[2] / s, val[3] / s);}
0071
0072
0073 Wave4 operator/(double s) {return Wave4(val[0] / s, val[1] / s,
0074 val[2]/s, val[3]/s);}
0075
0076
0077 friend Wave4 conj(Wave4 w);
0078
0079
0080 friend Wave4 epsilon(Wave4 w1, Wave4 w2, Wave4 w3);
0081
0082
0083 friend double m2(Wave4 w);
0084 friend double m2(Wave4 w1, Wave4 w2);
0085
0086
0087
0088
0089 friend ostream& operator<<(ostream& output, Wave4 w);
0090
0091 protected:
0092
0093 complex val[4];
0094
0095 };
0096
0097
0098
0099
0100 Wave4 operator*(complex s, const Wave4& w);
0101 Wave4 operator*(double s, const Wave4& w);
0102 Wave4 conj(Wave4 w);
0103 Wave4 epsilon(Wave4 w1, Wave4 w2, Wave4 w3);
0104 double m2(Wave4 w);
0105 double m2(Wave4 w1, Wave4 w2);
0106 ostream& operator<<(ostream& os, Wave4 w);
0107
0108
0109
0110
0111
0112
0113
0114
0115
0116
0117
0118 class GammaMatrix {
0119
0120 public:
0121
0122
0123 GammaMatrix() : index() {};
0124 GammaMatrix(int mu);
0125 ~GammaMatrix() {};
0126
0127
0128 complex& operator() (int I, int J) {if (index[J] == I) return val[J];
0129 else return COMPLEXZERO; }
0130
0131
0132 friend Wave4 operator*(Wave4 w, GammaMatrix g);
0133
0134
0135 GammaMatrix operator*(complex s) {val[0] = s*val[0]; val[1] = s*val[1];
0136 val[2] = s*val[2]; val[3] = s*val[3]; return *this;}
0137
0138
0139 friend GammaMatrix operator*(complex s, GammaMatrix g);
0140
0141
0142 GammaMatrix operator-(complex s) {val[0] = val[0] - s; val[1] = val[1] - s;
0143 val[2] = val[2] - s; val[3] = val[3] - s; return *this;}
0144
0145
0146 friend GammaMatrix operator-(complex s, GammaMatrix g);
0147
0148
0149 GammaMatrix operator+(complex s) {val[0] = val[0] + s; val[1] = val[1] + s;
0150 val[2] = val[2] + s; val[3] = val[3] + s; return *this;}
0151
0152
0153 friend GammaMatrix operator+(complex s, GammaMatrix g);
0154
0155
0156 friend ostream& operator<<(ostream& os, GammaMatrix g);
0157
0158 protected:
0159
0160 complex val[4];
0161 int index[4];
0162
0163
0164 complex COMPLEXZERO;
0165
0166 };
0167
0168
0169
0170
0171 Wave4 operator*(Wave4 w, GammaMatrix g);
0172 GammaMatrix operator*(complex s, GammaMatrix g);
0173 GammaMatrix operator-(complex s, GammaMatrix g);
0174 GammaMatrix operator+(complex s, GammaMatrix g);
0175 ostream& operator<<(ostream& os, GammaMatrix g);
0176
0177
0178
0179
0180
0181
0182 class HelicityParticle : public Particle {
0183
0184 public:
0185
0186
0187 HelicityParticle() : Particle(), indexSave() { direction = 1;}
0188 HelicityParticle(int idIn, int statusIn = 0, int mother1In = 0,
0189 int mother2In = 0, int daughter1In = 0, int daughter2In = 0,
0190 int colIn = 0, int acolIn = 0, double pxIn = 0.,
0191 double pyIn = 0., double pzIn = 0., double eIn = 0.,
0192 double mIn = 0., double scaleIn = 0., ParticleData* ptr = 0)
0193 : Particle(idIn, statusIn, mother1In, mother2In, daughter1In, daughter2In,
0194 colIn, acolIn, pxIn, pyIn, pzIn, eIn, mIn, scaleIn), indexSave() {
0195 if (ptr) setPDEPtr( ptr->particleDataEntryPtr( idIn) );
0196 initRhoD();
0197 direction = 1; }
0198 HelicityParticle(int idIn, int statusIn, int mother1In, int mother2In,
0199 int daughter1In, int daughter2In, int colIn, int acolIn, Vec4 pIn,
0200 double mIn = 0., double scaleIn = 0., ParticleData* ptr = 0)
0201 : Particle(idIn, statusIn, mother1In, mother2In, daughter1In, daughter2In,
0202 colIn, acolIn, pIn, mIn, scaleIn), indexSave() {
0203 if (ptr) setPDEPtr( ptr->particleDataEntryPtr( idIn) );
0204 initRhoD();
0205 direction = 1; }
0206 HelicityParticle(const Particle& ptIn, ParticleData* ptr = 0)
0207 : Particle(ptIn) {
0208 indexSave = ptIn.index();
0209 if (ptr) setPDEPtr( ptr->particleDataEntryPtr( id()) );
0210 initRhoD();
0211 direction = 1; }
0212
0213
0214 Wave4 wave(int h);
0215 Wave4 waveBar(int h);
0216 void normalize(vector< vector<complex> >& m);
0217 int spinStates();
0218
0219
0220 double m() {return mSave;}
0221 void m(double mIn) {mSave = mIn; initRhoD();}
0222
0223
0224 double pol() {return polSave;}
0225 void pol(double hIn);
0226
0227
0228 int index() const {return indexSave;}
0229 void index(int indexIn) {indexSave = indexIn;}
0230
0231
0232 int direction;
0233
0234
0235 vector< vector<complex> > rho;
0236
0237
0238 vector< vector<complex> > D;
0239
0240 private:
0241
0242
0243 void initRhoD();
0244
0245
0246 int indexSave;
0247
0248 };
0249
0250
0251
0252 }
0253
0254 #endif