15 #ifndef Pythia8_SigmaTotal_H
16 #define Pythia8_SigmaTotal_H
18 #include "Pythia8/Info.h"
19 #include "Pythia8/ParticleData.h"
20 #include "Pythia8/PythiaStdlib.h"
21 #include "Pythia8/PythiaComplex.h"
22 #include "Pythia8/Settings.h"
44 virtual bool calcTotEl(
int ,
int ,
double ,
double ,
double ) {
return true;}
48 double sigTot, rhoOwn, sigEl, bEl, sigTotCou, sigElCou;
51 virtual double dsigmaEl(
double ,
bool =
false,
bool =
true) {
return 0.;}
55 virtual bool calcDiff(
int ,
int ,
double ,
double ,
double ) {
return true;}
58 double sigXB, sigAX, sigXX, sigAXB;
62 virtual double dsigmaSD(
double ,
double,
bool =
true,
int = 0) {
return 0.;}
65 virtual bool splitDiff() {
return false;}
69 virtual double dsigmaDD(
double ,
double ,
double ,
int = 0) {
return 0.;}
73 virtual double dsigmaCD(
double ,
double ,
double ,
double,
int ) {
77 virtual double mMinCD() {
return 1.;}
81 pair<double,double> tRange(
double sIn,
double s1In,
double s2In,
82 double s3In,
double s4In) {
83 double lambda12 = pow2( sIn - s1In - s2In) - 4. * s1In * s2In;
84 double lambda34 = pow2( sIn - s3In - s4In) - 4. * s3In * s4In;
85 if (lambda12 < 0. || lambda34 < 0.)
return make_pair( 0., 0.);
86 double tLow = -0.5 * (sIn - (s1In + s2In + s3In + s4In) + (s1In - s2In)
87 * (s3In - s4In) / sIn + sqrtpos(lambda12 * lambda34) / sIn);
88 double tUpp = ( (s3In - s1In) * (s4In - s2In) + (s1In + s4In - s2In - s3In)
89 * (s1In * s4In - s2In * s3In) / sIn ) / tLow;
90 return make_pair( tLow, tUpp); }
91 bool tInRange(
double tIn,
double sIn,
double s1In,
double s2In,
92 double s3In,
double s4In) {
93 pair<double, double> tRng = tRange( sIn, s1In, s2In, s3In, s4In);
94 return (tIn > tRng.first && tIn < tRng.second); }
97 double pFormFac(
double tIn) {
return (4. * SPROTON - 2.79 * tIn)
98 / ((4. * SPROTON - tIn) * pow2(1. - tIn / 0.71)); }
103 static const int NPOINTS;
104 static const double ALPHAEM, HBARC2, CONVERTEL, MPROTON, SPROTON, MPION,
105 SPION, GAMMAEUL, TABSREF, TABSMAX, MINSLOPEEL;
112 double chgSgn, tAbsMin, lambda, phaseCst;
113 virtual bool initCoulomb(
Settings& settings,
115 virtual bool addCoulomb();
116 virtual double dsigmaElCoulomb(
double t);
136 SigmaTotal() : isCalc(false), sigTotElPtr(NULL), sigDiffPtr(NULL) {};
139 ~SigmaTotal() {
if (sigTotElPtr)
delete sigTotElPtr;
140 if (sigDiffPtr)
delete sigDiffPtr; }
143 void init( Info* infoPtrIn, Settings& settings,
144 ParticleData* particleDataPtrIn, Rndm* rndmPtrIn);
147 bool calc(
int idA,
int idB,
double eCM);
150 bool hasSigmaTot() {
return isCalc;}
153 double sigmaTot() {
return sigTotElPtr->sigTotCou;}
154 double rho() {
return sigTotElPtr->rhoOwn;}
155 double sigmaEl() {
return sigTotElPtr->sigElCou;}
156 bool bElIsExp() {
return sigTotElPtr->isExpEl;}
157 double bSlopeEl() {
return sigTotElPtr->bEl;}
158 bool hasCoulomb() {
return sigTotElPtr->hasCou;}
161 double dsigmaEl(
double t,
bool useCoulomb =
false,
162 bool onlyPomerons =
false) {
163 return sigTotElPtr->dsigmaEl( t, useCoulomb, onlyPomerons); }
166 double sigmaXB()
const {
return sigDiffPtr->sigXB;}
167 double sigmaAX()
const {
return sigDiffPtr->sigAX;}
168 double sigmaXX()
const {
return sigDiffPtr->sigXX;}
169 double sigmaAXB()
const {
return sigDiffPtr->sigAXB;}
170 double sigmaND()
const {
return sigND;}
173 double dsigmaSD(
double xi,
double t,
bool isXB =
true,
int step = 0) {
174 return sigDiffPtr->dsigmaSD( xi, t, isXB, step); }
177 virtual bool splitDiff() {
return sigDiffPtr->splitDiff();}
180 double dsigmaDD(
double xi1,
double xi2,
double t,
int step = 0) {
181 return sigDiffPtr->dsigmaDD( xi1, xi2, t, step); }
184 double dsigmaCD(
double xi1,
double xi2,
double t1,
double t2,
int step = 0)
185 {
return sigDiffPtr->dsigmaCD( xi1, xi2, t1, t2, step); }
188 double mMinCD() {
return sigDiffPtr->mMinCD();}
192 pair<double,double> tRange(
double sIn,
double s1In,
double s2In,
193 double s3In,
double s4In) {
194 return sigDiffPtr->tRange( sIn, s1In, s2In, s3In, s4In); }
195 bool tInRange(
double tIn,
double sIn,
double s1In,
double s2In,
196 double s3In,
double s4In) {
197 return sigDiffPtr->tInRange( tIn, sIn, s1In, s2In, s3In, s4In); }
202 static const double MMIN;
207 int modeTotEl, modeTotElNow, modeDiff, modeDiffNow, idAbsA, idAbsB;
211 SigmaTotAux* sigTotElPtr;
214 SigmaTotAux* sigDiffPtr;
220 Settings* settingsPtr;
223 ParticleData* particleDataPtr;
247 virtual bool calcTotEl(
int idAin,
int idBin,
double ,
double ,
double);
250 virtual double dsigmaEl(
double t,
bool useCoulomb =
false,
bool =
true);
253 virtual bool calcDiff(
int ,
int ,
double sIn,
double ,
double ) {
254 s = sIn;
return true;}
257 virtual double dsigmaSD(
double xi,
double t,
bool =
true,
int = 0);
260 virtual double dsigmaDD(
double xi1,
double xi2,
double t,
int = 0);
263 virtual double dsigmaCD(
double xi1,
double xi2,
double t1,
double t2,
267 virtual double mMinCD() {
return mMinCDnow;}
274 double s, a0, ap, b0, A1, A2, A3, a1, a2, a3, bMinDD, ygap, ypow, expPygap,
275 mMinCDnow, wtNow, yNow, yNow1, yNow2, b, b1, b2, Q, Q1, Q2;
297 virtual bool calcTotEl(
int idAin,
int idBin,
double sIn,
double mAin,
301 virtual double dsigmaEl(
double t,
bool useCoulomb =
false,
bool =
true);
304 virtual bool calcDiff(
int idAin,
int idBin,
double sIn,
double mAin,
308 virtual double dsigmaSD(
double xi,
double t,
bool isXB,
int = 0);
311 virtual double dsigmaDD(
double xi1,
double xi2,
double t,
int = 0);
314 virtual double dsigmaCD(
double xi1,
double xi2,
double t1,
double t2,
318 virtual double mMinCD() {
return mMinCDnow;}
323 static const int IHADATABLE[], IHADBTABLE[], ISDTABLE[], IDDTABLE[];
324 static const double EPSILON, ETA, X[], Y[], BETA0[], BHAD[], ALPHAPRIME,
325 CONVERTSD, CONVERTDD, VMDMASS[3], GAMMAFAC[3],
326 CSD[10][8], CDD[10][9];
329 bool doDampen, zeroAXB, swapped, sameSign;
330 int idAbsA, idAbsB, iProc, iHadA, iHadB, iHadAtmp[3],
331 iHadBtmp[3], iProcVP[3], iProcVV[3][3];
332 double s, mA, mB, bA, bB, maxXBOwn, maxAXOwn, maxXXOwn, maxAXBOwn, epsSaS,
333 sigmaPomP, mPomP, pPomP, sigAXB2TeV, mMin0, cRes, mRes0, mMinCDnow,
334 alP2, s0, mMinXB, mMinAX, mMinAXB, mResXB, mResAX, sResXB,
335 sResAX, wtNow, mAtmp[3], mBtmp[3], multVP[3], multVV[3][3];
338 bool findBeamComb(
int idAin,
int idBin,
double mAin,
double mBin);
362 virtual bool calcTotEl(
int idAin,
int idBin,
double sIn,
double ,
double );
365 virtual double dsigmaEl(
double t,
bool useCoulomb =
false,
bool =
true);
368 virtual bool calcDiff(
int ,
int ,
double sIn,
double ,
double );
371 virtual bool splitDiff() {
return true;}
374 virtual double dsigmaSD(
double xi,
double t,
bool =
true,
int step = 0);
377 virtual double dsigmaDD(
double xi1,
double xi2,
double t,
int step = 0);
380 virtual double dsigmaCD(
double xi1,
double xi2,
double t1,
double t2,
384 virtual double mMinCD() {
return sqrt(m2min);}
389 static const int NINTEG, NINTEG2;
390 static const double FFA1, FFA2, FFB1, FFB2;
393 double s, sigSD, sigDD, sigCD, eps, alph, beta0gev,
394 beta0mb, sigma0mb, sigma0gev, m2min, dyminSDflux, dyminDDflux,
395 dyminCDflux, dyminSD, dyminDD, dyminCD, dyminSigSD, dyminSigDD,
396 dyminSigCD, a1, a2, b1, b2, sdpmax, ddpmax, dpepmax;
423 virtual bool calcTotEl(
int idAin,
int idBin,
double sIn,
double ,
double );
426 virtual double dsigmaEl(
double t,
bool useCoulomb =
false,
427 bool onlyPomerons =
false) {
428 return facEl * pow2(abs(amplitude( t, useCoulomb, onlyPomerons)));}
431 virtual bool calcDiff(
int idAin,
int idBin,
double sIn,
double ,
double );
434 virtual double dsigmaSD(
double xi,
double t,
bool =
true ,
int = 0);
437 virtual double dsigmaDD(
double xi1,
double xi2,
double t,
int = 0);
440 virtual double dsigmaCD(
double xi1,
double xi2,
double t1,
double t2,
444 virtual double mMinCD() {
return mMinCDnow;}
449 static const bool MCINTDD;
450 static const int NPOINTSTSD, NPOINTSTDD, NPOINTMCDD, NPOINTMCCD;
451 static const double EPSI[], ALPP[], NORM[], SLOPE[], FRACS[], TRIG[],
452 LAM2P, BAPPR[], LAM2FF, MRES[4], WRES[4], CRES[4],
453 AFAC[4], BFAC[4], CFAC[4], PPP[4], EPS[2], APR[2],
454 CPI[6], CNST[5], XIDIVSD, DXIRAWSD, DLNXIRAWSD,
455 XIDIVDD, DXIRAWDD, DLNXIRAWDD, BMCINTDD, BMCINTCD;
458 bool ispp, dampenGap, useBMin;
459 int modeSD, modeDD, modeCD;
460 double s, facEl, m2minp, m2minm, alp0[2], alpt[3], s0, c0,
461 ygap, ypow, expPygap, multSD, powSD, multDD, powDD,
462 multCD, powCD, mMinCDnow, bMinSD, bMinDD, bMinCD;
465 complex amplitude(
double t,
bool useCoulomb =
false,
466 bool onlyPomerons =
false) ;
469 complex sModAlp(
double sMod,
double alpha) {
470 return exp(complex( 0., -0.5 * M_PI * alpha)) * pow( sMod, alpha); }
473 virtual double dsigmaSDcore(
double xi,
double t);
476 double dsigmaSDintT(
double xi,
double tMinIn,
double tMaxIn);
479 double dsigmaSDintXiT(
double xiMinIn,
double xiMaxIn,
double tMinIn,
483 double dsigmaDDintMC();
486 double dsigmaDDintT(
double xi1,
double xi2,
double tMinIn,
double tMaxIn);
489 double dsigmaDDintXi2T(
double xi1,
double xi2MinIn,
double xi2MaxIn,
490 double tMinIn,
double tMaxIn);
493 double dsigmaDDintXi1Xi2T(
double xi1MinIn,
double xi1MaxIn,
494 double xi2MinIn,
double xi2MaxIn,
double tMinIn,
double tMaxIn);
497 double dsigmaCDintMC();
515 tryCoulomb = settings.flag(
"SigmaElastic:Coulomb");
516 tAbsMin = settings.parm(
"SigmaElastic:tAbsMin"); }
519 virtual bool calcTotEl(
int idAin,
int idBin,
double sIn,
double ,
double );
522 virtual double dsigmaEl(
double t,
bool useCoulomb =
false,
bool =
true) {
523 return facEl * pow2(abs(amplitude( t, useCoulomb))); }
528 static const double EPS1[], ALPP[], NORM[], BRPP[], KRPP[], LAM2FF;
535 complex amplitude(
double t,
bool useCoulomb =
false) ;
538 complex sModAlp(
double sMod,
double alpha) {
539 return exp(complex( 0., -0.5 * M_PI * alpha)) * pow( sMod, alpha); }
542 complex besJ0( complex x);
543 complex besJ1( complex x);
551 #endif // Pythia8_SigmaTotal_H