00001
00002
00003 #ifndef SpaceShower_H
00004 #define SpaceShower_H
00005
00006 #include <iostream>
00007 #include <vector>
00008 #include <cmath>
00009 #include <ctime>
00010 #include "Pythia7/Config/Pythia7.h"
00011 #include "Basics.h"
00012 #include "Beam.h"
00013
00014 namespace Pythia7 {
00015 namespace Shower {
00016
00017 using namespace std;
00018
00019
00020
00021
00028 class SpaceParticle : public Particle {
00029
00030 public:
00034 SpaceParticle()
00035 : Particle(), canBranch(false), hasBranched(false),
00036 shouldEvolveMore(false), idMother(-1), idSister(-1),
00037 coneSide(0), copyOfPrimary(-1), Q2Now(0.0), x(0.0),
00038 zMother(0.0), phiDaughter(0.0), sin2thetaMax(0.0),
00039 sin2thetaNow(0.0), hasColVec4(false), hasAntiColVec4(false) {}
00041 SpaceParticle(long idin, long statusin = 0, long mother1in = -1,
00042 long mother2in = -1, long colin = 0, long anticolin = 0,
00043 Vec4 pin = Vec4(0.,0.,0.,0.),
00044 double min = 0., double scalein = 0.)
00045 : Particle(idin, statusin, mother1in, mother2in,
00046 colin, anticolin, pin, min), canBranch(false),
00047 hasBranched(false), shouldEvolveMore(false), idMother(-1),
00048 idSister(-1), coneSide( 0), copyOfPrimary(-1), Q2Now(0.0),
00049 x(0.0), zMother(0.0), phiDaughter(0.0), sin2thetaMax(0.0),
00050 sin2thetaNow(0.0), hasColVec4(false), hasAntiColVec4(false) {}
00052 SpaceParticle(const SpaceParticle& pt)
00053 : Particle(pt), canBranch(pt.canBranch), hasBranched(pt.hasBranched),
00054 shouldEvolveMore(pt.shouldEvolveMore), idMother(pt.idMother),
00055 idSister(pt.idSister), coneSide(pt.coneSide),
00056 copyOfPrimary(pt.copyOfPrimary), Q2Now(pt.Q2Now), x(pt.x),
00057 zMother(pt.zMother), phiDaughter(pt.phiDaughter),
00058 sin2thetaMax(pt.sin2thetaMax), sin2thetaNow(pt.sin2thetaNow),
00059 hasColVec4(pt.hasColVec4), hasAntiColVec4(pt.hasAntiColVec4),
00060 colVec4(pt.colVec4), antiColVec4(pt.antiColVec4) {}
00062 SpaceParticle& operator=(const SpaceParticle& pt) {
00063 if (this != &pt) { Particle::operator=(pt);
00064 canBranch = pt.canBranch; hasBranched = pt.hasBranched;
00065 shouldEvolveMore = pt.shouldEvolveMore; idMother = pt.idMother;
00066 idSister = pt.idSister; coneSide = pt.coneSide;
00067 copyOfPrimary = pt.copyOfPrimary; Q2Now = pt.Q2Now;
00068 x = pt.x; zMother = pt.zMother; phiDaughter = pt.phiDaughter;
00069 sin2thetaMax = pt.sin2thetaMax; sin2thetaNow = pt.sin2thetaNow;
00070 hasColVec4 = pt.hasColVec4; hasAntiColVec4 = pt.hasAntiColVec4;
00071 colVec4 = pt.colVec4; antiColVec4 = pt.antiColVec4;} return *this; }
00075 SpaceParticle(const Particle& pt) : Particle(pt) {
00076 canBranch = false; hasColVec4 = false; hasAntiColVec4 = false;}
00078 SpaceParticle& operator=(const Particle& pt) {Particle::operator=(pt);
00079 canBranch = false; hasColVec4 = false; hasAntiColVec4 = false;
00080 return *this; }
00081
00082
00086 double mNow() const {if (!hasBranched) return 0.; return -sqrt(Q2Now);}
00088 double m2Now() const {if (!hasBranched) return 0.; return -Q2Now;}
00090 void setColVec4() {hasColVec4 = false;}
00092 void setColVec4(Vec4 colVec4in)
00093 {colVec4 = colVec4in; hasColVec4 = true;}
00095 void setAntiColVec4() {hasAntiColVec4 = false;}
00097 void setAntiColVec4(Vec4 antiColVec4in)
00098 {antiColVec4 = antiColVec4in; hasAntiColVec4 = true;}
00100 void rot(double theta, double phi) {
00101 Particle::rot(theta, phi);
00102 if (hasColVec4) colVec4.rot(theta, phi);
00103 if (hasAntiColVec4) antiColVec4.rot(theta, phi); }
00105 void bst(double betaX, double betaY, double betaZ) {
00106 Particle::bst(betaX, betaY, betaZ);
00107 if (hasColVec4) colVec4.bst(betaX, betaY, betaZ);
00108 if (hasAntiColVec4) antiColVec4.bst(betaX, betaY, betaZ); }
00110 void bst(const Vec4& vec) {
00111 Particle::bst(vec);
00112 if (hasColVec4) colVec4.bst(vec);
00113 if (hasAntiColVec4) antiColVec4.bst(vec); }
00115 void rotbst(const RotBstMatrix& M) {
00116 Particle::rotbst(M);
00117 if (hasColVec4) colVec4.rotbst(M);
00118 if (hasAntiColVec4) antiColVec4.rotbst(M); }
00119
00120
00124 friend class SpaceShower;
00125
00126
00127 private:
00130 bool canBranch, hasBranched, shouldEvolveMore;
00132 long idMother, idSister, coneSide, copyOfPrimary;
00134 double Q2Now, x, zMother, phiDaughter, sin2thetaMax, sin2thetaNow;
00136 bool hasColVec4, hasAntiColVec4;
00138 Vec4 colVec4, antiColVec4;
00140 };
00141
00142
00143
00144
00149 class SpaceShower {
00150
00151 public:
00156 static long HADRONSHOWER, LEPTONSHOWER, ANGULARORDER, NQUARK, ALPHASMODE,
00157 Q2ORDER, MAXVIRTUALITY, MEMODE, SOFTGLUONRESUM, FINALCONE, PHIPOLASYM,
00158 PHICOHERASYM, RESPECTSCALE;
00162 static double Q0, Q0CHGQ,Q0CHGL, ALPHASFIX, LAMBDA5, ALPHAEMFIX,
00163 EMINEMITTED, ZMINEMITTED, XMINEMITTEDCHG, TINYQCHG, TINYPDF,
00164 TINYKERNELPDF, TINYKINPREC, HEAVYEVOL, EXTRAQEDPREWT, HEAVYXMAX,
00165 Q2STARTFRAC;
00171 SpaceShower(long capacity = 20) {entry1.reserve(capacity);
00172 entry2.reserve(capacity);}
00173
00174
00178 void shower(Event&, BeamParticle&, BeamParticle&, long = -1, long = -1,
00179 long = -1);
00180
00181 private:
00184 BeamParticle* beam1;
00186 BeamParticle* beam2;
00188 vector<SpaceParticle> entry1;
00190 vector<SpaceParticle> entry2;
00192 bool hasME;
00194 long in1, in2, maxColIndx, MEkind, nFinal, finalId1, finalId2;
00196 double s, eCM, sHat, mHat, sHatFinalState, avgMT2, minMT2;
00202 void read(Event&, BeamParticle&, BeamParticle&, long, long);
00206 void write(Event&);
00210 bool setUpPrimary(long);
00214 bool kinemPrimary();
00218 long pickSide();
00222 void setUpBranching(long);
00226 bool kinemBranching(long);
00230 void evolveParton(long);
00234 void findMEkind(long);
00238 double calcMEmax(long, long);
00242 double calcMEcorr(long, long, double, double);
00243
00244 };
00245
00246
00247
00248 }
00249 }
00250
00251 #endif // SpaceShower_H