diff --git a/Shower/Basics.h b/Shower/Basics.h --- a/Shower/Basics.h +++ b/Shower/Basics.h @@ -1,856 +1,892 @@ // Header file for the Rndm, Hist, Vec4 and Particle classes, // and for some convenient global functions. #ifndef Basics_H #define Basics_H #include #include #include #include #include "Pythia7/Config/Pythia7.h" namespace Pythia7 { /** * The underlying classes in the Pythia7 parton shower handler do not * directly use the ThePEG framework. All these classes are included * in the Shower namespace. */ namespace Shower { using namespace std; //************************************************************************** // Some simple global functions that are very convenient. // Minimum and maximum for long integers - should have been part of compiler? // inline long min(long i, long j) {return (i < j) ? i : j;} // inline long max(long i, long j) {return (i > j) ? i : j;} // Ensure that roundoff does not give square root of negative number. /** * Return the square root. If the argument is negative, zero will be * returned. */ inline double sqrtpos(double x) {if (x < 0.) return 0.; else return sqrt(x);} /** * Return the square root. If the argument \a x is negative the * negative of the square root of the absolute, \f$-\sqrt{-x}\f$, is * returned. */ inline double sqrtsgn(double x) {if (x < 0.) return -sqrt(-x); else return sqrt(x);} /** * The Kallens lambda function. \f$\lambda_K(a,b,c)=(a-b-c)^2-4bc\f$. */ inline double lambdaK(double a, double b, double c) { return max(0., pow(a - b - c, 2) - 4. * b * c); } /** * Square root of the Kallens lambda * function. \f$\sqrt{\lambda_K(a,b,c)}=\sqrt{(a-b-c)^2-4bc}\f$. */ inline double lambdaKRoot(double a, double b, double c) { return sqrt(lambdaK(a, b, c)); } /** * Magnitude of three-momentum. Given the mass squared, \a a, of a * decaying particle return the magnitude of the three-momentum of the * two daughters with squared masses \a b and \a c in the rest system * of the decay. */ inline double pAbsLambdaK(double a, double b, double c) { return 0.5*sqrt(lambdaK(a, b, c)/a); } /** * The random number generator class used internally in the Pythia7 * Shower routines. This should be replaced with the ThePEG * RandomGenerator. Uses only static methods. */ class Rndm { public: /** Default constructor. */ Rndm() {;} /** * Standard constructor giving a seed. Note that although this looks * like a new Rndm object is constructed with a separate random * number sequence, the underlying static generator is * reinitialized. */ Rndm(long inseed) {init(inseed);} /** * Initialize the random generator optionally giving a seed. */ static void init(long = 0); /** * Return a number uniformly distributed between 0 and 1. */ static double flat() ; /** * Return a random number distributed according to \f$\exp(x)\f$. */ static double exp() { return -log(flat()) ;} /** * Return a random number distributed according to \f$x\exp(x)\f$. */ static double xexp() { return -log(flat() * flat()) ;} /** * Return a random number distributed according to * \f$\exp(-x^2/2)\f$. */ static double gauss() ; /** * Return an index of the given vector according to the relative * (positive) probabilities therein. */ static long pick(const vector&) ; private: /** * Has the generator been initialized? */ static bool initrndm; /** * Has a gaussian number been * saved? */ static bool savgauss; /** * Internal index. */ static long i97; /** * Internal index. */ static long j97; /** * Internal variable. */ static double u[97]; /** * Internal variable. */ static double c; /** * Internal variable. */ static double cd; /** * Internal variable. */ static double cm; /** * Internal variable. */ static double save; }; //************************************************************************** /** * Simple histogram class to be used internally in the Pythia7 Shower * classes for testing purposes. */ class Hist{ public: /** The maximum number of lines a histogram can use at output. */ static long NLINES; /** Tolerance in deviation of xmin and xmax between two histograms. */ static double TOLERANCE; /** Small number to avoid division by zero. */ static double TINY; /** * Default constructor. */ Hist() {} /** * Standard constructor. * @param titlein the title of the histogram. * @param nbinin the number of bins. * @param xminin the lower edge of the histogram. * @param xmaxin the upper edge of the histogram */ Hist(string titlein, long nbinin = 100, double xminin = 0., double xmaxin = 1.) { book(titlein, nbinin, xminin, xmaxin); } /** * Copy constructor. */ Hist(const Hist& h) { title = h.title; nbin = h.nbin; xmin = h.xmin; xmax = h.xmax; dx = h.dx; nfill = h.nfill; under = h.under; inside = h.inside; over = h.over; res = h.res; } /** * Copy constructor giving a new title. */ Hist(string titlein, const Hist& h) { title = titlein; nbin = h.nbin; xmin = h.xmin; xmax = h.xmax; dx = h.dx; nfill = h.nfill; under = h.under; inside = h.inside; over = h.over;res = h.res; } /** * Assignment operator. */ Hist& operator=(const Hist& h) { if(this != &h) { nbin = h.nbin; xmin = h.xmin; xmax = h.xmax; dx = h.dx; nfill = h.nfill; under = h.under; inside = h.inside; over = h.over; res = h.res; return *this; } } /** * (Re-) Book this histogram. (Same parameters as in the Standard * constructor) */ void book(string = " ", long = 100, double = 0., double = 1.); /** * Set a new name. */ void name(string = " "); /** * Reset this histogram. */ void null() ; /** * Fill histogram. */ void fill(double, double = 1.); /** * Print histogram to the given stream. Print a table of x and y * values suitable to be used by programs such as gnuplot. */ void table(ostream& = cout) const ; /** * Check if the given histogram is compatible with this. */ bool sameSize(const Hist&) const ; /** Add histogram. */ Hist& operator+=(const Hist&) ; /** Subtract histogram. */ Hist& operator-=(const Hist&) ; /** Multiply by histogram (bin-by-bin). */ Hist& operator*=(const Hist&) ; /** Divide by histogram (bin-by-bin). */ Hist& operator/=(const Hist&) ; /** Add number to each bin. */ Hist& operator+=(double) ; /** Subtract number from each bin. */ Hist& operator-=(double) ; /** Multiply by number in each bin. */ Hist& operator*=(double) ; /** Divide by number in each bin. */ Hist& operator/=(double) ; /** Add number and histogram. */ friend Hist operator+(double, const Hist&); /** Add number and histogram. */ friend Hist operator+(const Hist&, double); /** Add two histograms. */ friend Hist operator+(const Hist&, const Hist&); /** Subtraction between number and histogram. */ friend Hist operator-(double, const Hist&); /** Subtraction between number and histogram. */ friend Hist operator-(const Hist&, double); /** Subtraction between two histograms. */ friend Hist operator-(const Hist&, const Hist&); /** Multiply number with histogram (bin-by-bin). */ friend Hist operator*(double, const Hist&); /** Multiply number with histogram (bin-by-bin). */ friend Hist operator*(const Hist&, double); /** Multiply two histograms (bin-by-bin). */ friend Hist operator*(const Hist&, const Hist&); /** Divide number with histogram (bin-by-bin). */ friend Hist operator/(double, const Hist&); /** Divide histogram with number (bin-by-bin). */ friend Hist operator/(const Hist&, double); /** Divide two histograms (bin-by-bin). */ friend Hist operator/(const Hist&, const Hist&); - /** Standard output operator. */ - friend ostream& operator<<(ostream&, const Hist&) ; /** Non-member function of table(ostream&). */ friend void table(const vector&, ostream& = cout) ; + /** Standard output operator. */ + friend ostream& operator<<(ostream&, const Hist&) ; + private: /** The title. */ string title; /** The number of bins. */ long nbin; /** The number of times fill() has been called. */ long nfill; /** the lower cut. */ double xmin; /** the upper cut. */ double xmax; /** the bin width. */ double dx; /** the underflow bin. */ double under; /** the sum of all bins. */ double inside; /** the overflow bin. */ double over; /** The bins. */ vector res; }; //************************************************************************** // Forward reference to RotBstMatrix class. class RotBstMatrix; //************************************************************************** /** * Vec4 class. * This class implements four-vectors, in energy-momentum space. * (But could equally well be used to hold space-time four-vectors.) * Used by the internal Pythia7 Shower classes. */ class Vec4 { public: /** * Constructors. */ Vec4(double xin = 0., double yin = 0., double zin = 0., double tin = 0.) : xx(xin), yy(yin), zz(zin), tt(tin) {} /** NOT DOCUMENTED */ Vec4(const Vec4& v) : xx(v.xx), yy(v.yy), zz(v.zz), tt(v.tt) {} /** NOT DOCUMENTED */ Vec4& operator=(const Vec4& v) { if (this != &v) {xx = v.xx; yy = v.yy; zz = v.zz; tt = v.tt; } return *this; } /** * Member functions for input. */ void p(double xin, double yin, double zin, double tin) {xx = xin; yy = yin; zz = zin; tt = tin;} /** NOT DOCUMENTED */ void px(double xin) {xx = xin;} /** NOT DOCUMENTED */ void py(double yin) {yy = yin;} /** NOT DOCUMENTED */ void pz(double zin) {zz = zin;} /** NOT DOCUMENTED */ void e(double tin) {tt = tin;} /** * Member functions for output. */ double px() const {return xx;} /** NOT DOCUMENTED */ double py() const {return yy;} /** NOT DOCUMENTED */ double pz() const {return zz;} /** NOT DOCUMENTED */ double e() const {return tt;} /** NOT DOCUMENTED */ double m2calc() const {return tt*tt - xx*xx - yy*yy - zz*zz;} /** NOT DOCUMENTED */ double mcalc() const {return sqrtsgn(tt*tt - xx*xx - yy*yy - zz*zz);} /** NOT DOCUMENTED */ double pT() const {return sqrt(xx*xx + yy*yy);} /** NOT DOCUMENTED */ double pT2() const {return xx*xx + yy*yy;} /** NOT DOCUMENTED */ double pAbs() const {return sqrt(xx*xx + yy*yy + zz*zz);} /** NOT DOCUMENTED */ double p2() const {return xx*xx + yy*yy + zz*zz;} /** NOT DOCUMENTED */ double theta() const {return atan2(sqrt(xx*xx + yy*yy), zz);} /** NOT DOCUMENTED */ double phi() const {return atan2(yy,xx);} /** * Member functions that perform operations. */ void rescalep(double fac) {xx = fac * xx; yy = fac * yy; zz = fac * zz;} /** NOT DOCUMENTED */ void flip(){xx = -xx; yy = -yy; zz = -zz;} /** NOT DOCUMENTED */ void rot(double, double); /** NOT DOCUMENTED */ void rotaxis(double, double, double, double); /** NOT DOCUMENTED */ void rotaxis(double, const Vec4&); /** * Member functions that perform operations. */ void bst(double, double, double); /** NOT DOCUMENTED */ void bst(const Vec4&); /** NOT DOCUMENTED */ void rotbst(const RotBstMatrix&); /** * Operator overloading with member functions */ Vec4& operator+=(const Vec4& v) {xx += v.xx; yy += v.yy; zz += v.zz; tt += v.tt; return *this;} /** NOT DOCUMENTED */ Vec4& operator-=(const Vec4& v) {xx -= v.xx; yy -= v.yy; zz -= v.zz; tt -= v.tt; return *this;} /** NOT DOCUMENTED */ Vec4& operator*=(double f) {xx *= f; yy *= f; zz *= f; tt *= f; return *this;} /** NOT DOCUMENTED */ Vec4& operator/=(double f) {xx /= f; yy /= f; zz /= f; tt /= f; return *this;} /** * Operator overloading with friends */ friend Vec4 operator+(const Vec4&, const Vec4&); /** * Operator overloading with friends */ friend Vec4 operator-(const Vec4&, const Vec4&); /** * Operator overloading with friends */ friend Vec4 operator*(double, const Vec4&); /** * Operator overloading with friends */ friend Vec4 operator*(const Vec4&, double); /** * Operator overloading with friends */ friend Vec4 operator/(const Vec4&, double); /** * Operator overloading with friends */ friend double operator*(const Vec4&, const Vec4&); /** * Scalar product of 3-vector parts. */ friend double dot3(const Vec4&, const Vec4&); /** * Cross product of 3-vector parts. */ friend Vec4 cross3(const Vec4&, const Vec4&); /** * Cosine of the polar angle between \a v1 and \a v2. */ friend double costheta(const Vec4 & v1, const Vec4 & v2); /** * The polar angle between \a v1 and \a v2. */ friend double theta(const Vec4& v1, const Vec4& v2) { return acos(costheta(v1, v2)); } /** * Cosine of the azimuthal angle between \a v1 and \a v2 around the * \a n axis. */ friend double cosphi(const Vec4 & v1, const Vec4 & v2, const Vec4 & n); /** * The azimuthal angle between \a v1 and \a v2 around the \a n axis. */ friend double phi(const Vec4 & v1, const Vec4 & v2, const Vec4 & n) { return acos(cosphi(v1, v2, n)); } /** * Print a four-vector */ friend ostream& operator<<(ostream&, const Vec4&) ; private: /** The x component. */ double xx; /** The y component. */ double yy; /** The z component. */ double zz; /** The time component. */ double tt; }; // Implementation of operator overloading with friends. /** NOT DOCUMENTED */ inline Vec4 operator+(const Vec4& v1, const Vec4& v2) {Vec4 v = v1 ; return v += v2;} /** NOT DOCUMENTED */ inline Vec4 operator-(const Vec4& v1, const Vec4& v2) {Vec4 v = v1 ; return v -= v2;} /** NOT DOCUMENTED */ inline Vec4 operator*(double f, const Vec4& v1) {Vec4 v = v1; return v *= f;} /** NOT DOCUMENTED */ inline Vec4 operator*(const Vec4& v1, double f) {Vec4 v = v1; return v *= f;} /** NOT DOCUMENTED */ inline Vec4 operator/(const Vec4& v1, double f) {Vec4 v = v1; return v /= f;} /** NOT DOCUMENTED */ inline double operator*(const Vec4& v1, const Vec4& v2) {return v1.tt*v2.tt - v1.xx*v2.xx - v1.yy*v2.yy - v1.zz*v2.zz;} + ostream& operator<<(ostream&, const Vec4&) ; + //************************************************************************** /** * RotBstMatrix class. * This class implements 4 * 4 matrices that encode an arbitrary combination * of rotations and boosts, that can be applied to Vec4 four-vectors. * Used by the internal Pythia7 Shower classes. */ class RotBstMatrix { public: /** * Constructors. */ RotBstMatrix() {for (long i = 0; i < 4; ++i) { for (long j = 0; j < 4; ++j) { M[i][j] = (i==j) ? 1. : 0.; } } } /** NOT DOCUMENTED */ RotBstMatrix(const RotBstMatrix& Min) { for (long i = 0; i < 4; ++i) { for (long j = 0; j < 4; ++j) { M[i][j] = Min.M[i][j]; } } } /** NOT DOCUMENTED */ RotBstMatrix& operator=(const RotBstMatrix& Min) {if (this != &Min) { for (long i = 0; i < 4; ++i) { for (long j = 0; j < 4; ++j) { M[i][j] = Min.M[i][j]; } }} return *this; } /** * Member functions. */ void rot(double = 0., double = 0.); /** * Member functions. */ void rot(const Vec4& p); /** * Member functions. */ void bst(double = 0., double = 0., double = 0.); /** * Member functions. */ void bst(const Vec4&); /** * Member functions. */ void bstback(const Vec4&); /** * Member functions. */ void bst(const Vec4&, const Vec4&); /** * Member functions. */ void rotbst(const RotBstMatrix&); /** * Member functions. */ void invert(); /** * Member functions. */ void toCMframe(const Vec4&, const Vec4&); /** * Member functions. */ void fromCMframe(const Vec4&, const Vec4&); /** * Member functions. */ void reset(); /** * Print a transformation matrix. */ friend ostream& operator<<(ostream&, const RotBstMatrix&) ; /** * Private members to be accessible from Vec4. */ friend class Vec4; private: /** NOT DOCUMENTED */ double M[4][4]; }; +/** + * Print a transformation matrix. + */ +ostream& operator<<(ostream&, const RotBstMatrix&) ; //************************************************************************** /** * Particle class. * This class holds info on a particle in general. * Used by the internal Pythia7 Shower classes. */ class Particle { public: /** * Constructors. */ Particle() {idp = 0; statusp = 0; mother1p = -1; mother2p = -1; prevp = -1; colp = 0; anticolp = 0; pp = Vec4(0.,0.,0.,0.); mp = 0.; scalep = 0.;} /** NOT DOCUMENTED */ Particle(long idin, long statusin = 0, long mother1in = -1, long mother2in = -1, long colin = 0, long anticolin = 0, Vec4 pin = Vec4(0.,0.,0.,0.), double min = 0., double scalein = 0.) { idp = idin; statusp = statusin; mother1p = mother1in; mother2p = mother2in; prevp = -1; colp = colin; anticolp = anticolin; pp = pin; mp = min; scalep = scalein;} /** NOT DOCUMENTED */ Particle(long idin, long statusin = 0, long mother1in = -1, long mother2in = -1, long colin = 0, long anticolin = 0, double pxin = 0., double pyin = 0., double pzin = 0., double ein = 0., double min = 0., double scalein = 0.) { idp = idin; statusp = statusin; mother1p = mother1in; mother2p = mother2in; prevp = -1; colp = colin; anticolp = anticolin; pp = Vec4(pxin, pyin, pzin, ein); mp = min; scalep = scalein;} /** NOT DOCUMENTED */ Particle(const Particle& pt) { idp = pt.idp; statusp = pt.statusp; mother1p = pt.mother1p; mother2p = pt.mother2p; prevp = pt.prevp; /** * Constructors. */ colp = pt.colp; anticolp = pt.anticolp; pp = pt.pp; mp = pt.mp; scalep = pt.scalep;} /** NOT DOCUMENTED */ Particle& operator=(const Particle& pt) {if (this != &pt) { idp = pt.idp; statusp = pt.statusp; mother1p = pt.mother1p; mother2p = pt.mother2p; prevp = pt.prevp; colp = pt.colp; anticolp = pt.anticolp; pp = pt.pp; mp = pt.mp; scalep = pt.scalep;} return *this; } /** * Member functions for input. */ void id(long idin) {idp = idin;} /** NOT DOCUMENTED */ void status(long statusin) {statusp = statusin;} /** NOT DOCUMENTED */ void addstatus(long change) {statusp += change;} /** NOT DOCUMENTED */ void mother1(long mother1in) {mother1p = mother1in;} /** NOT DOCUMENTED */ void mother2(long mother2in) {mother2p = mother2in;} /** NOT DOCUMENTED */ void mothers(long mother1in = -1, long mother2in = -1) {mother1p = mother1in; mother2p = mother2in;} /** NOT DOCUMENTED */ void prev(long previn) {prevp = previn;} /** NOT DOCUMENTED */ void col(long colin) {colp = colin;} /** NOT DOCUMENTED */ void anticol(long anticolin) {anticolp = anticolin;} /** NOT DOCUMENTED */ void cols(long colin = 0,long anticolin = 0) {colp = colin; anticolp = anticolin;} /** NOT DOCUMENTED */ void p(Vec4 pin) {pp = pin;} /** NOT DOCUMENTED */ void p(double pxin, double pyin, double pzin, double ein) {pp.p(pxin, pyin, pzin, ein);} /** NOT DOCUMENTED */ void px(double pxin) {pp.px(pxin);} /** NOT DOCUMENTED */ void py(double pyin) {pp.py(pyin);} /** NOT DOCUMENTED */ void pz(double pzin) {pp.pz(pzin);} /** NOT DOCUMENTED */ void e(double ein) {pp.e(ein);} /** NOT DOCUMENTED */ void m(double min) {mp = min;} /** NOT DOCUMENTED */ void scale(double scalein) {scalep = scalein;} /** * Member functions for output. */ long id() const {return idp;} /** NOT DOCUMENTED */ long status() const {return statusp;} /** NOT DOCUMENTED */ long mother1() const {return mother1p;} /** NOT DOCUMENTED */ long mother2() const {return mother2p;} /** NOT DOCUMENTED */ long prev() const {return prevp;} /** NOT DOCUMENTED */ long col() const {return colp;} /** NOT DOCUMENTED */ long anticol() const {return anticolp;} /** NOT DOCUMENTED */ Vec4 p() const {return pp;} /** NOT DOCUMENTED */ double px() const {return pp.px();} /** NOT DOCUMENTED */ double py() const {return pp.py();} /** NOT DOCUMENTED */ double pz() const {return pp.pz();} /** NOT DOCUMENTED */ double e() const {return pp.e();} /** NOT DOCUMENTED */ double m() const {return mp;} /** NOT DOCUMENTED */ double scale() const {return scalep;} /** NOT DOCUMENTED */ double m2() const {return mp*mp;} /** NOT DOCUMENTED */ double mcalc() const {return pp.mcalc();} /** NOT DOCUMENTED */ double m2calc() const {return pp.m2calc();} /** NOT DOCUMENTED */ double pT() const {return pp.pT();} /** NOT DOCUMENTED */ double pT2() const {return pp.pT2();} /** NOT DOCUMENTED */ double mT() const {return sqrt(mp*mp + pp.pT2());} /** NOT DOCUMENTED */ double mT2() const {return mp*mp + pp.pT2();} /** NOT DOCUMENTED */ double pAbs() const {return pp.pAbs();} /** NOT DOCUMENTED */ double p2() const {return pp.p2();} /** NOT DOCUMENTED */ double theta() const {return pp.theta();} /** NOT DOCUMENTED */ double phi() const {return pp.phi();} /** * Member functions that perform operations. */ void rescalep(double fac) {pp.rescalep(fac);} /** NOT DOCUMENTED */ void rot(double theta, double phi) {pp.rot(theta, phi);} /** NOT DOCUMENTED */ void bst(double betaX, double betaY, double betaZ) {pp.bst(betaX, betaY, betaZ);} /** NOT DOCUMENTED */ void bst(const Vec4& vec) {pp.bst(vec);} /** NOT DOCUMENTED */ void rotbst(const RotBstMatrix& M) {pp.rotbst(M);} /** * Print a particle */ friend ostream& operator<<(ostream&, const Particle&) ; private: /** NOT DOCUMENTED */ long idp; /** NOT DOCUMENTED */ long statusp; /** NOT DOCUMENTED */ long mother1p; /** NOT DOCUMENTED */ long mother2p; /** NOT DOCUMENTED */ long prevp; /** NOT DOCUMENTED */ long colp; /** NOT DOCUMENTED */ long anticolp; /** NOT DOCUMENTED */ Vec4 pp; /** NOT DOCUMENTED */ double mp; /** NOT DOCUMENTED */ double scalep; }; + /** + * Print a particle + */ + ostream& operator<<(ostream&, const Particle&) ; + //************************************************************************** /** Function to give particle masses. */ double Mass(long); /** Function to give spin of particle. */ long iSpin(long); /** Function to give charge of particle. */ long iCharge(long); /** Function to give colour of particle. */ long iColour(long); //************************************************************************** + + + /** Subtraction between number and histogram. */ + Hist operator-(double, const Hist&); + /** Subtraction between number and histogram. */ + Hist operator-(const Hist&, double); + /** Subtraction between two histograms. */ + Hist operator-(const Hist&, const Hist&); + /** Multiply number with histogram (bin-by-bin). */ + Hist operator*(double, const Hist&); + /** Multiply number with histogram (bin-by-bin). */ + Hist operator*(const Hist&, double); + /** Multiply two histograms (bin-by-bin). */ + Hist operator*(const Hist&, const Hist&); + /** Divide number with histogram (bin-by-bin). */ + Hist operator/(double, const Hist&); + /** Divide histogram with number (bin-by-bin). */ + Hist operator/(const Hist&, double); + /** Divide two histograms (bin-by-bin). */ + Hist operator/(const Hist&, const Hist&); + + /** Standard output operator. */ + ostream& operator<<(ostream&, const Hist&) ; + } } #endif // Basics_H diff --git a/Shower/Beam.h b/Shower/Beam.h --- a/Shower/Beam.h +++ b/Shower/Beam.h @@ -1,201 +1,206 @@ // Header file for information on incoming beams, including PDF's. #ifndef Beam_H #define Beam_H #include #include #include #include #include "Pythia7/Config/Pythia7.h" #include "ThePEG/PDF/PDFBase.h" namespace Pythia7 { namespace Shower { using namespace std; //************************************************************************** /** * Base class for parton distribution functions. * Used by the internal Pythia7 Shower classes. */ class PDF { public: /** NOT DOCUMENTED */ PDF(long idBeamin = 2212) : idBeam(idBeamin), xSav(-1.0), Q2Sav(-1.0), xu(0.0), xd(0.0), xubar(0.0), xdbar(0.0), xs(0.0), xc(0.0), xb(0.0), xg(0.0), xlepton(0.0), xgamma(0.0) {} /** NOT DOCUMENTED */ virtual ~PDF() {} /** NOT DOCUMENTED */ double xfx(long, double, double); /** NOT DOCUMENTED */ virtual bool isParton(long) const; /** NOT DOCUMENTED */ virtual bool isValence(long) const; protected: /** @cond NEVERTOBEDOCUMENTED */ /** NOT DOCUMENTED */ long idBeam; /** NOT DOCUMENTED */ double xSav, Q2Sav; /** NOT DOCUMENTED */ double xu, xd, xubar, xdbar, xs, xc, xb, xg, xlepton, xgamma; /** NOT DOCUMENTED */ virtual void xfUpdate(double x, double Q2) = 0; /** @endcond */ }; //********* /** * Gives the GRV 94 L (leading order) parton distribution function set * in parametrized form. Authors: M. Glueck, E. Reya and A. Vogt. * Used by the internal Pythia7 Shower classes. */ class GRV94L : public PDF { public: /** NOT DOCUMENTED */ GRV94L(long idBeamin = 2212) : PDF(idBeamin) {;} private: /** NOT DOCUMENTED */ void xfUpdate(double x, double Q2); /** NOT DOCUMENTED */ double grvv (double x, double n, double ak, double bk, double a, double b, double c, double d); /** NOT DOCUMENTED */ double grvw (double x, double s, double al, double be, double ak, double bk, double a, double b, double c, double d, double e, double es); /** NOT DOCUMENTED */ double grvs (double x, double s, double sth, double al, double be, double ak, double ag, double b, double d, double e, double es); }; //********* /** * Gives electron (or muon, or tau) parton distribution. * Used by the internal Pythia7 Shower classes. */ class Lepton : public PDF { public: /** NOT DOCUMENTED */ Lepton(long idBeamin = 11) : PDF(idBeamin) {;} private: /** NOT DOCUMENTED */ void xfUpdate(double x, double Q2); }; //************************************************************************** /** * This class holds info on a beam particle in the shower evolution. * It derives from the particle class. */ class BeamParticle : public Particle { public: /** * Constructors. */ BeamParticle() : Particle() {pdfbm = 0;} /** NOT DOCUMENTED */ BeamParticle(long idin, Vec4 pin = Vec4(0.,0.,0.,0.), double min = 0., PDF* pdfin = 0) : Particle(idin, -9, -1, -1, 0, 0, pin, min, 0.) {pdf(pdfin);} /** NOT DOCUMENTED */ BeamParticle(const BeamParticle& pt) : Particle(pt) {pdfbm = pt.pdfbm;} /** NOT DOCUMENTED */ BeamParticle& operator=(const BeamParticle& pt) {if (this != &pt) { pdfbm = pt.pdfbm; return *this;} } /** * Construct a BeamParticle from a Particle. */ BeamParticle(const Particle& pt) : Particle(pt) {pdfbm = 0;} /** NOT DOCUMENTED */ BeamParticle& operator=(const Particle& pt) {Particle::operator=(pt); pdfbm = 0; return *this; } /** * Member functions. */ double xfx(long id, double x, double Q2) {return pdfbm->xfx(id, x, Q2);} /** NOT DOCUMENTED */ void pdf(PDF* pdfin) {pdfbm = pdfin;} /** NOT DOCUMENTED */ PDF* pdf() const {return pdfbm;} /** NOT DOCUMENTED */ bool isParton(long id) const {return pdfbm->isParton(id);} /** NOT DOCUMENTED */ bool isValence(long id) const {return pdfbm->isValence(id);} /** NOT DOCUMENTED */ - bool isHadron() const {if (abs(id()) > 100) return true; return false;} + bool isHadron() const { + if (abs(id()) > 100) return true; + return false; + } /** NOT DOCUMENTED */ - bool isLepton() const {if (abs(id()) == 11 || abs(id()) == 13 - || abs(id()) == 15) return true; return false;} + bool isLepton() const { + if (abs(id()) == 11 || abs(id()) == 13 || abs(id()) == 15) return true; + return false; + } private: /** NOT DOCUMENTED */ PDF* pdfbm; }; /** * Interface class to make the ThePEG pdf classes available to the * internal Pythia7 Shower classes. */ class ThePEGPDF: public PDF { public: /** * Constructor taking a ThePEG::PDFBase object and a * ThePEG::ParticleData as arguments. */ ThePEGPDF(tcPDFPtr pdf, tcPDPtr parent); /** * Calculate new values of the parton densities to be cached. */ virtual void xfUpdate(double x, double Q2); /** Set the cached value of the density \a xf for parton type \a id. */ void set(long id, double xf); private: /** The ThePEG pdf object. */ tcPDFPtr thePDF; /** The ThePEG particle type. */ tcPDPtr theParent; /** Map of possible partons indexed by their id. */ map thePartons; /** The type of lepton if this is a lepton pdf. */ long theLeptonID; }; //************************************************************************** } } #endif // Beam_H diff --git a/Shower/Shower.h b/Shower/Shower.h --- a/Shower/Shower.h +++ b/Shower/Shower.h @@ -1,171 +1,173 @@ // This file collects top-level classes for shower evolution. #ifndef Shower_H #define Shower_H #include #include #include #include #include "Pythia7/Config/Pythia7.h" namespace Pythia7 { namespace Shower { using namespace std; class TimeShower; class SpaceShower; //************************************************************************** /** * This class hold a partonic event, which is to shower (on input) * or has showered (on output). * Used by the internal Pythia7 Shower classes. */ class Event { public: /** * Constructor. */ Event(long capacity = 100) {entry.reserve(capacity); maxColIndx = 0;} /** * Input of new particle at the end of the event record. */ long append(Particle entryin) { entry.push_back(entryin); if (entryin.col() > maxColIndx) maxColIndx = entryin.col(); if (entryin.anticol() > maxColIndx) maxColIndx = entryin.anticol(); return entry.size() - 1; } /** * Removal of particle. */ void remove(long index) {entry.erase(entry.begin() + index);} /** * Overload index operator to access element of Particle vector. */ Particle& operator[](long i) {return entry[i];} /** * Overload index operator to access element of Particle vector. */ const Particle & operator[](long i) const {return entry[i];} /** * Find if given entry is daughter/granddaughter/... of another one. */ bool isDescendent(long, long) const; /** * Query or reset size. */ long size() const {return entry.size();} /** * Query or reset size. */ void zero() {entry.resize(0); maxColIndx = 0;} /** * Manipulate colour index. */ void colIndx(long indx) {maxColIndx = indx;} /** * Manipulate colour index. */ long colIndx() const {return maxColIndx;} /** * Print an event. */ friend ostream& operator<<(ostream&, const Event&) ; private: /** NOT DOCUMENTED */ vector entry; /** NOT DOCUMENTED */ long maxColIndx; }; + +ostream& operator<<(ostream&, const Event&) ; //************************************************************************** /** * The Shower class administrates initial- and final-state radiation, * by one call to SpaceShower and repeated calls to TimeShower. * (Currently only latter implemented.) * Used by the internal Pythia7 Shower classes. */ class Shower { public: /** * Constant (possibly to be changed externally). */ static long ISR; /** * Constant (possibly to be changed externally). */ static long FSR; /** * Constant (possibly to be changed externally). */ static long FSRONISR; /** * Pointer to the object doing the actual work for time-like showers. */ static TimeShower * theTimeShower; /** * Pointer to the object doing the actual work for space-like showers. */ static SpaceShower * theSpaceShower; /** * Driver routine to handle a succession of showers. */ void shower(Event&, BeamParticle&, BeamParticle&, bool = false); /** * Driver routine to handle a succession of showers. * Simpler version for final-state radiation only; no beams required. */ void shower(Event&); private: /** @cond NEVERTOBEDOCUMENTED */ /** NOT DOCUMENTED */ long in1Old, in2Old, in1New, in2New, sizeOld,sizeMid, sizeNew; /** NOT DOCUMENTED */ bool hadISR; /** NOT DOCUMENTED */ void doSpaceShower(Event&, BeamParticle&, BeamParticle&); /** NOT DOCUMENTED */ void doTimeOnSpaceShower(Event&); /** NOT DOCUMENTED */ void copyFinalState(Event&); /** NOT DOCUMENTED */ void doTimeShower(Event&); /** @endcond */ }; //************************************************************************** } } #endif // Shower_H diff --git a/Shower/ShowerHandler.h b/Shower/ShowerHandler.h --- a/Shower/ShowerHandler.h +++ b/Shower/ShowerHandler.h @@ -1,408 +1,407 @@ // -*- C++ -*- #ifndef PYTHIA7_ShowerHandler_H #define PYTHIA7_ShowerHandler_H // This is the declaration of the ShowerHandler class. #include "Pythia7/Config/Pythia7.h" #include "ThePEG/Handlers/CascadeHandler.h" #include "ThePEG/Utilities/ObjectIndexer.h" // #include "ShowerHandler.fh" // #include "ShowerHandler.xh" #include "Pythia7/Shower/SpaceShowerHandler.h" #include "Pythia7/Shower/TimeShowerHandler.h" #include "Pythia7/Shower/Basics.h" #include "Pythia7/Shower/Shower.h" #include "ThePEG/PDF/PartonBinInstance.h" namespace Pythia7 { /** * The ShowerHandler class administers parton showers for * external partons in a hard SubProcess or in a * decay of a heavy resonance. The main function will identify partons * in the current step which should shower and create corresponding * TimeParticle and SpaceParticle * objects which, using the assigned TimeShower and * SpaceShower objects, will administer the * showering. * * @see \ref ShowerHandlerInterfaces "The interfaces" * defined for ShowerHandler. * @see SubProcess * @see TimeParticle * @see SpaceParticle * @see TimeShower * @see SpaceShower * */ class ShowerHandler: public CascadeHandler { public: /** @name Standard constructors and destructors. */ //@{ /** * The default constructor. */ inline ShowerHandler(); /** * The copy constructor. */ inline ShowerHandler(const ShowerHandler &); /** * The destructor. */ virtual ~ShowerHandler(); //@} public: /** @name Virtual functions required by the CascadeHandler class. */ //@{ /** * The main function called by the EventHandler class to * perform a step. Stores important information and calls * cascade(). * @param eh the EventHandler in charge of the Event generation. * @param tagged if not empty these are the only particles which should * be considered by the StepHandler. * @param hint a Hint object with possible information from previously * performed steps. * @throws Veto if the StepHandler requires the current step to be * discarded. * @throws Stop if the generation of the current Event should be stopped * after this call. * @throws Exception if something goes wrong. */ virtual void handle(EventHandler & eh, const tPVector & tagged, const Hint & hint); /** * Perform the actual cascade. */ virtual void cascade(); //@} /** * Perform a final-state cascade on the given partons. */ virtual void cascade(const tPVector & final); /** * Perform an initial-state cascade on the incoming partons of the * given sub-process. */ virtual void cascade(tSubProPtr sub); /** * Return true if the given particle can be showered. If \a inc is * true, test if the particle can initiate an initial state shower. */ virtual bool canShower(tcPPtr p, bool inc = false) const; /** * If true all branchings in the shower will be added to the new * step. Otherwise only the final partons will be added. */ inline bool history() const; public: /** @name Functions used by the persistent I/O system. */ //@{ /** * Function used to write out object persistently. * @param os the persistent output stream written to. */ void persistentOutput(PersistentOStream & os) const; /** * Function used to read in object persistently. * @param is the persistent input stream read from. * @param version the version number of the object when written. */ void persistentInput(PersistentIStream & is, int version); //@} /** * Standard Init function used to initialize the interfaces. */ static void Init(); protected: /** * Add a particle to the internal event record with the given * status. Note that if the parent particles has not already been * added, they will not be listed as parents in the internal event * record. */ long addParticle(tPPtr p, long status); /** * Add a particle to the internal event record with the given status * and mother indices. Note that if the parent particles has not * already been added, they will not be listed as parents in the * internal event record. */ long addParticle(tPPtr p, long status, long mother1, long mother2); /** * Add a time-like particle to the internal event record with the * given mother indices. If the particle has decayed add its * children recursively. */ void addFinalParticles(tPPtr p, long mother1, long mother2); /** * Set the static parameters of the underlying model object and * return an instance. */ Shower::Shower * getModel(); /** * Return true if the given particle is a resonance (defined by the * fact that all children only has the resonance as a parent). */ bool isResonance(tcPPtr r) const; protected: /** * Recursively find the first and last indices in the internal event * record of the incoming shower initiator. */ void findChain(pair & chain, long init) const; /** * Find the parent ThePEG::Particle pair of a given entry in the * internal event record. */ tPPair findParent(long i) const; /** * Create a ThePEG::Particle corresponding to a given entry in the * internal event record. If \a inc is true the particle is an * initiator for an intial state shower. */ tPPtr createParticle(long i, bool inc = false); /** * Copy information of the given entry in the internal event record * to the given ThePEG::Particle. */ tPPtr copyParticle(long i, tPPtr p); /** * Return the ThePEG::Particle corresponding to a given entry in the * internal event record. */ tPPtr getParticle(long i) const; /** * Return the momentum of the given entry in the internal event * record. */ Lorentz5Momentum momentum(long i) const; protected: /** @name Clone Methods. */ //@{ /** * Make a simple clone of this object. * @return a pointer to the new object. */ inline virtual IBPtr clone() const; /** Make a clone of this object, possibly modifying the cloned object * to make it sane. * @return a pointer to the new object. */ inline virtual IBPtr fullclone() const; //@} public: /** * Return a pointer to the object which implements the actual * time-like shower model. */ inline tTimeShowerPtr timeShower() const; /** * Return a pointer to the object which implements the actual * space-like shower model. */ inline tSpaceShowerPtr spaceShower() const; protected: protected: /** @name Standard Interfaced functions. */ //@{ /** * Check sanity of the object during the setup phase. */ - inline virtual void doupdate() throw(UpdateException); + inline virtual void doupdate(); /** * Initialize this object after the setup phase before saving an * EventGenerator to disk. * @throws InitException if object could not be initialized properly. */ - inline virtual void doinit() throw(InitException); + inline virtual void doinit(); /** * Initialize this object. Called in the run phase just before * a run begins. */ inline virtual void doinitrun(); /** * Finalize this object. Called in the run phase just after a * run has ended. Used eg. to write out statistics. */ inline virtual void dofinish(); /** * Rebind pointer to other Interfaced objects. Called in the setup phase * after all objects used in an EventGenerator has been cloned so that * the pointers will refer to the cloned objects afterwards. * @param trans a TranslationMap relating the original objects to * their respective clones. * @throws RebindException if no cloned object was found for a given * pointer. */ - inline virtual void rebind(const TranslationMap & trans) - throw(RebindException); + inline virtual void rebind(const TranslationMap & trans); /** * Return a vector of all pointers to Interfaced objects used in this * object. * @return a vector of pointers. */ inline virtual IVector getReferences(); //@} private: /** * The object implementing the administration of the time- and * space-like showers. */ Shower::Shower * theShowerModel; /** * The object which implements the actual time-like shower model. */ TimeShowerPtr theTimeShower; /** * The object which implements the actual space-like shower model. */ SpaceShowerPtr theSpaceShower; /** * If true add final-state radiation off initial-state cascade. */ bool addFSROnISR; /** * If true all branchings in the shower will be added to the new * step. Otherwise only the final partons will be added. */ bool theFullHistory; /** * The maximum number of attempts to cascade a sub process before * giving up and throwing an eventerror. */ long maxTries; protected: /** * The event record used internally. */ Shower::Event event; /** * Association between ColourLines and colour indices. */ ObjectIndexer colourIndex; /** * Association between Particles and indices. */ ObjectIndexer particleIndex; private: /** * Exception class used if too many attempts is made to shower a * sub-process. */ struct InfiniteLoopException: public Exception {}; private: /** * Describe a concrete class with persistent data. */ static ClassDescription initShowerHandler; /** * Private and non-existent assignment operator. */ ShowerHandler & operator=(const ShowerHandler &); }; } namespace ThePEG { /** @cond TRAITSPECIALIZATIONS */ /** * This template specialization informs ThePEG about the base class of * Pythia7::ShowerHandler. */ template <> struct BaseClassTrait: public ClassTraitsType { /** Typedef of the base class of Pythia7::ShowerHandler. */ typedef CascadeHandler NthBase; }; /** * This template specialization informs ThePEG about the name of the * Pythia7::ShowerHandler class and the shared object where it is * defined. */ template <> struct ClassTraits : public ClassTraitsBase { /** Return the class name. */ static string className() { return "Pythia7::ShowerHandler"; } /** Return the name of the shared library be loaded to get access to * the Pythia7::ShowerHandler class and every other class it uses * (except the base class). */ static string library() { return "libP7Shower.so"; } }; /** @endcond */ } #include "ShowerHandler.icc" #ifndef PYTHIA7_TEMPLATES_IN_CC_FILE // #include "ShowerHandler.tcc" #endif #endif /* PYTHIA7_ShowerHandler_H */ diff --git a/Shower/ShowerHandler.icc b/Shower/ShowerHandler.icc --- a/Shower/ShowerHandler.icc +++ b/Shower/ShowerHandler.icc @@ -1,80 +1,79 @@ // -*- C++ -*- // // This is the implementation of the inlined member functions of // the ShowerHandler class. // namespace Pythia7 { inline ShowerHandler::ShowerHandler() : theShowerModel(0), addFSROnISR(true), theFullHistory(false), maxTries(1000) {} inline ShowerHandler::ShowerHandler(const ShowerHandler & x) : CascadeHandler(x), theShowerModel(0), theTimeShower(x.theTimeShower), theSpaceShower(x.theSpaceShower), addFSROnISR(x.addFSROnISR), theFullHistory(x.theFullHistory), maxTries(x.maxTries) {} inline bool ShowerHandler::history() const { return theFullHistory; } inline IBPtr ShowerHandler::clone() const { return new_ptr(*this); } inline IBPtr ShowerHandler::fullclone() const { return new_ptr(*this); } -inline void ShowerHandler::doupdate() throw(UpdateException) { +inline void ShowerHandler::doupdate() { CascadeHandler::doupdate(); // First update base class. bool redo = touched(); // redo if touched. // UpdateChecker::check(aDependentMember, redo); // Update referenced objects on which this depends redo is set to true // if the dependent object is touched. // for_each(ContainerOfDependencies, UpdateChecker(redo)); // Update a container of references. // for_each(MapOfDependencies, UpdateMapChecker(redo)); // Update a map of references. if ( !redo ) return; // return if nothing has been touched. Otherwise do the actual update. // touch() // Touch if anything has changed. } -inline void ShowerHandler::doinit() throw(InitException) { +inline void ShowerHandler::doinit() { CascadeHandler::doinit(); } inline void ShowerHandler::dofinish() { CascadeHandler::dofinish(); } inline void ShowerHandler::doinitrun() { CascadeHandler::doinitrun(); } -inline void ShowerHandler::rebind(const TranslationMap & trans) - throw(RebindException) { +inline void ShowerHandler::rebind(const TranslationMap & trans) { // dummy = trans.translate(dummy); CascadeHandler::rebind(trans); } inline IVector ShowerHandler::getReferences() { IVector ret = CascadeHandler::getReferences(); // ret.push_back(dummy); return ret; } inline tTimeShowerPtr ShowerHandler::timeShower() const { return theTimeShower; } inline tSpaceShowerPtr ShowerHandler::spaceShower() const { return theSpaceShower; } } diff --git a/Shower/SpaceShowerHandler.h b/Shower/SpaceShowerHandler.h --- a/Shower/SpaceShowerHandler.h +++ b/Shower/SpaceShowerHandler.h @@ -1,567 +1,566 @@ // -*- C++ -*- #ifndef PYTHIA7_SpaceShowerHandler_H #define PYTHIA7_SpaceShowerHandler_H // This is the declaration of the SpaceShowerHandler class. #include "Pythia7/Config/Pythia7.h" #include "ThePEG/Handlers/HandlerBase.h" #include "Pythia7/Shower/SpaceShower.h" #include "SpaceShowerHandler.fh" // #include "SpaceShowerHandler.xh" #include "TimeShowerHandler.fh" namespace Pythia7 { /** * SpaceShowerHandler is a wrapper around the internal * Shower::SpaceShower class to perform a space-like parton shower. * * @see \ref SpaceShowerHandlerInterfaces "The interfaces" * defined for SpaceShowerHandler. */ class SpaceShowerHandler: public HandlerBase { public: /** @name Standard constructors and destructors. */ //@{ /** * The default constructor. */ inline SpaceShowerHandler(); /** * The copy constructor. */ inline SpaceShowerHandler(const SpaceShowerHandler &); /** * The destructor. */ virtual ~SpaceShowerHandler(); //@} public: /** * Set the static parameters of the underlying model object and * return an instance. */ Shower::SpaceShower * getModel(); /** * Allowed ISR showers for incoming hadron: = 0: none; = 1: QCD * ones; = 2 : also allow photon emission; = 3 : allow spacelike * photon branchings, if supported by the PDF used (not the case * currently) (does not address VMD part of resolved photons). */ inline int hadronShower() const; /** * Allowed ISR showers for incoming lepton: = 0: none; = 1: photon * emission; = 2 : allow spacelike photon branchings, if supported * by the PDF used (not the case currently) (does not address VMD * part of resolved photons). */ inline int leptonShower() const; /** * Number of allowed quark flavours in \f$g\rightarrow q \bar{q}\f$ * branching. */ inline int nQuarks() const; /** * Running of alpha_strong in evolution: = 0: fixed; = 1: scale * \f$Q^2\f$; = 2: scale \f$p_\perp^2\f$. But note that PDF's are * always evaluated at \f$Q^2\f$. */ inline int alphaSMode() const; /** * Maximum virtuality setting the starting point of the evolution: = * 0: \f$s\f$; = 1: \f$\hat{s}\f$; = 2: average \f$m_\perp^2\f$; = * 3: smallest \f$m_\perp^2\f$. */ inline int maxVirtuality() const; /** * Use of matrix element corrections: * = 0: no; = 1: yes. */ inline int MEMode() const; /** * Resum the effect of multiple soft gluon emissions: = 0: no; = 1: yes. */ inline int softGluonResum() const; /** * Restrict first emission within cone given by colour flow in hard * process. = 0: no; = 1: yes, isotropic phi angle inside cone; = 2: * yes, also with anisotropic phi angle inside cone. */ inline int finalCone() const; /** * Q2 ordering is normal, but could be relaxed (to be developed in * future). = 0: yes; = 1: no, allow maximum kinematically possible * (toy scenario). */ inline int Q2Order() const; /** * Use angular ordering? */ inline bool angularOrdering() const; /** * Azimuthal asymmetry induced by gluon polarization. * = 0: no; = 1: yes. */ inline int phiPolAsym() const; /** * Azimuthal asymmetry induced by colour coherence. * = 0: no; = 1: yes. */ inline int phiCoherAsym() const; /** * Use the scale variable of original partons to restrict * branchings. = 0: no; = 1: yes, \f$Q^2 <\f$ scale; = 2: yes, * \f$p_\perp^2 <\f$ scale, = 3: yes, \f$(E\theta)^2 <\f$ scale; = * 4: yes, \f$\theta^2 <\f$ scale. Here theta is the full opening * angle of a branching, defined in the rest frame of the event. (In * all cases relations are approximate.) */ inline int respectScale() const; /** * Parton shower cut-off mass for QCD emissions. */ inline Energy Q0() const; /** * Parton shower cut-off mass for photon coupling to coloured particle. */ inline Energy Q0ChgQ() const; /** * Parton shower cut-off mass for pure QED branchings. Assumed <= Q0CHGQ. */ inline Energy Q0ChgL() const; /** * Fixed alpha_strong value for AlphaSMode == 0. */ inline double alphaSFix() const; /** * Lambda_QCD(five flavours) in alpha_strong for AlphaSMode >= 1. */ inline Energy Lambda5() const; /** * Fixed alpha_em value. */ inline double alphaEMFix() const; /** * Minimum energy of emitted QCD parton in rest frame of subprocess. */ inline Energy EMinEmitted() const; /** * Minimum fraction \f$1 - z\f$ of emitted QCD parton, in addition * to other limits. */ inline double zMinEmitted() const; /** * Minimum \f$x\f$ fraction of emitted photon - matched to treatment of * photon PDF. */ inline double xMinEmittedChg() const; /** * Smallest particle mass for QED evolution (= electron mass). */ inline Energy tinyQChg() const; /** * Vanishingly small parton density. */ inline double tinyPDF() const; /** * Vanishingly small product of splitting kernels and parton density * ratios. */ inline double tinyKernelPDF() const; /** * Vanishingly small recoil mass in branching kinematics reconstruction. */ inline double tinyKinPrec() const; /** * Safety margin in \f$x\f$ that heavy flavour evolution is at all * possible. */ inline double heavyEvol() const; /** * Extra preweight in QED shower evolution, to avoid maximum violation. */ inline double extraPreweight() const; /** * Maximum allowed \f$x\f$ when reconstructing back to heavy flavour * from gluon or photon. */ inline double heavyMax() const; /** * Mimimum gap in \f$Q^2\f$ values to allow iteration when parton * density vanishes. */ inline double Q2StartFrac() const; public: /** @name Functions used by the persistent I/O system. */ //@{ /** * Function used to write out object persistently. * @param os the persistent output stream written to. */ void persistentOutput(PersistentOStream & os) const; /** * Function used to read in object persistently. * @param is the persistent input stream read from. * @param version the version number of the object when written. */ void persistentInput(PersistentIStream & is, int version); //@} /** * Standard Init function used to initialize the interfaces. */ static void Init(); protected: protected: /** @name Clone Methods. */ //@{ /** * Make a simple clone of this object. * @return a pointer to the new object. */ inline virtual IBPtr clone() const; /** Make a clone of this object, possibly modifying the cloned object * to make it sane. * @return a pointer to the new object. */ inline virtual IBPtr fullclone() const; //@} protected: protected: /** @name Standard Interfaced functions. */ //@{ /** * Check sanity of the object during the setup phase. */ - inline virtual void doupdate() throw(UpdateException); + inline virtual void doupdate(); /** * Initialize this object after the setup phase before saving an * EventGenerator to disk. * @throws InitException if object could not be initialized properly. */ - inline virtual void doinit() throw(InitException); + inline virtual void doinit(); /** * Initialize this object. Called in the run phase just before * a run begins. */ inline virtual void doinitrun(); /** * Finalize this object. Called in the run phase just after a * run has ended. Used eg. to write out statistics. */ inline virtual void dofinish(); /** * Rebind pointer to other Interfaced objects. Called in the setup phase * after all objects used in an EventGenerator has been cloned so that * the pointers will refer to the cloned objects afterwards. * @param trans a TranslationMap relating the original objects to * their respective clones. * @throws RebindException if no cloned object was found for a given * pointer. */ - inline virtual void rebind(const TranslationMap & trans) - throw(RebindException); + inline virtual void rebind(const TranslationMap & trans); /** * Return a vector of all pointers to Interfaced objects used in this * object. * @return a vector of pointers. */ inline virtual IVector getReferences(); //@} private: /** * The object implementing the actual model. */ Shower::SpaceShower * theShowerModel; /** * Allowed ISR showers for incoming hadron: = 0: none; = 1: QCD * ones; = 2 : also allow photon emission; = 3 : allow spacelike * photon branchings, if supported by the PDF used (not the case * currently) (does not address VMD part of resolved photons). */ int theHadronShower; /** * Allowed ISR showers for incoming lepton: = 0: none; = 1: photon * emission; = 2 : allow spacelike photon branchings, if supported * by the PDF used (not the case currently) (does not address VMD * part of resolved photons). */ int theLeptonShower; /** * Number of allowed quark flavours in g -> q qbar branching. */ int theNQuarks; /** * Running of alpha_strong in evolution: * = 0: fixed; = 1: scale Q^2; = 2: scale pT^2. * But note that PDF's are always evaluated at Q2. */ int theAlphaSMode; /** * Maximum virtuality setting the starting point of the evolution: = * 0: s; = 1: sHat; = 2: average mT^2; = 3: smallest mT^2. */ int theMaxVirtuality; /** * Use of matrix element corrections: * = 0: no; = 1: yes. */ int theMEMode; /** * Resum the effect of multiple soft gluon emissions: = 0: no; = 1: yes. */ int theSoftGluonResum; /** * Restrict first emission within cone given by colour flow in hard * process. = 0: no; = 1: yes, isotropic phi angle inside cone; = 2: * yes, also with anisotropic phi angle inside cone. */ int theFinalCone; /** * Q2 ordering is normal, but could be relaxed (to be developed in * future). = 0: yes; = 1: no, allow maximum kinematically possible * (toy scenario). */ int theQ2Order; /** * Use angular ordering if non-zero. */ int useAngularOrdering; /** * Azimuthal asymmetry induced by gluon polarization. * = 0: no; = 1: yes. */ int thePhiPolAsym; /** * Azimuthal asymmetry induced by colour coherence. * = 0: no; = 1: yes. */ int thePhiCoherAsym; /** * Use the scale variable of original partons to restrict * branchings. = 0: no; = 1: yes, the Q2 < scale; = 2: yes, the pT2 * < scale, = 3: yes, the (E*theta)^2 < scale; = 4: yes, the theta^2 * < scale. Here theta is the full opening angle of a branching, * defined in the rest frame of the event. (In all cases relations * are approximate.) */ int theRespectScale; /** * Parton shower cut-off mass for QCD emissions. */ Energy theQ0; /** * Parton shower cut-off mass for photon coupling to coloured particle. */ Energy theQ0ChgQ; /** * Parton shower cut-off mass for pure QED branchings. Assumed <= Q0CHGQ. */ Energy theQ0ChgL; /** * Fixed alpha_strong value for AlphaSMode == 0. */ double theAlphaSFix; /** * Lambda_QCD(five flavours) in alpha_strong for AlphaSMode >= 1. */ Energy theLambda5; /** * Fixed alpha_em value. */ double theAlphaEMFix; /** * Minimum energy of emitted QCD parton in rest frame of subprocess. */ Energy theEMinEmitted; /** * Minimum fraction 1 - z of emitted QCD parton, in addition to * other limits. */ double theZMinEmitted; /** * Minimum x fraction of emitted photon - matched to treatment of * photon PDF. */ double theXMinEmittedChg; /** * Smallest particle mass for QED evolution (= electron mass). */ Energy theTinyQChg; /** * Vanishingly small parton density. */ double theTinyPDF; /** * Vanishingly small product of splitting kernels and parton density * ratios. */ double theTinyKernelPDF; /** * Vanishingly small recoil mass in branching kinematics reconstruction. */ double theTinyKinPrec; /** * Safety margin in x that heavy flavour evolution is at all possible. */ double theHeavyEvol; /** * Extra preweight in QED shower evolution, to avoid maximum violation. */ double theExtraPreweight; /** * Maximum allowed x when reconstructing back to heavy flavour from * gluon or photon. */ double theHeavyMax; /** * Mimimum gap in Q2 values to allow iteration when parton density * vanishes. */ double theQ2StartFrac; private: /** * Describe a concrete class with persistent data. */ static ClassDescription initSpaceShowerHandler; /** * Private and non-existent assignment operator. */ SpaceShowerHandler & operator=(const SpaceShowerHandler &); }; } namespace ThePEG { /** @cond TRAITSPECIALIZATIONS */ /** * This template specialization informs ThePEG about the base class of * Pythia7::SpaceShowerHandler. */ template <> struct BaseClassTrait: public ClassTraitsType { /** Typedef of the base class of Pythia7::SpaceShowerHandler. */ typedef HandlerBase NthBase; }; /** * This template specialization informs ThePEG about the name of the * Pythia7::SpaceShowerHandler class and the shared object where it is * defined. */ template <> struct ClassTraits : public ClassTraitsBase { /** Return the class name. */ static string className() { return "Pythia7::SpaceShowerHandler"; } /** Return the name of the shared library be loaded to get access to * the Pythia7::SpaceShowerHandler class and every other class it uses * (except the base class). */ static string library() { return "libP7Shower.so"; } }; /** @endcond */ } #include "SpaceShowerHandler.icc" #ifndef PYTHIA7_TEMPLATES_IN_CC_FILE // #include "SpaceShowerHandler.tcc" #endif #endif /* PYTHIA7_SpaceShowerHandler_H */ diff --git a/Shower/SpaceShowerHandler.icc b/Shower/SpaceShowerHandler.icc --- a/Shower/SpaceShowerHandler.icc +++ b/Shower/SpaceShowerHandler.icc @@ -1,207 +1,206 @@ // -*- C++ -*- // // This is the implementation of the inlined member functions of // the SpaceShowerHandler class. // namespace Pythia7 { inline SpaceShowerHandler::SpaceShowerHandler() : theShowerModel(0), theHadronShower(2), theLeptonShower(1), theNQuarks(5), theAlphaSMode(2), theMaxVirtuality(0), theMEMode(1), theSoftGluonResum(1), theFinalCone(2), theQ2Order(0), useAngularOrdering(true), thePhiPolAsym(1), thePhiCoherAsym(1), theRespectScale(0), theQ0(1.0*GeV), theQ0ChgQ(1.0*GeV), theQ0ChgL(1.0*GeV), theAlphaSFix(0.2), theLambda5(0.18*GeV), theAlphaEMFix(0.0073), theEMinEmitted(2.0*GeV), theZMinEmitted(0.001), theXMinEmittedChg(1.0e-10), theTinyQChg(0.51*MeV), theTinyPDF(1.0e-10), theTinyKernelPDF(1.0e-5), theTinyKinPrec(1.0e-10), theHeavyEvol(0.8), theExtraPreweight(0.1), theHeavyMax(0.5), theQ2StartFrac(0.9) {} inline SpaceShowerHandler::SpaceShowerHandler(const SpaceShowerHandler & x) : HandlerBase(x), theShowerModel(0), theHadronShower(x.theHadronShower), theLeptonShower(x.theLeptonShower), theNQuarks(x.theNQuarks), theAlphaSMode(x.theAlphaSMode), theMaxVirtuality(x.theMaxVirtuality), theMEMode(x.theMEMode), theSoftGluonResum(x.theSoftGluonResum), theFinalCone(x.theFinalCone), theQ2Order(x.theQ2Order), useAngularOrdering(x.useAngularOrdering), thePhiPolAsym(x.thePhiPolAsym), thePhiCoherAsym(x.thePhiCoherAsym), theRespectScale(x.theRespectScale), theQ0(x.theQ0), theQ0ChgQ(x.theQ0ChgQ), theQ0ChgL(x.theQ0ChgL), theAlphaSFix(x.theAlphaSFix), theLambda5(x.theLambda5), theAlphaEMFix(x.theAlphaEMFix), theEMinEmitted(x.theEMinEmitted), theZMinEmitted(x.theZMinEmitted), theXMinEmittedChg(x.theXMinEmittedChg), theTinyQChg(x.theTinyQChg), theTinyPDF(x.theTinyPDF), theTinyKernelPDF(x.theTinyKernelPDF), theTinyKinPrec(x.theTinyKinPrec), theHeavyEvol(x.theHeavyEvol), theExtraPreweight(x.theExtraPreweight), theHeavyMax(x.theHeavyMax), theQ2StartFrac(x.theQ2StartFrac) {} inline IBPtr SpaceShowerHandler::clone() const { return new_ptr(*this); } inline IBPtr SpaceShowerHandler::fullclone() const { return new_ptr(*this); } -inline void SpaceShowerHandler::doupdate() throw(UpdateException) { +inline void SpaceShowerHandler::doupdate() { HandlerBase::doupdate(); // First update base class. bool redo = touched(); // redo if touched. // UpdateChecker::check(aDependentMember, redo); // Update referenced objects on which this depends redo is set to true // if the dependent object is touched. // for_each(ContainerOfDependencies, UpdateChecker(redo)); // Update a container of references. // for_each(MapOfDependencies, UpdateMapChecker(redo)); // Update a map of references. if ( !redo ) return; // return if nothing has been touched. Otherwise do the actual update. // touch() // Touch if anything has changed. } -inline void SpaceShowerHandler::doinit() throw(InitException) { +inline void SpaceShowerHandler::doinit() { HandlerBase::doinit(); } inline void SpaceShowerHandler::dofinish() { HandlerBase::dofinish(); } inline void SpaceShowerHandler::doinitrun() { HandlerBase::doinitrun(); } -inline void SpaceShowerHandler::rebind(const TranslationMap & trans) - throw(RebindException) { +inline void SpaceShowerHandler::rebind(const TranslationMap & trans) { // dummy = trans.translate(dummy); HandlerBase::rebind(trans); } inline IVector SpaceShowerHandler::getReferences() { IVector ret = HandlerBase::getReferences(); // ret.push_back(dummy); return ret; } inline int SpaceShowerHandler::hadronShower() const { return theHadronShower; } inline int SpaceShowerHandler::leptonShower() const { return theLeptonShower; } inline int SpaceShowerHandler::nQuarks() const { return theNQuarks; } inline int SpaceShowerHandler::alphaSMode() const { return theAlphaSMode; } inline int SpaceShowerHandler::maxVirtuality() const { return theMaxVirtuality; } inline int SpaceShowerHandler::MEMode() const { return theMEMode; } inline int SpaceShowerHandler::softGluonResum() const { return theSoftGluonResum; } inline int SpaceShowerHandler::finalCone() const { return theFinalCone; } inline int SpaceShowerHandler::Q2Order() const { return theQ2Order; } inline bool SpaceShowerHandler::angularOrdering() const { return useAngularOrdering; } inline int SpaceShowerHandler::phiPolAsym() const { return thePhiPolAsym; } inline int SpaceShowerHandler::phiCoherAsym() const { return thePhiCoherAsym; } inline int SpaceShowerHandler::respectScale() const { return theRespectScale; } inline Energy SpaceShowerHandler::Q0() const { return theQ0; } inline Energy SpaceShowerHandler::Q0ChgQ() const { return theQ0ChgQ; } inline Energy SpaceShowerHandler::Q0ChgL() const { return theQ0ChgL; } inline double SpaceShowerHandler::alphaSFix() const { return theAlphaSFix; } inline Energy SpaceShowerHandler::Lambda5() const { return theLambda5; } inline double SpaceShowerHandler::alphaEMFix() const { return theAlphaEMFix; } inline Energy SpaceShowerHandler::EMinEmitted() const { return theEMinEmitted; } inline double SpaceShowerHandler::zMinEmitted() const { return theZMinEmitted; } inline double SpaceShowerHandler::xMinEmittedChg() const { return theXMinEmittedChg; } inline Energy SpaceShowerHandler::tinyQChg() const { return theTinyQChg; } inline double SpaceShowerHandler::tinyPDF() const { return theTinyPDF; } inline double SpaceShowerHandler::tinyKernelPDF() const { return theTinyKernelPDF; } inline double SpaceShowerHandler::tinyKinPrec() const { return theTinyKinPrec; } inline double SpaceShowerHandler::heavyEvol() const { return theHeavyEvol; } inline double SpaceShowerHandler::extraPreweight() const { return theExtraPreweight; } inline double SpaceShowerHandler::heavyMax() const { return theHeavyMax; } inline double SpaceShowerHandler::Q2StartFrac() const { return theQ2StartFrac; } } diff --git a/Shower/TimeShowerHandler.h b/Shower/TimeShowerHandler.h --- a/Shower/TimeShowerHandler.h +++ b/Shower/TimeShowerHandler.h @@ -1,417 +1,416 @@ // -*- C++ -*- #ifndef PYTHIA7_TimeShowerHandler_H #define PYTHIA7_TimeShowerHandler_H // This is the declaration of the TimeShowerHandler class. #include "Pythia7/Config/Pythia7.h" #include "ThePEG/Handlers/HandlerBase.h" #include "Pythia7/Shower/TimeShower.h" #include "TimeShowerHandler.fh" // #include "TimeShowerHandler.xh" namespace Pythia7 { /** * TimeShowerHandler is a wrapper around the internal * Shower::TimeShower class to perform a space-like parton shower. * * @see \ref TimeShowerHandlerInterfaces "The interfaces" * defined for TimeShowerHandler. */ class TimeShowerHandler: public HandlerBase { public: /** @name Standard constructors and destructors. */ //@{ /** * The default constructor. */ inline TimeShowerHandler(); /** * The copy constructor. */ inline TimeShowerHandler(const TimeShowerHandler &); /** * The destructor. */ virtual ~TimeShowerHandler(); //@} public: /** * Set the static parameters of the underlying model object and * return an instance. */ Shower::TimeShower * getModel(); /** * Angular ordering; = 0: off, = 1: on for g emission, = 2: on also * for \f$g\rightarrow q \bar{q}\f$ splitting. */ inline int angularOrder() const; /** * Number of allowed quark flavours in \f$g\rightarrow q \bar{q}\f$ * branching. */ inline int nQuark() const; /** * Running of alpha_strong in evolution: = 0: fixed; = 1: scale * \f$Q^2/4\f$; = 2: scale \f$p_\perp^2\f$; = 3: scale * \f$p_\perp^2\f$, except for \f$g\rightarrow q \bar{q}\f$, where * it is \f$Q^2/4\f$. */ inline int alphaSMode() const; /** * Also allow a QED shower together with QCD ones: = 0: no; = 1: * radiate on-shell photons; = 2 : also allow photons to branch. */ inline int MEMode() const; /** * Also allow a QED shower together with QCD ones: = 0: no; * = 1: radiate on-shell photons; = 2 : also allow photons to branch. */ inline int QEDShower() const; /** * Restrict first emission within cone given by colour flow in hard * process. = 0: no; = 1: yes, isotropic phi angle inside cone; = * 2: yes, also with anisotropic phi angle inside cone. */ inline int initialCone() const; /** * Azimuthal asymmetry induced by gluon polarization. * = 0: no; = 1: yes. */ inline int phiPolAsym() const; /** * Azimuthal asymmetry induced by colour coherence. * = 0: no; = 1: yes. */ inline int phoCoherAsym() const; /** * Use the scale variable of original partons to restrict * branchings. = 0: no; = 1: yes, \f$Q^2 <\f$ scale; = 2: yes, * \f$p_\perp^2 <\f$ scale, = 3: yes, \f$(E\theta)^2 <\f$ scale; = * 4: yes, \f$\theta^2 <\f$ scale. (In all cases relations are * approximate.) */ inline int respectScale() const; /** * Parton shower cut-off mass for QCD emissions. */ inline Energy Q0() const; /** * Parton shower cut-off mass for photon coupling to coloured particle. */ inline Energy Q0ChgQ() const; /** * Parton shower cut-off mass for pure QED branchings. Assumed <= Q0CHGQ. */ inline Energy Q0ChgL() const; /** * Fixed alpha_strong value for AlphaSMode == 0. */ inline double alphaSFix() const; /** * \f$\Lambda_{\mbox{QCD}}\f$ (five flavours) in alpha_strong for * AlphaSMode >= 1. */ inline Energy Lambda5() const; /** * Fixed \f$\alpha_{\mbox{EM}}\f$ value. */ inline double alphaEMFix() const; /** * Fraction of Q0 cut-off mass used as safety margin in * daughter mass sum. Relevant for total parton multiplicity. */ inline double Q0FracPS() const; public: /** @name Functions used by the persistent I/O system. */ //@{ /** * Function used to write out object persistently. * @param os the persistent output stream written to. */ void persistentOutput(PersistentOStream & os) const; /** * Function used to read in object persistently. * @param is the persistent input stream read from. * @param version the version number of the object when written. */ void persistentInput(PersistentIStream & is, int version); //@} /** * Standard Init function used to initialize the interfaces. */ static void Init(); protected: protected: /** @name Clone Methods. */ //@{ /** * Make a simple clone of this object. * @return a pointer to the new object. */ inline virtual IBPtr clone() const; /** Make a clone of this object, possibly modifying the cloned object * to make it sane. * @return a pointer to the new object. */ inline virtual IBPtr fullclone() const; //@} protected: protected: /** @name Standard Interfaced functions. */ //@{ /** * Check sanity of the object during the setup phase. */ - inline virtual void doupdate() throw(UpdateException); + inline virtual void doupdate(); /** * Initialize this object after the setup phase before saving an * EventGenerator to disk. * @throws InitException if object could not be initialized properly. */ - inline virtual void doinit() throw(InitException); + inline virtual void doinit(); /** * Initialize this object. Called in the run phase just before * a run begins. */ inline virtual void doinitrun(); /** * Finalize this object. Called in the run phase just after a * run has ended. Used eg. to write out statistics. */ inline virtual void dofinish(); /** * Rebind pointer to other Interfaced objects. Called in the setup phase * after all objects used in an EventGenerator has been cloned so that * the pointers will refer to the cloned objects afterwards. * @param trans a TranslationMap relating the original objects to * their respective clones. * @throws RebindException if no cloned object was found for a given * pointer. */ - inline virtual void rebind(const TranslationMap & trans) - throw(RebindException); + inline virtual void rebind(const TranslationMap & trans); /** * Return a vector of all pointers to Interfaced objects used in this * object. * @return a vector of pointers. */ inline virtual IVector getReferences(); //@} private: /** * The object implementing the actual model. */ Shower::TimeShower * theShowerModel; /** * Angular ordering; = 0: off, = 1: on for g emission, = 2: on also * for g -> q qbar splitting. */ int theAngularOrdering; /** * Number of allowed quark flavours in g -> q qbar branching. */ int theNQuark; /** * Running of alpha_strong in evolution: = 0: fixed; = 1: scale * Q^2/4; = 2: scale pT^2; = 3: scale pT2, except for g -> q qbar, * where it is Q^2/4 . */ int theAlphaSMode; /** * Also allow a QED shower together with QCD ones: = 0: no; = 1: * radiate on-shell photons; = 2 : also allow photons to branch. */ int theMEMode; /** * Also allow a QED shower together with QCD ones: = 0: no; * = 1: radiate on-shell photons; = 2 : also allow photons to branch. */ int theQEDShower; /** * Restrict first emission within cone given by colour flow in hard * process. = 0: no; = 1: yes, isotropic phi angle inside cone; = * 2: yes, also with anisotropic phi angle inside cone. */ int theInitialCone; /** * Azimuthal asymmetry induced by gluon polarization. * = 0: no; = 1: yes. */ int thePhiPolAsym; /** * Azimuthal asymmetry induced by colour coherence. * = 0: no; = 1: yes. */ int thePhiCoherAsym; /** * Use the scale variable of original partons to restrict * branchings. = 0: no; = 1: yes, the Q2 < scale; = 2: yes, the pT2 * < scale, = 3: yes, the (E*theta)^2 < scale; = 4: yes, the theta^2 * < scale. (In all cases relations are approximate.) */ int theRespectScale; /** * Parton shower cut-off mass for QCD emissions. */ Energy theQ0; /** * Parton shower cut-off mass for photon coupling to coloured particle. */ Energy theQ0ChgQ; /** * Parton shower cut-off mass for pure QED branchings. Assumed <= Q0CHGQ. */ Energy theQ0ChgL; /** * Fixed alpha_strong value for AlphaSMode == 0. */ double theAlphaSFix; /** * Lambda_QCD(five flavours) in alpha_strong for AlphaSMode >= 1. */ Energy theLambda5; /** * Fixed alpha_EM value. */ double theAlphaEMFix; /** * Fraction of Q0 cut-off mass used as safety margin in * daughter mass sum. Relevant for total parton multiplicity. */ double theQ0FracPS; private: /** * Describe a concrete class with persistent data. */ static ClassDescription initTimeShowerHandler; /** * Private and non-existent assignment operator. */ TimeShowerHandler & operator=(const TimeShowerHandler &); }; } namespace ThePEG { /** @cond TRAITSPECIALIZATIONS */ /** * This template specialization informs ThePEG about the base class of * Pythia7::TimeShowerHandler. */ template <> struct BaseClassTrait: public ClassTraitsType { /** Typedef of the base class of Pythia7::TimeShowerHandler. */ typedef HandlerBase NthBase; }; /** * This template specialization informs ThePEG about the name of the * Pythia7::TimeShowerHandler class and the shared object where it is * defined. */ template <> struct ClassTraits : public ClassTraitsBase { /** Return the class name. */ static string className() { return "Pythia7::TimeShowerHandler"; } /** Return the name of the shared library be loaded to get access to * the Pythia7::TimeShowerHandler class and every other class it uses * (except the base class). */ static string library() { return "libP7Shower.so"; } }; /** @endcond */ } #include "TimeShowerHandler.icc" #ifndef ThePEG_TEMPLATES_IN_CC_FILE // #include "TimeShowerHandler.tcc" #endif #endif /* PYTHIA7_TimeShowerHandler_H */ diff --git a/Shower/TimeShowerHandler.icc b/Shower/TimeShowerHandler.icc --- a/Shower/TimeShowerHandler.icc +++ b/Shower/TimeShowerHandler.icc @@ -1,142 +1,141 @@ // -*- C++ -*- // // This is the implementation of the inlined member functions of // the TimeShowerHandler class. // namespace Pythia7 { inline TimeShowerHandler::TimeShowerHandler() : theShowerModel(0), theAngularOrdering(2), theNQuark(5), theAlphaSMode(2), theMEMode(1), theQEDShower(2), theInitialCone(2), thePhiPolAsym(1), thePhiCoherAsym(1), theRespectScale(0), theQ0(1.0*GeV), theQ0ChgQ(1.0*GeV), theQ0ChgL(0.001*GeV), theAlphaSFix(0.2), theLambda5(0.25*GeV), theAlphaEMFix(0.0073), theQ0FracPS(0.25) {} inline TimeShowerHandler::TimeShowerHandler(const TimeShowerHandler & x) : HandlerBase(x), theShowerModel(0), theAngularOrdering(x.theAngularOrdering), theNQuark(x.theNQuark), theAlphaSMode(x.theAlphaSMode), theMEMode(x.theMEMode), theQEDShower(x.theQEDShower), theInitialCone(x.theInitialCone), thePhiPolAsym(x.thePhiPolAsym), thePhiCoherAsym(x.thePhiCoherAsym), theRespectScale(x.theRespectScale), theQ0(x.theQ0), theQ0ChgQ(x.theQ0ChgQ), theQ0ChgL(x.theQ0ChgL), theAlphaSFix(x.theAlphaSFix), theLambda5(x.theLambda5), theAlphaEMFix(x.theAlphaEMFix), theQ0FracPS(x.theQ0FracPS) {} inline IBPtr TimeShowerHandler::clone() const { return new_ptr(*this); } inline IBPtr TimeShowerHandler::fullclone() const { return new_ptr(*this); } -inline void TimeShowerHandler::doupdate() throw(UpdateException) { +inline void TimeShowerHandler::doupdate() { HandlerBase::doupdate(); // First update base class. bool redo = touched(); // redo if touched. // UpdateChecker::check(aDependentMember, redo); // Update referenced objects on which this depends redo is set to true // if the dependent object is touched. // for_each(ContainerOfDependencies, UpdateChecker(redo)); // Update a container of references. // for_each(MapOfDependencies, UpdateMapChecker(redo)); // Update a map of references. if ( !redo ) return; // return if nothing has been touched. Otherwise do the actual update. // touch() // Touch if anything has changed. } -inline void TimeShowerHandler::doinit() throw(InitException) { +inline void TimeShowerHandler::doinit() { HandlerBase::doinit(); } inline void TimeShowerHandler::dofinish() { HandlerBase::dofinish(); } inline void TimeShowerHandler::doinitrun() { HandlerBase::doinitrun(); } -inline void TimeShowerHandler::rebind(const TranslationMap & trans) - throw(RebindException) { +inline void TimeShowerHandler::rebind(const TranslationMap & trans) { // dummy = trans.translate(dummy); HandlerBase::rebind(trans); } inline IVector TimeShowerHandler::getReferences() { IVector ret = HandlerBase::getReferences(); // ret.push_back(dummy); return ret; } inline int TimeShowerHandler::angularOrder() const { return theAngularOrdering; } inline int TimeShowerHandler::nQuark() const { return theNQuark; } inline int TimeShowerHandler::alphaSMode() const { return theAlphaSMode; } inline int TimeShowerHandler::QEDShower() const { return theQEDShower; } inline int TimeShowerHandler::MEMode() const { return theMEMode; } inline int TimeShowerHandler::initialCone() const { return theInitialCone; } inline int TimeShowerHandler::phiPolAsym() const { return thePhiPolAsym; } inline int TimeShowerHandler::phoCoherAsym() const { return thePhiCoherAsym; } inline int TimeShowerHandler::respectScale() const { return theRespectScale; } inline Energy TimeShowerHandler::Q0() const { return theQ0; } inline Energy TimeShowerHandler::Q0ChgQ() const { return theQ0ChgQ; } inline Energy TimeShowerHandler::Q0ChgL() const { return theQ0ChgL; } inline double TimeShowerHandler::alphaSFix() const { return theAlphaSFix; } inline Energy TimeShowerHandler::Lambda5() const { return theLambda5; } inline double TimeShowerHandler::alphaEMFix() const { return theAlphaEMFix; } inline double TimeShowerHandler::Q0FracPS() const { return theQ0FracPS; } } diff --git a/Strategy/Pythia7Strategy.h b/Strategy/Pythia7Strategy.h --- a/Strategy/Pythia7Strategy.h +++ b/Strategy/Pythia7Strategy.h @@ -1,166 +1,165 @@ // -*- C++ -*- #ifndef PYTHIA7_Pythia7Strategy_H #define PYTHIA7_Pythia7Strategy_H // This is the declaration of the Pythia7Strategy class. #include "ThePEG/Repository/Strategy.h" #include "ThePEG/PDT/ParticleData.h" // #include "Pythia7Strategy.fh" // #include "Pythia7Strategy.xh" namespace Pythia7 { using namespace ThePEG; /** * The Pythia7Strategy class is a sub-class of the Strategy * class, simply implementing the correct citation for Pythia7 in the * ClassDocumentation interface. * * See also \ref Pythia7StrategyInterfaces "the interfaces" defined * for Pythia7Strategy. */ class Pythia7Strategy: public Strategy { public: /** @name Standard constructors and destructors. */ //@{ /** * Default constructor. */ inline Pythia7Strategy(); /** * Copy-constructor. */ inline Pythia7Strategy(const Pythia7Strategy &); /** * Destructor. */ virtual ~Pythia7Strategy(); //@} public: /** * Standard Init function used to initialize the interface. */ static void Init(); protected: protected: /** @name Clone Methods. */ //@{ /** * Make a simple clone of this object. * @return a pointer to the new object. */ inline virtual IBPtr clone() const; /** Make a clone of this object, possibly modifying the cloned object * to make it sane. * @return a pointer to the new object. */ inline virtual IBPtr fullclone() const; //@} protected: /** @name Standard Interfaced functions. */ //@{ /** * Check sanity of the object during the setup phase. */ - inline virtual void doupdate() throw(UpdateException); + inline virtual void doupdate(); /** * Initialize this object after the setup phase before saving an * EventGenerator to disk. * @throws InitException if object could not be initialized properly. */ - inline virtual void doinit() throw(InitException); + inline virtual void doinit(); /** * Finalize this object. Called in the run phase just after a * run has ended. Used eg. to write out statistics. */ inline virtual void dofinish(); /** * Rebind pointer to other Interfaced objects. Called in the setup phase * after all objects used in an EventGenerator has been cloned so that * the pointers will refer to the cloned objects afterwards. * @param trans a TranslationMap relating the original objects to * their respective clones. * @throws RebindException if no cloned object was found for a given * pointer. */ - inline virtual void rebind(const TranslationMap & trans) - throw(RebindException); + inline virtual void rebind(const TranslationMap & trans); /** * Return a vector of all pointers to Interfaced objects used in this * object. * @return a vector of pointers. */ inline virtual IVector getReferences(); //@} private: /** * Describe concrete class without persistent data. */ static NoPIOClassDescription initPythia7Strategy; /** * Private and non-existent assignment operator. */ Pythia7Strategy & operator=(const Pythia7Strategy &); }; } namespace ThePEG { /** @cond TRAITSPECIALIZATIONS */ /** This template specialization informs ThePEG about the base classes * of Pythia7::Pythia7Strategy. */ template <> struct BaseClassTrait: public ClassTraitsType { /** Typedef of the first base class of Pythia7::Pythia7Strategy. */ typedef Strategy NthBase; }; /** This template specialization informs ThePEG about the name of the * Pythia7::Pythia7Strategy class and the shared object where it is * defined. */ template <> struct ClassTraits : public ClassTraitsBase { /** Return a platform-independent class name */ static string className() { return "Pythia7::Pythia7Strategy"; } /** Return the name of the shared library be loaded to get access to * the Pythia7::Pythia7Strategy class and every other class it uses * (except the base class). */ static string library() { return "Pythia7Strategy.so"; } }; /** @endcond */ } #include "Pythia7Strategy.icc" #ifndef PYTHIA7_TEMPLATES_IN_CC_FILE // #include "Pythia7Strategy.tcc" #endif #endif /* PYTHIA7_Pythia7Strategy_H */ diff --git a/Strategy/Pythia7Strategy.icc b/Strategy/Pythia7Strategy.icc --- a/Strategy/Pythia7Strategy.icc +++ b/Strategy/Pythia7Strategy.icc @@ -1,45 +1,44 @@ // -*- C++ -*- // // This is the implementation of the inlined member functions of // the Pythia7Strategy class. // namespace Pythia7 { inline Pythia7Strategy::Pythia7Strategy() {} inline Pythia7Strategy::Pythia7Strategy(const Pythia7Strategy & x) : Strategy(x) {} inline IBPtr Pythia7Strategy::clone() const { return new_ptr(*this); } inline IBPtr Pythia7Strategy::fullclone() const { return new_ptr(*this); } -inline void Pythia7Strategy::doupdate() throw(UpdateException) { +inline void Pythia7Strategy::doupdate() { Strategy::doupdate(); } -inline void Pythia7Strategy::doinit() throw(InitException) { +inline void Pythia7Strategy::doinit() { Strategy::doinit(); } inline void Pythia7Strategy::dofinish() { Strategy::dofinish(); } -inline void Pythia7Strategy::rebind(const TranslationMap & trans) - throw(RebindException) { +inline void Pythia7Strategy::rebind(const TranslationMap & trans){ Strategy::rebind(trans); } inline IVector Pythia7Strategy::getReferences() { IVector ret = Strategy::getReferences(); return ret; } } diff --git a/StringFrag/LundFlavourGenerator.h b/StringFrag/LundFlavourGenerator.h --- a/StringFrag/LundFlavourGenerator.h +++ b/StringFrag/LundFlavourGenerator.h @@ -1,742 +1,742 @@ // -*- C++ -*- #ifndef PYTHIA7_LundFlavourGenerator_H #define PYTHIA7_LundFlavourGenerator_H // This is the declaration of the LundFlavourGenerator class. #include "FragConfig.h" // #include "LundFlavourGenerator.fh" // #include "LundFlavourGenerator.xh" #include "ThePEG/PDT/ParticleData.h" #include "ThePEG/Handlers/FlavourGenerator.h" #include "ThePEG/Repository/EventGenerator.h" namespace Pythia7 { /** * The LundFlavouGenerator is the class responsible for the flavour * generation according to the Lund scheme of fragmentation. It derives * from the FlavourGenerator and overrides the two categories of * interfaces : the generateHadron() and the getHadron() methods.
* * The first one is given one incoming flavour, generates a new quark * or diquark, and combines it with the existing flavour, then returns * the new hadron and the newly created flavour. The second receives * two incoming flavours and tries to combine them into a new hadron. * * Different models for flavour production can be selected setting the * Switch BaryonMode. * * The popcorn model for baryon production needs extra handling * than simple flavour production. It is therefore handled by the * LundFlavourHandler. Nevertheless the * LundFlavourGenerator encapsulates the methods for the * popcorn generation. They are denoted as popXXXX() * methods. * * @see \ref LundFlavourGeneratorInterfaces "The interfaces" * defined for LundFlavourGenerator. * @see FlavourGenerator * @see LundFlavourHandler * */ class LundFlavourGenerator: public ThePEG::FlavourGenerator { public: /** A vector used for SU6 Weights. */ typedef vector WeightsVec; /** An iterator into the SU6 weights vector. */ typedef WeightsVec::const_iterator WeightsVecPtr; /** A matrix used for SU6 Weights. */ typedef vector< WeightsVec > WeightsTable; public: /** @name Standard constructors and destructors. */ //@{ /** * Default constructor. */ LundFlavourGenerator(); /** * Copy-constructor. */ LundFlavourGenerator(const LundFlavourGenerator &); /** * Destructor. */ inline virtual ~LundFlavourGenerator(); //@} public: /** @name Virtual functions required by the FlavourGenerator class. */ //@{ /** * Generate a hadron from a quark. Given a quark(antiquark, diquark * or antidiquark), choose a quark-antiquark (or * antidiquark-diquark) pair. Return (first) a hadron formed by the * original quark and the antiquark together with (second) the * generated quark. Returns null pointers if the generation failed. * @param quark a quark, antiquark, diquark or antidiquark. * @return a pair of ParticleData pointers. The \a first is the * hadron produced and the \a second is the anti-partner of the * (anti-)(di-)quark generated to form the hadron. */ virtual tcPDPair generateHadron(tcPDPtr quark) const; /** * Get hadron from flavours. Return a hadron with the flavour * content given by the (anti-)(di-)quarks in the argument. The * arguments are given as ParticleData pointers. The default * versions will call the getHadron(long, long). * @param inPD1 the first flavour. * @param inPD2 the second flavour. * @return the corresponding hadron type or null if none could be * generated. */ virtual tcPDPtr getHadron(tcPDPtr inPD1, tcPDPtr inPD2) const; /** * Return a baryon with the flavour content given by the * (anti)quarks in the argument. The arguments are given as * particle data pointers. The default versions will call * getBaryon(tcPDPtr, tcPDPtr, tcPDPtr). If no corresponding hadron was * formed it should return the null pointer. * @param q1 the PDG code of the first flavour. * @param q2 the PDG code of the second flavour. * @param q3 the PDG code of the third flavour. * @return the corresponding baryon type or null if none could be * generated. */ virtual tcPDPtr getBaryon(long q1, long q2, long q3) const; /** * Generate a random quark flavour. */ virtual long selectQuark() const; /** * Generate a random (di)quark flavour. */ virtual long selectFlavour() const; //@} /** * Given an input flavour, \a inPD, selects a method (Q2BaryonDQ(), * Q2MesonQ(), PopDQ2MesonDQ() or DQ2BaryonQ()) that will generate * the new flavour to be combined with \a inPD to produce the new * hadron. \a newPD will be set to the newly created flavour and the * hadron will be returned.
For the popcorn model the Id number * of the diquark curtain-quark is given as \a curtainQid. Therefore * \a curtainQid = 0 means either that the popcorn model is not * switched on or the final baryon of a popcorn generation has to be * produced. The selection of curtain quark is however handled by * the LundFlavourHandler. */ virtual PDPtr generateHadron(tcPDPtr inPD, cPDPtr& newPD, long curtainQid=0) const; public: /** * Initializes the parameters of the generator that depend either on * the the interfaced parameters or on the model chosen for the * baryon production. It calls the setMesonFlavourMixingProbs() and * initGenPar() methods. */ void initialize(); /** * Returns the a pointer to a quark (or antiquark) of a qqbar pair * created in the string colour field. */ inline virtual PDPtr getRandomFlavour() const; /** @name Access parameters and swithces. */ //@{ /** * Returns the baryon mode. */ inline int BaryonMod() const; /** * Returns the suppression factor for production of a \f$s\bar{s}\f$ * pair. */ inline double strangeQSup() const; /** * Returns true if any selected flavour is extra-suppressed. Currently * returns true if an Eta, Eta' meson is extra-suppressed. */ inline bool extraSuppressed() const; //@} /** @name Functions dealing with popcorn generation. */ //@{ /** * When a diquark is first produced in the string fragmentation, if * (BaryomMode=2) this method is invoked to know the * number of popcorn mesons that should be produced in between the * baryon anti-baryon pair. */ inline int PopMesonN(tcPDPtr inDQ) const; /** * When a diquark is first produced in the string fragmentation, if * (BaryomMode=2) this method is invoked to know the * number of popcorn mesons that should be produced in between the * baryon anti-baryon pair. */ int PopMesonN(long inDQ) const; /** * Given the diquark that initializes the popcorn generation, * selects a curtain quark for the popcorn meson production. */ inline long PopSelectCurtainFlavour(tcPDPtr inDQ) const; /** * Given the diquark that initializes the popcorn generation, * selects a curtain quark for the popcorn meson production. */ long PopSelectCurtainFlavour(long inDQ) const; /** * In the process of producing a popcorn meson, the PopDQ2MesonD() * function may fail to recombine the curtainQ and the new flavour * into a new diquark state. The handler of the popcorn generation * is informed about this rejection invoking this method that * returns true if the generation failed. */ inline bool PopGenRejected() const; //@} /** @name Functions used by the persistent I/O system. */ //@{ /** * Function used to write out object persistently. * @param os the persistent output stream written to. */ void persistentOutput(PersistentOStream & os) const; /** * Function used to read in object persistently. * @param is the persistent input stream read from. * @param version the version number of the object when written. */ void persistentInput(PersistentIStream & is, int version); //@} /** * Standard Init function used to initialize the interface. */ static void Init(); /** * Print out state of an object for debugging purposed. */ void DBprint(); protected: protected: /** @name Clone Methods. */ //@{ /** * Make a simple clone of this object. * @return a pointer to the new object. */ inline virtual IBPtr clone() const; /** Make a clone of this object, possibly modifying the cloned object * to make it sane. * @return a pointer to the new object. */ inline virtual IBPtr fullclone() const; //@} protected: /** @name Standard Interfaced functions. */ //@{ /** * Check sanity of the object during the setup phase. */ - inline virtual void doupdate() throw(UpdateException); + inline virtual void doupdate(); /** * Initialize this object after the setup phase before saving an * EventGenerator to disk. * @throws InitException if object could not be initialized properly. */ - inline virtual void doinit() throw(InitException); + inline virtual void doinit(); /** * Finalize this object. Called in the run phase just after a * run has ended. Used eg. to write out statistics. */ inline virtual void dofinish(); //@} private: /** @name Meson-production functions. */ //@{ /** * Is the method for the meson production : \a inQ \f$\rightarrow\f$ * newQ + newMeson. Receives the incoming quark id, \a * inQ, generates a new quark flavour and invokes formMeson() to * combine them into a newMeson stored in member variables. */ void Q2MesonQ(long inQ) const; /** * Given the two constituant quark id numbers, \a inQ and \a newQ, * forms a new meson and returns its id. */ long formMeson(long inQ, long newQ) const; /** * When two flavours combine off to form a meson, this function * returns the multiplet of the new meson in function of the heavier * quark, \a Hfl, of the two. */ int selectMesonMultiplet(long Hfl) const; /** * Given the multiplet of the newly created meson, returns its total * angular momentum J. */ inline int MesonSpin(int multipletIdx) const; /** * Selects the physical state of a light flavour-diagonal meson. * Given the flavour (\a Qid) of a qqbar pair and the meson * multiplet (\a multipletIdx) of the corresponding meson selects at * random the meson state (described internally by an integer number * that is returned), according to the different probabilities * (theMixingProbabilities) that the \f$q\bar{q}\f$ pair produces * the possible diagonal-mesons of the different multiplets. */ inline int RandomFlavourMixing(long Qid, int multipletIdx, double rnd) const; //@} /** @name Diquark production functions. */ //@{ /** * When a incoming quark is sent to generateHadron() a choice is * made to rather produce a quark or a diquark. This method returns * true if a diquark is chosen to be produced. */ inline bool DQproduction() const; /** * When creating a new diquark (in the Q2BaryonDQ)) this method * returns true if the diquark is spin-suppressed. */ inline bool DQspinSup(int DQspin) const; //@} /** @name Baryaon production functions. */ //@{ /** * This is a baryon production method for the process \a inQ * -> newDQ + newBaryon
Given a incoming quark, \a * inQ generates a new diquark such as the q-diquark combination is * acceptable according to the corresponding weight for the baryon * production. Warning: Contains a special treatment for * diquark produced within the pocorm model. */ void Q2BaryonDQ(long inQ) const; /** * This is the baryon production method for the process : \a inDQ * -> newQ + newBaryon
Given the incoming diquark, * \a inDQ, generates a new flavour such as the weight of the baryon * corresponding to the (diquark-quark) combination is acceptable. */ void DQ2BaryonQ(long inDQ) const; /** * Given the quark (\a Q) - diquark(\a DQ) flavour combination and * the corresponding SU6 Weights, form the new baryon. */ long formBaryon(long Q, long DQ, WeightsVecPtr theWeights) const; /** * Given the quark (\a Qid) - diquark (\a DQid) combination, returns * from the lookup table theSU6WeightsTable a pointer * to the table (internally a vector) holding the relative * probabilities for the Q, DQ to join into a baryon of the octet or * decuplet multiplet. */ WeightsVecPtr getSU6MultWeightVec(long Qid, long DQid) const; /** * Given the table selected by the getSU6MultWeightVec() returns the * relative probability that the quark-diquark combination forms a * baryon in the octet. */ inline double OctetWT(WeightsVecPtr wtIt) const; /** * Given the table selected by the getSU6MultWeightVec() return the * relative probability that the quark-diquark combination forms a * baryon in the decuplet. */ inline double DecupletWT(WeightsVecPtr wtIt) const; //@} /** @name Popcorn functions. */ //@{ /** * Given a diquark (\a inDQ), returns its weight for the popcorn * model in function of its flavour content. */ double PopDQweight(long inDQ) const; /** * Method of the popcorn meson generation : DQ -> popMeson + DQ' *
Given the incoming diquark (\a inDQ) and the curtain quark * (absCurtainQ), combines the free flavour of inDQ with a * new created quark to produce the popcorn Meson -> if the * generation is not rejected by the PopConsistentDQ() then * reconstructs the outgoing diquark DQ', else a new curtain quark * has to be re-selected.
Warning: the absolute value of * curtainQ (\a absCurtainQ) as input here. */ void PopDQ2MesonDQ(long inDQ, long absCurtainQ ) const; /** * In popcorn meson production, this method returns false if * the selected curtainQ and the new flavour cannot combine into a * new diquark state. */ bool PopConsistentDQ(long q1, long q2) const; //@} /** @name Flavour joining functions. */ //@{ /** * Performs checks on the two incoming flavours to be combined. * Returns false if the flavour combination is not consistent. */ bool consistentJoin(long fl1, long fl2) const; //@} /** @name Inlined helper functions. */ //@{ /** * Returns true if the incoming flavour id (\a fl) corresponds to a * quark number. */ inline bool isQuark(long fl) const; /** * Returns true if the incoming flavour id (\a fl) corresponds to a * diquark number. */ inline bool isDiquark(long fl) const; /** * Given a diquark id number (\a inDQ), returns its heavy (\a hq), * light(\a lq) quark and its spin (\a s). */ inline void getDQcontent(int inDQ, int& hq, int& lq, int& s) const; //@} /** @name Functions for initialization of parameters. */ //@{ /** * Computes the suppression factor for Spin1 diquark production. if * the popcorn model is selected scales the quark/diquark * suppression factors and sets the diquark weights.
Warning: * To be called after any change of the interfaced parameters * involved. */ void initGenPar(); /** * Initializes the default values of the mixing angles, * theMixingAngles, for the 6 meson multiplets. */ void setDefaultMixingAnglesVec(); /** * Given the set of Mixing angles, theMixingAngles for the different * meson multiplets (the defaults values or the user defined * values), initializes the mixing probabilities theMixingProbVec * for the production of diagonal-flavour mesons.
Warning: * To be called after any change of the mixing angles. */ void setMesonFlavourMixingProbs(); /** * Initializes the table of the non-interfaced SU6 Weights : * theSU6WeightsTable. */ void setSU6weights(); /** * Initializes the diquark weights for the popcorn model * (DQweight).
Warning: Called by initGenPar() after any * change of the interfaced parameters. */ void setPopDQweights(); //@} private: /** * The Id number of the generated flavour. */ mutable long newFl; /** * The Id numbers of the created hadron. */ mutable long theHadron; /** * True if an Eta, Eta' meson constructed by formMeson() * method turns out to be extra-suppressed. */ mutable bool extraSup; /** * True if the PopDQ2MesonDQ method fails to reconstruct the * outgoing diquark. The generation is rejected and a new curtain quark as * to be selected. */ mutable bool thePopRejection; /** * See documentation of interface BaryonMode */ int theBaryonMod; //MSTJ(12) /** * See documentation of interface DQsup */ double DQsup; //PARJ(1) /** * See documentation of interface S1DQsup */ double IS1DQsup; //PARJ(4) /** * See documentation of interface SBaryonDecupletSup */ double BaryonDecupletSup; //PARJ(18) /** * See documentation of interface extraEtaSup */ double extraEtaSup; //PARJ(25) /** * See documentation of interface extraEtapSup */ double extraEtapSup; //PARJ(26) /** * See documentation of interface MesonP */ double MesonP; //PARJ(5) /** * See documentation of interface BssBsup */ double BssBsup; //PARJ(6) /** * See documentation of interface BMsBsup */ double BMsBsup; //PARJ(7) /** * See documentation of interface sQsup */ double sQsup; //PARJ(2) /** * See documentation of interface sDQvQsup */ double sDQvQsup; //PARJ(3) /** * See documentation of interface S1lightMesonP */ double S1lightMesonP; /** * See documentation of interface S1sMesonP */ double S1sMesonP; /** * See documentation of interface S1hqMesonP */ double S1hqMesonP; /** * See documentation of interface P_S0L1J1 */ double P_S0L1J1; /** * See documentation of interface P_S1L1J0 */ double P_S1L1J0; /** * See documentation of interface P_S1L1J1 */ double P_S1L1J1; /** * See documentation of interface P_S1L1J2 */ double P_S1L1J2; /** *The mixing angles for the production of flavour-diagonal meson. */ vector theMixingAngles; /** * The lookup table for diquark weights in the popcorn model, * used to compute the baryon weight when combining the DQ with * a new Q in the Q2BaryonDQ() method. Set by initialize(). */ vector DQweight; /** * Set in initialization to 3*IS1DQsup. */ double S1DQsup; /** * Popcorn parameters. */ double POP_sDQvQsup; /** * Popcorn parameters. */ double POP_S1DQsup; /** * Popcorn parameters. */ double POP_delta; /** * Maximun weight for diquark production */ double DQmaxWeight; /** * Lookup Tables for the SU6 weights. */ WeightsTable theSU6WeightsTable; /** * Lookup Tables for the mixing probabilities . */ WeightsTable theMixingProbVec; /** * Standard Interface */ static ClassDescription initLundFlavourGenerator; }; } namespace ThePEG { /** @cond TRAITSPECIALIZATIONS */ /** * This template specialization informs ThePEG about the base class of * Pythia7::LundFlavourGenerator. */ template <> struct BaseClassTrait: public ClassTraitsType { /** Typedef of the base class of Pythia7::LundFlavourGenerator. */ typedef FlavourGenerator NthBase; }; /** * This template specialization informs ThePEG about the name of the * Pythia7::LundFlavourGenerator class and the shared object where it * is defined. */ template <> struct ClassTraits : public ClassTraitsBase { /** Return the class name. */ static string className() { return "Pythia7::LundFlavourGenerator"; } /** * Return the name of the shared library to be loaded to get access * to the Pythia7::LundFlavourGenerator class and every other class * it uses (except the base class). */ static string library() { return "libP7String.so"; } }; /** @endcond */ } #include "LundFlavourGenerator.icc" #ifndef PYTHIA7_TEMPLATES_IN_CC_FILE // #include "LundFlavourGenerator.tcc" #endif #endif /* PYTHIA7_LundFlavourGenerator_H */ diff --git a/StringFrag/LundFlavourGenerator.icc b/StringFrag/LundFlavourGenerator.icc --- a/StringFrag/LundFlavourGenerator.icc +++ b/StringFrag/LundFlavourGenerator.icc @@ -1,131 +1,131 @@ // -*- C++ -*- namespace Pythia7 { inline LundFlavourGenerator::~LundFlavourGenerator(){} inline PDPtr LundFlavourGenerator::getRandomFlavour() const { long rndFlavourId = long(selectQuark()*(rndbool()? -1: 1)); return getParticleData(rndFlavourId); } inline int LundFlavourGenerator::BaryonMod() const{ return theBaryonMod; } inline double LundFlavourGenerator::strangeQSup() const{ return sQsup; } inline bool LundFlavourGenerator::isQuark(long fl) const { return abs(fl) <= 10; } inline bool LundFlavourGenerator::isDiquark(long fl) const{ fl = abs(fl); int hq = (fl/1000)%10 ; int lq = (fl/100)%10 ; int dq = (fl/10)%10; return (hq && lq &&!dq ); } inline void LundFlavourGenerator:: getDQcontent(int inDQ, int& hq, int& lq, int& s) const{ inDQ = abs(inDQ); hq = (inDQ/1000)%10; lq = (inDQ/100)%10; s = (inDQ%10 -1)/2; } // *** Meson Production Inline Functions *** inline int LundFlavourGenerator::MesonSpin(int multIdx) const{ int J=1; if(multIdx==0 || multIdx==3) J=0; else if(multIdx==5) J=2; return(J); } inline int LundFlavourGenerator:: RandomFlavourMixing(long inFl, int multIdx, double rndMixing) const{ //Fl = abs(Fl); long flavourIdx = 2*( abs(inFl) - 1); return(1 + int(rndMixing + theMixingProbVec[multIdx][flavourIdx]) + int(rndMixing + theMixingProbVec[multIdx][flavourIdx+1]) ); } inline bool LundFlavourGenerator::extraSuppressed() const { return extraSup; } // *** Inline functions Diquark production *** inline bool LundFlavourGenerator::DQproduction() const{ return (1.0 + DQsup)*rnd() > 1.0; } inline bool LundFlavourGenerator::DQspinSup(int DQspin) const{ if( DQspin == 0 ) return S1DQsup*rnd() > 1.0; else return S1DQsup < rnd(); } // *** Inline functions Baryon production *** inline double LundFlavourGenerator::OctetWT(WeightsVecPtr wtIt) const{ return(*wtIt); } inline double LundFlavourGenerator::DecupletWT(WeightsVecPtr wtIt) const{ return(*(++wtIt) ); } // *** Inline functions PopCorn Scheme *** inline bool LundFlavourGenerator::PopGenRejected() const { return(thePopRejection); } inline int LundFlavourGenerator::PopMesonN(tcPDPtr inDQ) const { return PopMesonN(inDQ->id() ); } inline long LundFlavourGenerator:: PopSelectCurtainFlavour(tcPDPtr inDQ) const { return PopSelectCurtainFlavour(inDQ->id() ); } // ============================================================ // Standard Methods for Interface // ============================================================= inline IBPtr LundFlavourGenerator::clone() const { return new_ptr(*this); } inline IBPtr LundFlavourGenerator::fullclone() const { return new_ptr(*this); } // -inline void LundFlavourGenerator::doupdate() throw(UpdateException){ +inline void LundFlavourGenerator::doupdate() { initialize(); } -inline void LundFlavourGenerator::doinit() throw(InitException){} +inline void LundFlavourGenerator::doinit() {} inline void LundFlavourGenerator::dofinish(){} }//End_Pythia7_Namespace diff --git a/StringFrag/LundFragHandler.h b/StringFrag/LundFragHandler.h --- a/StringFrag/LundFragHandler.h +++ b/StringFrag/LundFragHandler.h @@ -1,793 +1,793 @@ // -*- C++ -*- #ifndef PYTHIA7_LundFragHandler_H #define PYTHIA7_LundFragHandler_H // This is the declaration of the LundFragHandler class. #include "FragConfig.h" #include "ThePEG/Handlers/HadronizationHandler.h" #include "LundFragHandler.xh" #include "LundFlavourGenerator.h" #include "Oriented.h" #include "OrientedIndex.h" #include "ThePEG/Handlers/PtGenerator.h" #include "ThePEG/Handlers/ZGenerator.h" #include "ThePEG/Handlers/FlavourGenerator.h" #include "ThePEG/Handlers/ClusterCollapser.h" #include "EndPoint.h" #include "Hadron.h" namespace Pythia7 { /** * The LundFragHandler is the main class of the string fragmentation * modules. It is responsible for handling the hadronization phase * according to the Lund fragmentation scheme. It inherits from * HadronizationHandler the methods to communicate with the * EventHandler and the EventGenerator. It also derives from Oriented * to fix the orientation taken for each step in the fragmentation * procedure. * * Its tasks is : to look through the tagged particles * present in the current Step, to extract the Strings to be * hadronized into a list of Particles. At the end of the procedure, * it asks the EventHandler for a copy of the current Step * to add the newly created hadrons. * * The LundFragHandler is responsible for creating the current String * object to fragment. The fragmentation algorithm is implemented as a * step-by-step updating procedure of EndPoint. The LundFragHandler * contains three EndPoints: two to describe the last * (right, left) end-point left over in the previous steps, and the * current end-point created during the current step. * * To achieve its job the LundFragHandler makes use of the * LundPtGenerator, LundZGenerator and LundFlavourGenerator classes. * * @see \ref LundFragHandlerInterfaces "The interfaces" * defined for LundFragHandler. * @see HadronizationHandler * @see Oriented * @see String * @see EndPoint */ class LundFragHandler:public HadronizationHandler, public Oriented { public: /** Shorthand alias. */ typedef OrientedIndex OIndex; /** A pair of energy fractions. */ typedef pair Xhat; /** A vector of energy fraction pairs. */ typedef vector XhatVector; /** A list of Hadron object. */ typedef list Buffer; /** Iterator into a list of Hadron object. */ typedef Buffer::iterator BufferIt; public: /** @name Standard constructors and destructors. */ //@{ /** * Default constructor. */ LundFragHandler(); /** * Copy-constructor. */ LundFragHandler(const LundFragHandler &); /** * Destructor. */ ~LundFragHandler(); //@} /** @name Virtual functions to be implemented by concrete sub-classes. */ //@{ /** * The main function called by the EventHandler class to * perform a step. Extracts the color singlet strings in the * tagged particles vector, and send them to the Hadronize method * to be fragmented. When completed get a copy of the current Step * from the EventHandler and insert the newly created * particles to form a new step in the EventRecord. * @param eh the EventHandler in charge of the Event generation. * @param tagged if not empty these are the only particles which should * be considered by the StepHandler. * @param hint a Hint object with possible information from previously * performed steps. * @throws Veto if the StepHandler requires the current step to be * discarded. * @throws Stop if the generation of the current Event should be stopped * after this call. * @throws Exception if something goes wrong. */ virtual void handle(EventHandler & eh, const tPVector & tagged, const Hint & hint); //@} /** * The major method in the string fragmentation administration. * Given a vector of Particles that form the string, it returns the list * of newly produced particles. Its task is divided in three main parts :
* 1) Set-up the string calling the initHadronization method
* 2) call getHadron() method to produce a new hadron while the * remaining energy of the string is above a minimum threshold, * otherwise call the finalTwoHadron() method the produce * the last 2 hadron in the procedure. */ ParticleList Hadronize(const tcPVector& ); /** * Standard Init function used to initialize the interface. */ static void Init(); /** @name Functions used by the persistent I/O system. */ //@{ /** * Function used to write out object persistently. * @param os the persistent output stream written to. */ void persistentOutput(PersistentOStream & os) const; /** * Function used to read in object persistently. * @param is the persistent input stream read from. * @param version the version number of the object when written. */ void persistentInput(PersistentIStream & is, int version); //@} public: /** @name Access helper generator objects. */ //@{ /** * Set pointer to LundPtGenerator. */ inline void PtGen(PtGeneratorPtr); /** * Get pointer to LundPtGenerator. */ inline PtGeneratorPtr PtGen() const; /** * Set pointer to LundFlavourGenerator. */ inline void FlavourGen(FlavourGeneratorPtr); /** * Get pointer to LundFlavourGenerator. */ inline FlavourGeneratorPtr FlavourGen() const; /** * Set pointer to LundZGenerator. */ inline void ZGen(ZGeneratorPtr); /** * Get pointer to LundZGenerator. */ inline ZGeneratorPtr ZGen() const; //@} /** @name Access interfaced parameters. */ //@{ /** * Get maximum number of attempts. */ inline long maxLoop() const; /** * Set maximum number of attempts. */ inline void maxLoop(long n); /** * See documentation of interface Wmin0 */ inline Energy Wmin0() const; /** * See documentation of interface k */ inline double k() const; /** * See documentation of interface delta */ inline double Delta() const; /** * See documentation of interface m_0 */ inline Energy m0() const; /** * See documentation of interface d_0 */ inline InvEnergy4 d0() const; /** * Returns the suppression factor for production of a \f$s\bar{s}\f$ * pair (from the flavour generator). */ inline double SqRatio() const; //@} /** @name Print functions for debugging. */ //@{ /** * Print end points. */ void showEP() const; /** * Print Xhat values for a string region. */ void echoXhat(cStringRegionPtr ); //@} protected: protected: /** @name Clone Methods. */ //@{ /** * Make a simple clone of this object. * @return a pointer to the new object. */ inline virtual IBPtr clone() const; /** Make a clone of this object, possibly modifying the cloned object * to make it sane. * @return a pointer to the new object. */ inline virtual IBPtr fullclone() const; //@} protected: /** @name Standard Interfaced functions. */ //@{ /** * Check sanity of the object during the setup phase. */ - inline virtual void doupdate() throw(UpdateException); + inline virtual void doupdate(); /** * Initialize this object after the setup phase before saving an * EventGenerator to disk. * @throws InitException if object could not be initialized properly. */ - inline virtual void doinit() throw(InitException); + inline virtual void doinit(); /** * Finalize this object. Called in the run phase just after a * run has ended. Used eg. to write out statistics. */ inline virtual void dofinish(); //@} protected: /** @name Main internal functions for the hadronization. */ //@{ /** * Set the LundFraghandler members to their defaults value */ void resetHandler(); /** * Find the string type (open, closed) of the incoming vector of * particles */ void initHadronization(const tcPVector& ); /** * Copy partons which should be fragmented and recombine those which * are too close together. */ PVector copyRecombine(tcPPtr first, const tcPVector & inPVec); /** * Given the vector of particles, find the correct initial particle * to send to the String constructor to create the open String and * initialize the first EndPoints */ void initOpenString(const tcPVector& ); /** * Given the vector of particles, find the correct initial particle * to send to the String constructor to create the closed String and * initialize the first EndPoints */ void initClosedString(const tcPVector& ); /** * Perform a step in the fragmentation iterative process, resulting * by the creation of a new hadron. This is the method that fixes * the step's side, that will be used by all oriented classes. */ void getHadron(); /** * Updates the CurrentString variables after a step has been preformed * (i.e. a new break-point created and a new hadron produced) before * starting a new step. */ void loopBack(); /** * Produce the last two hadron in the string fragmentation scheme. * Invoked when the String remaining energy is below Wmin. At that * point the iterative procedure is stopped andd the last two hadrons * are produced */ void finalTwoHadrons(); /** * Main method responsible for finding the string region where a * solution for the new generated breakpoint can be found. */ void Stepping(); /** * Invoked by Stepping() to solve the (Gamma, m2) equation system in * the current StringRegion reached by the Stepping procedure. */ void solveGammaM2System(); /** * Handle the steps along the StringRegion map. */ void Step(); /** * Handle the steps along the StringRegion map. */ void stepDown(); /** * Calculate the momentum vector for two string regions. */ LorentzMomentum p0(cStringRegionPtr first, cStringRegionPtr last); /** * Used by initClosedString to break a closed string * and find the rightmost, leftmost end-points, for the resulting * open-like string. */ cPPtr selectBreakup(const tcPVector&); /** * Used by initClosedString to break a closed string * and find the rightmost, leftmost end-points, for the resulting * open-like string. */ void pickFirstEPts(); //@} /** @name Functions for creating the final two hadrons. */ //@{ /** * Used by the finalTwoHadrons() to find the final region when the * two last End-point are not in the same string-region */ void setupCommonFinalRegion(); /** * Used by finalTwoHadrons() to compute the kinematics of the two * final hadrons */ void solveKinematics(); /** * Return the final string-region where the second end-point is produced. */ inline cStringRegionPtr finalSR() const; /** * Return the first end-point. */ inline const EndPoint& firstEP() const; /** * Return the second end-point. */ inline EndPoint& secondEP(); /** * Get Ref to the second Hadron. */ inline Hadron& secondH(); //@} /** @name Helper and access functions. */ //@{ /** * Given the masses of the last two end-point and the current one , * compute the minimum energy above which a \f$q\bar{q}\f$ pair can * be produced. */ Energy2 Wmin2() const; /** * Return true if the string remaining energy is large enough * to produce a new \f$q\bar{q}\f$ pair. */ inline bool enoughE() const; /** * Return true if the current string is a simple \f$q\bar{q}\f$ * string. */ inline bool AqqbarSystem() const; /** * Used by the Step() method. Return true if a step taken on the * string region map ends-up in an inconsistent string-region, * that will lead to uncrossed the left-right sequences. */ inline bool inconsistentBreakupRegions() const; /** * Return the number of string-regions of the currentString. */ inline int nSR() const; /** * EndPoints accessor. */ inline const EndPoint& lastEP() const; /** * EndPoints accessor. */ inline const EndPoint& lastOppEP() const; /** * EndPoints accessor. */ inline EndPoint& getLastEP(); /** * EndPoints accessor. */ inline EndPoint& getLastOppEP(); /** * Return the current string */ inline cStringRegionPtr CurrentSR() const; /** * Access to the forward momentum fraction available in the * current StringRegion. */ inline double CurrentXremf() const; /** * Access to the backward momentum fraction available in the current * StringRegion. */ inline double CurrentXremb() const; /** * Get ref to the forward Xhat fractions given the index (int) of * the string-region axis. (cf. StrinRegion). */ inline double& Xhatfwd(int ); /** * Get ref to the backward Xhat fractions given the index (int) of * the string-region axis. (cf. StrinRegion). */ inline double& Xhatbwd(int ); /** * Set the forward and backward Xhat fractions * in the current StrinRegion. */ inline void setXhat(double, double); /** * Return true when a solution has been found for the position * of the new breakup. */ inline bool aSolution() const; //@} /** @name Functions for generating and storing hadrons. */ //@{ /** * Store a hadron. */ void store(Hadron& , int Dir=Oriented::Dir()); /** * Clear hadron storage. */ inline void clearBuffer(); /** * Create a list of stored hadrons. */ ParticleList createParticleList(); /** * Calls LundFlavourGenerator::generateHadron(tcPDPtr, cPDPtr&, long). */ virtual tcPDPtr generateHadron(tcPDPtr inPDPtr, cPDPtr& newPDPtr, long curtainQid=0); /** * Calls LundFlavourGenerator::getHadron(tcPDPtr, tcPDPtr). */ virtual tcPDPtr getHadron(tcPDPtr inPD1, tcPDPtr inPD2); //@} private : /** * The LundPtGenerator. */ PtGeneratorPtr thePtGen; /** * The LundFlavourGenerator. */ FlavourGeneratorPtr theFlGen; /** * The LundZGenerator. */ ZGeneratorPtr theZGen; /** * The object used to avoid too small strings in the hadronization. */ ClusterCollapserPtr theCollapser; /** * See documentation of interface Wmin0 */ Energy pWmin0; // PARJ(33) - PARJ(34) /** * See documentation of interface k */ double pK; // PARJ(36) /** * See documentation of interface delta */ double pDelta; // PARJ(37) /** * See documentation of interface m_0 */ Energy pM0; // PARJ(32) /** * The effective cut-off in squared mass, below which partons may be * recombined to simplify (machine precision limited) kinematics of * string fragmentation. (Default chosen to be of the order of a * light quark mass, or half a typical light meson mass.) */ Energy2 m2min; // PARU(12) /** * The effective cut-off in squared mass, below which partons may be * recombined to simplify (machine precision limited) kinematics of * string fragmentation. (Default chosen to be of the order of a * light quark mass, or half a typical light meson mass.) m2mini is * copied from m2min for each string to be hadronized and will be * increased if the hadronization fails too often. */ Energy2 m2mini; /** * The effective angular cut-off in radians for recombination of * partons, used in conjunction with m2min. */ double angmin; // PARU(13) /** * The effective angular cut-off in radians for recombination of * partons, used in conjunction with m2min. angmini is * copied from angmin for each string to be hadronized and will be * increased if the hadronization fails too often. */ double angmini; /** * Used to parametrize the probability for reverse rapidity ordering * of the final two hadrons. */ InvEnergy4 pd0; // PAR(38) /** * Defines the maximun mumber of allowed attemps to fragment the CurrentString */ long MaxLoop; /** * The current string to fragment */ StringPtr theCurrentString; /** * The right end-point. */ EndPoint theRightEP; /** * The left end-point. */ EndPoint theLeftEP; /** * The current end-points */ EndPoint CurrentEP; /** * The final string-region in the final 2 hadrons procedure. */ cStringRegionPtr thefinalSR; /** * Newly created ParticleData type. */ cPDPtr newCreatedPD; /** * Newly created Hadrons. */ Hadron newHadron; /** * Newly created Hadrons. */ Hadron lastHadron; /** * Vector of forward Xhat coordinates */ XhatVector XhatFwdVector; /** * Vector of backward Xhat coordinates */ XhatVector XhatBwdVector; /** * Used to keep track of total momentum available in breakups. */ LorentzMomentum Pzero; /** * True as long as there is enough energy left in the string. */ bool Estatus; /** * True as long as there is a solution to the gamma equation. */ bool GammaM2Solution; /** * The number of attempts so far to fragment the current string. */ long ntry; /** * Closed string first breakup */ cPPtr breakup; /** * Hadron storage. */ Buffer theBuffer; /** * Hadron storage iterator. */ BufferIt currentBufferIt; /** * The rotation to boost back ftom the current string rest frame. */ LorentzRotation cmr; /** * Interface description */ static ClassDescription initLundFragHandler; }; } namespace ThePEG { /** @cond TRAITSPECIALIZATIONS */ /** * This template specialization informs ThePEG about the base class of * Pythia7::LundFragHandler. */ template <> struct BaseClassTrait: public ClassTraitsType { /** Typedef of the base class of Pythia7::LundFragHandler. */ typedef HadronizationHandler NthBase; }; /** * This template specialization informs ThePEG about the name of the * Pythia7::LundFragHandler class and the shared object where it * is defined. */ template <> struct ClassTraits : public ClassTraitsBase { /** Return the class name. */ static string className() { return "Pythia7::LundFragHandler"; } /** * Return the name of the shared library to be loaded to get access * to the Pythia7::LundFragHandler class and every other class * it uses (except the base class). */ static string library() { return "libP7String.so"; } }; /** @endcond */ } #include "LundFragHandler.icc" #ifndef PYTHIA7_TEMPLATES_IN_CC_FILE // #include "LundFragHandler.tcc" #endif #endif /* PYTHIA7_LundFragHandler_H */ diff --git a/StringFrag/LundFragHandler.icc b/StringFrag/LundFragHandler.icc --- a/StringFrag/LundFragHandler.icc +++ b/StringFrag/LundFragHandler.icc @@ -1,189 +1,189 @@ // -*- C++ -*- namespace Pythia7 { // *********** Fragmentation Administration *********** inline bool LundFragHandler::enoughE() const { return Estatus; } inline bool LundFragHandler::inconsistentBreakupRegions() const { return( (Oriented::Dir() == Oriented::right)? (CurrentSR()->Ibwd() > lastOppEP().SR()->Ibwd()): (CurrentSR()->Ibwd() < lastOppEP().SR()->Ibwd()) ); } inline int LundFragHandler::nSR() const { return theCurrentString->nPrimaryStringRegion(); } // ***************** Parameter accessors ******************* inline long LundFragHandler::maxLoop() const{ return MaxLoop; } inline void LundFragHandler::maxLoop(long n){ MaxLoop=n; } inline PtGeneratorPtr LundFragHandler::PtGen() const{ return thePtGen; } inline void LundFragHandler::PtGen(PtGeneratorPtr newPtGen){ thePtGen = newPtGen; } inline FlavourGeneratorPtr LundFragHandler::FlavourGen() const { return theFlGen; } inline void LundFragHandler::FlavourGen(FlavourGeneratorPtr newFlGen) { theFlGen = newFlGen; } inline void LundFragHandler::ZGen(ZGeneratorPtr newZGen) { theZGen = newZGen; } inline ZGeneratorPtr LundFragHandler::ZGen() const { return theZGen; } inline Energy LundFragHandler::Wmin0() const { return pWmin0; } inline double LundFragHandler::k() const { return pK; } inline double LundFragHandler::Delta() const { return pDelta; } inline Energy LundFragHandler::m0() const { return pM0; } inline InvEnergy4 LundFragHandler::d0() const { return pd0; } inline double LundFragHandler::SqRatio() const { return FlavourGen()->strangeQSup(); } // ***************** Generation process accessors ******************* inline const EndPoint& LundFragHandler::lastEP() const { return((Oriented::Dir() == Oriented::right)? theRightEP : theLeftEP ); } inline const EndPoint& LundFragHandler::lastOppEP() const{ // Provide == for EndPoint ? // return((lastEP() == theRightEP)? theLeftEP: theRightEP ); return((Oriented::Dir() == Oriented::right)? theLeftEP : theRightEP ); } inline bool LundFragHandler::AqqbarSystem() const{ return (theCurrentString->nPrimaryStringRegion() == 1); } inline cStringRegionPtr LundFragHandler::CurrentSR() const { return CurrentEP.SR(); } inline double LundFragHandler::CurrentXremf() const { return CurrentSR()->Xremf(); } inline double LundFragHandler::CurrentXremb() const { return CurrentSR()->Xremb(); } // ****************** EndPoint Ref accessors ************************ inline EndPoint& LundFragHandler::getLastEP() { return((Oriented::Dir() == Oriented::right)? theRightEP : theLeftEP ); } inline EndPoint& LundFragHandler::getLastOppEP() { return((Oriented::Dir() == Oriented::right)? theLeftEP : theRightEP ); } // ********************** Accessors for Stepping Functions ************* inline double& LundFragHandler::Xhatfwd(int findex) { return (Oriented::Dir() == Oriented::right)? XhatFwdVector[findex-1].first : XhatFwdVector[findex-1].second; } inline double& LundFragHandler::Xhatbwd(int bindex) { return (Oriented::Dir() == Oriented::right)? XhatBwdVector[bindex-1].first : XhatBwdVector[bindex-1].second; } inline void LundFragHandler::setXhat(double newXhatfwd, double newXhatbwd){ int fwdIdx = CurrentSR()->Ifwd()-1; int bwdIdx = CurrentSR()->Ibwd()-1; if (Oriented::Dir() == Oriented::right){ XhatFwdVector[fwdIdx].first -= newXhatfwd; XhatBwdVector[bwdIdx].first = newXhatbwd; }else{ XhatFwdVector[fwdIdx].second -= newXhatfwd; XhatBwdVector[bwdIdx].second = newXhatbwd; } } inline bool LundFragHandler::aSolution() const { return GammaM2Solution; } //Final Two Hadrons Procedure inline cStringRegionPtr LundFragHandler::finalSR() const { return thefinalSR; } inline const EndPoint& LundFragHandler::firstEP() const { return (finalSR() == CurrentSR())? lastEP() : lastOppEP(); } inline EndPoint& LundFragHandler::secondEP() { return (finalSR() == CurrentSR())? getLastOppEP() : getLastEP(); } inline Hadron& LundFragHandler::secondH() { return (finalSR() == CurrentSR())? lastHadron: newHadron; } // *************** Managemant of produced particles **************** inline void LundFragHandler::clearBuffer() { theBuffer.clear(); } // *************** Standard Interfaced virtual functions ************* inline IBPtr LundFragHandler::clone() const { return new_ptr(*this); } inline IBPtr LundFragHandler::fullclone() const { return new_ptr(*this); } -inline void LundFragHandler::doupdate() throw(UpdateException){} -inline void LundFragHandler::doinit() throw(InitException) {} +inline void LundFragHandler::doupdate() {} +inline void LundFragHandler::doinit() {} inline void LundFragHandler::dofinish() {} }//End_Pythia7_Namespace diff --git a/StringFrag/LundPtGenerator.h b/StringFrag/LundPtGenerator.h --- a/StringFrag/LundPtGenerator.h +++ b/StringFrag/LundPtGenerator.h @@ -1,227 +1,227 @@ // -*- C++ -*- #ifndef PYTHIA7_LundPtGenerator_H #define PYTHIA7_LundPtGenerator_H // This is the declaration of the LundPtGenerator class. #include "FragConfig.h" // #include "LundPtGenerator.fh" // #include "LundPtGenerator.xh" #include "ThePEG/Handlers/PtGenerator.h" namespace Pythia7 { /** * LundPtGenerator is the transverse momentum generator used in the * Lund string fragmentation scheme. It generates the \f$(p_x,p_y)\f$ * components of the transverse momentum of a quark (diquark) in a * \f$q-\bar{q}\f$ (or a \f$(qq)-(\overline{qq})\f$) pair created in * the string colour field, according to the flavour independent * Gaussian distribution in \f$p_x\f$ and \f$p_y\f$ including the * possibility of non-Gaussian tails. * * LundPtGenerator inherits the from the PtGenerator class and * overrides the generate() function. * * Note that the 4-vector version of the transverse momentum is * obtained given the transverse vectors of the StringRegion where the * pair is produced. * * @see \ref LundPtGeneratorInterfaces "The interfaces" defined * for LundPtGenerator. * */ class LundPtGenerator: public ThePEG::PtGenerator { public: /** @name Standard constructors and destructors. */ //@{ /** * Default constructor. */ inline LundPtGenerator(); /** * Copy-constructor. */ inline LundPtGenerator(const LundPtGenerator &); /** * Destructor. */ virtual ~LundPtGenerator(); //@} public: /** @name Virtual functions required by the PtGenerator class. */ //@{ /** * Generate (\f$k_x, k_y\f$) components of the transverse * momentum. They will be distributed as * \f$\exp(-k_\perp^2/\sigma^2)k_\perp dk_\perp\f$ with * \f$k_\perp^2=k_x^2+k_y^2\f$ and \f$\sigma=\f$ Sigma(). */ virtual TransverseMomentum generate() const ; //@} /** @name Access to parameters. */ //@{ /** * Get the gaussian width. */ inline Energy Sigma() const; /** * Get the non-Gaussian fraction of the Gaussian transverse momentum * distribution to be enhanced by the factor nGaussFactor(). */ inline double NGaussFraction() const; /** * Get the non-Gaussian tails enhancement factor. */ inline double NGaussFactor() const; //@} public: /** @name Functions used by the persistent I/O system. */ //@{ /** * Function used to write out object persistently. * @param os the persistent output stream written to. */ void persistentOutput(PersistentOStream & os) const; /** * Function used to read in object persistently. * @param is the persistent input stream read from. * @param version the version number of the object when written. */ void persistentInput(PersistentIStream & is, int version); //@} /** * Standard Init function used to initialize the interface. */ static void Init(); protected: protected: /** @name Clone Methods. */ //@{ /** * Make a simple clone of this object. * @return a pointer to the new object. */ inline virtual IBPtr clone() const; /** Make a clone of this object, possibly modifying the cloned object * to make it sane. * @return a pointer to the new object. */ inline virtual IBPtr fullclone() const; //@} protected: /** @name Standard Interfaced functions. */ //@{ /** * Check sanity of the object during the setup phase. */ - inline virtual void doupdate() throw(UpdateException); + inline virtual void doupdate(); /** * Initialize this object after the setup phase before saving an * EventGenerator to disk. * @throws InitException if object could not be initialized properly. */ - inline virtual void doinit() throw(InitException); + inline virtual void doinit(); /** * Finalize this object. Called in the run phase just after a * run has ended. Used eg. to write out statistics. */ inline virtual void dofinish(); //@} private: /** * The gaussian width. */ Energy sigma; //PARJ(21) /** * The non-Gaussian fraction of the Gaussian transverse momentum * distribution to be enhanced by the factor nGaussFactor(). */ double nGaussfraction; //PARJ(23) /** * The non-Gaussian tails enhancement factor. */ double nGaussfactor; //PARJ(24) /** * Describe a concrete class with persistent data. */ static ClassDescription initLundPtGenerator; /** * Private and non-existent assignment operator. */ LundPtGenerator & operator=(const LundPtGenerator &); }; } namespace ThePEG { /** @cond TRAITSPECIALIZATIONS */ /** * This template specialization informs ThePEG about the base class of * Pythia7::LundPtGenerator. */ template <> struct BaseClassTrait: public ClassTraitsType { /** Typedef of the base class of Pythia7::LundPtGenerator. */ typedef PtGenerator NthBase; }; /** * This template specialization informs ThePEG about the name of the * Pythia7::LundPtGenerator class and the shared object where it is * defined. */ template <> struct ClassTraits : public ClassTraitsBase { /** Return the class name. */ static string className() { return "Pythia7::LundPtGenerator"; } /** Return the name of the shared library to be loaded to get access * to the Pythia7::LundPtGenerator class and every other class it * uses (except the base class). */ static string library() { return "libP7String.so"; } }; /** @endcond */ } #include "LundPtGenerator.icc" #ifndef PYTHIA7_TEMPLATES_IN_CC_FILE // #include "LundPtGenerator.tcc" #endif #endif /* PYTHIA7_LundPtGenerator_H */ diff --git a/StringFrag/LundPtGenerator.icc b/StringFrag/LundPtGenerator.icc --- a/StringFrag/LundPtGenerator.icc +++ b/StringFrag/LundPtGenerator.icc @@ -1,62 +1,62 @@ // -*- C++ -*- // This is the implementation of the inlined member functions of // the LundPtGenerator class. // namespace Pythia7 { inline LundPtGenerator::LundPtGenerator(): sigma(0.36*GeV), nGaussfraction(0.01), nGaussfactor(2.){} inline LundPtGenerator::LundPtGenerator(const LundPtGenerator & x) : PtGenerator(x), sigma(x.sigma), nGaussfraction(x.nGaussfraction), nGaussfactor(x.nGaussfactor) {} // Accessors inline Energy LundPtGenerator::Sigma() const { return sigma; } inline double LundPtGenerator::NGaussFraction() const { return nGaussfraction; } inline double LundPtGenerator::NGaussFactor() const { return nGaussfactor; } // *** Standard Interfaced functions *** inline IBPtr LundPtGenerator::clone() const{ return new_ptr(*this); } inline IBPtr LundPtGenerator::fullclone() const{ return new_ptr(*this); } -inline void LundPtGenerator::doupdate() throw(UpdateException) {} +inline void LundPtGenerator::doupdate() {} -inline void LundPtGenerator::doinit() throw(InitException) {} +inline void LundPtGenerator::doinit() {} inline void LundPtGenerator::dofinish() { } /* inline void LundPtGenerator:: - rebind(const TranslationMap & trans) throw(RebindException) { + rebind(const TranslationMap & trans) { // dummy = trans.translate(dummy); PtGenerator::rebind(trans); } inline IVector LundPtGenerator::getReferences() { IVector ret = PtGenerator::getReferences(); // ret.push_back(dummy); return ret; } */ } diff --git a/StringFrag/LundZGenerator.h b/StringFrag/LundZGenerator.h --- a/StringFrag/LundZGenerator.h +++ b/StringFrag/LundZGenerator.h @@ -1,328 +1,328 @@ // -*- C++ -*- #ifndef PYTHIA7_LundZGenerator_H #define PYTHIA7_LundZGenerator_H // This is the declaration of the LundZGenerator class. #include "FragConfig.h" // #include "LundZGenerator.fh" // #include "LundZGenerator.xh" #include "ThePEG/Handlers/ZGenerator.h" namespace Pythia7 { /** * The LundZGenerator generates longitudinal scaling variable z of * hadron produced in the Lund string fragmentation scheme, according * to the Lund Symmetric Fragmentation Function, * \f$f(z)=(1/z^{c})(1-z)^{a}exp(-bm_\perp^2/z)\f$, where the \f$a\f$, * \f$b\f$ and \f$c\f$ factors are determined by the setShape() * function. * * For diuark production there is an enhancement of the effective * \f$a\f$ parameter (see deltaDQ). * * A heavy endpoint quark (above c quark) is treated according to the * Bowler modification of the Lund Symmetric fragmentation function. * (see the rQ() method). * * The LundZGenerator inherits all the necessary interfaces from the * ZGenerator class. * * @see \ref LundZGeneratorInterfaces "The interfaces" * defined for LundZGenerator. */ class LundZGenerator: public ThePEG::ZGenerator { public: /** @name Standard constructors and destructors. */ //@{ /** * Default constructor. */ inline LundZGenerator(); /** * Copy-constructor. */ inline LundZGenerator(const LundZGenerator &); /** * Destructor. */ virtual ~LundZGenerator(); //@} public: /** @name Virtual functions mandated by the ZGenerator base class. */ //@{ /** * generate the scaling variable z of hadrons created at each step * of the fragmentation procedure, given the two hadron constituents * \a lastPD leftover at the previous step, and the \a newPD newly * created in the current step and the hadron transverse mass * squared \a mT2. */ virtual double generate(cPDPtr lastPD, cPDPtr newPD, Energy2 mT2) const; /** * Return the default value of the \f$a\f$ parameter of the Lund Symmetric * fragmentation function */ inline double aSym() const; /** * Return the default value of the \f$b\f$ parameter of the Lund * Symmetric fragmentation function */ inline InvEnergy2 bSym() const; //@} public: /** @name Functions used by the persistent I/O system. */ //@{ /** * Function used to write out object persistently. * @param os the persistent output stream written to. */ void persistentOutput(PersistentOStream & os) const; /** * Function used to read in object persistently. * @param is the persistent input stream read from. * @param version the version number of the object when written. */ void persistentInput(PersistentIStream & is, int version); //@} /** * Standard Init function used to initialize the interface. */ static void Init(); protected: /** * Determine the \f$a\f$, \f$b\f$ and \f$c\f$ parameters of the * fragmentation function parametrization, given the flavour content * of the two end-points \a lastPD and \a newPD and the hadron \a * mT2. */ virtual void setShape(cPDPtr lastPD, cPDPtr newPD, Energy2 mT2) const; /** * Return the value of the \f$r_Q\f$ parameter of the Bowler * parametrization given the the heavy quark id number, \a hf. Note * that the same \f$r_Q\f$ value is returned for all \a hf above the * c-quark. */ inline virtual double rQ(long hf) const; protected: /** @name Clone Methods. */ //@{ /** * Make a simple clone of this object. * @return a pointer to the new object. */ inline virtual IBPtr clone() const; /** Make a clone of this object, possibly modifying the cloned object * to make it sane. * @return a pointer to the new object. */ inline virtual IBPtr fullclone() const; //@} protected: /** @name Standard Interfaced functions. */ //@{ /** * Check sanity of the object during the setup phase. */ - inline virtual void doupdate() throw(UpdateException); + inline virtual void doupdate(); /** * Initialize this object after the setup phase before saving an * EventGenerator to disk. * @throws InitException if object could not be initialized properly. */ - inline virtual void doinit() throw(InitException); + inline virtual void doinit(); /** * Finalize this object. Called in the run phase just after a * run has ended. Used eg. to write out statistics. */ inline virtual void dofinish(); //@} private: /** * Return the \f$a\f$ factor of the fragmentation function * parametrization. */ inline double af() const; /** * Return the \f$b m_\perp^2\f$ factor of the fragmentation function * parametrization. */ inline double bf() const; /** * Return the \f$c\f$ factor of the fragmentation function * parametrization. */ inline double cf() const; /** * Return true when \a zm is below the minimal * value for Zmax. */ inline bool smallZmax(double zm) const; /** * Return true when \a zm is above the maximal value for Zmax. */ inline bool largeZmax(double zm) const; /** * Return true when both \a zm and \a bmt2 are large */ inline bool largeZmax(double zm, double bmt2) const; /** * Return true when \f$c\f$ is close to 1. */ inline bool cCloseToOne() const; /** * Return true when \f$c\f$ is close to \f$a\f$. */ inline bool cCloseToA() const; private: /** * The default \f$a\f$ parameter of the Lund Symmetric fragmentation * function */ double asym; // PARJ(41) /** * The default \f$b\f$ parameter of the Lund Symmetric fragmentation * function */ InvEnergy2 bsym; // PARJ(42) /** * The amount by which the effective a\f$a\f$ parameter in the Lund * flavour dependent symmetric fragmentation function is assumed to * be larger than the default \f$a\f$ when diquarks are produced. */ double deltaDQ; // PARJ(45) /** * The value of the \f$r_Q\f$ parameter of the Bowler * parametrization for all quarks heavier than the c-quark. */ double rQc; // PARJ(46) /** * Current value of \f$bm_\perp^2\f$. */ mutable double bmT2; /** * Current value of \f$a\f$. */ mutable double theAf; /** * Current value of \f$c\f$. */ mutable double theCf; /** * Init Interface Description/Map */ static ClassDescription initLundZGenerator; /** * Private and non-existent assignment operator. */ LundZGenerator & operator=(const LundZGenerator &); }; } namespace ThePEG { /** @cond TRAITSPECIALIZATIONS */ /** * This template specialization informs ThePEG about the base class of * Pythia7::LundZGenerator. */ template <> struct BaseClassTrait: public ClassTraitsType { /** Typedef of the base class of Pythia7::LundZGenerator. */ typedef ZGenerator NthBase; }; /** * This template specialization informs ThePEG about the name of the * Pythia7::LundZGenerator class and the shared object where it is * defined. */ template <> struct ClassTraits : public ClassTraitsBase { /** Return the class name. */ static string className() { return "Pythia7::LundZGenerator"; } /** * Return the name of the shared library to be loaded to get access * to the Pythia7::LundZGenerator class and every other class it * uses (except the base class). */ static string library() { return "libP7String.so"; } }; /** @endcond */ } #include "LundZGenerator.icc" #ifndef PYTHIA7_TEMPLATES_IN_CC_FILE // #include "LundZGenerator.tcc" #endif #endif /* PYTHIA7_LundZGenerator_H */ diff --git a/StringFrag/LundZGenerator.icc b/StringFrag/LundZGenerator.icc --- a/StringFrag/LundZGenerator.icc +++ b/StringFrag/LundZGenerator.icc @@ -1,89 +1,89 @@ // -*- C++ -*- // // This is the implementation of the inlined member functions of // the LundZGenerator class. // namespace Pythia7 { inline LundZGenerator::LundZGenerator() : asym(0.3), bsym(0.58/GeV2), deltaDQ(0.5), rQc(1.0) {} inline LundZGenerator::LundZGenerator(const LundZGenerator & x) : ZGenerator(x), asym(x.asym), bsym(x.bsym), deltaDQ(x.deltaDQ), rQc(x.rQc) {} // *** Accessors *** inline double LundZGenerator::aSym() const { return asym; } inline InvEnergy2 LundZGenerator::bSym() const { return bsym; } inline double LundZGenerator::af() const { return theAf; } inline double LundZGenerator::bf() const { return bmT2; } inline double LundZGenerator::cf() const { return theCf; } // *** Helpers *** inline bool LundZGenerator::smallZmax(double zm) const { return (zm < 0.1); } inline bool LundZGenerator::largeZmax(double zm) const { return ( zm > 0.85 && bmT2 > 1.0 ); } inline bool LundZGenerator::largeZmax(double zm, double bmt2) const { return ( zm > 0.85 && bmt2 > 1.0 ); } inline bool LundZGenerator::cCloseToOne() const { return ( abs(cf()-1.0) <= 0.01 ); } inline bool LundZGenerator::cCloseToA() const { return ( abs(cf() - af()) < 0.01 ); } inline double LundZGenerator::rQ(long hf) const{ return rQc; } // *** Standard Interfaced Functions. *** inline IBPtr LundZGenerator::clone() const { return new_ptr(*this); } inline IBPtr LundZGenerator::fullclone() const { return new_ptr(*this); } -inline void LundZGenerator::doupdate() throw(UpdateException) {} +inline void LundZGenerator::doupdate() {} -inline void LundZGenerator::doinit() throw(InitException) {} +inline void LundZGenerator::doinit() {} inline void LundZGenerator::dofinish() {} } diff --git a/StringFrag/StringCollapser.h b/StringFrag/StringCollapser.h --- a/StringFrag/StringCollapser.h +++ b/StringFrag/StringCollapser.h @@ -1,197 +1,196 @@ // -*- C++ -*- #ifndef PYTHIA7_StringCollapser_H #define PYTHIA7_StringCollapser_H // This is the declaration of the StringCollapser class. #include "Pythia7/Config/Pythia7.h" #include "ThePEG/Handlers/ClusterCollapser.h" // #include "StringCollapser.fh" // #include "StringCollapser.xh" namespace Pythia7 { /** * StringCollapser is the class used by the LundFragHandler class to * collapse strings which are deemed too small to fragment into one or * two hadrons. Currently this class does not introduce any * functionality on top the ClusterCollapser base class. * * @see \ref StringCollapserInterfaces "The interfaces" * defined for StringCollapser. */ class StringCollapser: public ClusterCollapser { public: /** @name Standard constructors and destructors. */ //@{ /** * Default constructor. */ inline StringCollapser(); /** * Copy-constructor. */ inline StringCollapser(const StringCollapser &); /** * Destructor. */ virtual ~StringCollapser(); //@} public: /** @name Functions used by the persistent I/O system. */ //@{ /** * Function used to write out object persistently. * @param os the persistent output stream written to. */ void persistentOutput(PersistentOStream & os) const; /** * Function used to read in object persistently. * @param is the persistent input stream read from. * @param version the version number of the object when written. */ void persistentInput(PersistentIStream & is, int version); //@} /** * Standard Init function used to initialize the interfaces. */ static void Init(); protected: protected: /** @name Clone Methods. */ //@{ /** * Make a simple clone of this object. * @return a pointer to the new object. */ inline virtual IBPtr clone() const; /** Make a clone of this object, possibly modifying the cloned object * to make it sane. * @return a pointer to the new object. */ inline virtual IBPtr fullclone() const; //@} protected: protected: /** @name Standard Interfaced functions. */ //@{ /** * Check sanity of the object during the setup phase. */ - inline virtual void doupdate() throw(UpdateException); + inline virtual void doupdate(); /** * Initialize this object after the setup phase before saving an * EventGenerator to disk. * @throws InitException if object could not be initialized properly. */ - inline virtual void doinit() throw(InitException); + inline virtual void doinit(); /** * Initialize this object. Called in the run phase just before * a run begins. */ inline virtual void doinitrun(); /** * Finalize this object. Called in the run phase just after a * run has ended. Used eg. to write out statistics. */ inline virtual void dofinish(); /** * Rebind pointer to other Interfaced objects. Called in the setup phase * after all objects used in an EventGenerator has been cloned so that * the pointers will refer to the cloned objects afterwards. * @param trans a TranslationMap relating the original objects to * their respective clones. * @throws RebindException if no cloned object was found for a given * pointer. */ - inline virtual void rebind(const TranslationMap & trans) - throw(RebindException); + inline virtual void rebind(const TranslationMap & trans); /** * Return a vector of all pointers to Interfaced objects used in this * object. * @return a vector of pointers. */ inline virtual IVector getReferences(); //@} private: /** * Describe a concrete class with persistent data. */ static ClassDescription initStringCollapser; /** * Private and non-existent assignment operator. */ StringCollapser & operator=(const StringCollapser &); }; } namespace ThePEG { /** @cond TRAITSPECIALIZATIONS */ /** * This template specialization informs ThePEG about the base class of * Pythia7::StringCollapser. */ template <> struct BaseClassTrait: public ClassTraitsType { /** Typedef of the base class of Pythia7::StringCollapser. */ typedef ClusterCollapser NthBase; }; /** * This template specialization informs ThePEG about the name of the * Pythia7::StringCollapser class and the shared object where it * is defined. */ template <> struct ClassTraits : public ClassTraitsBase { /** Return the class name. */ static string className() { return "Pythia7::StringCollapser"; } /** * Return the name of the shared library to be loaded to get access * to the Pythia7::StringCollapser class and every other class * it uses (except the base class). */ static string library() { return "libP7String.so"; } }; /** @endcond */ } #include "StringCollapser.icc" #ifndef PYTHIA7_TEMPLATES_IN_CC_FILE // #include "StringCollapser.tcc" #endif #endif /* PYTHIA7_StringCollapser_H */ diff --git a/StringFrag/StringCollapser.icc b/StringFrag/StringCollapser.icc --- a/StringFrag/StringCollapser.icc +++ b/StringFrag/StringCollapser.icc @@ -1,64 +1,63 @@ // -*- C++ -*- // // This is the implementation of the inlined member functions of // the StringCollapser class. // namespace Pythia7 { inline StringCollapser::StringCollapser() {} inline StringCollapser::StringCollapser(const StringCollapser & x) : ClusterCollapser(x) {} inline IBPtr StringCollapser::clone() const { return new_ptr(*this); } inline IBPtr StringCollapser::fullclone() const { return new_ptr(*this); } -inline void StringCollapser::doupdate() throw(UpdateException) { +inline void StringCollapser::doupdate(){ ClusterCollapser::doupdate(); // First update base class. bool redo = touched(); // redo if touched. // UpdateChecker::check(aDependentMember, redo); // Update referenced objects on which this depends redo is set to true // if the dependent object is touched. // for_each(ContainerOfDependencies, UpdateChecker(redo)); // Update a container of references. // for_each(MapOfDependencies, UpdateMapChecker(redo)); // Update a map of references. if ( !redo ) return; // return if nothing has been touched. Otherwise do the actual update. // touch() // Touch if anything has changed. } -inline void StringCollapser::doinit() throw(InitException) { +inline void StringCollapser::doinit() { ClusterCollapser::doinit(); } inline void StringCollapser::dofinish() { ClusterCollapser::dofinish(); } inline void StringCollapser::doinitrun() { ClusterCollapser::doinitrun(); } -inline void StringCollapser::rebind(const TranslationMap & trans) - throw(RebindException) { +inline void StringCollapser::rebind(const TranslationMap & trans) { // dummy = trans.translate(dummy); ClusterCollapser::rebind(trans); } inline IVector StringCollapser::getReferences() { IVector ret = ClusterCollapser::getReferences(); // ret.push_back(dummy); return ret; } }