00001
00002
00003 #ifndef TimeShower_H
00004 #define TimeShower_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 TimeParticle : public Particle {
00029
00030 public:
00034 TimeParticle()
00035 : canBranch(false), hasBranched(false),
00036 shouldEvolveMore(false), idDaughter(0), copyOfPrimary(-1), coneSide(0),
00037 sister(-1), Q2Now(0.0), eMax(0.0), eNow(0.0), pAbsNow(0.0),
00038 zDaughter(0.0), phiDaughter(0.0), hasColVec4(false),
00039 hasAntiColVec4(false) {}
00041 TimeParticle(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.), double min = 0., double scalein = 0.)
00044 : Particle(idin, statusin, mother1in, mother2in, colin, anticolin, pin,
00045 min, scalein),
00046 canBranch(false), hasBranched(false), shouldEvolveMore(false),
00047 idDaughter(0), copyOfPrimary(-1), coneSide(0), sister(-1), Q2Now(0.0),
00048 eMax(0.0), eNow(0.0), pAbsNow(0.0), zDaughter(0.0), phiDaughter(0.0),
00049 hasColVec4(false), hasAntiColVec4(false) {}
00051 TimeParticle(const TimeParticle& pt)
00052 : Particle(pt), canBranch(pt.canBranch), hasBranched(pt.hasBranched),
00053 shouldEvolveMore(pt.shouldEvolveMore), idDaughter(pt.idDaughter),
00054 copyOfPrimary(pt.copyOfPrimary), coneSide(pt.coneSide), sister(pt.sister),
00055 Q2Now(pt.Q2Now), eMax(pt.eMax), eNow(pt.eNow), pAbsNow(pt.pAbsNow),
00056 zDaughter(pt.zDaughter), phiDaughter(pt.phiDaughter),
00057 hasColVec4(pt.hasColVec4), hasAntiColVec4(pt.hasAntiColVec4),
00058 colVec4(pt.colVec4), antiColVec4(pt.antiColVec4) {}
00060 TimeParticle& operator=(const TimeParticle& pt) {
00061 if (this != &pt) { Particle::operator=(pt);
00062 canBranch = pt.canBranch; hasBranched = pt.hasBranched;
00063 shouldEvolveMore = pt.shouldEvolveMore; idDaughter = pt.idDaughter;
00064 copyOfPrimary = pt.copyOfPrimary; coneSide = pt.coneSide;
00065 sister = pt.sister; Q2Now = pt.Q2Now; eMax = pt.eMax; eNow = pt.eNow;
00066 pAbsNow = pt.pAbsNow; zDaughter = pt.zDaughter;
00067 phiDaughter = pt.phiDaughter; hasColVec4 = pt.hasColVec4;
00068 hasAntiColVec4 = pt.hasAntiColVec4; colVec4 = pt.colVec4;
00069 antiColVec4 = pt.antiColVec4;} return *this; }
00071 TimeParticle(const Particle& pt) : Particle(pt) {
00072 canBranch = false; hasBranched = false; sister = -1;
00073 hasColVec4 = false; hasAntiColVec4 = false;}
00075 TimeParticle& operator=(const Particle& pt) {Particle::operator=(pt);
00076 canBranch = false; hasBranched = false; sister = -1;
00077 hasColVec4 = false; hasAntiColVec4 = false; return *this; }
00078
00079
00083 double mNow() const {if (hasBranched) return sqrt(m()*m() + Q2Now);
00084 else return m(); }
00086 double m2Now() const {if (hasBranched) return m()*m() + Q2Now;
00087 else return m()*m(); }
00089 double mOff() const {return sqrt(m()*m() + Q2Now); }
00091 double m2Off() const {return m()*m() + Q2Now; }
00093 void setColVec4() {hasColVec4 = false;}
00095 void setColVec4(Vec4 colVec4in)
00096 {colVec4 = colVec4in; hasColVec4 = true;}
00098 void setAntiColVec4() {hasAntiColVec4 = false;}
00100 void setAntiColVec4(Vec4 antiColVec4in)
00101 {antiColVec4 = antiColVec4in; hasAntiColVec4 = true;}
00103 void rot(double theta, double phi) {
00104 Particle::rot(theta, phi);
00105 if (hasColVec4) colVec4.rot(theta, phi);
00106 if (hasAntiColVec4) antiColVec4.rot(theta, phi); }
00108 void bst(double betaX, double betaY, double betaZ) {
00109 Particle::bst(betaX, betaY, betaZ);
00110 if (hasColVec4) colVec4.bst(betaX, betaY, betaZ);
00111 if (hasAntiColVec4) antiColVec4.bst(betaX, betaY, betaZ); }
00113 void bst(const Vec4& vec) {
00114 Particle::bst(vec);
00115 if (hasColVec4) colVec4.bst(vec);
00116 if (hasAntiColVec4) antiColVec4.bst(vec); }
00118 void rotbst(const RotBstMatrix& M) {
00119 Particle::rotbst(M);
00120 if (hasColVec4) colVec4.rotbst(M);
00121 if (hasAntiColVec4) antiColVec4.rotbst(M); }
00122
00123
00127 friend class TimeShower;
00128
00129
00130 private:
00133 bool canBranch, hasBranched, shouldEvolveMore;
00135 long idDaughter, copyOfPrimary, coneSide, sister;
00137 double Q2Now, eMax, eNow, pAbsNow, zDaughter, phiDaughter;
00139 bool hasColVec4, hasAntiColVec4;
00141 Vec4 colVec4, antiColVec4;
00143 };
00144
00145
00146
00147
00152 class TimeShower {
00153
00154 public:
00159 static long ANGULARORDER, NQUARK, ALPHASMODE, MEMODE, QEDSHOWER,
00160 INITIALCONE, PHIPOLASYM, PHICOHERASYM, RESPECTSCALE;
00164 static double Q0, Q0CHGQ,Q0CHGL, ALPHASFIX, LAMBDA5, ALPHAEMFIX,
00165 Q0FRACPS;
00171 TimeShower(long capacity = 100) {entry.reserve(capacity);}
00172
00173
00177 void shower(Event&, vector<long> = vector<long>(1,long(-1)),
00178 double = -1., long = 0, long = 0, double = 0.5);
00179
00180 private:
00183 vector<TimeParticle> entry;
00185 long nPrimary, maxColIndx, inFlavour1, inFlavour2;
00187 RotBstMatrix bstMother;
00189 bool hasME, MEorder, MEsplit, MEgluinoDau;
00191 long MEkind, MEcombi;
00193 double MEmix;
00199 void read(Event&, vector<long>);
00203 void write(Event&);
00207 bool setUpPrimary(double, long, long, double);
00211 bool kinemPrimary();
00215 void setUpBranching(long);
00219 bool kinemBranching(long, long, long);
00223 void evolveParton(long);
00227 long pickParton(long, long);
00231 bool zQcheck(long);
00235 void kinemConstruct(long, long, long);
00239 void findMEkind(long, long, double);
00243 long findMEparticle(long);
00247 double gammaZmix();
00251 double findMEcorr(long);
00255 static double calcMEcorr(long, long, double, double, double, double, double);
00256
00257 };
00258
00259
00260
00261 }
00262 }
00263
00264 #endif // TimeShower_H