9 #include "MultipartonInteractions.h"
14 #include "SigmaOnia.h"
28 const double SigmaMultiparton::MASSMARGIN = 0.1;
31 const double SigmaMultiparton::OTHERFRAC = 0.2;
37 bool SigmaMultiparton::init(
int inState,
int processLevel, Info* infoPtr,
38 Settings* settingsPtr, ParticleData* particleDataPtr, Rndm* rndmPtrIn,
39 BeamParticle* beamAPtr, BeamParticle* beamBPtr, Couplings* couplingsPtr) {
45 if (sigmaT.size() > 0) {
46 for (
int i = 0; i < int(sigmaT.size()); ++i)
delete sigmaT[i];
49 if (sigmaU.size() > 0) {
50 for (
int i = 0; i < int(sigmaU.size()); ++i)
delete sigmaU[i];
58 sigmaT.push_back(
new Sigma2gg2gg() );
59 sigmaU.push_back(
new Sigma2gg2gg() );
62 }
else if (inState == 1) {
63 sigmaT.push_back(
new Sigma2qg2qg() );
64 sigmaU.push_back(
new Sigma2qg2qg() );
68 sigmaT.push_back(
new Sigma2qq2qq() );
69 sigmaU.push_back(
new Sigma2qq2qq() );
73 if (processLevel > 0) {
75 sigmaT.push_back(
new Sigma2gg2qqbar() );
76 sigmaU.push_back(
new Sigma2gg2qqbar() );
77 sigmaT.push_back(
new Sigma2gg2QQbar(4, 121) );
78 sigmaU.push_back(
new Sigma2gg2QQbar(4, 121) );
79 sigmaT.push_back(
new Sigma2gg2QQbar(5, 123) );
80 sigmaU.push_back(
new Sigma2gg2QQbar(5, 123) );
81 }
else if (inState == 2) {
82 sigmaT.push_back(
new Sigma2qqbar2gg() );
83 sigmaU.push_back(
new Sigma2qqbar2gg() );
84 sigmaT.push_back(
new Sigma2qqbar2qqbarNew() );
85 sigmaU.push_back(
new Sigma2qqbar2qqbarNew() );
86 sigmaT.push_back(
new Sigma2qqbar2QQbar(4, 122) );
87 sigmaU.push_back(
new Sigma2qqbar2QQbar(4, 122) );
88 sigmaT.push_back(
new Sigma2qqbar2QQbar(5, 124) );
89 sigmaU.push_back(
new Sigma2qqbar2QQbar(5, 124) );
94 if (processLevel > 1) {
96 sigmaT.push_back(
new Sigma2gg2ggamma() );
97 sigmaU.push_back(
new Sigma2gg2ggamma() );
98 sigmaT.push_back(
new Sigma2gg2gammagamma() );
99 sigmaU.push_back(
new Sigma2gg2gammagamma() );
100 }
else if (inState == 1) {
101 sigmaT.push_back(
new Sigma2qg2qgamma() );
102 sigmaU.push_back(
new Sigma2qg2qgamma() );
103 }
else if (inState == 2) {
104 sigmaT.push_back(
new Sigma2qqbar2ggamma() );
105 sigmaU.push_back(
new Sigma2qqbar2ggamma() );
106 sigmaT.push_back(
new Sigma2ffbar2gammagamma() );
107 sigmaU.push_back(
new Sigma2ffbar2gammagamma() );
108 sigmaT.push_back(
new Sigma2ffbar2ffbarsgm() );
109 sigmaU.push_back(
new Sigma2ffbar2ffbarsgm() );
112 sigmaT.push_back(
new Sigma2ff2fftgmZ() );
113 sigmaU.push_back(
new Sigma2ff2fftgmZ() );
114 sigmaT.push_back(
new Sigma2ff2fftW() );
115 sigmaU.push_back(
new Sigma2ff2fftW() );
120 if (processLevel > 2) {
122 sigmaT.push_back(
new Sigma2gg2QQbar3S11g(4, 401) );
123 sigmaU.push_back(
new Sigma2gg2QQbar3S11g(4, 401) );
124 sigmaT.push_back(
new Sigma2gg2QQbar3PJ1g(4, 0, 402) );
125 sigmaU.push_back(
new Sigma2gg2QQbar3PJ1g(4, 0, 402) );
126 sigmaT.push_back(
new Sigma2gg2QQbar3PJ1g(4, 1, 403) );
127 sigmaU.push_back(
new Sigma2gg2QQbar3PJ1g(4, 1, 403) );
128 sigmaT.push_back(
new Sigma2gg2QQbar3PJ1g(4, 2, 404) );
129 sigmaU.push_back(
new Sigma2gg2QQbar3PJ1g(4, 2, 404) );
130 sigmaT.push_back(
new Sigma2gg2QQbarX8g(4, 0, 411) );
131 sigmaU.push_back(
new Sigma2gg2QQbarX8g(4, 0, 411) );
132 sigmaT.push_back(
new Sigma2gg2QQbarX8g(4, 1, 412) );
133 sigmaU.push_back(
new Sigma2gg2QQbarX8g(4, 1, 412) );
134 sigmaT.push_back(
new Sigma2gg2QQbarX8g(4, 2, 413) );
135 sigmaU.push_back(
new Sigma2gg2QQbarX8g(4, 2, 413) );
136 sigmaT.push_back(
new Sigma2gg2QQbar3S11g(5, 501) );
137 sigmaU.push_back(
new Sigma2gg2QQbar3S11g(5, 501) );
138 sigmaT.push_back(
new Sigma2gg2QQbar3PJ1g(5, 0, 502) );
139 sigmaU.push_back(
new Sigma2gg2QQbar3PJ1g(5, 0, 502) );
140 sigmaT.push_back(
new Sigma2gg2QQbar3PJ1g(5, 1, 503) );
141 sigmaU.push_back(
new Sigma2gg2QQbar3PJ1g(5, 1, 503) );
142 sigmaT.push_back(
new Sigma2gg2QQbar3PJ1g(5, 2, 504) );
143 sigmaU.push_back(
new Sigma2gg2QQbar3PJ1g(5, 2, 504) );
144 sigmaT.push_back(
new Sigma2gg2QQbarX8g(5, 0, 511) );
145 sigmaU.push_back(
new Sigma2gg2QQbarX8g(5, 0, 511) );
146 sigmaT.push_back(
new Sigma2gg2QQbarX8g(5, 1, 512) );
147 sigmaU.push_back(
new Sigma2gg2QQbarX8g(5, 1, 512) );
148 sigmaT.push_back(
new Sigma2gg2QQbarX8g(5, 2, 513) );
149 sigmaU.push_back(
new Sigma2gg2QQbarX8g(5, 2, 513) );
150 }
else if (inState == 1) {
151 sigmaT.push_back(
new Sigma2qg2QQbar3PJ1q(4, 0, 405) );
152 sigmaU.push_back(
new Sigma2qg2QQbar3PJ1q(4, 0, 405) );
153 sigmaT.push_back(
new Sigma2qg2QQbar3PJ1q(4, 1, 406) );
154 sigmaU.push_back(
new Sigma2qg2QQbar3PJ1q(4, 1, 406) );
155 sigmaT.push_back(
new Sigma2qg2QQbar3PJ1q(4, 2, 407) );
156 sigmaU.push_back(
new Sigma2qg2QQbar3PJ1q(4, 2, 407) );
157 sigmaT.push_back(
new Sigma2qg2QQbarX8q(4, 0, 414) );
158 sigmaU.push_back(
new Sigma2qg2QQbarX8q(4, 0, 414) );
159 sigmaT.push_back(
new Sigma2qg2QQbarX8q(4, 1, 415) );
160 sigmaU.push_back(
new Sigma2qg2QQbarX8q(4, 1, 415) );
161 sigmaT.push_back(
new Sigma2qg2QQbarX8q(4, 2, 416) );
162 sigmaU.push_back(
new Sigma2qg2QQbarX8q(4, 2, 416) );
163 sigmaT.push_back(
new Sigma2qg2QQbar3PJ1q(5, 0, 505) );
164 sigmaU.push_back(
new Sigma2qg2QQbar3PJ1q(5, 0, 505) );
165 sigmaT.push_back(
new Sigma2qg2QQbar3PJ1q(5, 1, 506) );
166 sigmaU.push_back(
new Sigma2qg2QQbar3PJ1q(5, 1, 506) );
167 sigmaT.push_back(
new Sigma2qg2QQbar3PJ1q(5, 2, 507) );
168 sigmaU.push_back(
new Sigma2qg2QQbar3PJ1q(5, 2, 507) );
169 sigmaT.push_back(
new Sigma2qg2QQbarX8q(5, 0, 514) );
170 sigmaU.push_back(
new Sigma2qg2QQbarX8q(5, 0, 514) );
171 sigmaT.push_back(
new Sigma2qg2QQbarX8q(5, 1, 515) );
172 sigmaU.push_back(
new Sigma2qg2QQbarX8q(5, 1, 515) );
173 sigmaT.push_back(
new Sigma2qg2QQbarX8q(5, 2, 516) );
174 sigmaU.push_back(
new Sigma2qg2QQbarX8q(5, 2, 516) );
175 }
else if (inState == 2) {
176 sigmaT.push_back(
new Sigma2qqbar2QQbar3PJ1g(4, 0, 408) );
177 sigmaU.push_back(
new Sigma2qqbar2QQbar3PJ1g(4, 0, 408) );
178 sigmaT.push_back(
new Sigma2qqbar2QQbar3PJ1g(4, 1, 409) );
179 sigmaU.push_back(
new Sigma2qqbar2QQbar3PJ1g(4, 1, 409) );
180 sigmaT.push_back(
new Sigma2qqbar2QQbar3PJ1g(4, 2, 410) );
181 sigmaU.push_back(
new Sigma2qqbar2QQbar3PJ1g(4, 2, 410) );
182 sigmaT.push_back(
new Sigma2qqbar2QQbarX8g(4, 0, 417) );
183 sigmaU.push_back(
new Sigma2qqbar2QQbarX8g(4, 0, 417) );
184 sigmaT.push_back(
new Sigma2qqbar2QQbarX8g(4, 1, 418) );
185 sigmaU.push_back(
new Sigma2qqbar2QQbarX8g(4, 1, 418) );
186 sigmaT.push_back(
new Sigma2qqbar2QQbarX8g(4, 2, 419) );
187 sigmaU.push_back(
new Sigma2qqbar2QQbarX8g(4, 2, 419) );
188 sigmaT.push_back(
new Sigma2qqbar2QQbar3PJ1g(5, 0, 508) );
189 sigmaU.push_back(
new Sigma2qqbar2QQbar3PJ1g(5, 0, 508) );
190 sigmaT.push_back(
new Sigma2qqbar2QQbar3PJ1g(5, 1, 509) );
191 sigmaU.push_back(
new Sigma2qqbar2QQbar3PJ1g(5, 1, 509) );
192 sigmaT.push_back(
new Sigma2qqbar2QQbar3PJ1g(5, 2, 510) );
193 sigmaU.push_back(
new Sigma2qqbar2QQbar3PJ1g(5, 2, 510) );
194 sigmaT.push_back(
new Sigma2qqbar2QQbarX8g(5, 0, 517) );
195 sigmaU.push_back(
new Sigma2qqbar2QQbarX8g(5, 0, 517) );
196 sigmaT.push_back(
new Sigma2qqbar2QQbarX8g(5, 1, 518) );
197 sigmaU.push_back(
new Sigma2qqbar2QQbarX8g(5, 1, 518) );
198 sigmaT.push_back(
new Sigma2qqbar2QQbarX8g(5, 2, 519) );
199 sigmaU.push_back(
new Sigma2qqbar2QQbarX8g(5, 2, 519) );
204 nChan = sigmaT.size();
205 needMasses.resize(nChan);
208 sHatMin.resize(nChan);
209 sigmaTval.resize(nChan);
210 sigmaUval.resize(nChan);
213 for (
int i = 0; i < nChan; ++i) {
214 sigmaT[i]->init( infoPtr, settingsPtr, particleDataPtr, rndmPtr,
215 beamAPtr, beamBPtr, couplingsPtr);
216 sigmaT[i]->initProc();
217 sigmaU[i]->init( infoPtr, settingsPtr, particleDataPtr, rndmPtr,
218 beamAPtr, beamBPtr, couplingsPtr);
219 sigmaU[i]->initProc();
222 needMasses[i] =
false;
223 int id3Mass = sigmaT[i]->id3Mass();
224 int id4Mass = sigmaT[i]->id4Mass();
227 if (id3Mass > 0 || id4Mass > 0) {
228 needMasses[i] =
true;
229 m3Fix[i] = particleDataPtr->m0(id3Mass);
230 m4Fix[i] = particleDataPtr->m0(id4Mass);
232 sHatMin[i] = pow2( m3Fix[i] + m4Fix[i] + MASSMARGIN);
244 double SigmaMultiparton::sigma(
int id1,
int id2,
double x1,
double x2,
245 double sHat,
double tHat,
double uHat,
double alpS,
double alpEM,
246 bool restore,
bool pickOtherIn) {
249 if (restore) pickOther = pickOtherIn;
250 else pickOther = (rndmPtr->flat() < OTHERFRAC);
255 for (
int i = 0; i < nChan; ++i) {
260 if (i == 0 && pickOther)
continue;
261 if (i > 0 && !pickOther)
continue;
264 if (sHat > sHatMin[i]) {
265 sigmaT[i]->set2KinMPI( x1, x2, sHat, tHat, uHat,
266 alpS, alpEM, needMasses[i], m3Fix[i], m4Fix[i]);
267 sigmaTval[i] = sigmaT[i]->sigmaHatWrap(id1, id2);
268 sigmaT[i]->pickInState(id1, id2);
270 if (needMasses[i]) sigmaTval[i] *= sigmaT[i]->sHBetaMPI() / sHat;
271 sigmaTsum += sigmaTval[i];
275 if (sHat > sHatMin[i]) {
276 sigmaU[i]->set2KinMPI( x1, x2, sHat, uHat, tHat,
277 alpS, alpEM, needMasses[i], m3Fix[i], m4Fix[i]);
278 sigmaUval[i] = sigmaU[i]->sigmaHatWrap( id1, id2);
279 sigmaU[i]->pickInState(id1, id2);
281 if (needMasses[i]) sigmaUval[i] *= sigmaU[i]->sHBetaMPI() / sHat;
282 sigmaUsum += sigmaUval[i];
287 double sigmaAvg = 0.5 * (sigmaTsum + sigmaUsum);
288 if (pickOther) sigmaAvg /= OTHERFRAC;
289 if (!pickOther) sigmaAvg /= (1. - OTHERFRAC);
298 SigmaProcess* SigmaMultiparton::sigmaSel() {
301 pickedU = (rndmPtr->flat() * (sigmaTsum + sigmaUsum) < sigmaUsum);
305 double sigmaRndm = sigmaTsum * rndmPtr->flat();
307 do sigmaRndm -= sigmaTval[++iPick];
308 while (sigmaRndm > 0.);
309 return sigmaT[iPick];
313 double sigmaRndm = sigmaUsum * rndmPtr->flat();
315 do sigmaRndm -= sigmaUval[++iPick];
316 while (sigmaRndm > 0.);
317 return sigmaU[iPick];
333 const bool MultipartonInteractions::SHIFTFACSCALE =
false;
336 const bool MultipartonInteractions::PREPICKRESCATTER =
true;
339 const double MultipartonInteractions::SIGMAFUDGE = 0.7;
342 const double MultipartonInteractions::RPT20 = 0.25;
345 const double MultipartonInteractions::PT0STEP = 0.9;
346 const double MultipartonInteractions::SIGMASTEP = 1.1;
349 const double MultipartonInteractions::PT0MIN = 0.2;
352 const double MultipartonInteractions::EXPPOWMIN = 0.4;
355 const double MultipartonInteractions::PROBATLOWB = 0.6;
358 const double MultipartonInteractions::BSTEP = 0.01;
361 const double MultipartonInteractions::BMAX = 1e-8;
364 const double MultipartonInteractions::EXPMAX = 50.;
367 const double MultipartonInteractions::KCONVERGE = 1e-7;
370 const double MultipartonInteractions::CONVERT2MB = 0.389380;
373 const double MultipartonInteractions::ROOTMIN = 0.01;
376 const double MultipartonInteractions::ECMDEV = 0.01;
381 const int MultipartonInteractions::XDEP_BBIN = 500;
383 const double MultipartonInteractions::XDEP_A0 = 1.0;
385 const double MultipartonInteractions::XDEP_A1 = 1.0;
387 const double MultipartonInteractions::XDEP_BSTEP = 0.02;
388 const double MultipartonInteractions::XDEP_BSTEPINC = 0.01;
391 const double MultipartonInteractions::XDEP_CUTOFF = 1e-4;
393 const double MultipartonInteractions::XDEP_SMB2FM = sqrt(0.1);
399 bool MultipartonInteractions::init(
bool doMPIinit,
int diffractiveModeIn,
400 Info* infoPtrIn, Settings& settings, ParticleData* particleDataPtr,
401 Rndm* rndmPtrIn, BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn,
402 Couplings* couplingsPtrIn, PartonSystems* partonSystemsPtrIn,
403 SigmaTotal* sigmaTotPtrIn, UserHooks* userHooksPtrIn, ostream& os) {
406 diffractiveMode = diffractiveModeIn;
409 beamAPtr = beamAPtrIn;
410 beamBPtr = beamBPtrIn;
411 couplingsPtr = couplingsPtrIn;
412 partonSystemsPtr = partonSystemsPtrIn;
413 sigmaTotPtr = sigmaTotPtrIn;
414 userHooksPtr = userHooksPtrIn;
415 if (!doMPIinit)
return false;
418 hasBaryonBeams = ( beamAPtr->isBaryon() && beamBPtr->isBaryon() );
421 pTmaxMatch = settings.mode(
"MultipartonInteractions:pTmaxMatch");
424 alphaSvalue = settings.parm(
"MultipartonInteractions:alphaSvalue");
425 alphaSorder = settings.mode(
"MultipartonInteractions:alphaSorder");
428 alphaEMorder = settings.mode(
"MultipartonInteractions:alphaEMorder");
431 Kfactor = settings.parm(
"MultipartonInteractions:Kfactor");
434 pT0Ref = settings.parm(
"MultipartonInteractions:pT0Ref");
435 ecmRef = settings.parm(
"MultipartonInteractions:ecmRef");
436 ecmPow = settings.parm(
"MultipartonInteractions:ecmPow");
437 pTmin = settings.parm(
"MultipartonInteractions:pTmin");
440 if (diffractiveMode == 0) {
441 bProfile = settings.mode(
"MultipartonInteractions:bProfile");
442 coreRadius = settings.parm(
"MultipartonInteractions:coreRadius");
443 coreFraction = settings.parm(
"MultipartonInteractions:coreFraction");
444 expPow = settings.parm(
"MultipartonInteractions:expPow");
445 expPow = max(EXPPOWMIN, expPow);
447 a1 = settings.parm(
"MultipartonInteractions:a1");
451 bProfile = settings.mode(
"Diffraction:bProfile");
452 coreRadius = settings.parm(
"Diffraction:coreRadius");
453 coreFraction = settings.parm(
"Diffraction:coreFraction");
454 expPow = settings.parm(
"Diffraction:expPow");
455 expPow = max(EXPPOWMIN, expPow);
459 processLevel = settings.mode(
"MultipartonInteractions:processLevel");
462 allowRescatter = settings.flag(
"MultipartonInteractions:allowRescatter");
464 = settings.flag(
"MultipartonInteractions:allowDoubleRescatter");
465 rescatterMode = settings.mode(
"MultipartonInteractions:rescatterMode");
466 ySepResc = settings.parm(
"MultipartonInteractions:ySepRescatter");
467 deltaYResc = settings.parm(
"MultipartonInteractions:deltaYRescatter");
470 if (bProfile == 4) allowRescatter =
false;
473 globalRecoilFSR = settings.flag(
"TimeShower:globalRecoil");
474 nMaxGlobalRecoilFSR = settings.mode(
"TimeShower:nMaxGlobalRecoil");
477 nQuarkIn = settings.mode(
"MultipartonInteractions:nQuarkIn");
478 nSample = settings.mode(
"MultipartonInteractions:nSample");
481 enhanceScreening = settings.mode(
"MultipartonInteractions:enhanceScreening");
484 sigmaPomP = settings.parm(
"Diffraction:sigmaRefPomP");
485 mPomP = settings.parm(
"Diffraction:mRefPomP");
486 pPomP = settings.parm(
"Diffraction:mPowPomP");
487 mMinPertDiff = settings.parm(
"Diffraction:mMinPert");
490 canVetoMPI = (userHooksPtr > 0) ? userHooksPtr->canVetoMPIEmission() :
false;
494 fracA = pow2(1. - coreFraction);
495 fracB = 2. * coreFraction * (1. - coreFraction);
496 fracC = pow2(coreFraction);
497 radius2B = 0.5 * (1. + pow2(coreRadius));
498 radius2C = pow2(coreRadius);
501 }
else if (bProfile == 3) {
502 hasLowPow = (expPow < 2.);
503 expRev = 2. / expPow - 1.;
507 alphaS.init( alphaSvalue, alphaSorder);
508 double Lambda3 = alphaS.Lambda3();
511 alphaEM.init( alphaEMorder, &settings);
514 sigma2gg.init( 0, processLevel, infoPtr, &settings, particleDataPtr,
515 rndmPtr, beamAPtr, beamBPtr, couplingsPtr);
516 sigma2qg.init( 1, processLevel, infoPtr, &settings, particleDataPtr,
517 rndmPtr, beamAPtr, beamBPtr, couplingsPtr);
518 sigma2qqbarSame.init( 2, processLevel, infoPtr, &settings, particleDataPtr,
519 rndmPtr, beamAPtr, beamBPtr, couplingsPtr);
520 sigma2qq.init( 3, processLevel, infoPtr, &settings, particleDataPtr,
521 rndmPtr, beamAPtr, beamBPtr, couplingsPtr);
524 eCM = infoPtr->eCM();
530 if (!sigmaTotPtr->hasSigmaTot())
return false;
531 bool isNonDiff = (diffractiveMode == 0);
532 sigmaND = sigmaTotPtr->sigmaND();
533 double sigmaMaxViol = 0.;
536 bool showMPI = settings.flag(
"Init:showMultipartonInteractions");
538 os <<
"\n *------- PYTHIA Multiparton Interactions Initialization "
543 os <<
" | minbias, sigmaNonDiffractive = " << fixed
544 << setprecision(2) << setw(7) << sigmaND <<
" mb | \n";
545 else if (diffractiveMode == 1)
546 os <<
" | diffraction XB "
548 else if (diffractiveMode == 2)
549 os <<
" | diffraction AX "
556 nStep = (diffractiveMode == 0) ? 1 : 5;
557 eStepSize = (nStep < 2) ? 1.
558 : log(mMaxPertDiff / mMinPertDiff) / (nStep - 1.);
559 for (
int iStep = 0; iStep < nStep; ++iStep) {
564 eCM = mMinPertDiff * pow( mMaxPertDiff / mMinPertDiff,
565 iStep / (nStep - 1.) );
567 sigmaND = sigmaPomP * pow( eCM / mPomP, pPomP);
568 if (showMPI) os <<
" | diffractive mass = " << scientific
569 << setprecision(3) << setw(9) << eCM <<
" GeV and sigmaNorm = "
570 << fixed << setw(6) << sigmaND <<
" mb | \n";
574 pT0 = pT0Ref * pow(eCM / ecmRef, ecmPow);
577 double pT4dSigmaMaxBeg = 0.;
582 pT2min = pTmin*pTmin;
584 pT2max = pTmax*pTmax;
585 pT20R = RPT20 * pT20;
586 pT20minR = pT2min + pT20R;
587 pT20maxR = pT2max + pT20R;
588 pT20min0maxR = pT20minR * pT20maxR;
589 pT2maxmin = pT2max - pT2min;
596 sigmaIntWgt.resize(XDEP_BBIN);
597 sigmaSumWgt.resize(XDEP_BBIN);
598 bstepNow = XDEP_BSTEP;
602 pT4dSigmaMaxBeg = pT4dSigmaMax;
608 && sigmaIntWgt[XDEP_BBIN - 1] > XDEP_CUTOFF * sigmaInt) {
609 bstepNow += XDEP_BSTEPINC;
614 if (sigmaInt > SIGMASTEP * sigmaND)
break;
615 if (showMPI) os << fixed << setprecision(2) <<
" | pT0 = "
616 << setw(5) << pT0 <<
" gives sigmaInteraction = " << setw(7)
617 << sigmaInt <<
" mb: rejected | \n";
618 if (pTmin > pT0) pTmin *= PT0STEP;
622 if ( max(pT0, pTmin) < max(PT0MIN, Lambda3) ) {
623 infoPtr->errorMsg(
"Error in MultipartonInteractions::init:"
624 " failed to find acceptable pT0 and pTmin");
625 infoPtr->setTooLowPTmin(
true);
631 if (showMPI) os << fixed << setprecision(2) <<
" | pT0 = "
632 << setw(5) << pT0 <<
" gives sigmaInteraction = "<< setw(7)
633 << sigmaInt <<
" mb: accepted | \n";
639 sigmaMaxViol = max( sigmaMaxViol, pT4dSigmaMax / pT4dSigmaMaxBeg);
643 pT0Save[iStep] = pT0;
644 pT4dSigmaMaxSave[iStep] = pT4dSigmaMax;
645 pT4dProbMaxSave[iStep] = pT4dProbMax;
646 sigmaIntSave[iStep] = sigmaInt;
647 for (
int j = 0; j <= 100; ++j) sudExpPTSave[iStep][j] = sudExpPT[j];
648 zeroIntCorrSave[iStep] = zeroIntCorr;
649 normOverlapSave[iStep] = normOverlap;
650 kNowSave[iStep] = kNow;
651 bAvgSave[iStep] = bAvg;
652 bDivSave[iStep] = bDiv;
653 probLowBSave[iStep] = probLowB;
654 fracAhighSave[iStep] = fracAhigh;
655 fracBhighSave[iStep] = fracBhigh;
656 fracChighSave[iStep] = fracBhigh;
657 fracABChighSave[iStep] = fracABChigh;
658 cDivSave[iStep] = cDiv;
659 cMaxSave[iStep] = cMax;
666 if (bProfile == 4 && showMPI)
669 << fixed << setprecision(2)
670 <<
" | x-dependent matter profile: a1 = " << a1 <<
", "
671 <<
"a0 = " << a0now * XDEP_SMB2FM <<
", bStep = "
672 << bstepNow <<
" | \n";
675 if (showMPI) os <<
" | "
677 <<
" *------- End PYTHIA Multiparton Interactions Initialization"
678 <<
" -----* " << endl;
681 if (sigmaMaxViol > 1.) {
682 ostringstream osWarn;
683 osWarn <<
"by factor " << fixed << setprecision(3) << sigmaMaxViol;
684 infoPtr->errorMsg(
"Warning in MultipartonInteractions::init:"
685 " maximum increased", osWarn.str());
689 SigmaMultiparton* dSigma;
690 for (
int i = 0; i < 4; ++i) {
691 if (i == 0) dSigma = &sigma2gg;
692 else if (i == 1) dSigma = &sigma2qg;
693 else if (i == 2) dSigma = &sigma2qqbarSame;
694 else dSigma = &sigma2qq;
695 int nProc = dSigma->nProc();
696 for (
int iProc = 0; iProc < nProc; ++iProc)
697 nGen[ dSigma->codeProc(iProc) ] = 0;
718 void MultipartonInteractions::reset( ) {
725 eCM = infoPtr->eCM();
727 if (nStep == 1 || abs( eCM / eCMsave - 1.) < ECMDEV)
return;
730 sigmaND = sigmaPomP * pow( eCM / mPomP, pPomP);
734 eStepSave = log(eCM / mMinPertDiff) / eStepSize;
735 iStepFrom = max( 0, min( nStep - 2,
int( eStepSave) ) );
736 iStepTo = iStepFrom + 1;
737 eStepTo = max( 0., min( 1., eStepSave - iStepFrom) );
738 eStepFrom = 1. - eStepTo;
741 pT0 = eStepFrom * pT0Save[iStepFrom]
742 + eStepTo * pT0Save[iStepTo];
744 pT2min = pTmin*pTmin;
746 pT2max = pTmax*pTmax;
747 pT20R = RPT20 * pT20;
748 pT20minR = pT2min + pT20R;
749 pT20maxR = pT2max + pT20R;
750 pT20min0maxR = pT20minR * pT20maxR;
751 pT2maxmin = pT2max - pT2min;
754 pT4dSigmaMax = eStepFrom * pT4dSigmaMaxSave[iStepFrom]
755 + eStepTo * pT4dSigmaMaxSave[iStepTo];
756 pT4dProbMax = eStepFrom * pT4dProbMaxSave[iStepFrom]
757 + eStepTo * pT4dProbMaxSave[iStepTo];
758 sigmaInt = eStepFrom * sigmaIntSave[iStepFrom]
759 + eStepTo * sigmaIntSave[iStepTo];
760 for (
int j = 0; j <= 100; ++j)
761 sudExpPT[j] = eStepFrom * sudExpPTSave[iStepFrom][j]
762 + eStepTo * sudExpPTSave[iStepTo][j];
765 zeroIntCorr = eStepFrom * zeroIntCorrSave[iStepFrom]
766 + eStepTo * zeroIntCorrSave[iStepTo];
767 normOverlap = eStepFrom * normOverlapSave[iStepFrom]
768 + eStepTo * normOverlapSave[iStepTo];
769 kNow = eStepFrom * kNowSave[iStepFrom]
770 + eStepTo * kNowSave[iStepTo];
771 bAvg = eStepFrom * bAvgSave[iStepFrom]
772 + eStepTo * bAvgSave[iStepTo];
773 bDiv = eStepFrom * bDivSave[iStepFrom]
774 + eStepTo * bDivSave[iStepTo];
775 probLowB = eStepFrom * probLowBSave[iStepFrom]
776 + eStepTo * probLowBSave[iStepTo];
777 fracAhigh = eStepFrom * fracAhighSave[iStepFrom]
778 + eStepTo * fracAhighSave[iStepTo];
779 fracBhigh = eStepFrom * fracBhighSave[iStepFrom]
780 + eStepTo * fracBhighSave[iStepTo];
781 fracChigh = eStepFrom * fracChighSave[iStepFrom]
782 + eStepTo * fracChighSave[iStepTo];
783 fracABChigh = eStepFrom * fracABChighSave[iStepFrom]
784 + eStepTo * fracABChighSave[iStepTo];
785 cDiv = eStepFrom * cDivSave[iStepFrom]
786 + eStepTo * cDivSave[iStepTo];
787 cMax = eStepFrom * cMaxSave[iStepFrom]
788 + eStepTo * cMaxSave[iStepTo];
797 void MultipartonInteractions::pTfirst() {
801 if (bProfile == 4) isAtLowB =
false;
821 WTacc = sigmaPT2scatter(
true) / dSigmaApprox;
822 if (WTacc > 1.) infoPtr->errorMsg(
"Warning in "
823 "MultipartonInteractions::pTfirst: weight above unity");
827 }
while (WTacc < rndmPtr->flat() || !dSigmaDtSel->final2KinMPI());
834 pT2 = pT20min0maxR / (pT20minR + rndmPtr->flat() * pT2maxmin) - pT20R;
837 dSigmaApprox = pT4dSigmaMax / pow2(pT2 + pT20R);
840 WTacc = sigmaPT2scatter(
true) / dSigmaApprox;
843 if (bProfile != 4) WTacc *= sudakov( pT2, enhanceB);
846 if (WTacc > 1.) infoPtr->errorMsg(
"Warning in "
847 "MultipartonInteractions::pTfirst: weight above unity");
850 }
while (WTacc < rndmPtr->flat() || !dSigmaDtSel->final2KinMPI());
854 if (bProfile != 4)
break;
869 xPDF1nowSave = xPDF1now;
870 xPDF2nowSave = xPDF2now;
872 dSigmaDtSel->saveKin();
873 dSigmaDtSelSave = dSigmaDtSel;
878 beamAPtr->append( 0, id1, x1);
879 beamAPtr->xfISR( 0, id1, x1, pT2Fac * pT2Fac);
880 vsc1 = beamAPtr->pickValSeaComp();
881 beamBPtr->append( 0, id2, x2);
882 beamBPtr->xfISR( 0, id2, x2, pT2Fac * pT2Fac);
883 vsc2 = beamBPtr->pickValSeaComp();
886 double w1 = XDEP_A1 + a1 * log(1. / x1);
887 double w2 = XDEP_A1 + a1 * log(1. / x2);
888 double fac = a02now * (w1 * w1 + w2 * w2);
889 double expb2 = rndmPtr->flat();
890 b2now = - fac * log(expb2);
896 enhanceB = sigmaND / M_PI / fac * expb2;
897 enhanceBmax = sigmaND / 2. / M_PI / a02now *
898 exp( -b2now / 2. / a2max );
902 double pTtrial = pTnext(pTmax, pTmin, evDummy);
909 if (pTtrial < sqrt(pT2FacSave)) {
912 swap(pT2Fac, pT2FacSave);
913 swap(pT2Ren, pT2RenSave);
918 swap(sHat, sHatSave);
919 swap(tHat, tHatSave);
920 swap(uHat, uHatSave);
921 swap(alpS, alpSsave);
922 swap(alpEM, alpEMsave);
923 swap(xPDF1now, xPDF1nowSave);
924 swap(xPDF2now, xPDF2nowSave);
925 if (dSigmaDtSel == dSigmaDtSelSave) dSigmaDtSel->swapKin();
926 else swap(dSigmaDtSel, dSigmaDtSelSave);
944 void MultipartonInteractions::setupFirstSys(
Event& process) {
947 int sizeProc = process.size();
949 for (
int i = 3; i < sizeProc; ++i)
950 if (process[i].statusAbs() < 20) nBeams = i + 1;
951 int nOffset = nBeams - 3;
954 if (sizeProc > nBeams) {
955 process.popBack( sizeProc - nBeams);
956 process.initColTag();
960 process[1 + nOffset].daughter1(3 + nOffset);
961 process[2 + nOffset].daughter1(4 + nOffset);
964 process[1 + nOffset].statusNeg();
965 process[2 + nOffset].statusNeg();
968 int colOffset = process.lastColTag();
969 for (
int i = 1; i <= 4; ++i) {
970 Particle parton = dSigmaDtSel->getParton(i);
971 if (i <= 2 ) parton.mothers( i + nOffset, 0);
972 else parton.mothers( 3 + nOffset, 4 + nOffset);
973 if (i <= 2 ) parton.daughters( 5 + nOffset, 6 + nOffset);
974 else parton.daughters( 0, 0);
975 int col = parton.col();
976 if (col > 0) parton.col( col + colOffset);
977 int acol = parton.acol();
978 if (acol > 0) parton.acol( acol + colOffset);
981 process.append(parton);
985 process.scale( sqrt(pT2Fac) );
988 string nameSub = dSigmaDtSel->name();
989 int codeSub = dSigmaDtSel->code();
990 int nFinalSub = dSigmaDtSel->nFinal();
991 double pTMPI = dSigmaDtSel->pTMPIFin();
992 infoPtr->setSubType( nameSub, codeSub, nFinalSub);
993 infoPtr->setTypeMPI( codeSub, pTMPI, 0, 0, enhanceB / zeroIntCorr);
996 infoPtr->setPDFalpha( id1, id2, xPDF1now, xPDF2now, pT2Fac, alpEM, alpS,
998 double m3 = dSigmaDtSel->m(3);
999 double m4 = dSigmaDtSel->m(4);
1000 double theta = dSigmaDtSel->thetaMPI();
1001 double phi = dSigmaDtSel->phiMPI();
1002 infoPtr->setKin( x1, x2, sHat, tHat, uHat, sqrt(pT2), m3, m4, theta, phi);
1010 bool MultipartonInteractions::limitPTmax(
Event& event) {
1013 if (pTmaxMatch == 1)
return true;
1014 if (pTmaxMatch == 2)
return false;
1017 bool onlyQGP =
true;
1018 for (
int i = 5; i <
event.size(); ++i)
1019 if (event[i].status() != -21) {
1020 int idAbs =
event[i].idAbs();
1021 if (idAbs > 5 && idAbs != 21 && idAbs != 22) onlyQGP =
false;
1031 double MultipartonInteractions::pTnext(
double pTbegAll,
double pTendAll,
1035 bool pickRescatter, acceptKin;
1036 double dSigmaScatter, dSigmaRescatter, WTacc;
1037 double pT2end = pow2( max(pTmin, pTendAll) );
1044 if (bProfile == 4 && bIsSet && infoPtr->getCounter(21) == 1
1045 && infoPtr->getCounter(22) == 1) {
1049 if (pT2Save < pT2end)
return 0.;
1051 pT2Fac = pT2FacSave;
1052 pT2Ren = pT2RenSave;
1062 xPDF1now = xPDF1nowSave;
1063 xPDF2now = xPDF2nowSave;
1064 if (dSigmaDtSel == dSigmaDtSelSave) dSigmaDtSel->swapKin();
1065 else dSigmaDtSel = dSigmaDtSelSave;
1070 return (pT2 < pT2end) ? 0. : sqrt(pT2);
1075 bool allowRescatterNow = allowRescatter;
1076 if (globalRecoilFSR && partonSystemsPtr->sizeOut(0) <= nMaxGlobalRecoilFSR)
1077 allowRescatterNow =
false;
1080 pT2 = pow2(pTbegAll);
1083 if (allowRescatterNow) findScatteredPartons( event);
1089 if (pT2 < pT2end)
return 0.;
1095 pickRescatter =
false;
1098 dSigmaScatter = sigmaPT2scatter(
false);
1101 dSigmaRescatter = (allowRescatterNow) ? sigmaPT2rescatter( event) : 0.;
1104 WTacc = (dSigmaScatter + dSigmaRescatter) / dSigmaApprox;
1105 if (WTacc > 1.) infoPtr->errorMsg(
"Warning in MultipartonInteractions::"
1106 "pTnext: weight above unity");
1110 if (enhanceScreening > 0) {
1111 int nSysNow = infoPtr->nMPI() + 1;
1112 if (enhanceScreening == 2) nSysNow += infoPtr->nISR();
1113 double WTscreen = pow2( (pT2 + pT20) / (pT2 + nSysNow * pT20) );
1118 if (bProfile == 4) {
1119 double w1 = XDEP_A1 + a1 * log(1. / x1);
1120 double w2 = XDEP_A1 + a1 * log(1. / x2);
1121 double fac = a02now * (w1 * w1 + w2 * w2);
1123 enhanceBnow = sigmaND / M_PI / fac * exp( - b2now / fac);
1124 double oWgt = enhanceBnow / enhanceBmax;
1125 if (oWgt > 1.) infoPtr->errorMsg(
"Warning in MultipartonInteractions::"
1126 "pTnext: overlap weight above unity");
1131 }
while (WTacc < rndmPtr->flat());
1134 if (allowRescatterNow) {
1135 pickRescatter = (i1Sel > 0 || i2Sel > 0);
1145 sigma2Sel->sigma( id1, id2, x1, x2, sHat, tHat, uHat, alpS, alpEM,
1146 true, pickOtherSel);
1150 dSigmaDtSel = sigma2Sel->sigmaSel();
1151 if (sigma2Sel->swapTU()) swap( tHat, uHat);
1155 if (pickRescatter) {
1156 Vec4 p1Res = (i1Sel == 0) ? 0.5 * eCM * x1Sel * Vec4( 0., 0., 1., 1.)
1158 Vec4 p2Res = (i2Sel == 0) ? 0.5 * eCM * x2Sel * Vec4( 0., 0., -1., 1.)
1160 double m1Res = (i1Sel == 0) ? 0. : event[i1Sel].m();
1161 double m2Res = (i2Sel == 0) ? 0. : event[i2Sel].m();
1162 acceptKin = dSigmaDtSel->final2KinMPI( i1Sel, i2Sel, p1Res, p2Res,
1165 }
else acceptKin = dSigmaDtSel->final2KinMPI();
1166 }
while (!acceptKin);
1178 bool MultipartonInteractions::scatter(
Event& event) {
1181 int sizeProc =
event.size();
1183 for (
int i = 3; i < sizeProc; ++i)
1184 if (event[i].statusAbs() < 20) nBeams = i + 1;
1185 int nOffset = nBeams - 3;
1188 int motherOffset =
event.size();
1189 int colOffset =
event.lastColTag();
1190 for (
int i = 1; i <= 4; ++i) {
1191 Particle parton = dSigmaDtSel->getParton(i);
1192 if (i <= 2 ) parton.mothers( i + nOffset, 0);
1193 else parton.mothers( motherOffset, motherOffset + 1);
1194 if (i <= 2 ) parton.daughters( motherOffset + 2, motherOffset + 3);
1195 else parton.daughters( 0, 0);
1196 int col = parton.col();
1197 if (col > 0) parton.col( col + colOffset);
1198 int acol = parton.acol();
1199 if (acol > 0) parton.acol( acol + colOffset);
1202 event.append(parton);
1206 if (canVetoMPI && userHooksPtr->doVetoMPIEmission(sizeProc, event)) {
1207 event.popBack(event.size() - sizeProc);
1212 int iSys = partonSystemsPtr->addSys();
1213 partonSystemsPtr->setInA(iSys, motherOffset);
1214 partonSystemsPtr->setInB(iSys, motherOffset + 1);
1215 partonSystemsPtr->addOut(iSys, motherOffset + 2);
1216 partonSystemsPtr->addOut(iSys, motherOffset + 3);
1217 partonSystemsPtr->setSHat(iSys, sHat);
1220 bool annihil1 =
false;
1221 bool annihil2 =
false;
1222 if (i1Sel > 0 && i2Sel > 0) {
1223 if (event[motherOffset].col() == event[motherOffset + 1].acol()
1224 && event[motherOffset].col() > 0) annihil1 =
true;
1225 if (event[motherOffset].acol() == event[motherOffset + 1].col()
1226 && event[motherOffset].acol() > 0) annihil2 =
true;
1230 BeamParticle& beamA = *beamAPtr;
1231 int iA = beamA.append( motherOffset, id1, x1);
1235 beamA.xfISR( iA, id1, x1, pT2);
1236 beamA.pickValSeaComp();
1241 beamA[iA].companion(-10);
1242 event[i1Sel].statusNeg();
1243 event[i1Sel].daughters( motherOffset, motherOffset);
1244 event[motherOffset].mothers( i1Sel, i1Sel);
1245 int colOld =
event[i1Sel].col();
1247 int colNew =
event[motherOffset].col();
1248 for (
int i = motherOffset; i < motherOffset + 4; ++i) {
1249 if (event[i].col() == colNew)
event[i].col( colOld);
1250 if (event[i].acol() == colNew)
event[i].acol( colOld);
1253 int acolOld =
event[i1Sel].acol();
1255 int acolNew =
event[motherOffset].acol();
1256 for (
int i = motherOffset; i < motherOffset + 4; ++i) {
1257 if (event[i].col() == acolNew)
event[i].col( acolOld);
1258 if (event[i].acol() == acolNew)
event[i].acol( acolOld);
1264 BeamParticle& beamB = *beamBPtr;
1265 int iB = beamB.append( motherOffset + 1, id2, x2);
1269 beamB.xfISR( iB, id2, x2, pT2);
1270 beamB.pickValSeaComp();
1275 beamB[iB].companion(-10);
1276 event[i2Sel].statusNeg();
1277 event[i2Sel].daughters( motherOffset + 1, motherOffset + 1);
1278 event[motherOffset + 1].mothers( i2Sel, i2Sel);
1279 int colOld =
event[i2Sel].col();
1281 int colNew =
event[motherOffset + 1].col();
1282 for (
int i = motherOffset; i < motherOffset + 4; ++i) {
1283 if (event[i].col() == colNew)
event[i].col( colOld);
1284 if (event[i].acol() == colNew)
event[i].acol( colOld);
1287 int acolOld =
event[i2Sel].acol();
1289 int acolNew =
event[motherOffset + 1].acol();
1290 for (
int i = motherOffset; i < motherOffset + 4; ++i) {
1291 if (event[i].col() == acolNew)
event[i].col( acolOld);
1292 if (event[i].acol() == acolNew)
event[i].acol( acolOld);
1299 if (annihil1 || annihil2) {
1300 int colLeft = (annihil1) ? event[motherOffset].col()
1301 :
event[motherOffset].acol();
1302 int mother1 =
event[motherOffset].mother1();
1303 int mother2 =
event[motherOffset + 1].mother1();
1304 int colLost = (annihil1)
1305 ? event[mother1].col() +
event[mother2].acol() - colLeft
1306 :
event[mother1].acol() +
event[mother2].col() - colLeft;
1307 for (
int i = 0; i < motherOffset; ++i) {
1308 if (event[i].col() == colLost)
event[i].col( colLeft );
1309 if (event[i].acol() == colLost)
event[i].acol( colLeft );
1314 int codeMPI = dSigmaDtSel->code();
1315 double pTMPI = dSigmaDtSel->pTMPIFin();
1316 infoPtr->setTypeMPI( codeMPI, pTMPI, i1Sel, i2Sel,
1317 enhanceBnow / zeroIntCorr);
1327 void MultipartonInteractions::upperEnvelope() {
1334 for (
int iPT = 0; iPT < 100; ++iPT) {
1335 double pT = pTmin * pow( pTmax/pTmin, 0.01 * (iPT + 0.5) );
1337 pT2shift = pT2 + pT20;
1339 pT2Fac = (SHIFTFACSCALE) ? pT2shift : pT2;
1343 double xPDF1sumMax = (9./4.) * beamAPtr->xf(21, xT, pT2Fac);
1344 for (
int id = 1;
id <= nQuarkIn; ++id)
1345 xPDF1sumMax += beamAPtr->xf(
id, xT, pT2Fac)
1346 + beamAPtr->xf(-
id, xT, pT2Fac);
1347 double xPDF2sumMax = (9./4.) * beamBPtr->xf(21, xT, pT2Fac);
1348 for (
int id = 1;
id <= nQuarkIn; ++id)
1349 xPDF2sumMax += beamBPtr->xf(
id, xT, pT2Fac)
1350 + beamBPtr->xf(-
id, xT, pT2Fac);
1353 alpS = alphaS.alphaS(pT2Ren);
1354 alpEM = alphaEM.alphaEM(pT2Ren);
1355 double dSigmaPartonApprox = CONVERT2MB * Kfactor * 0.5 * M_PI
1356 * pow2(alpS / pT2shift);
1357 double yMax = log(1./xT + sqrt(1./(xT*xT) - 1.));
1358 double volumePhSp = pow2(2. * yMax);
1361 double dSigmaApproxNow = SIGMAFUDGE * xPDF1sumMax * xPDF2sumMax
1362 * dSigmaPartonApprox * volumePhSp;
1363 double pT4dSigmaNow = pow2(pT2 + pT20R) * dSigmaApproxNow;
1364 if ( pT4dSigmaNow > pT4dSigmaMax) pT4dSigmaMax = pT4dSigmaNow;
1368 pT4dProbMax = pT4dSigmaMax / sigmaND;
1378 void MultipartonInteractions::jetCrossSection() {
1381 double sigmaFactor = (1. / pT20minR - 1. / pT20maxR) / (100. * nSample);
1384 if (bProfile == 4)
for (
int bBin = 0; bBin < XDEP_BBIN; bBin++)
1385 sigmaIntWgt[bBin] = 0.;
1389 double dSigmaMax = 0.;
1392 for (
int iPT = 99; iPT >= 0; --iPT) {
1393 double sigmaSum = 0.;
1396 if (bProfile == 4)
for (
int bBin = 0; bBin < XDEP_BBIN; bBin++)
1397 sigmaSumWgt[bBin] = 0.;
1400 for (
int iSample = 0; iSample < nSample; ++iSample) {
1401 double mappedPT2 = 1. - 0.01 * (iPT + rndmPtr->flat());
1402 pT2 = pT20min0maxR / (pT20minR + mappedPT2 * pT2maxmin) - pT20R;
1405 double dSigma = sigmaPT2scatter(
true);
1408 dSigma *= pow2(pT2 + pT20R);
1410 if (dSigma > dSigmaMax) dSigmaMax = dSigma;
1414 if (bProfile == 4 && dSigma > 0.) {
1415 double w1 = XDEP_A1 + a1 * log(1. / x1);
1416 double w2 = XDEP_A1 + a1 * log(1. / x2);
1417 double fac = XDEP_A0 * XDEP_A0 * (w1 * w1 + w2 * w2);
1418 double b = 0.5 * bstepNow;
1419 for (
int bBin = 0; bBin < XDEP_BBIN; bBin++) {
1420 double wgt = exp( - b * b / fac ) / fac / M_PI;
1421 sigmaSumWgt[bBin] += dSigma * wgt;
1428 sigmaSum *= sigmaFactor;
1429 sigmaInt += sigmaSum;
1430 sudExpPT[iPT] = sudExpPT[iPT + 1] + sigmaSum / sigmaND;
1433 if (bProfile == 4)
for (
int bBin = 0; bBin < XDEP_BBIN; bBin++) {
1434 sigmaSumWgt[bBin] *= sigmaFactor;
1435 sigmaIntWgt[bBin] += sigmaSumWgt[bBin];
1442 if (dSigmaMax > pT4dSigmaMax) {
1443 pT4dSigmaMax = dSigmaMax;
1444 pT4dProbMax = dSigmaMax / sigmaND;
1454 double MultipartonInteractions::sudakov(
double pT2sud,
double enhance) {
1457 double xBin = (pT2sud - pT2min) * pT20maxR
1458 / (pT2maxmin * (pT2sud + pT20R));
1459 xBin = max(1e-6, min(100. - 1e-6, 100. * xBin) );
1460 int iBin = int(xBin);
1463 double sudExp = sudExpPT[iBin] + (xBin - iBin)
1464 * (sudExpPT[iBin + 1] - sudExpPT[iBin]);
1465 return exp( -enhance * sudExp);
1474 double MultipartonInteractions::fastPT2(
double pT2beg) {
1477 double pT20begR = pT2beg + pT20R;
1478 double pT4dProbMaxNow = pT4dProbMax * enhanceBmax;
1479 double pT2try = pT4dProbMaxNow * pT20begR
1480 / (pT4dProbMaxNow - pT20begR * log(rndmPtr->flat())) - pT20R;
1483 dSigmaApprox = pT4dSigmaMax / pow2(pT2try + pT20R);
1494 double MultipartonInteractions::sigmaPT2scatter(
bool isFirst) {
1497 pT2shift = pT2 + pT20;
1499 pT2Fac = (SHIFTFACSCALE) ? pT2shift : pT2;
1500 alpS = alphaS.alphaS(pT2Ren);
1501 alpEM = alphaEM.alphaEM(pT2Ren);
1504 xT = 2. * sqrt(pT2) / eCM;
1505 if (xT >= 1.)
return 0.;
1507 double yMax = log(1./xT + sqrt(1./xT2 - 1.));
1510 double y3 = yMax * (2. * rndmPtr->flat() - 1.);
1511 double y4 = yMax * (2. * rndmPtr->flat() - 1.);
1512 y = 0.5 * (y3 + y4);
1516 double WTy = (hasBaryonBeams)
1517 ? (1. - pow2(y3/yMax)) * (1. - pow2(y4/yMax)) : 1.;
1518 if (WTy < rndmPtr->flat())
return 0.;
1521 x1 = 0.5 * xT * (exp(y3) + exp(y4));
1522 x2 = 0.5 * xT * (exp(-y3) + exp(-y4));
1524 if (x1 > 1. || x2 > 1.)
return 0.;
1526 if (x1 > beamAPtr->xMax() || x2 > beamBPtr->xMax())
return 0.;
1532 double xPDF1sum = 0.;
1534 double xPDF2sum = 0.;
1538 for (
int id = -nQuarkIn;
id <= nQuarkIn; ++id) {
1539 if (
id == 0) xPDF1[10] = (9./4.) * beamAPtr->xf(21, x1, pT2Fac);
1540 else xPDF1[
id+10] = beamAPtr->xf(
id, x1, pT2Fac);
1541 xPDF1sum += xPDF1[
id+10];
1543 for (
int id = -nQuarkIn;
id <= nQuarkIn; ++id) {
1544 if (
id == 0) xPDF2[10] = (9./4.) * beamBPtr->xf(21, x2, pT2Fac);
1545 else xPDF2[
id+10] = beamBPtr->xf(
id, x2, pT2Fac);
1546 xPDF2sum += xPDF2[
id+10];
1551 for (
int id = -nQuarkIn;
id <= nQuarkIn; ++id) {
1552 if (
id == 0) xPDF1[10] = (9./4.) * beamAPtr->xfMPI(21, x1, pT2Fac);
1553 else xPDF1[
id+10] = beamAPtr->xfMPI(
id, x1, pT2Fac);
1554 xPDF1sum += xPDF1[
id+10];
1556 for (
int id = -nQuarkIn;
id <= nQuarkIn; ++id) {
1557 if (
id == 0) xPDF2[10] = (9./4.) * beamBPtr->xfMPI(21, x2, pT2Fac);
1558 else xPDF2[
id+10] = beamBPtr->xfMPI(
id, x2, pT2Fac);
1559 xPDF2sum += xPDF2[
id+10];
1564 id1 = -nQuarkIn - 1;
1565 double temp = xPDF1sum * rndmPtr->flat();
1566 do { xPDF1now = xPDF1[(++id1) + 10]; temp -= xPDF1now; }
1567 while (temp > 0. && id1 < nQuarkIn);
1568 if (id1 == 0) id1 = 21;
1570 temp = xPDF2sum * rndmPtr->flat();
1571 do { xPDF2now = xPDF2[(++id2) + 10]; temp -= xPDF2now;}
1572 while (temp > 0. && id2 < nQuarkIn);
1573 if (id2 == 0) id2 = 21;
1578 SigmaMultiparton* sigma2Tmp;
1580 if (id1 == 21 && id2 == 21) {
1581 sigma2Tmp = &sigma2gg;
1583 }
else if (id1 == 21 || id2 == 21) {
1584 sigma2Tmp = &sigma2qg;
1586 }
else if (id1 == -id2) sigma2Tmp = &sigma2qqbarSame;
1587 else sigma2Tmp = &sigma2qq;
1591 double root = sqrtpos(1. - xT2 / tau);
1592 tHat = -0.5 * sHat * (1. - root);
1593 uHat = -0.5 * sHat * (1. + root);
1598 double dSigmaPartonCorr = Kfactor * gluFac
1599 * sigma2Tmp->sigma( id1, id2, x1, x2, sHat, tHat, uHat, alpS, alpEM);
1602 double volumePhSp = pow2(2. * yMax) / WTy;
1603 double dSigmaScat = dSigmaPartonCorr * xPDF1sum * xPDF2sum * volumePhSp;
1608 double pT2massive = pT2;
1609 dSigmaScat *= pow2( pT2massive / (pT2massive + pT20) );
1612 dSigmaSum += dSigmaScat;
1624 sigma2Sel = sigma2Tmp;
1625 pickOtherSel = sigma2Tmp->pickedOther();
1629 dSigmaDtSel = sigma2Tmp->sigmaSel();
1630 if (sigma2Tmp->swapTU()) swap( tHat, uHat);
1641 void MultipartonInteractions::findScatteredPartons(
Event& event) {
1644 scatteredA.resize(0);
1645 scatteredB.resize(0);
1646 double yTmp, probA, probB;
1649 for (
int i = 0; i <
event.size(); ++i)
1650 if (event[i].isFinal() && (
event[i].idAbs() <= nQuarkIn
1651 ||
event[i].id() == 21)) {
1652 yTmp =
event[i].y();
1655 switch(rescatterMode) {
1659 if ( yTmp > 0.) scatteredA.push_back( i);
1660 if (-yTmp > 0.) scatteredB.push_back( i);
1665 if ( yTmp > ySepResc) scatteredA.push_back( i);
1666 if (-yTmp > ySepResc) scatteredB.push_back( i);
1671 probA = 0.5 * (1. + ( yTmp - ySepResc) / deltaYResc);
1672 if (probA > rndmPtr->flat()) scatteredA.push_back( i);
1673 probB = 0.5 * (1. + (-yTmp - ySepResc) / deltaYResc);
1674 if (probB > rndmPtr->flat()) scatteredB.push_back( i);
1680 probA = 1. / (1. + exp(-2. * ( yTmp - ySepResc) / deltaYResc));
1681 if (probA > rndmPtr->flat()) scatteredA.push_back( i);
1682 probB = 1. / (1. + exp(-2. * (-yTmp - ySepResc) / deltaYResc));
1683 if (probB > rndmPtr->flat()) scatteredB.push_back( i);
1688 scatteredA.push_back( i);
1689 scatteredB.push_back( i);
1704 double MultipartonInteractions::sigmaPT2rescatter(
Event& event) {
1707 xT = 2. * sqrt(pT2) / eCM;
1708 if (xT >= 1.)
return 0.;
1712 SigmaMultiparton* sigma2Tmp;
1713 double dSigmaResc = 0.;
1716 int nScatA = scatteredA.size();
1718 if (PREPICKRESCATTER && nScatA > 0) iScatA = min( nScatA - 1,
1719 int( rndmPtr->flat() * double(nScatA) ) );
1722 for (
int iScat = 0; iScat < nScatA; ++iScat) {
1723 if (PREPICKRESCATTER && iScat != iScatA)
continue;
1724 int iA = scatteredA[iScat];
1725 int id1Tmp =
event[iA].id();
1728 double x1Tmp =
event[iA].pPos() / eCM;
1729 double sHatMax = x1Tmp * beamBPtr->xMax() * sCM;
1730 if (sHatMax < 4. * pT2)
continue;
1733 double dyMax = log( sqrt(0.25 * sHatMax / pT2)
1734 * (1. + sqrtpos(1. - 4. * pT2 / sHatMax)) );
1735 double dy = dyMax * (2. * rndmPtr->flat() - 1.);
1739 double m2Tmp =
event[iA].m2();
1740 double sHatTmp = m2Tmp + 4. * pT2 * pow2(cosh(dy));
1741 double x2Tmp = (sHatTmp - m2Tmp) /(x1Tmp * sCM);
1742 double tauTmp = sHatTmp / sCM;
1743 double root = sqrtpos(1. - xT2 / tauTmp);
1744 double tHatTmp = -0.5 * sHatTmp * (1. - root);
1745 double uHatTmp = -0.5 * sHatTmp * (1. + root);
1749 double xPDF2sum = 0.;
1752 for (
int id = -nQuarkIn;
id <= nQuarkIn; ++id) {
1753 if (
id == 0) xPDF2[10] = (9./4.) * beamBPtr->xfMPI(21, x2Tmp, pT2Fac);
1754 else xPDF2[
id+10] = beamBPtr->xfMPI(
id, x2Tmp, pT2Fac);
1755 xPDF2sum += xPDF2[
id+10];
1759 int id2Tmp = -nQuarkIn - 1;
1760 double temp = xPDF2sum * rndmPtr->flat();
1761 do { xPDF2now = xPDF2[(++id2Tmp) + 10]; temp -= xPDF2now;}
1762 while (temp > 0. && id2Tmp < nQuarkIn);
1763 if (id2Tmp == 0) id2Tmp = 21;
1768 if (id1Tmp == 21 && id2Tmp == 21) sigma2Tmp = &sigma2gg;
1769 else if (id1Tmp == 21 || id2Tmp == 21) sigma2Tmp = &sigma2qg;
1770 else if (id1Tmp == -id2Tmp) sigma2Tmp = &sigma2qqbarSame;
1771 else sigma2Tmp = &sigma2qq;
1772 double gluFac = (id2Tmp == 21) ? 4. / 9. : 1.;
1777 double dSigmaPartonCorr = Kfactor * gluFac
1778 * sigma2Tmp->sigma( id1Tmp, id2Tmp, x1Tmp, x2Tmp, sHatTmp, tHatTmp,
1779 uHatTmp, alpS, alpEM);
1782 double volumePhSp = 4. *dyMax;
1783 double dSigmaCorr = dSigmaPartonCorr * xPDF2sum * volumePhSp;
1788 double pT2massive = pT2;
1789 dSigmaCorr *= pow2( pT2massive / (pT2massive + pT20) );
1792 if (PREPICKRESCATTER) dSigmaCorr *= nScatA;
1795 dSigmaSum += dSigmaCorr;
1796 dSigmaResc += dSigmaCorr;
1799 if (dSigmaCorr > rndmPtr->flat() * dSigmaSum) {
1809 sigma2Sel = sigma2Tmp;
1810 pickOtherSel = sigma2Tmp->pickedOther();
1815 int nScatB = scatteredB.size();
1817 if (PREPICKRESCATTER && nScatB > 0) iScatB = min( nScatB - 1,
1818 int( rndmPtr->flat() * double(nScatB) ) );
1821 for (
int iScat = 0; iScat < nScatB; ++iScat) {
1822 if (PREPICKRESCATTER && iScat != iScatB)
continue;
1823 int iB = scatteredB[iScat];
1824 int id2Tmp =
event[iB].id();
1827 double x2Tmp =
event[iB].pNeg() / eCM;
1828 double sHatMax = beamAPtr->xMax() * x2Tmp * sCM;
1829 if (sHatMax < 4. * pT2)
continue;
1832 double dyMax = log( sqrt(0.25 * sHatMax / pT2)
1833 * (1. + sqrtpos(1. - 4. * pT2 / sHatMax)) );
1834 double dy = dyMax * (2. * rndmPtr->flat() - 1.);
1838 double m2Tmp =
event[iB].m2();
1839 double sHatTmp = m2Tmp + 4. * pT2 * pow2(cosh(dy));
1840 double x1Tmp = (sHatTmp - m2Tmp) /(x2Tmp * sCM);
1841 double tauTmp = sHatTmp / sCM;
1842 double root = sqrtpos(1. - xT2 / tauTmp);
1843 double tHatTmp = -0.5 * sHatTmp * (1. - root);
1844 double uHatTmp = -0.5 * sHatTmp * (1. + root);
1848 double xPDF1sum = 0.;
1851 for (
int id = -nQuarkIn;
id <= nQuarkIn; ++id) {
1852 if (
id == 0) xPDF1[10] = (9./4.) * beamAPtr->xfMPI(21, x1Tmp, pT2Fac);
1853 else xPDF1[
id+10] = beamAPtr->xfMPI(
id, x1Tmp, pT2Fac);
1854 xPDF1sum += xPDF1[
id+10];
1858 int id1Tmp = -nQuarkIn - 1;
1859 double temp = xPDF1sum * rndmPtr->flat();
1860 do { xPDF1now = xPDF1[(++id1Tmp) + 10]; temp -= xPDF1now;}
1861 while (temp > 0. && id1Tmp < nQuarkIn);
1862 if (id1Tmp == 0) id1Tmp = 21;
1867 if (id1Tmp == 21 && id2Tmp == 21) sigma2Tmp = &sigma2gg;
1868 else if (id1Tmp == 21 || id2Tmp == 21) sigma2Tmp = &sigma2qg;
1869 else if (id1Tmp == -id2Tmp) sigma2Tmp = &sigma2qqbarSame;
1870 else sigma2Tmp = &sigma2qq;
1871 double gluFac = (id1Tmp == 21) ? 4. / 9. : 1.;
1876 double dSigmaPartonCorr = Kfactor * gluFac
1877 * sigma2Tmp->sigma( id1Tmp, id2Tmp, x1Tmp, x2Tmp, sHatTmp, tHatTmp,
1878 uHatTmp, alpS, alpEM);
1881 double volumePhSp = 4. *dyMax;
1882 double dSigmaCorr = dSigmaPartonCorr * xPDF1sum * volumePhSp;
1887 double pT2massive = pT2;
1888 dSigmaCorr *= pow2( pT2massive / (pT2massive + pT20) );
1891 if (PREPICKRESCATTER) dSigmaCorr *= nScatB;
1894 dSigmaSum += dSigmaCorr;
1895 dSigmaResc += dSigmaCorr;
1898 if (dSigmaCorr > rndmPtr->flat() * dSigmaSum) {
1908 sigma2Sel = sigma2Tmp;
1909 pickOtherSel = sigma2Tmp->pickedOther();
1915 if (allowDoubleRes) {
1916 for (
int iScat1 = 0; iScat1 < nScatA; ++iScat1) {
1917 if (PREPICKRESCATTER && iScat1 != iScatA)
continue;
1918 int iA = scatteredA[iScat1];
1919 int id1Tmp =
event[iA].id();
1920 for (
int iScat2 = 0; iScat2 < nScatB; ++iScat2) {
1921 if (PREPICKRESCATTER && iScat2 != iScatB)
continue;
1922 int iB = scatteredB[iScat2];
1923 int id2Tmp =
event[iB].id();
1926 double sHatTmp = (
event[iA].p() +
event[iB].p()).m2Calc();
1927 if (sHatTmp < 4. * pT2)
continue;
1930 double x1Tmp =
event[iA].pPos() / eCM;
1931 double x2Tmp =
event[iB].pNeg() / eCM;
1932 double tauTmp = sHatTmp / sCM;
1933 double root = sqrtpos(1. - xT2 / tauTmp);
1934 double tHatTmp = -0.5 * sHatTmp * (1. - root);
1935 double uHatTmp = -0.5 * sHatTmp * (1. + root);
1939 if (id1Tmp == 21 && id2Tmp == 21) sigma2Tmp = &sigma2gg;
1940 else if (id1Tmp == 21 || id2Tmp == 21) sigma2Tmp = &sigma2qg;
1941 else if (id1Tmp == -id2Tmp) sigma2Tmp = &sigma2qqbarSame;
1942 else sigma2Tmp = &sigma2qq;
1947 double dSigmaPartonCorr = Kfactor
1948 * sigma2Tmp->sigma( id1Tmp, id2Tmp, x1Tmp, x2Tmp, sHatTmp, tHatTmp,
1949 uHatTmp, alpS, alpEM);
1953 double dSigmaCorr = dSigmaPartonCorr / max(ROOTMIN, root);
1958 double pT2massive = pT2;
1959 dSigmaCorr *= pow2( pT2massive / (pT2massive + pT20) );
1962 if (PREPICKRESCATTER) dSigmaCorr *= nScatA * nScatB;
1965 dSigmaSum += dSigmaCorr;
1966 dSigmaResc += dSigmaCorr;
1969 if (dSigmaCorr > rndmPtr->flat() * dSigmaSum) {
1979 sigma2Sel = sigma2Tmp;
1980 pickOtherSel = sigma2Tmp->pickedOther();
1997 void MultipartonInteractions::overlapInit() {
2000 nAvg = sigmaInt / sigmaND;
2003 double deltaB = BSTEP;
2004 if (bProfile == 2) deltaB *= min( 0.5, 2.5 * coreRadius);
2005 if (bProfile == 3) deltaB *= max(1., pow(2. / expPow, 1. / expPow));
2013 double overlapNow = 0.;
2014 double probNow = 0.;
2015 double overlapInt = 0.5;
2016 double probInt = 0.;
2017 double probOverlapInt = 0.;
2018 double bProbInt = 0.;
2019 normPi = 1. / (2. * M_PI);
2022 bool pastBDiv =
false;
2023 double overlapHighB = 0.;
2030 double rescale2 = 1.;
2031 if (bProfile == 4) {
2033 kNow = XDEP_A0 / 2.0;
2039 if (stepDir == 1) kNow *= 2.;
2040 else if (stepDir == -1) kNow *= 0.5;
2041 else kNow = kLow + (nAvg - nLow) * (kHigh - kLow) / (nHigh - nLow);
2044 if (bProfile <= 0 || bProfile > 4) {
2045 probInt = 0.5 * M_PI * (1. - exp(-kNow));
2046 probOverlapInt = probInt / M_PI;
2050 nNow = M_PI * kNow * overlapInt / probInt;
2053 }
else if (bProfile < 4) {
2056 overlapInt = (bProfile == 3) ? 0. : 0.5;
2058 probOverlapInt = 0.;
2064 double b = -0.5 * deltaB;
2068 bArea = 2. * M_PI * b * deltaB;
2071 if (bProfile == 1) {
2072 overlapNow = normPi * exp( -b*b);
2073 }
else if (bProfile == 2) {
2074 overlapNow = normPi * ( fracA * exp( -min(EXPMAX, b*b))
2075 + fracB * exp( -min(EXPMAX, b*b / radius2B)) / radius2B
2076 + fracC * exp( -min(EXPMAX, b*b / radius2C)) / radius2C );
2078 overlapNow = normPi * exp( -pow( b, expPow));
2079 overlapInt += bArea * overlapNow;
2081 if (pastBDiv) overlapHighB += bArea * overlapNow;
2084 probNow = 1. - exp( -min(EXPMAX, M_PI * kNow * overlapNow));
2085 probInt += bArea * probNow;
2086 probOverlapInt += bArea * overlapNow * probNow;
2087 bProbInt += b * bArea * probNow;
2090 if (!pastBDiv && probNow < PROBATLOWB) {
2091 bDiv = b + 0.5 * deltaB;
2096 }
while (b < 1. || b * probNow > BMAX);
2099 nNow = M_PI * kNow * overlapInt / probInt;
2102 }
else if (bProfile == 4) {
2103 rescale2 = pow2(kNow / XDEP_A0);
2105 double b = 0.5 * bstepNow;
2106 for (
int bBin = 0; bBin < XDEP_BBIN; bBin++) {
2107 double bArea = 2. * M_PI * b * bstepNow;
2108 double pIntNow = 1 - exp( -min(EXPMAX, sigmaIntWgt[bBin] / rescale2) );
2109 probInt += bArea * rescale2 * pIntNow;
2119 if (stepDir == -1) stepDir = 0;
2123 if (stepDir == 1) stepDir = -1;
2127 }
while (abs(nNow - nAvg) > KCONVERGE * nAvg);
2130 if (bProfile >= 0 && bProfile < 4) {
2131 double avgOverlap = probOverlapInt / probInt;
2132 zeroIntCorr = probOverlapInt / overlapInt;
2133 normOverlap = normPi * zeroIntCorr / avgOverlap;
2134 bAvg = bProbInt / probInt;
2137 }
else if (bProfile == 4) {
2142 double b = 0.5 * bstepNow;
2143 for (
int bBin = 0; bBin < XDEP_BBIN; bBin++) {
2144 double bArea = 2. * M_PI * b * bstepNow;
2145 double pIntNow = 1. - exp( -min(EXPMAX, sigmaIntWgt[bBin] / rescale2) );
2146 bAvg += sqrt(rescale2) * b * bArea * rescale2 * pIntNow;
2147 zeroIntCorr += bArea * sigmaIntWgt[bBin] * pIntNow;
2151 zeroIntCorr /= sigmaInt;
2155 infoPtr->a0MPI(a0now * XDEP_SMB2FM);
2156 a02now = a0now * a0now;
2157 double xMin = 2. * pTmin / infoPtr->eCM();
2158 a2max = a0now * (XDEP_A1 + a1 * log(1. / xMin));
2164 if (bProfile > 0 && bProfile <= 3) {
2165 probLowB = M_PI * bDiv*bDiv;
2166 double probHighB = M_PI * kNow * overlapHighB;
2167 if (bProfile == 1) probHighB = M_PI * kNow * 0.5 * exp( -bDiv*bDiv);
2168 else if (bProfile == 2) {
2169 fracAhigh = fracA * exp( -bDiv*bDiv);
2170 fracBhigh = fracB * exp( -bDiv*bDiv / radius2B);
2171 fracChigh = fracC * exp( -bDiv*bDiv / radius2C);
2172 fracABChigh = fracAhigh + fracBhigh + fracChigh;
2173 probHighB = M_PI * kNow * 0.5 * fracABChigh;
2175 cDiv = pow( bDiv, expPow);
2176 cMax = max(2. * expRev, cDiv);
2178 probLowB /= (probLowB + probHighB);
2188 void MultipartonInteractions::overlapFirst() {
2191 if (bProfile <= 0 || bProfile > 4) {
2193 enhanceB = zeroIntCorr;
2200 double overlapNow = 0.;
2201 double probAccept = 0.;
2205 if (rndmPtr->flat() < probLowB) {
2207 bNow = bDiv * sqrt(rndmPtr->flat());
2210 if (bProfile == 1) overlapNow = normPi * exp( -bNow*bNow);
2211 else if (bProfile == 2) overlapNow = normPi *
2212 ( fracA * exp( -bNow*bNow)
2213 + fracB * exp( -bNow*bNow / radius2B) / radius2B
2214 + fracC * exp( -bNow*bNow / radius2C) / radius2C );
2215 else overlapNow = normPi * exp( -pow( bNow, expPow));
2216 probAccept = 1. - exp( -min(EXPMAX, M_PI * kNow * overlapNow));
2223 if (bProfile == 1) {
2224 bNow = sqrt(bDiv*bDiv - log(rndmPtr->flat()));
2225 overlapNow = normPi * exp( -min(EXPMAX, bNow*bNow));
2226 }
else if (bProfile == 2) {
2227 double pickFrac = rndmPtr->flat() * fracABChigh;
2228 if (pickFrac < fracAhigh)
2229 bNow = sqrt(bDiv*bDiv - log(rndmPtr->flat()));
2230 else if (pickFrac < fracAhigh + fracBhigh)
2231 bNow = sqrt(bDiv*bDiv - radius2B * log(rndmPtr->flat()));
2232 else bNow = sqrt(bDiv*bDiv - radius2C * log(rndmPtr->flat()));
2233 overlapNow = normPi * ( fracA * exp( -min(EXPMAX, bNow*bNow))
2234 + fracB * exp( -min(EXPMAX, bNow*bNow / radius2B)) / radius2B
2235 + fracC * exp( -min(EXPMAX, bNow*bNow / radius2C)) / radius2C );
2241 }
else if (hasLowPow) {
2242 double cNow, acceptC;
2244 cNow = cDiv - 2. * log(rndmPtr->flat());
2245 acceptC = pow(cNow / cMax, expRev) * exp( -0.5 * (cNow - cMax));
2246 }
while (acceptC < rndmPtr->flat());
2247 bNow = pow( cNow, 1. / expPow);
2248 overlapNow = normPi * exp( -cNow);
2253 double cNow, acceptC;
2255 cNow = cDiv - log(rndmPtr->flat());
2256 acceptC = pow(cNow / cDiv, expRev);
2257 }
while (acceptC < rndmPtr->flat());
2258 bNow = pow( cNow, 1. / expPow);
2259 overlapNow = normPi * exp( -cNow);
2261 double temp = M_PI * kNow *overlapNow;
2262 probAccept = (1. - exp( -min(EXPMAX, temp))) / temp;
2266 }
while (probAccept < rndmPtr->flat());
2269 enhanceB = enhanceBmax = enhanceBnow = (normOverlap / normPi) * overlapNow;
2281 void MultipartonInteractions::overlapNext(
Event& event,
double pTscale) {
2284 enhanceB = zeroIntCorr;
2285 if (bProfile <= 0 || bProfile > 4)
return;
2286 double pT2scale = pTscale*pTscale;
2289 if (bProfile == 4) {
2290 double pTtrial = 0.;
2293 double expb2 = rndmPtr->flat();
2294 double w1 = XDEP_A1 + a1 * log(1. / infoPtr->x1());
2295 double w2 = XDEP_A1 + a1 * log(1. / infoPtr->x2());
2296 double fac = a02now * (w1 * w1 + w2 * w2);
2297 b2now = - fac * log(expb2);
2303 enhanceB = sigmaND / M_PI / fac * expb2;
2304 enhanceBmax = sigmaND / 2. / M_PI / a02now
2305 * exp( -b2now / 2. / a2max );
2308 pTtrial = pTnext(pTmax, pTmin, event);
2309 }
while (pTtrial > pTscale);
2318 if (bProfile == 1) {
2319 double expb2 = rndmPtr->flat();
2321 enhanceB = enhanceBmax = enhanceBnow = normOverlap * expb2;
2322 bNow = sqrt( -log(expb2));
2325 }
else if (bProfile == 2) {
2326 double bType = rndmPtr->flat();
2327 double b2 = -log( rndmPtr->flat() );
2328 if (bType < fracA) ;
2329 else if (bType < fracA + fracB) b2 *= radius2B;
2330 else b2 *= radius2C;
2332 enhanceB = enhanceBmax = enhanceBnow = normOverlap *
2333 ( fracA * exp( -min(EXPMAX, b2))
2334 + fracB * exp( -min(EXPMAX, b2 / radius2B)) / radius2B
2335 + fracC * exp( -min(EXPMAX, b2 / radius2C)) / radius2C );
2342 }
else if (bProfile == 3 && hasLowPow) {
2343 double cNow, acceptC;
2344 double probLowC = expRev / (expRev + pow(2., expRev) * exp( - expRev));
2346 if (rndmPtr->flat() < probLowC) {
2347 cNow = 2. * expRev * rndmPtr->flat();
2348 acceptC = pow( cNow / expRev, expRev) * exp(expRev - cNow);
2350 cNow = 2. * (expRev - log( rndmPtr->flat() ));
2351 acceptC = pow(0.5 * cNow / expRev, expRev)
2352 * exp(expRev - 0.5 * cNow);
2354 }
while (acceptC < rndmPtr->flat());
2356 enhanceB = enhanceBmax = enhanceBnow = normOverlap *exp(-cNow);
2357 bNow = pow( cNow, 1. / expPow);
2361 }
else if (bProfile == 3 && !hasLowPow) {
2362 double cNow, acceptC;
2363 double probLowC = expPow / (2. * exp(-1.) + expPow);
2365 if (rndmPtr->flat() < probLowC) {
2366 cNow = pow( rndmPtr->flat(), 0.5 * expPow);
2367 acceptC = exp(-cNow);
2369 cNow = 1. - log( rndmPtr->flat() );
2370 acceptC = pow( cNow, expRev);
2372 }
while (acceptC < rndmPtr->flat());
2374 enhanceB = enhanceBmax = enhanceBnow = normOverlap * exp(-cNow);
2375 bNow = pow( cNow, 1. / expPow);
2379 }
while (sudakov(pT2scale, enhanceB) < rndmPtr->flat());
2389 void MultipartonInteractions::statistics(
bool resetStat, ostream& os) {
2392 os <<
"\n *------- PYTHIA Multiparton Interactions Statistics -----"
2396 <<
" | Note: excludes hardest subprocess if already listed above "
2400 <<
" | Subprocess Code | Times"
2404 <<
" |------------------------------------------------------------"
2411 for ( map<int, int>::iterator iter = nGen.begin(); iter != nGen.end();
2413 int code = iter -> first;
2414 int number = iter->second;
2415 numberSum += number;
2419 bool foundName =
false;
2420 SigmaMultiparton* dSigma;
2421 for (
int i = 0; i < 4; ++i) {
2422 if (i == 0) dSigma = &sigma2gg;
2423 else if (i == 1) dSigma = &sigma2qg;
2424 else if (i == 2) dSigma = &sigma2qqbarSame;
2425 else dSigma = &sigma2qq;
2426 int nProc = dSigma->nProc();
2427 for (
int iProc = 0; iProc < nProc; ++iProc)
2428 if (dSigma->codeProc(iProc) == code) {
2429 name = dSigma->nameProc(iProc);
2432 if (foundName)
break;
2436 os <<
" | " << left << setw(40) << name << right << setw(5) << code
2437 <<
" | " << setw(11) << number <<
" |\n";
2443 <<
" | " << left << setw(45) <<
"sum" << right <<
" | " << setw(11)
2444 << numberSum <<
" |\n";
2449 <<
" *------- End PYTHIA Multiparton Interactions Statistics ----"
2453 if (resetStat) resetStatistics();