Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:06:31

0001 // SigmaTotal.h is a part of the PYTHIA event generator.
0002 // Copyright (C) 2024 Torbjorn Sjostrand.
0003 // PYTHIA is licenced under the GNU GPL v2 or later, see COPYING for details.
0004 // Please respect the MCnet Guidelines, see GUIDELINES for details.
0005 
0006 // This file contains classes for cross section parametrizations.
0007 // SigmaTotAux : base class for the different parametrizations.
0008 // SigmaTotal  : top-level class, making use of the classes below.
0009 // SigmaTotOwn : user-set values.
0010 // SigmaSaSDL  : Schuler and Sjostrand, based on Donnachie and Landshoff.
0011 // SigmaMBR    : Min Bias Rockefeller.
0012 // SigmaABMST  : Appleby, Barlow, Molson, Serluca and Toader.
0013 // SigmaRPP    : Review of Particle Physics 2014.
0014 
0015 #ifndef Pythia8_SigmaTotal_H
0016 #define Pythia8_SigmaTotal_H
0017 
0018 #include "Pythia8/Info.h"
0019 #include "Pythia8/ParticleData.h"
0020 #include "Pythia8/PhysicsBase.h"
0021 #include "Pythia8/PythiaStdlib.h"
0022 #include "Pythia8/PythiaComplex.h"
0023 #include "Pythia8/Settings.h"
0024 
0025 namespace Pythia8 {
0026 
0027 //==========================================================================
0028 
0029 // The SigmaTotAux is base class for the different parametrizations
0030 // made accessible via SigmaTotal. Many variables are public, since
0031 // they can only be accessed via the SigmaTotal methods anyway.
0032 
0033 class SigmaTotAux {
0034 
0035 public:
0036 
0037   // Constructor.
0038   SigmaTotAux() : isExpEl(), hasCou(), sigTot(), rhoOwn(), sigEl(), bEl(),
0039     sigTotCou(), sigElCou(), sigXB(), sigAX(), sigXX(), sigAXB(), idA(),
0040     idB(), tryCoulomb(), chgSgn(), tAbsMin(), lambda(), phaseCst(),
0041     particleDataPtr(), rndmPtr() {}
0042 
0043   // Destructor.
0044   virtual ~SigmaTotAux() {};
0045 
0046   // Store pointers and initialize data members.
0047   virtual void init(Info*) = 0;
0048 
0049   // Calculate total cros section only. Only implemented for SigmaSaSDL.
0050   virtual bool calcTot( int, int, double) {return true;}
0051 
0052   // Calculate integrated total/elastic cross sections.
0053   // Usage: calcTotEl( idAin, idBin, sIn, mAin, mBin).
0054   virtual bool calcTotEl( int , int , double , double , double ) {return true;}
0055 
0056   // Store total and elastic cross section properties.
0057   bool   isExpEl, hasCou;
0058   double sigTot, rhoOwn, sigEl, bEl, sigTotCou, sigElCou;
0059 
0060   // Differential elastic cross section, d(sigma_el) / dt.
0061   virtual double dsigmaEl( double , bool = false, bool = false) {return 0.;}
0062 
0063   // Calculate integrated diffractive cross sections.
0064   // Usage: calcDiff(  idAin, idBin, sIn, mAin, mBin).
0065   virtual bool calcDiff(  int , int , double , double , double ) {return true;}
0066 
0067   // Store diffractive cross sections. Possibly also sigmaND.
0068   double sigXB, sigAX, sigXX, sigAXB, sigNDtmp;
0069 
0070   // Differential single diffractive cross section,
0071   // xi * d(sigma_SD) / (dxi dt).
0072   virtual double dsigmaSD( double , double, bool = true, int = 0) {return 0.;}
0073 
0074   // Possibility to separate xi and t choices for diffraction.
0075   virtual bool splitDiff() {return false;}
0076 
0077   // Differential double diffractive cross section,
0078   // xi1 * xi2 * d(sigma_DD) / (dxi1 dxi2 dt).
0079   virtual double dsigmaDD( double , double , double , int = 0) {return 0.;}
0080 
0081   // Differential central diffractive cross section,
0082   // xi1 * xi2 * d(sigma_CD) / (dxi1 dxi2 dt1 dt2).
0083   virtual double dsigmaCD( double , double , double , double, int ) {
0084     return 0.;}
0085 
0086   // Minimal central diffractive mass.
0087   virtual double mMinCD() {return 1.;}
0088 
0089   // Standard methods to find t range of a 2 -> 2 process
0090   // and to check whether a given t value is in that range.
0091   pair<double,double> tRange( double sIn, double s1In, double s2In,
0092     double s3In,  double s4In) {
0093     double lambda12 = pow2( sIn - s1In - s2In) - 4. * s1In * s2In;
0094     double lambda34 = pow2( sIn - s3In - s4In) - 4. * s3In * s4In;
0095     if (lambda12 < 0. || lambda34 < 0.) return make_pair( 0., 0.);
0096     double tLow = -0.5 * (sIn - (s1In + s2In + s3In + s4In) + (s1In - s2In)
0097       * (s3In - s4In) / sIn + sqrtpos(lambda12 *  lambda34) / sIn);
0098     double tUpp = ( (s3In - s1In) * (s4In - s2In) + (s1In + s4In - s2In - s3In)
0099       * (s1In * s4In - s2In * s3In) / sIn ) / tLow;
0100     return make_pair( tLow, tUpp); }
0101   bool tInRange( double tIn, double sIn, double s1In, double s2In,
0102     double s3In,  double s4In) {
0103     pair<double, double> tRng = tRange( sIn, s1In, s2In, s3In, s4In);
0104     return (tIn > tRng.first && tIn < tRng.second); }
0105 
0106   // Commonly used proton form factor.
0107   double pFormFac(double tIn) {return (4. * SPROTON - 2.79 * tIn)
0108     / ((4. * SPROTON - tIn) * pow2(1. - tIn / 0.71)); }
0109 
0110 protected:
0111 
0112   // Constants: could only be changed in the code itself.
0113   static const int    NPOINTS;
0114   static const double ALPHAEM, CONVERTEL, MPROTON, SPROTON, MPION, SPION,
0115                       GAMMAEUL, TABSREF, TABSMAX, MINSLOPEEL;
0116 
0117   // Initialization data, normally only set once.
0118   int    idA, idB;
0119 
0120   // Add Coulomb corrections to the elastic cross section.
0121   bool           tryCoulomb;
0122   double         chgSgn, tAbsMin, lambda, phaseCst;
0123   virtual bool   initCoulomb(Settings& settings,
0124     ParticleData* particleDataPtrIn);
0125   virtual bool   addCoulomb();
0126   virtual double dsigmaElCoulomb(double t);
0127 
0128   // Pointer to the particle data table.
0129   ParticleData*  particleDataPtr;
0130 
0131   // Pointer to the random number generator.
0132   Rndm*          rndmPtr;
0133 
0134 };
0135 
0136 //==========================================================================
0137 
0138 // The SigmaTotal class contains parametrizations of total, elastic and
0139 // diffractive cross sections, and of the respective slope parameter.
0140 
0141 class SigmaTotal : public PhysicsBase {
0142 
0143 public:
0144 
0145   // Constructor.
0146   SigmaTotal() : isCalc(false), ispp(), modeTotEl(), modeTotElNow(),
0147     modeDiff(), modeDiffNow(), idAbsA(), idAbsB(), s(), sigND(),
0148     sigTotElPtr(nullptr), sigDiffPtr(nullptr) {};
0149 
0150   // Destructor.
0151   virtual ~SigmaTotal() { if (sigTotElPtr) delete sigTotElPtr;
0152     if (sigDiffPtr) delete sigDiffPtr; }
0153 
0154   // Store pointers and initialize data members.
0155   void   init();
0156 
0157   // Calculate, or recalculate for new beams or new energy.
0158   bool   calc( int idA, int idB, double eCM);
0159 
0160   // Confirm that initialization worked.
0161   bool   hasSigmaTot()  {return isCalc;}
0162 
0163   // Total and integrated elastic cross sections.
0164   double sigmaTot()     {return sigTotElPtr->sigTotCou;}
0165   double rho()          {return sigTotElPtr->rhoOwn;}
0166   double sigmaEl()      {return sigTotElPtr->sigElCou;}
0167   bool   bElIsExp()     {return sigTotElPtr->isExpEl;}
0168   double bSlopeEl()     {return sigTotElPtr->bEl;}
0169   bool   hasCoulomb()   {return sigTotElPtr->hasCou;}
0170 
0171   // Total and elastic cross section.
0172   bool calcTotEl( int idAin, int idBin, double sIn, double mAin, double mBin) {
0173     return sigTotElPtr->calcTotEl( idAin, idBin, sIn, mAin, mBin); }
0174 
0175   // Differential elastic cross section.
0176   double dsigmaEl( double t, bool useCoulomb = false,
0177     bool onlyPomerons = false) {
0178     return sigTotElPtr->dsigmaEl( t, useCoulomb, onlyPomerons); }
0179 
0180   // Integrated diffractive cross sections.
0181   double sigmaXB()  const {return sigDiffPtr->sigXB;}
0182   double sigmaAX()  const {return sigDiffPtr->sigAX;}
0183   double sigmaXX()  const {return sigDiffPtr->sigXX;}
0184   double sigmaAXB() const {return sigDiffPtr->sigAXB;}
0185   double sigmaND()  const {return sigND;}
0186 
0187   // Differential single diffractive cross section.
0188   double dsigmaSD( double xi, double t, bool isXB = true, int step = 0) {
0189     return sigDiffPtr->dsigmaSD( xi, t, isXB, step); }
0190 
0191   // Possibility to separate xi and t choices for diffraction.
0192   virtual bool splitDiff() {return sigDiffPtr->splitDiff();}
0193 
0194   // Differential double diffractive cross section.
0195   double dsigmaDD( double xi1, double xi2, double t, int step = 0) {
0196     return sigDiffPtr->dsigmaDD( xi1, xi2, t, step); }
0197 
0198   // Differential central diffractive cross section.
0199   double dsigmaCD( double xi1, double xi2, double t1, double t2, int step = 0)
0200     { return sigDiffPtr->dsigmaCD( xi1, xi2, t1, t2, step); }
0201 
0202   // Minimal central diffractive mass.
0203   double mMinCD() {return sigDiffPtr->mMinCD();}
0204 
0205   // Sample the VMD states for resolved photons.
0206   void chooseVMDstates(int idA, int idB, double eCM, int processCode);
0207 
0208   // Standard methods to find t range of a 2 -> 2 process
0209   // and to check whether a given t value is in that range.
0210   pair<double,double> tRange( double sIn, double s1In, double s2In,
0211     double s3In,  double s4In) {
0212     return sigDiffPtr->tRange( sIn, s1In, s2In, s3In, s4In); }
0213   bool tInRange( double tIn, double sIn, double s1In, double s2In,
0214     double s3In,  double s4In) {
0215     return sigDiffPtr->tInRange( tIn, sIn, s1In, s2In, s3In, s4In); }
0216 
0217 private:
0218 
0219   // Constants: could only be changed in the code itself.
0220   static const double MMIN;
0221 
0222   // Initialization data, normally only set once.
0223   bool   isCalc, ispp;
0224 
0225   int    modeTotEl, modeTotElNow, modeDiff, modeDiffNow, idAbsA, idAbsB,
0226          idAOld, idBOld, modeTotElOld, modeDiffOld;
0227   double s, sigND, eCMOld;
0228 
0229   // Pointer to class that handles total and elastic cross sections.
0230   SigmaTotAux*  sigTotElPtr;
0231 
0232   // Pointer to class that handles diffractive cross sections.
0233   SigmaTotAux*  sigDiffPtr;
0234 
0235 };
0236 
0237 //==========================================================================
0238 
0239 // The SigmaTotOwn class parametrizes total, elastic and diffractive
0240 // cross sections by user settings.
0241 
0242 class SigmaTotOwn : public SigmaTotAux {
0243 
0244 public:
0245 
0246   // Constructor.
0247   SigmaTotOwn() : dampenGap(), pomFlux(), s(), a0(), ap(), b0(), A1(), A2(),
0248     A3(), a1(), a2(), a3(), bMinDD(), ygap(), ypow(), expPygap(), mMinCDnow(),
0249     wtNow(), yNow(), yNow1(), yNow2(), b(), b1(), b2(), Q(), Q1(),
0250     Q2() {};
0251 
0252   // Store pointers and initialize data members.
0253   virtual void init(Info* infoPtrIn);
0254 
0255   // Calculate integrated total/elastic cross sections.
0256   virtual bool calcTotEl( int idAin, int idBin, double , double , double);
0257 
0258   // Differential elastic cross section.
0259   virtual double dsigmaEl( double t, bool useCoulomb = false, bool = false);
0260 
0261   // Calculate integrated diffractive cross sections.
0262   virtual bool calcDiff(  int , int , double sIn, double , double ) {
0263     s = sIn; return true;}
0264 
0265   // Differential single diffractive cross section.
0266   virtual double dsigmaSD( double xi, double t, bool = true, int = 0);
0267 
0268   // Differential double diffractive cross section.
0269   virtual double dsigmaDD( double xi1, double xi2, double t, int = 0);
0270 
0271   // Differential central diffractive cross section.
0272   virtual double dsigmaCD( double xi1, double xi2, double t1, double t2,
0273     int = 0);
0274 
0275   // Minimal central diffractive mass.
0276   virtual double mMinCD() {return mMinCDnow;}
0277 
0278 private:
0279 
0280   // Initialization data, normally only set once.
0281   bool   dampenGap;
0282   int    pomFlux;
0283   double s, a0, ap, b0, A1, A2, A3, a1, a2, a3, bMinDD, ygap, ypow, expPygap,
0284          mMinCDnow, wtNow, yNow, yNow1, yNow2, b, b1, b2, Q, Q1, Q2;
0285 
0286 };
0287 
0288 //==========================================================================
0289 
0290 // The SigmaSaSDL class parametrizes total, elastic and diffractive
0291 // cross sections according to Schuler and Sjostrand, starting from
0292 // Donnachie and Landshoff.
0293 
0294 class SigmaSaSDL : public SigmaTotAux {
0295 
0296 public:
0297 
0298   // Constructor.
0299   SigmaSaSDL() : doDampen(), zeroAXB(), swapped(), sameSign(), idAbsA(),
0300     idAbsB(), iProc(), iHadA(), iHadB(), iHadAtmp(), iHadBtmp(), iProcVP(),
0301     iProcVV(), s(), mA(), mB(), bA(), bB(), maxXBOwn(), maxAXOwn(), maxXXOwn(),
0302     maxAXBOwn(), epsSaS(), sigmaPomP(), mPomP(), pPomP(), sigAXB2TeV(),
0303     mMin0(), cRes(), mRes0(), mMinCDnow(), alP2(), s0(), mMinXB(), mMinAX(),
0304     mMinAXB(), mResXB(), mResAX(), sResXB(), sResAX(), wtNow(), mAtmp(),
0305     mBtmp(), multVP(), multVV(), infoPtr() {};
0306 
0307   // Store pointers and initialize data members.
0308   virtual void init(Info* infoPtrIn);
0309 
0310   // Fast method uniquely to return total cross section.
0311   double sigmaTotal( int idAin, int idBin, double sIn, double mAin,
0312     double mBin);
0313 
0314   // Calculate integrated total/elastic cross sections.
0315   virtual bool calcTotEl( int idAin, int idBin, double sIn, double mAin,
0316     double mBin);
0317 
0318   // Differential elastic cross section.
0319   virtual double dsigmaEl( double t, bool useCoulomb = false, bool = false);
0320 
0321   // Calculate integrated diffractive cross sections.
0322   virtual bool calcDiff(  int idAin, int idBin, double sIn, double mAin,
0323     double mBin);
0324 
0325   // Differential single diffractive cross section.
0326   virtual double dsigmaSD( double xi, double t, bool isXB, int = 0);
0327 
0328   // Differential double diffractive cross section.
0329   virtual double dsigmaDD( double xi1, double xi2, double t, int = 0);
0330 
0331   // Differential central diffractive cross section.
0332   virtual double dsigmaCD( double xi1, double xi2, double t1, double t2,
0333     int = 0);
0334 
0335   // Minimal central diffractive mass.
0336   virtual double mMinCD() {return mMinCDnow;}
0337 
0338 private:
0339 
0340   // Constants: could only be changed in the code itself.
0341   static const int    IHADATABLE[], IHADBTABLE[], ISDTABLE[], IDDTABLE[], NVMD;
0342   static const double EPSILON, ETA, X[], Y[], BETA0[], BHAD[], ALPHAPRIME,
0343                       CONVERTSD, CONVERTDD, VMDMASS[4], GAMMAFAC[4],
0344                       CSD[24][8], CDD[22][9], DIFFTHR, DIFFMULT;
0345 
0346   // Initialization data, normally only set once, and result of calculation.
0347   bool   doDampen, zeroAXB, swapped, sameSign;
0348   int    idAbsA, idAbsB, iProc, iHadA, iHadB, iHadAtmp[4],
0349          iHadBtmp[4], iProcVP[4], iProcVV[4][4];
0350   double s, mA, mB, bA, bB, maxXBOwn, maxAXOwn, maxXXOwn, maxAXBOwn, epsSaS,
0351          sigmaPomP, mPomP, pPomP, sigAXB2TeV, mMin0,  cRes, mRes0, mMinCDnow,
0352          alP2, s0, mMinXB,  mMinAX, mMinAXB, mResXB, mResAX, sResXB,
0353          sResAX, wtNow, mAtmp[4], mBtmp[4], multVP[4], multVV[4][4];
0354 
0355   // Find combination of incoming beams.
0356   bool findBeamComb( int idAin, int idBin, double mAin, double mBin);
0357 
0358   // Pointer to various information on the generation.
0359   Info* infoPtr;
0360 
0361 };
0362 
0363 //==========================================================================
0364 
0365 // The SigmaMBR class parametrizes total and elastic cross sections
0366 // according to the Minimum Bias Rockefeller (MBR) model.
0367 
0368 class SigmaMBR : public SigmaTotAux {
0369 
0370 public:
0371 
0372   // Constructor.
0373   SigmaMBR() : s(), sigSD(), sigDD(), sigCD(), eps(), alph(), beta0gev(),
0374     beta0mb(), sigma0mb(), sigma0gev(), m2min(), dyminSDflux(),
0375     dyminDDflux(), dyminCDflux(), dyminSD(), dyminDD(), dyminCD(),
0376     dyminSigSD(), dyminSigDD(), dyminSigCD(), a1(), a2(), b1(), b2(),
0377     sdpmax(), ddpmax(), dpepmax() {};
0378 
0379   // Initialize data members.
0380   virtual void init(Info* infoPtrIn);
0381 
0382   // Calculate integrated total/elastic cross sections.
0383   virtual bool calcTotEl( int idAin, int idBin, double sIn, double , double );
0384 
0385   // Differential elastic cross section.
0386   virtual double dsigmaEl(double t, bool useCoulomb = false, bool = false);
0387 
0388   // Calculate integrated diffractive cross sections.
0389   virtual bool calcDiff(  int , int , double sIn, double , double );
0390 
0391   // In MBR choice of xi and t values are separated.
0392   virtual bool splitDiff() {return true;}
0393 
0394   // Differential single diffractive cross section.
0395   virtual double dsigmaSD( double xi, double t, bool = true, int step = 0);
0396 
0397   // Differential double diffractive cross section.
0398   virtual double dsigmaDD( double xi1, double xi2, double t, int step = 0);
0399 
0400   // Differential central diffractive cross section.
0401   virtual double dsigmaCD( double xi1, double xi2, double t1, double t2,
0402     int step = 0);
0403 
0404   // Minimal central diffractive mass.
0405   virtual double mMinCD() {return sqrt(m2min);}
0406 
0407 private:
0408 
0409   // Integration of MBR cross sections and form factor approximation.
0410   static const int    NINTEG, NINTEG2;
0411   static const double FFA1, FFA2, FFB1, FFB2;
0412 
0413   // Parameters of MBR model.
0414   double s, sigSD, sigDD, sigCD, eps, alph, beta0gev,
0415          beta0mb, sigma0mb, sigma0gev, m2min, dyminSDflux, dyminDDflux,
0416          dyminCDflux, dyminSD, dyminDD, dyminCD, dyminSigSD, dyminSigDD,
0417          dyminSigCD, a1, a2, b1, b2, sdpmax, ddpmax, dpepmax;
0418 
0419   // The error function erf(x) should normally be in your math library,
0420   // but if not uncomment this simple parametrization by Sergei Winitzki.
0421   //double erf(double x) { double x2 = x * x; double kx2 = 0.147 * x2;
0422   //  double tmp = sqrt(1. - exp(-x2 * (4./M_PI + kx2) / (1. + kx2)));
0423   //  return ((x >= 0.) ? tmp : -tmp); }
0424 
0425 };
0426 
0427 //==========================================================================
0428 
0429 // The SigmaABMST class parametrizes total and elastic cross sections
0430 // according to Appleby, Barlow, Molson, Serluca and Toader (ABMST).
0431 
0432 class SigmaABMST : public SigmaTotAux {
0433 
0434 public:
0435 
0436   // Constructor.
0437   SigmaABMST() : ispp(), dampenGap(), useBMin(), modeSD(), modeDD(), modeCD(),
0438     s(), facEl(), m2minp(), m2minm(), alp0(), alpt(), s0(), c0(), ygap(),
0439     ypow(), expPygap(), multSD(), powSD(), multDD(), powDD(), multCD(),
0440     powCD(), mMinCDnow(), bMinSD(), bMinDD(), bMinCD() {};
0441 
0442   // Initialize data members.
0443   virtual void init(Info* infoPtrIn);
0444 
0445   // Calculate integrated total/elastic cross sections.
0446   virtual bool calcTotEl( int idAin, int idBin, double sIn, double , double );
0447 
0448   // Differential elastic cross section.
0449   virtual double dsigmaEl( double t, bool useCoulomb = false,
0450     bool onlyPomerons = false) {
0451     return facEl * pow2(abs(amplitude( t, useCoulomb, onlyPomerons)));}
0452 
0453   // Calculate integrated diffractive cross sections.
0454   virtual bool calcDiff(  int idAin, int idBin, double sIn, double , double );
0455 
0456   // Differential single diffractive cross section.
0457   virtual double dsigmaSD( double xi, double t, bool = true , int = 0);
0458 
0459   // Differential double diffractive cross section.
0460   virtual double dsigmaDD( double xi1, double xi2, double t, int = 0);
0461 
0462   // Differential central diffractive cross section.
0463   virtual double dsigmaCD( double xi1, double xi2, double t1, double t2,
0464     int = 0);
0465 
0466   // Minimal central diffractive mass.
0467   virtual double mMinCD() {return mMinCDnow;}
0468 
0469 private:
0470 
0471   // Constants: could only be changed in the code itself.
0472   static const bool   MCINTDD;
0473   static const int    NPOINTSTSD, NPOINTSTDD, NPOINTMCDD, NPOINTMCCD;
0474   static const double EPSI[], ALPP[], NORM[], SLOPE[], FRACS[], TRIG[],
0475                       LAM2P, BAPPR[], LAM2FF, MRES[4], WRES[4], CRES[4],
0476                       AFAC[4], BFAC[4], CFAC[4], PPP[4], EPS[2], APR[2],
0477                       CPI[6], CNST[5], XIDIVSD, DXIRAWSD, DLNXIRAWSD,
0478                       XIDIVDD, DXIRAWDD, DLNXIRAWDD, BMCINTDD, BMCINTCD;
0479 
0480   // Initialization data, normally only set once.
0481   bool   ispp, dampenGap, useBMin;
0482   int    modeSD, modeDD, modeCD;
0483   double s, facEl, m2minp, m2minm, alp0[2], alpt[3], s0, c0,
0484          ygap, ypow, expPygap, multSD, powSD, multDD, powDD,
0485          multCD, powCD, mMinCDnow, bMinSD, bMinDD, bMinCD;
0486 
0487   // The scattering amplitude, from which cross sections are derived.
0488   complex amplitude( double t, bool useCoulomb = false,
0489     bool onlyPomerons = false) ;
0490 
0491   // Auxiliary method for repetitive part of amplitude.
0492   complex sModAlp( double sMod, double alpha) {
0493     return exp(complex( 0., -0.5 * M_PI * alpha)) * pow( sMod, alpha); }
0494 
0495   // Core differential single diffractive cross section.
0496   virtual double dsigmaSDcore(double xi, double t);
0497 
0498   // xi * d(sigma_SD) / (dxi dt) integrated over [t_min, t_max].
0499   double dsigmaSDintT( double xi, double tMinIn, double tMaxIn);
0500 
0501   // d(sigma_SD) / (dxi dt) integrated over [xi_min, xi_max] * [t_min, t_max].
0502   double dsigmaSDintXiT( double xiMinIn, double xiMaxIn, double tMinIn,
0503     double tMaxIn );
0504 
0505   // d(sigma_DD) / (dxi1 dxi2 dt) integrated with Monte Carlo sampling.
0506   double dsigmaDDintMC();
0507 
0508   // xi1 * xi2 * d(sigma_DD) / (dxi1 dxi2 dt) integrated over t.
0509   double dsigmaDDintT( double xi1, double xi2, double tMinIn, double tMaxIn);
0510 
0511   // xi1 * d(sigma_DD) / (dxi1 dxi2 dt) integrated over xi2 and t.
0512   double dsigmaDDintXi2T( double xi1, double xi2MinIn, double xi2MaxIn,
0513     double tMinIn, double tMaxIn);
0514 
0515   // d(sigma_DD) / (dxi1 dxi2 dt) integrated over xi1, xi2 and t.
0516   double dsigmaDDintXi1Xi2T( double xi1MinIn, double xi1MaxIn,
0517     double xi2MinIn, double xi2MaxIn, double tMinIn, double tMaxIn);
0518 
0519   // d(sigma_CD) / (dxi1 dxi2 dt1 dt2) integrated with Monte Carlo sampling.
0520   double dsigmaCDintMC();
0521 
0522 };
0523 
0524 //==========================================================================
0525 
0526 // The SigmaRPP class parametrizes total and elastic cross sections
0527 // according to the fit in Review of Particle Physics 2014.
0528 
0529 class SigmaRPP : public SigmaTotAux {
0530 
0531 public:
0532 
0533   // Constructor.
0534   SigmaRPP() : ispp(), s(), facEl() {};
0535 
0536   // Initialize data members.
0537   virtual void init(Info* infoPtrIn) {
0538     tryCoulomb = infoPtrIn->settingsPtr->flag("SigmaElastic:Coulomb");
0539     tAbsMin = infoPtrIn->settingsPtr->parm("SigmaElastic:tAbsMin"); }
0540 
0541   // Calculate integrated total/elastic cross sections.
0542   virtual bool calcTotEl( int idAin, int idBin, double sIn, double , double );
0543 
0544   // Differential elastic cross section.
0545   virtual double dsigmaEl( double t, bool useCoulomb = false, bool = false) {
0546     return facEl * pow2(abs(amplitude( t, useCoulomb))); }
0547 
0548 private:
0549 
0550   // Constants: could only be changed in the code itself.
0551   static const double EPS1[], ALPP[], NORM[], BRPP[], KRPP[], LAM2FF;
0552 
0553   // Initialization data, normally only set once, and result of calculation.
0554   bool   ispp;
0555   double s, facEl;
0556 
0557   // The scattering amplitude, from which cross sections are derived.
0558   complex amplitude( double t, bool useCoulomb = false) ;
0559 
0560   // Auxiliary method for repetitive part of amplitude.
0561   complex sModAlp( double sMod, double alpha) {
0562     return exp(complex( 0., -0.5 * M_PI * alpha)) * pow( sMod, alpha); }
0563 
0564   // Auxiliary methods for Bessel J0 and J1 functions.
0565   complex besJ0( complex x);
0566   complex besJ1( complex x);
0567 
0568 };
0569 
0570 //==========================================================================
0571 
0572 } // end namespace Pythia8
0573 
0574 #endif // Pythia8_SigmaTotal_H