9 #include "Pythia8/MultipartonInteractions.h"
12 #include "Pythia8/SigmaQCD.h"
13 #include "Pythia8/SigmaEW.h"
14 #include "Pythia8/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 BeamParticle* beamAPtr, BeamParticle* beamBPtr) {
41 particleDataPtr = infoPtr->particleDataPtr;
42 rndmPtr = infoPtr->rndmPtr;
43 Settings* settingsPtr = infoPtr->settingsPtr;
46 if (sigmaT.size() > 0) {
47 for (
int i = 0; i < int(sigmaT.size()); ++i)
delete sigmaT[i];
50 if (sigmaU.size() > 0) {
51 for (
int i = 0; i < int(sigmaU.size()); ++i)
delete sigmaU[i];
59 sigmaT.push_back(
new Sigma2gg2gg() );
60 sigmaU.push_back(
new Sigma2gg2gg() );
63 }
else if (inState == 1) {
64 sigmaT.push_back(
new Sigma2qg2qg() );
65 sigmaU.push_back(
new Sigma2qg2qg() );
69 sigmaT.push_back(
new Sigma2qq2qq() );
70 sigmaU.push_back(
new Sigma2qq2qq() );
74 if (processLevel > 0) {
76 sigmaT.push_back(
new Sigma2gg2qqbar() );
77 sigmaU.push_back(
new Sigma2gg2qqbar() );
78 sigmaT.push_back(
new Sigma2gg2QQbar(4, 121) );
79 sigmaU.push_back(
new Sigma2gg2QQbar(4, 121) );
80 sigmaT.push_back(
new Sigma2gg2QQbar(5, 123) );
81 sigmaU.push_back(
new Sigma2gg2QQbar(5, 123) );
82 }
else if (inState == 2) {
83 sigmaT.push_back(
new Sigma2qqbar2gg() );
84 sigmaU.push_back(
new Sigma2qqbar2gg() );
85 sigmaT.push_back(
new Sigma2qqbar2qqbarNew() );
86 sigmaU.push_back(
new Sigma2qqbar2qqbarNew() );
87 sigmaT.push_back(
new Sigma2qqbar2QQbar(4, 122) );
88 sigmaU.push_back(
new Sigma2qqbar2QQbar(4, 122) );
89 sigmaT.push_back(
new Sigma2qqbar2QQbar(5, 124) );
90 sigmaU.push_back(
new Sigma2qqbar2QQbar(5, 124) );
95 if (processLevel > 1) {
97 sigmaT.push_back(
new Sigma2gg2ggamma() );
98 sigmaU.push_back(
new Sigma2gg2ggamma() );
99 sigmaT.push_back(
new Sigma2gg2gammagamma() );
100 sigmaU.push_back(
new Sigma2gg2gammagamma() );
101 }
else if (inState == 1) {
102 sigmaT.push_back(
new Sigma2qg2qgamma() );
103 sigmaU.push_back(
new Sigma2qg2qgamma() );
104 }
else if (inState == 2) {
105 sigmaT.push_back(
new Sigma2qqbar2ggamma() );
106 sigmaU.push_back(
new Sigma2qqbar2ggamma() );
107 sigmaT.push_back(
new Sigma2ffbar2gammagamma() );
108 sigmaU.push_back(
new Sigma2ffbar2gammagamma() );
109 sigmaT.push_back(
new Sigma2ffbar2ffbarsgm() );
110 sigmaU.push_back(
new Sigma2ffbar2ffbarsgm() );
113 sigmaT.push_back(
new Sigma2ff2fftgmZ() );
114 sigmaU.push_back(
new Sigma2ff2fftgmZ() );
115 sigmaT.push_back(
new Sigma2ff2fftW() );
116 sigmaU.push_back(
new Sigma2ff2fftW() );
121 if (processLevel > 2) {
122 SigmaOniaSetup charmonium(infoPtr, 4);
123 SigmaOniaSetup bottomonium(infoPtr, 5);
125 charmonium.setupSigma2gg(sigmaT,
true);
126 charmonium.setupSigma2gg(sigmaU,
true);
127 bottomonium.setupSigma2gg(sigmaT,
true);
128 bottomonium.setupSigma2gg(sigmaU,
true);
129 }
else if (inState == 1) {
130 charmonium.setupSigma2qg(sigmaT,
true);
131 charmonium.setupSigma2qg(sigmaU,
true);
132 bottomonium.setupSigma2qg(sigmaT,
true);
133 bottomonium.setupSigma2qg(sigmaU,
true);
134 }
else if (inState == 2) {
135 charmonium.setupSigma2qq(sigmaT,
true);
136 charmonium.setupSigma2qq(sigmaU,
true);
137 bottomonium.setupSigma2qq(sigmaT,
true);
138 bottomonium.setupSigma2qq(sigmaU,
true);
143 nChan = sigmaT.size();
144 needMasses.resize(nChan);
147 sHatMin.resize(nChan);
148 useNarrowBW3.resize(nChan);
149 useNarrowBW4.resize(nChan);
150 sigmaTval.resize(nChan);
151 sigmaUval.resize(nChan);
152 bool useBreitWigners = settingsPtr->flag(
"PhaseSpace:useBreitWigners");
153 double minWidthNarrowBW = settingsPtr->parm(
"PhaseSpace:minWidthNarrowBW");
156 for (
int i = 0; i < nChan; ++i) {
157 sigmaT[i]->initInfoPtr(*infoPtr);
158 sigmaT[i]->init(beamAPtr, beamBPtr);
159 sigmaT[i]->initProc();
160 sigmaU[i]->initInfoPtr(*infoPtr);
161 sigmaU[i]->init(beamAPtr, beamBPtr);
162 sigmaU[i]->initProc();
165 int id3Mass = sigmaT[i]->id3Mass();
166 int id4Mass = sigmaT[i]->id4Mass();
167 needMasses[i] = (id3Mass > 0 || id4Mass > 0);
168 m3Fix[i] = (id3Mass > 0) ? particleDataPtr->m0(id3Mass) : 0.;
169 m4Fix[i] = (id4Mass > 0) ? particleDataPtr->m0(id4Mass) : 0.;
170 sHatMin[i] = pow2( m3Fix[i] + m4Fix[i] + MASSMARGIN);
173 useNarrowBW3[i] = (useBreitWigners && id3Mass > 0
174 && particleDataPtr->mWidth(id3Mass) > minWidthNarrowBW);
175 useNarrowBW4[i] = (useBreitWigners && id4Mass > 0
176 && particleDataPtr->mWidth(id4Mass) > minWidthNarrowBW);
188 double SigmaMultiparton::sigma(
int id1,
int id2,
double x1,
double x2,
189 double sHat,
double tHat,
double uHat,
double alpS,
double alpEM,
190 bool restore,
bool pickOtherIn) {
193 if (restore) pickOther = pickOtherIn;
194 else pickOther = (rndmPtr->flat() < OTHERFRAC);
199 for (
int i = 0; i < nChan; ++i) {
204 if (i == 0 && pickOther)
continue;
205 if (i > 0 && !pickOther)
continue;
209 m3Fix[i] = particleDataPtr->mSel(sigmaT[i]->id3Mass());
211 m4Fix[i] = particleDataPtr->mSel(sigmaT[i]->id4Mass());
212 if ((useNarrowBW3[i] || useNarrowBW4[i])
213 && pow2( m3Fix[i] + m4Fix[i] + MASSMARGIN) > sHat)
return 0.;
216 if (sHat > sHatMin[i]) {
217 sigmaT[i]->set2KinMPI( x1, x2, sHat, tHat, uHat,
218 alpS, alpEM, needMasses[i], m3Fix[i], m4Fix[i]);
219 sigmaTval[i] = sigmaT[i]->sigmaHatWrap(id1, id2);
220 sigmaT[i]->pickInState(id1, id2);
222 if (needMasses[i]) sigmaTval[i] *= sigmaT[i]->sHBetaMPI() / sHat;
223 sigmaTsum += sigmaTval[i];
227 if (sHat > sHatMin[i]) {
228 sigmaU[i]->set2KinMPI( x1, x2, sHat, uHat, tHat,
229 alpS, alpEM, needMasses[i], m3Fix[i], m4Fix[i]);
230 sigmaUval[i] = sigmaU[i]->sigmaHatWrap( id1, id2);
231 sigmaU[i]->pickInState(id1, id2);
233 if (needMasses[i]) sigmaUval[i] *= sigmaU[i]->sHBetaMPI() / sHat;
234 sigmaUsum += sigmaUval[i];
239 double sigmaAvg = 0.5 * (sigmaTsum + sigmaUsum);
240 if (pickOther) sigmaAvg /= OTHERFRAC;
241 if (!pickOther) sigmaAvg /= (1. - OTHERFRAC);
250 SigmaProcess* SigmaMultiparton::sigmaSel() {
253 pickedU = (rndmPtr->flat() * (sigmaTsum + sigmaUsum) < sigmaUsum);
257 double sigmaRndm = sigmaTsum * rndmPtr->flat();
259 do sigmaRndm -= sigmaTval[++iPick];
260 while (sigmaRndm > 0.);
261 return sigmaT[iPick];
265 double sigmaRndm = sigmaUsum * rndmPtr->flat();
267 do sigmaRndm -= sigmaUval[++iPick];
268 while (sigmaRndm > 0.);
269 return sigmaU[iPick];
285 const bool MultipartonInteractions::SHIFTFACSCALE =
false;
288 const bool MultipartonInteractions::PREPICKRESCATTER =
true;
291 const double MultipartonInteractions::SIGMAFUDGE = 0.8;
294 const double MultipartonInteractions::RPT20 = 0.25;
297 const double MultipartonInteractions::PT0STEP = 0.9;
298 const double MultipartonInteractions::SIGMASTEP = 1.1;
301 const double MultipartonInteractions::PT0MIN = 0.2;
304 const double MultipartonInteractions::EXPPOWMIN = 0.4;
307 const double MultipartonInteractions::PROBATLOWB = 0.6;
310 const double MultipartonInteractions::BSTEP = 0.01;
313 const double MultipartonInteractions::BMAX = 1e-8;
316 const double MultipartonInteractions::EXPMAX = 50.;
319 const double MultipartonInteractions::KCONVERGE = 1e-7;
322 const double MultipartonInteractions::CONVERT2MB = 0.389380;
325 const double MultipartonInteractions::ROOTMIN = 0.01;
328 const double MultipartonInteractions::ECMDEV = 0.01;
333 const int MultipartonInteractions::XDEP_BBIN = 500;
335 const double MultipartonInteractions::XDEP_A0 = 1.0;
337 const double MultipartonInteractions::XDEP_A1 = 1.0;
339 const double MultipartonInteractions::XDEP_BSTEP = 0.02;
340 const double MultipartonInteractions::XDEP_BSTEPINC = 0.01;
343 const double MultipartonInteractions::XDEP_CUTOFF = 1e-4;
345 const double MultipartonInteractions::XDEP_SMB2FM = sqrt(0.1);
348 const double MultipartonInteractions::WTACCWARN = 1.1;
351 const double MultipartonInteractions::SIGMAMBLIMIT = 1.;
357 bool MultipartonInteractions::init(
bool doMPIinit,
int iDiffSysIn,
358 BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn,
359 PartonVertexPtr partonVertexPtrIn,
bool hasGammaIn) {
362 beamAPtr = beamAPtrIn;
363 beamBPtr = beamBPtrIn;
364 iDiffSys = iDiffSysIn;
365 partonVertexPtr = partonVertexPtrIn;
366 hasGamma = hasGammaIn;
367 if (!doMPIinit)
return false;
370 hasBaryonBeams = ( beamAPtr->isBaryon() && beamBPtr->isBaryon() );
371 hasPomeronBeams = ( beamAPtr->id() == 990 || beamBPtr->id() == 990 );
374 pTmaxMatch = mode(
"MultipartonInteractions:pTmaxMatch");
377 alphaSvalue = parm(
"MultipartonInteractions:alphaSvalue");
378 alphaSorder = mode(
"MultipartonInteractions:alphaSorder");
379 alphaSnfmax = mode(
"StandardModel:alphaSnfmax");
382 alphaEMorder = mode(
"MultipartonInteractions:alphaEMorder");
385 Kfactor = parm(
"MultipartonInteractions:Kfactor");
388 isGammaGamma = beamAPtr->isGamma() && beamBPtr->isGamma();
389 isGammaHadron = beamAPtr->isGamma() && beamBPtr->isHadron();
390 isHadronGamma = beamAPtr->isHadron() && beamBPtr->isGamma();
395 pT0paramMode = mode(
"PhotonPhoton:pT0parametrization");
396 pT0Ref = parm(
"PhotonPhoton:pT0Ref");
397 ecmRef = parm(
"PhotonPhoton:ecmRef");
398 ecmPow = parm(
"PhotonPhoton:ecmPow");
399 pTmin = parm(
"PhotonPhoton:pTmin");
401 pT0paramMode = mode(
"MultipartonInteractions:pT0parametrization");
402 pT0Ref = parm(
"MultipartonInteractions:pT0Ref");
403 ecmRef = parm(
"MultipartonInteractions:ecmRef");
404 ecmPow = parm(
"MultipartonInteractions:ecmPow");
405 pTmin = parm(
"MultipartonInteractions:pTmin");
410 bProfile = mode(
"MultipartonInteractions:bProfile");
411 coreRadius = parm(
"MultipartonInteractions:coreRadius");
412 coreFraction = parm(
"MultipartonInteractions:coreFraction");
413 expPow = parm(
"MultipartonInteractions:expPow");
414 expPow = max(EXPPOWMIN, expPow);
416 a1 = parm(
"MultipartonInteractions:a1");
420 bProfile = mode(
"Diffraction:bProfile");
421 coreRadius = parm(
"Diffraction:coreRadius");
422 coreFraction = parm(
"Diffraction:coreFraction");
423 expPow = parm(
"Diffraction:expPow");
424 expPow = max(EXPPOWMIN, expPow);
428 if ((iDiffSys > 0 || flag(
"Diffraction:doHard")) && bProfile == 4) {
429 infoPtr->errorMsg(
"Error in MultipartonInteractions::init:"
430 " chosen b profile not allowed for diffraction");
435 bSelScale = mode(
"MultipartonInteractions:bSelScale");
438 processLevel = mode(
"MultipartonInteractions:processLevel");
441 allowRescatter = flag(
"MultipartonInteractions:allowRescatter");
442 allowDoubleRes = flag(
"MultipartonInteractions:allowDoubleRescatter");
443 rescatterMode = mode(
"MultipartonInteractions:rescatterMode");
444 ySepResc = parm(
"MultipartonInteractions:ySepRescatter");
445 deltaYResc = parm(
"MultipartonInteractions:deltaYRescatter");
448 if (bProfile == 4) allowRescatter =
false;
451 globalRecoilFSR = flag(
"TimeShower:globalRecoil");
452 nMaxGlobalRecoilFSR = mode(
"TimeShower:nMaxGlobalRecoil");
455 nQuarkIn = mode(
"MultipartonInteractions:nQuarkIn");
456 nSample = mode(
"MultipartonInteractions:nSample");
459 enhanceScreening = mode(
"MultipartonInteractions:enhanceScreening");
462 sigmaPomP = parm(
"Diffraction:sigmaRefPomP");
463 mPomP = parm(
"Diffraction:mRefPomP");
464 pPomP = parm(
"Diffraction:mPowPomP");
465 mMinPertDiff = parm(
"Diffraction:mMinPert");
466 bSelHard = mode(
"Diffraction:bSelHard");
472 canVetoMPI = (userHooksPtr != 0) ? userHooksPtr->canVetoMPIEmission()
476 doPartonVertex = flag(
"PartonVertex:setVertex") && (partonVertexPtr != 0);
480 fracA = pow2(1. - coreFraction);
481 fracB = 2. * coreFraction * (1. - coreFraction);
482 fracC = pow2(coreFraction);
483 radius2B = 0.5 * (1. + pow2(coreRadius));
484 radius2C = pow2(coreRadius);
487 }
else if (bProfile == 3) {
488 hasLowPow = (expPow < 2.);
489 expRev = 2. / expPow - 1.;
494 alphaS.init( alphaSvalue, alphaSorder, alphaSnfmax,
false);
495 double Lambda3 = alphaS.Lambda3();
498 alphaEM.init( alphaEMorder, settingsPtr);
501 sigma2gg.init( 0, processLevel, infoPtr, beamAPtr, beamBPtr);
502 sigma2qg.init( 1, processLevel, infoPtr, beamAPtr, beamBPtr);
503 sigma2qqbarSame.init( 2, processLevel, infoPtr, beamAPtr, beamBPtr);
504 sigma2qq.init( 3, processLevel, infoPtr, beamAPtr, beamBPtr);
507 eCM = infoPtr->eCM();
513 doVarEcm = flag(
"Beams:allowVariableEnergy");
514 if (iDiffSys > 0 || hasGamma) doVarEcm =
false;
517 mGmGmMin = parm(
"Photon:Wmin");
518 mGmGmMax = parm(
"Photon:Wmax");
519 if ( mGmGmMax < mGmGmMin ) mGmGmMax = eCM;
523 if (infoPtr->isVMDstateA() || infoPtr->isVMDstateB()) {
524 int idVMDA = infoPtr->isVMDstateA() ? 22 : infoPtr->idA();
525 int idVMDB = infoPtr->isVMDstateB() ? 22 : infoPtr->idB();
526 sigmaTotPtr->calc(idVMDA, idVMDB, infoPtr->eCM());
529 else if ( (isGammaGamma || isGammaHadron || isHadronGamma) && !hasGamma)
530 sigmaTotPtr->calc(infoPtr->idA(), infoPtr->idB(), infoPtr->eCM());
531 if (!sigmaTotPtr->hasSigmaTot())
return false;
532 bool isNonDiff = (iDiffSys == 0);
533 sigmaND = sigmaTotPtr->sigmaND();
534 double sigmaMaxViol = 0.;
537 bool showMPI = flag(
"Init:showMultipartonInteractions");
539 cout <<
"\n *------- PYTHIA Multiparton Interactions Initialization "
543 if (!doVarEcm && isNonDiff && !hasGamma)
544 cout <<
" | sigmaNonDiffractive = " << setprecision(2)
545 << ((sigmaND > 1.) ? fixed : scientific) << setw(8) << sigmaND
548 cout <<
" | non-diffractive "
550 else if (iDiffSys == 1)
551 cout <<
" | diffraction XB "
553 else if (iDiffSys == 2)
554 cout <<
" | diffraction AX "
556 else if (iDiffSys == 3)
557 cout <<
" | diffraction AXB "
559 else if ( hasGamma && isGammaGamma )
560 cout <<
" | A+B -> gamma+gamma -> X "
562 else if ( hasGamma && isGammaHadron )
563 cout <<
" | A+B -> gamma+B -> X "
565 else if ( hasGamma && isHadronGamma )
566 cout <<
" | A+B -> A+gamma -> X "
578 if (doVarEcm || iDiffSys > 0 || hasGamma) {
580 eStepMin = parm(
"Beams:eMinPert");
583 }
else if (iDiffSys > 0) {
584 eStepMin = mMinPertDiff;
585 eStepMax = mMaxPertDiff;
591 nStep = min( 20,
int( 2. + 2. * log( eStepMax / eStepMin)) );
592 eStepSize = log( eStepMax / eStepMin) / (nStep - 1.);
596 for (
int iStep = 0; iStep < nStep; ++iStep) {
598 eCM = eStepMin * pow( eStepMax / eStepMin, iStep / (nStep - 1.) );
603 sigmaTotPtr->calc( beamAPtr->id(), beamBPtr->id(), eCM );
604 sigmaND = sigmaTotPtr->sigmaND();
605 if (showMPI) cout <<
" | collision energy = " << scientific
606 << setprecision(2) << setw(8) << eCM <<
" GeV and sigmaNorm = "
607 << ((sigmaND > SIGMAMBLIMIT) ? fixed : scientific)
608 << setw(8) << sigmaND <<
" mb | \n";
611 }
else if (hasPomeronBeams) {
612 double gamPomRatio = 1.;
614 sigmaTotPtr->calc(22, 2212, eCM);
615 double sigGamP = sigmaTotPtr->sigmaTot();
616 sigmaTotPtr->calc(2212, 2212, eCM);
617 double sigPP = sigmaTotPtr->sigmaTot();
618 gamPomRatio = sigGamP / sigPP;
620 sigmaND = gamPomRatio * sigmaPomP * pow( eCM / mPomP, pPomP);
621 if (showMPI) cout <<
" | diffractive mass = " << scientific
622 << setprecision(2) << setw(8) << eCM <<
" GeV and sigmaNorm = "
623 << ((sigmaND > SIGMAMBLIMIT) ? fixed : scientific)
624 << setw(8) << sigmaND <<
" mb | \n";
627 if ( beamAPtr->id() == 990 && beamBPtr->id() == 990 ) {
628 beamAPtr->xPom(eCM/eCMsave);
629 beamBPtr->xPom(eCM/eCMsave);
631 else if ( beamAPtr->id() == 990 )
632 beamAPtr->xPom(pow2(eCM/eCMsave));
633 else if ( beamBPtr->id() == 990 )
634 beamBPtr->xPom(pow2(eCM/eCMsave));
640 if ( isHadronGamma ) {
641 sigmaTotPtr->calc( beamAPtr->id(), 22, eCM );
642 sigmaND = sigmaTotPtr->sigmaND();
643 if (showMPI) cout <<
" | hadron+gamma eCM = " << scientific
644 << setprecision(2) << setw(8) << eCM <<
" GeV and sigmaNorm = "
645 << ((sigmaND > SIGMAMBLIMIT) ? fixed : scientific)
646 << setw(8) << sigmaND <<
" mb | \n";
649 }
else if ( isGammaHadron ) {
650 sigmaTotPtr->calc( 22, beamBPtr->id(), eCM );
651 sigmaND = sigmaTotPtr->sigmaND();
652 if (showMPI) cout <<
" | gamma+hadron eCM = " << scientific
653 << setprecision(2) << setw(8) << eCM <<
" GeV and sigmaNorm = "
654 << ((sigmaND > SIGMAMBLIMIT) ? fixed : scientific)
655 << setw(8) << sigmaND <<
" mb | \n";
659 sigmaTotPtr->calc( 22, 22, eCM );
660 sigmaND = sigmaTotPtr->sigmaND();
661 if (showMPI) cout <<
" | gamma+gamma eCM = " << scientific
662 << setprecision(2) << setw(8) << eCM <<
" GeV and sigmaNorm = "
663 << ((sigmaND > SIGMAMBLIMIT) ? fixed : scientific)
664 << setw(8) << sigmaND <<
" mb | \n";
671 if (pT0paramMode == 0) pT0 = pT0Ref * pow(eCM / ecmRef, ecmPow);
672 else pT0 = pT0Ref + ecmPow * log (eCM / ecmRef);
675 double pT4dSigmaMaxBeg = 0.;
680 pT2min = pTmin*pTmin;
682 pT2max = pTmax*pTmax;
683 pT20R = RPT20 * pT20;
684 pT20minR = pT2min + pT20R;
685 pT20maxR = pT2max + pT20R;
686 pT20min0maxR = pT20minR * pT20maxR;
687 pT2maxmin = pT2max - pT2min;
694 sigmaIntWgt.resize(XDEP_BBIN);
695 sigmaSumWgt.resize(XDEP_BBIN);
696 bstepNow = XDEP_BSTEP;
700 pT4dSigmaMaxBeg = pT4dSigmaMax;
706 && sigmaIntWgt[XDEP_BBIN - 1] > XDEP_CUTOFF * sigmaInt) {
707 bstepNow += XDEP_BSTEPINC;
712 if (sigmaInt > SIGMASTEP * sigmaND)
break;
713 if (showMPI) cout << fixed << setprecision(2) <<
" | pT0 = "
714 << setw(5) << pT0 <<
" gives sigmaInteraction = " << setw(8)
715 << ((sigmaInt > SIGMAMBLIMIT) ? fixed : scientific) << sigmaInt
716 <<
" mb: rejected | \n";
717 if (pTmin > pT0) pTmin *= PT0STEP;
721 if ( max(pT0, pTmin) < max(PT0MIN, Lambda3) ) {
722 infoPtr->errorMsg(
"Error in MultipartonInteractions::init:"
723 " failed to find acceptable pT0 and pTmin");
724 infoPtr->setTooLowPTmin(
true);
730 if (showMPI) cout << fixed << setprecision(2) <<
" | pT0 = "
731 << setw(5) << pT0 <<
" gives sigmaInteraction = "<< setw(8)
732 << ((sigmaInt > SIGMAMBLIMIT) ? fixed : scientific) << sigmaInt
733 <<
" mb: accepted | \n";
739 sigmaMaxViol = max( sigmaMaxViol, pT4dSigmaMax / pT4dSigmaMaxBeg);
743 pT0Save[iStep] = pT0;
744 pT4dSigmaMaxSave[iStep] = pT4dSigmaMax;
745 pT4dProbMaxSave[iStep] = pT4dProbMax;
746 sigmaIntSave[iStep] = sigmaInt;
747 for (
int j = 0; j <= 100; ++j) sudExpPTSave[iStep][j] = sudExpPT[j];
748 zeroIntCorrSave[iStep] = zeroIntCorr;
749 normOverlapSave[iStep] = normOverlap;
750 kNowSave[iStep] = kNow;
751 bAvgSave[iStep] = bAvg;
752 bDivSave[iStep] = bDiv;
753 probLowBSave[iStep] = probLowB;
754 fracAhighSave[iStep] = fracAhigh;
755 fracBhighSave[iStep] = fracBhigh;
756 fracChighSave[iStep] = fracBhigh;
757 fracABChighSave[iStep] = fracABChigh;
758 cDivSave[iStep] = cDiv;
759 cMaxSave[iStep] = cMax;
770 if (bProfile == 4 && showMPI)
773 << fixed << setprecision(2)
774 <<
" | x-dependent matter profile: a1 = " << a1 <<
", "
775 <<
"a0 = " << a0now * XDEP_SMB2FM <<
", bStep = "
776 << bstepNow <<
" | \n";
779 if (showMPI) cout <<
" | "
781 <<
" *------- End PYTHIA Multiparton Interactions Initialization"
782 <<
" -----* " << endl;
785 if (sigmaMaxViol > 1.) {
786 ostringstream osWarn;
787 osWarn <<
"by factor " << fixed << setprecision(3) << sigmaMaxViol;
788 infoPtr->errorMsg(
"Warning in MultipartonInteractions::init:"
789 " maximum increased", osWarn.str());
793 SigmaMultiparton* dSigma;
794 for (
int i = 0; i < 4; ++i) {
795 if (i == 0) dSigma = &sigma2gg;
796 else if (i == 1) dSigma = &sigma2qg;
797 else if (i == 2) dSigma = &sigma2qqbarSame;
798 else dSigma = &sigma2qq;
799 int nProc = dSigma->nProc();
800 for (
int iProc = 0; iProc < nProc; ++iProc)
801 nGen[ dSigma->codeProc(iProc) ] = 0;
822 void MultipartonInteractions::reset( ) {
829 eCM = infoPtr->eCM();
831 if (nStep == 1 || abs( eCM / eCMsave - 1.) < ECMDEV)
return;
835 if (doVarEcm || hasGamma) {
836 sigmaTotPtr->calc( beamAPtr->id(), beamBPtr->id(), eCM );
837 sigmaND = sigmaTotPtr->sigmaND();
839 }
else sigmaND = sigmaPomP * pow( eCM / mPomP, pPomP);
843 eStepSave = log(eCM / eStepMin) / eStepSize;
844 iStepFrom = max( 0, min( nStep - 2,
int( eStepSave) ) );
845 iStepTo = iStepFrom + 1;
846 eStepTo = max( 0., min( 1., eStepSave - iStepFrom) );
847 eStepFrom = 1. - eStepTo;
850 pT0 = eStepFrom * pT0Save[iStepFrom]
851 + eStepTo * pT0Save[iStepTo];
853 pT2min = pTmin*pTmin;
855 pT2max = pTmax*pTmax;
856 pT20R = RPT20 * pT20;
857 pT20minR = pT2min + pT20R;
858 pT20maxR = pT2max + pT20R;
859 pT20min0maxR = pT20minR * pT20maxR;
860 pT2maxmin = pT2max - pT2min;
863 pT4dSigmaMax = eStepFrom * pT4dSigmaMaxSave[iStepFrom]
864 + eStepTo * pT4dSigmaMaxSave[iStepTo];
865 pT4dProbMax = eStepFrom * pT4dProbMaxSave[iStepFrom]
866 + eStepTo * pT4dProbMaxSave[iStepTo];
867 sigmaInt = eStepFrom * sigmaIntSave[iStepFrom]
868 + eStepTo * sigmaIntSave[iStepTo];
869 for (
int j = 0; j <= 100; ++j)
870 sudExpPT[j] = eStepFrom * sudExpPTSave[iStepFrom][j]
871 + eStepTo * sudExpPTSave[iStepTo][j];
874 zeroIntCorr = eStepFrom * zeroIntCorrSave[iStepFrom]
875 + eStepTo * zeroIntCorrSave[iStepTo];
876 normOverlap = eStepFrom * normOverlapSave[iStepFrom]
877 + eStepTo * normOverlapSave[iStepTo];
878 kNow = eStepFrom * kNowSave[iStepFrom]
879 + eStepTo * kNowSave[iStepTo];
880 bAvg = eStepFrom * bAvgSave[iStepFrom]
881 + eStepTo * bAvgSave[iStepTo];
882 bDiv = eStepFrom * bDivSave[iStepFrom]
883 + eStepTo * bDivSave[iStepTo];
884 probLowB = eStepFrom * probLowBSave[iStepFrom]
885 + eStepTo * probLowBSave[iStepTo];
886 fracAhigh = eStepFrom * fracAhighSave[iStepFrom]
887 + eStepTo * fracAhighSave[iStepTo];
888 fracBhigh = eStepFrom * fracBhighSave[iStepFrom]
889 + eStepTo * fracBhighSave[iStepTo];
890 fracChigh = eStepFrom * fracChighSave[iStepFrom]
891 + eStepTo * fracChighSave[iStepTo];
892 fracABChigh = eStepFrom * fracABChighSave[iStepFrom]
893 + eStepTo * fracABChighSave[iStepTo];
894 cDiv = eStepFrom * cDivSave[iStepFrom]
895 + eStepTo * cDivSave[iStepTo];
896 cMax = eStepFrom * cMaxSave[iStepFrom]
897 + eStepTo * cMaxSave[iStepTo];
906 void MultipartonInteractions::pTfirst() {
911 if (bProfile == 4) isAtLowB =
false;
931 WTacc = sigmaPT2scatter(
true) / dSigmaApprox;
932 if (WTacc > WTACCWARN) infoPtr->errorMsg(
"Warning in "
933 "MultipartonInteractions::pTfirst: weight above unity");
937 }
while (WTacc < rndmPtr->flat() || !dSigmaDtSel->final2KinMPI());
944 pT2 = pT20min0maxR / (pT20minR + rndmPtr->flat() * pT2maxmin) - pT20R;
947 dSigmaApprox = pT4dSigmaMax / pow2(pT2 + pT20R);
950 WTacc = sigmaPT2scatter(
true) / dSigmaApprox;
953 if (bProfile != 4) WTacc *= sudakov( pT2, enhanceB);
956 if (WTacc > WTACCWARN) infoPtr->errorMsg(
"Warning in "
957 "MultipartonInteractions::pTfirst: weight above unity");
960 }
while (WTacc < rndmPtr->flat() || !dSigmaDtSel->final2KinMPI());
964 if (bProfile != 4)
break;
979 xPDF1nowSave = xPDF1now;
980 xPDF2nowSave = xPDF2now;
982 dSigmaDtSel->saveKin();
983 dSigmaDtSelSave = dSigmaDtSel;
988 beamAPtr->append( 0, id1, x1);
989 beamAPtr->xfISR( 0, id1, x1, pT2Fac * pT2Fac);
990 vsc1 = beamAPtr->pickValSeaComp();
991 beamBPtr->append( 0, id2, x2);
992 beamBPtr->xfISR( 0, id2, x2, pT2Fac * pT2Fac);
993 vsc2 = beamBPtr->pickValSeaComp();
996 double w1 = XDEP_A1 + a1 * log(1. / x1);
997 double w2 = XDEP_A1 + a1 * log(1. / x2);
998 double fac = a02now * (w1 * w1 + w2 * w2);
1000 if ( userHooksPtr && userHooksPtr->canSetImpactParameter() ) {
1001 bNow = userHooksPtr->doSetImpactParameter() * bAvg;
1003 expb2 = exp(-b2now / fac);
1005 expb2 = rndmPtr->flat();
1006 b2now = - fac * log(expb2);
1013 enhanceB = sigmaND / M_PI / fac * expb2;
1014 enhanceBmax = sigmaND / 2. / M_PI / a02now *
1015 exp( -b2now / 2. / a2max );
1019 double pTtrial = pTnext(pTmax, pTmin, evDummy);
1026 if (pTtrial < sqrt(pT2FacSave)) {
1029 swap(pT2Fac, pT2FacSave);
1030 swap(pT2Ren, pT2RenSave);
1035 swap(sHat, sHatSave);
1036 swap(tHat, tHatSave);
1037 swap(uHat, uHatSave);
1038 swap(alpS, alpSsave);
1039 swap(alpEM, alpEMsave);
1040 swap(xPDF1now, xPDF1nowSave);
1041 swap(xPDF2now, xPDF2nowSave);
1042 if (dSigmaDtSel == dSigmaDtSelSave) dSigmaDtSel->swapKin();
1043 else swap(dSigmaDtSel, dSigmaDtSelSave);
1062 void MultipartonInteractions::setupFirstSys(
Event& process) {
1065 int sizeProc = process.size();
1067 for (
int i = 3; i < sizeProc; ++i)
1068 if (process[i].statusAbs() < 20) nBeams = i + 1;
1069 int nOffset = nBeams - 3;
1072 if (sizeProc > nBeams) {
1073 process.popBack( sizeProc - nBeams);
1074 process.initColTag();
1078 process[1 + nOffset].daughter1(3 + nOffset);
1079 process[2 + nOffset].daughter1(4 + nOffset);
1082 process[1 + nOffset].statusNeg();
1083 process[2 + nOffset].statusNeg();
1086 int colOffset = process.lastColTag();
1087 for (
int i = 1; i <= 4; ++i) {
1088 Particle parton = dSigmaDtSel->getParton(i);
1089 if (i <= 2) parton.status(-21);
1090 else parton.status(23);
1091 if (i <= 2) parton.mothers( i + nOffset, 0);
1092 else parton.mothers( 3 + nOffset, 4 + nOffset);
1093 if (i <= 2) parton.daughters( 5 + nOffset, 6 + nOffset);
1094 else parton.daughters( 0, 0);
1095 int col = parton.col();
1096 if (col > 0) parton.col( col + colOffset);
1097 int acol = parton.acol();
1098 if (acol > 0) parton.acol( acol + colOffset);
1101 process.append(parton);
1104 partonVertexPtr->vertexMPI( sizeProc, 4, bNow, process);
1107 process.scale( sqrt(pT2Fac) );
1110 string nameSub = dSigmaDtSel->name();
1111 int codeSub = dSigmaDtSel->code();
1112 int nFinalSub = dSigmaDtSel->nFinal();
1113 double pTMPI = dSigmaDtSel->pTMPIFin();
1114 infoPtr->setSubType( iDiffSys, nameSub, codeSub, nFinalSub);
1115 if (iDiffSys == 0) infoPtr->setTypeMPI( codeSub, pTMPI, 0, 0,
1116 enhanceB / zeroIntCorr);
1119 infoPtr->setPDFalpha( iDiffSys, id1, id2, x1, x2,
1120 (id1 == 21 ? 4./9. : 1.) * xPDF1now, (id2 == 21 ? 4./9. : 1.) * xPDF2now,
1121 pT2Fac, alpEM, alpS, pT2Ren, 0.);
1122 double m3 = dSigmaDtSel->m(3);
1123 double m4 = dSigmaDtSel->m(4);
1124 double theta = dSigmaDtSel->thetaMPI();
1125 double phi = dSigmaDtSel->phiMPI();
1126 infoPtr->setKin( iDiffSys, id1, id2, x1, x2, sHat, tHat, uHat, sqrt(pT2),
1127 m3, m4, theta, phi);
1135 bool MultipartonInteractions::limitPTmax(
Event& event) {
1138 if (pTmaxMatch == 1)
return true;
1139 if (pTmaxMatch == 2)
return false;
1142 if (infoPtr->isNonDiffractive() || infoPtr->isDiffractiveA()
1143 || infoPtr->isDiffractiveB() || infoPtr->isDiffractiveC() )
1147 bool onlyQGP1 =
true;
1148 bool onlyQGP2 =
true;
1149 double scaleLimit1 = 0.;
1150 double scaleLimit2 = 0.;
1152 int iBegin = 5 + beamOffset;
1153 for (
int i = iBegin; i <
event.size(); ++i) {
1154 if (event[i].status() == -21) ++n21;
1155 else if (n21 == 0) {
1156 scaleLimit1 += 0.5 *
event[i].pT();
1157 int idAbs =
event[i].idAbs();
1158 if (idAbs > 5 && idAbs != 21 && idAbs != 22) onlyQGP1 =
false;
1159 }
else if (n21 == 2) {
1160 scaleLimit2 += 0.5 *
event[i].pT();
1161 int idAbs =
event[i].idAbs();
1162 if (idAbs > 5 && idAbs != 21 && idAbs != 22) onlyQGP2 =
false;
1167 scaleLimitPTsave = (n21 == 2) ? min( scaleLimit1, scaleLimit2) : scaleLimit1;
1168 bool onlyQGP = (n21 == 2) ? (onlyQGP1 || onlyQGP2) : onlyQGP1;
1177 double MultipartonInteractions::pTnext(
double pTbegAll,
double pTendAll,
1181 bool pickRescatter, acceptKin;
1182 double dSigmaScatter, dSigmaRescatter, WTacc;
1183 double pT2end = pow2( max(pTmin, pTendAll) );
1190 if (bProfile == 4 && bIsSet && bSetInFirst && infoPtr->getCounter(21) == 1
1191 && infoPtr->getCounter(22) == 1) {
1192 if (pT2Save < pT2end)
return 0.;
1194 pT2Fac = pT2FacSave;
1195 pT2Ren = pT2RenSave;
1205 xPDF1now = xPDF1nowSave;
1206 xPDF2now = xPDF2nowSave;
1207 if (dSigmaDtSel == dSigmaDtSelSave) dSigmaDtSel->swapKin();
1208 else dSigmaDtSel = dSigmaDtSelSave;
1213 bool allowRescatterNow = allowRescatter;
1214 if (globalRecoilFSR && partonSystemsPtr->sizeOut(0) <= nMaxGlobalRecoilFSR)
1215 allowRescatterNow =
false;
1218 pT2 = pow2(pTbegAll);
1221 if (allowRescatterNow) findScatteredPartons( event);
1227 if (pT2 < pT2end)
return 0.;
1233 pickRescatter =
false;
1236 dSigmaScatter = sigmaPT2scatter(
false);
1239 dSigmaRescatter = (allowRescatterNow) ? sigmaPT2rescatter( event) : 0.;
1242 WTacc = (dSigmaScatter + dSigmaRescatter) / dSigmaApprox;
1243 if (WTacc > WTACCWARN) infoPtr->errorMsg(
"Warning in "
1244 "MultipartonInteractions::pTnext: weight above unity");
1248 if (enhanceScreening > 0) {
1249 int nSysNow = infoPtr->nMPI() + 1;
1250 if (enhanceScreening == 2) nSysNow += infoPtr->nISR();
1251 double WTscreen = pow2( (pT2 + pT20) / (pT2 + nSysNow * pT20) );
1256 if (bProfile == 4) {
1257 double w1 = XDEP_A1 + a1 * log(1. / x1);
1258 double w2 = XDEP_A1 + a1 * log(1. / x2);
1259 double fac = a02now * (w1 * w1 + w2 * w2);
1261 enhanceBnow = sigmaND / M_PI / fac * exp( - b2now / fac);
1262 double oWgt = enhanceBnow / enhanceBmax;
1263 if (oWgt > 1.0000000001) infoPtr->errorMsg(
"Warning in Multiparton"
1264 "Interactions::pTnext: overlap weight above unity");
1269 }
while (WTacc < rndmPtr->flat());
1272 if (allowRescatterNow) {
1273 pickRescatter = (i1Sel > 0 || i2Sel > 0);
1283 sigma2Sel->sigma( id1, id2, x1, x2, sHat, tHat, uHat, alpS, alpEM,
1284 true, pickOtherSel);
1288 dSigmaDtSel = sigma2Sel->sigmaSel();
1289 if (sigma2Sel->swapTU()) swap( tHat, uHat);
1293 if (pickRescatter) {
1294 Vec4 p1Res = (i1Sel == 0) ? 0.5 * eCM * x1Sel * Vec4( 0., 0., 1., 1.)
1296 Vec4 p2Res = (i2Sel == 0) ? 0.5 * eCM * x2Sel * Vec4( 0., 0., -1., 1.)
1298 double m1Res = (i1Sel == 0) ? 0. : event[i1Sel].m();
1299 double m2Res = (i2Sel == 0) ? 0. : event[i2Sel].m();
1300 acceptKin = dSigmaDtSel->final2KinMPI( i1Sel, i2Sel, p1Res, p2Res,
1303 }
else acceptKin = dSigmaDtSel->final2KinMPI();
1304 }
while (!acceptKin);
1316 bool MultipartonInteractions::scatter(
Event& event) {
1319 int sizeProc =
event.size();
1321 for (
int i = 3; i < sizeProc; ++i)
1322 if (event[i].statusAbs() < 20) nBeams = i + 1;
1323 int nOffset = nBeams - 3;
1326 int motherOffset =
event.size();
1327 int colOffset =
event.lastColTag();
1328 for (
int i = 1; i <= 4; ++i) {
1329 Particle parton = dSigmaDtSel->getParton(i);
1330 if (i <= 2 ) parton.mothers( i + nOffset, 0);
1331 else parton.mothers( motherOffset, motherOffset + 1);
1332 if (i <= 2 ) parton.daughters( motherOffset + 2, motherOffset + 3);
1333 else parton.daughters( 0, 0);
1334 int col = parton.col();
1335 if (col > 0) parton.col( col + colOffset);
1336 int acol = parton.acol();
1337 if (acol > 0) parton.acol( acol + colOffset);
1340 event.append(parton);
1345 partonVertexPtr->vertexMPI( sizeProc, 4, bNow, event);
1348 if (canVetoMPI && userHooksPtr->doVetoMPIEmission(sizeProc, event)) {
1349 event.popBack(event.size() - sizeProc);
1354 int iSys = partonSystemsPtr->addSys();
1355 partonSystemsPtr->setInA(iSys, motherOffset);
1356 partonSystemsPtr->setInB(iSys, motherOffset + 1);
1357 partonSystemsPtr->addOut(iSys, motherOffset + 2);
1358 partonSystemsPtr->addOut(iSys, motherOffset + 3);
1359 partonSystemsPtr->setSHat(iSys, sHat);
1362 bool annihil1 =
false;
1363 bool annihil2 =
false;
1364 if (i1Sel > 0 && i2Sel > 0) {
1365 if (event[motherOffset].col() == event[motherOffset + 1].acol()
1366 && event[motherOffset].col() > 0) annihil1 =
true;
1367 if (event[motherOffset].acol() == event[motherOffset + 1].col()
1368 && event[motherOffset].acol() > 0) annihil2 =
true;
1372 BeamParticle& beamA = *beamAPtr;
1373 int iA = beamA.append( motherOffset, id1, x1);
1377 beamA.xfISR( iA, id1, x1, pT2);
1378 beamA.pickValSeaComp();
1383 beamA[iA].companion(-10);
1384 event[i1Sel].statusNeg();
1385 event[i1Sel].daughters( motherOffset, motherOffset);
1386 event[motherOffset].mothers( i1Sel, i1Sel);
1387 int colOld =
event[i1Sel].col();
1389 int colNew =
event[motherOffset].col();
1390 for (
int i = motherOffset; i < motherOffset + 4; ++i) {
1391 if (event[i].col() == colNew)
event[i].col( colOld);
1392 if (event[i].acol() == colNew)
event[i].acol( colOld);
1395 int acolOld =
event[i1Sel].acol();
1397 int acolNew =
event[motherOffset].acol();
1398 for (
int i = motherOffset; i < motherOffset + 4; ++i) {
1399 if (event[i].col() == acolNew)
event[i].col( acolOld);
1400 if (event[i].acol() == acolNew)
event[i].acol( acolOld);
1406 BeamParticle& beamB = *beamBPtr;
1407 int iB = beamB.append( motherOffset + 1, id2, x2);
1411 beamB.xfISR( iB, id2, x2, pT2);
1412 beamB.pickValSeaComp();
1417 beamB[iB].companion(-10);
1418 event[i2Sel].statusNeg();
1419 event[i2Sel].daughters( motherOffset + 1, motherOffset + 1);
1420 event[motherOffset + 1].mothers( i2Sel, i2Sel);
1421 int colOld =
event[i2Sel].col();
1423 int colNew =
event[motherOffset + 1].col();
1424 for (
int i = motherOffset; i < motherOffset + 4; ++i) {
1425 if (event[i].col() == colNew)
event[i].col( colOld);
1426 if (event[i].acol() == colNew)
event[i].acol( colOld);
1429 int acolOld =
event[i2Sel].acol();
1431 int acolNew =
event[motherOffset + 1].acol();
1432 for (
int i = motherOffset; i < motherOffset + 4; ++i) {
1433 if (event[i].col() == acolNew)
event[i].col( acolOld);
1434 if (event[i].acol() == acolNew)
event[i].acol( acolOld);
1441 if (annihil1 || annihil2) {
1442 int colLeft = (annihil1) ? event[motherOffset].col()
1443 :
event[motherOffset].acol();
1444 int mother1 =
event[motherOffset].mother1();
1445 int mother2 =
event[motherOffset + 1].mother1();
1446 int colLost = (annihil1)
1447 ? event[mother1].col() +
event[mother2].acol() - colLeft
1448 :
event[mother1].acol() +
event[mother2].col() - colLeft;
1449 for (
int i = 0; i < motherOffset; ++i) {
1450 if (event[i].col() == colLost)
event[i].col( colLeft );
1451 if (event[i].acol() == colLost)
event[i].acol( colLeft );
1458 if ( beamAPtr->isGamma() || beamBPtr->isGamma() ) {
1459 if ( !beamAPtr->roomForRemnants(*beamBPtr) ) {
1463 beamAPtr->popBack();
1464 beamBPtr->popBack();
1465 partonSystemsPtr->popBack();
1467 infoPtr->errorMsg(
"Warning in MultipartonInteractions::scatter:"
1468 " No room for remnants for given scattering");
1474 beamA.pTMPI(sqrtpos(pT2));
1475 beamB.pTMPI(sqrtpos(pT2));
1478 int codeMPI = dSigmaDtSel->code();
1479 double pTMPI = dSigmaDtSel->pTMPIFin();
1480 if (iDiffSys == 0) infoPtr->setTypeMPI( codeMPI, pTMPI, i1Sel, i2Sel,
1481 enhanceBnow / zeroIntCorr);
1482 partonSystemsPtr->setPTHat(iSys, pTMPI);
1492 void MultipartonInteractions::upperEnvelope() {
1499 for (
int iPT = 0; iPT < 100; ++iPT) {
1500 double pT = pTmin * pow( pTmax/pTmin, 0.01 * (iPT + 0.5) );
1502 pT2shift = pT2 + pT20;
1504 pT2Fac = (SHIFTFACSCALE) ? pT2shift : pT2;
1508 double xPDF1sumMax = (9./4.) * beamAPtr->xf(21, xT, pT2Fac);
1509 for (
int id = 1;
id <= nQuarkIn; ++id)
1510 xPDF1sumMax += beamAPtr->xf(
id, xT, pT2Fac)
1511 + beamAPtr->xf(-
id, xT, pT2Fac);
1512 double xPDF2sumMax = (9./4.) * beamBPtr->xf(21, xT, pT2Fac);
1513 for (
int id = 1;
id <= nQuarkIn; ++id)
1514 xPDF2sumMax += beamBPtr->xf(
id, xT, pT2Fac)
1515 + beamBPtr->xf(-
id, xT, pT2Fac);
1518 alpS = alphaS.alphaS(pT2Ren);
1519 alpEM = alphaEM.alphaEM(pT2Ren);
1520 double dSigmaPartonApprox = CONVERT2MB * Kfactor * 0.5 * M_PI
1521 * pow2(alpS / pT2shift);
1522 double yMax = log(1./xT + sqrt(1./(xT*xT) - 1.));
1523 double volumePhSp = pow2(2. * yMax);
1526 double dSigmaApproxNow = SIGMAFUDGE * xPDF1sumMax * xPDF2sumMax
1527 * dSigmaPartonApprox * volumePhSp;
1528 double pT4dSigmaNow = pow2(pT2 + pT20R) * dSigmaApproxNow;
1529 if ( pT4dSigmaNow > pT4dSigmaMax) pT4dSigmaMax = pT4dSigmaNow;
1533 pT4dProbMax = pT4dSigmaMax / sigmaND;
1543 void MultipartonInteractions::jetCrossSection() {
1546 double sigmaFactor = (1. / pT20minR - 1. / pT20maxR) / (100. * nSample);
1549 if (bProfile == 4)
for (
int bBin = 0; bBin < XDEP_BBIN; bBin++)
1550 sigmaIntWgt[bBin] = 0.;
1554 double dSigmaMax = 0.;
1557 for (
int iPT = 99; iPT >= 0; --iPT) {
1558 double sigmaSum = 0.;
1561 if (bProfile == 4)
for (
int bBin = 0; bBin < XDEP_BBIN; bBin++)
1562 sigmaSumWgt[bBin] = 0.;
1565 for (
int iSample = 0; iSample < nSample; ++iSample) {
1566 double mappedPT2 = 1. - 0.01 * (iPT + rndmPtr->flat());
1567 pT2 = pT20min0maxR / (pT20minR + mappedPT2 * pT2maxmin) - pT20R;
1570 double dSigma = sigmaPT2scatter(
true);
1573 dSigma *= pow2(pT2 + pT20R);
1575 if (dSigma > dSigmaMax) dSigmaMax = dSigma;
1579 if (bProfile == 4 && dSigma > 0.) {
1580 double w1 = XDEP_A1 + a1 * log(1. / x1);
1581 double w2 = XDEP_A1 + a1 * log(1. / x2);
1582 double fac = XDEP_A0 * XDEP_A0 * (w1 * w1 + w2 * w2);
1583 double b = 0.5 * bstepNow;
1584 for (
int bBin = 0; bBin < XDEP_BBIN; bBin++) {
1585 double wgt = exp( - b * b / fac ) / fac / M_PI;
1586 sigmaSumWgt[bBin] += dSigma * wgt;
1593 sigmaSum *= sigmaFactor;
1594 sigmaInt += sigmaSum;
1595 sudExpPT[iPT] = sudExpPT[iPT + 1] + sigmaSum / sigmaND;
1598 if (bProfile == 4)
for (
int bBin = 0; bBin < XDEP_BBIN; bBin++) {
1599 sigmaSumWgt[bBin] *= sigmaFactor;
1600 sigmaIntWgt[bBin] += sigmaSumWgt[bBin];
1607 if (dSigmaMax > pT4dSigmaMax) {
1608 pT4dSigmaMax = dSigmaMax;
1609 pT4dProbMax = dSigmaMax / sigmaND;
1619 double MultipartonInteractions::sudakov(
double pT2sud,
double enhance) {
1622 double xBin = (pT2sud - pT2min) * pT20maxR
1623 / (pT2maxmin * (pT2sud + pT20R));
1624 xBin = max(1e-6, min(100. - 1e-6, 100. * xBin) );
1625 int iBin = int(xBin);
1628 double sudExp = sudExpPT[iBin] + (xBin - iBin)
1629 * (sudExpPT[iBin + 1] - sudExpPT[iBin]);
1630 return exp( -enhance * sudExp);
1639 double MultipartonInteractions::fastPT2(
double pT2beg) {
1642 double pT20begR = pT2beg + pT20R;
1643 double pT4dProbMaxNow = pT4dProbMax * enhanceBmax;
1644 double pT2try = pT4dProbMaxNow * pT20begR
1645 / (pT4dProbMaxNow - pT20begR * log(rndmPtr->flat())) - pT20R;
1647 if ( pT2try + pT20R <= 0.0 )
return 0.0;
1650 dSigmaApprox = pT4dSigmaMax / pow2(pT2try + pT20R);
1661 double MultipartonInteractions::sigmaPT2scatter(
bool isFirst) {
1664 pT2shift = pT2 + pT20;
1666 pT2Fac = (SHIFTFACSCALE) ? pT2shift : pT2;
1667 alpS = alphaS.alphaS(pT2Ren);
1668 alpEM = alphaEM.alphaEM(pT2Ren);
1671 xT = 2. * sqrt(pT2) / eCM;
1672 if (xT >= 1.)
return 0.;
1674 double yMax = log(1./xT + sqrt(1./xT2 - 1.));
1677 double y3 = yMax * (2. * rndmPtr->flat() - 1.);
1678 double y4 = yMax * (2. * rndmPtr->flat() - 1.);
1679 y = 0.5 * (y3 + y4);
1682 x1 = 0.5 * xT * (exp(y3) + exp(y4));
1683 x2 = 0.5 * xT * (exp(-y3) + exp(-y4));
1684 if (isFirst && iDiffSys == 0) {
1685 if (x1 > 1. || x2 > 1.)
return 0.;
1687 if (x1 > beamAPtr->xMax() || x2 > beamBPtr->xMax())
return 0.;
1693 double xPDF1sum = 0.;
1695 double xPDF2sum = 0.;
1699 for (
int id = -nQuarkIn;
id <= nQuarkIn; ++id) {
1701 xPDF1[10] = (9./4.) * beamAPtr->xf(21, x1, pT2Fac);
1702 xPDF2[10] = (9./4.) * beamBPtr->xf(21, x2, pT2Fac);
1704 xPDF1[
id+10] = beamAPtr->xf(
id, x1, pT2Fac);
1705 xPDF2[
id+10] = beamBPtr->xf(
id, x2, pT2Fac);
1707 xPDF1sum += xPDF1[
id+10];
1708 xPDF2sum += xPDF2[
id+10];
1713 xfModPrepData xfDataA = beamAPtr->xfModPrep(-1, pT2Fac);
1714 xfModPrepData xfDataB = beamBPtr->xfModPrep(-1, pT2Fac);
1715 for (
int id = -nQuarkIn;
id <= nQuarkIn; ++id) {
1716 if (
id == 0)
continue;
1717 xPDF1[
id+10] = beamAPtr->xfMPI(
id, x1, pT2Fac, xfDataA);
1718 xPDF2[
id+10] = beamBPtr->xfMPI(
id, x2, pT2Fac, xfDataB);
1719 xPDF1sum += xPDF1[
id+10];
1720 xPDF2sum += xPDF2[
id+10];
1722 xPDF1[10] = (9./4.) * beamAPtr->xfMPI(21, x1, pT2Fac, xfDataA);
1723 xPDF2[10] = (9./4.) * beamBPtr->xfMPI(21, x2, pT2Fac, xfDataB);
1724 xPDF1sum += xPDF1[10];
1725 xPDF2sum += xPDF2[10];
1729 id1 = -nQuarkIn - 1;
1730 double temp = xPDF1sum * rndmPtr->flat();
1731 do { xPDF1now = xPDF1[(++id1) + 10]; temp -= xPDF1now; }
1732 while (temp > 0. && id1 < nQuarkIn);
1733 if (id1 == 0) id1 = 21;
1735 temp = xPDF2sum * rndmPtr->flat();
1736 do { xPDF2now = xPDF2[(++id2) + 10]; temp -= xPDF2now;}
1737 while (temp > 0. && id2 < nQuarkIn);
1738 if (id2 == 0) id2 = 21;
1741 if ( isFirst && ( beamAPtr->isGamma() || beamBPtr->isGamma() ) ) {
1742 double mTRem = eCM * sqrt( (1 - x1) * (1 - x2) );
1743 double m1 = beamAPtr->remnantMass(id1);
1744 double m2 = beamBPtr->remnantMass(id2);
1745 if (mTRem < m1 + m2)
return 0.;
1751 SigmaMultiparton* sigma2Tmp;
1753 if (id1 == 21 && id2 == 21) {
1754 sigma2Tmp = &sigma2gg;
1756 }
else if (id1 == 21 || id2 == 21) {
1757 sigma2Tmp = &sigma2qg;
1759 }
else if (id1 == -id2) sigma2Tmp = &sigma2qqbarSame;
1760 else sigma2Tmp = &sigma2qq;
1764 double root = sqrtpos(1. - xT2 / tau);
1765 tHat = -0.5 * sHat * (1. - root);
1766 uHat = -0.5 * sHat * (1. + root);
1771 double dSigmaPartonCorr = Kfactor * gluFac
1772 * sigma2Tmp->sigma( id1, id2, x1, x2, sHat, tHat, uHat, alpS, alpEM);
1775 double volumePhSp = pow2(2. * yMax);
1776 double dSigmaScat = dSigmaPartonCorr * xPDF1sum * xPDF2sum * volumePhSp;
1781 double pT2massive = pT2;
1782 dSigmaScat *= pow2( pT2massive / (pT2massive + pT20) );
1785 dSigmaSum += dSigmaScat;
1797 sigma2Sel = sigma2Tmp;
1798 pickOtherSel = sigma2Tmp->pickedOther();
1802 dSigmaDtSel = sigma2Tmp->sigmaSel();
1803 if (sigma2Tmp->swapTU()) swap( tHat, uHat);
1814 void MultipartonInteractions::findScatteredPartons(
Event& event) {
1817 scatteredA.resize(0);
1818 scatteredB.resize(0);
1819 double yTmp, probA, probB;
1822 for (
int i = 0; i <
event.size(); ++i)
1823 if (event[i].isFinal() && (
event[i].idAbs() <= nQuarkIn
1824 ||
event[i].id() == 21)) {
1825 yTmp =
event[i].y();
1828 switch(rescatterMode) {
1832 if ( yTmp > 0.) scatteredA.push_back( i);
1833 if (-yTmp > 0.) scatteredB.push_back( i);
1838 if ( yTmp > ySepResc) scatteredA.push_back( i);
1839 if (-yTmp > ySepResc) scatteredB.push_back( i);
1844 probA = 0.5 * (1. + ( yTmp - ySepResc) / deltaYResc);
1845 if (probA > rndmPtr->flat()) scatteredA.push_back( i);
1846 probB = 0.5 * (1. + (-yTmp - ySepResc) / deltaYResc);
1847 if (probB > rndmPtr->flat()) scatteredB.push_back( i);
1853 probA = 1. / (1. + exp(-2. * ( yTmp - ySepResc) / deltaYResc));
1854 if (probA > rndmPtr->flat()) scatteredA.push_back( i);
1855 probB = 1. / (1. + exp(-2. * (-yTmp - ySepResc) / deltaYResc));
1856 if (probB > rndmPtr->flat()) scatteredB.push_back( i);
1861 scatteredA.push_back( i);
1862 scatteredB.push_back( i);
1877 double MultipartonInteractions::sigmaPT2rescatter(
Event& event) {
1880 xT = 2. * sqrt(pT2) / eCM;
1881 if (xT >= 1.)
return 0.;
1885 SigmaMultiparton* sigma2Tmp;
1886 double dSigmaResc = 0.;
1889 int nScatA = scatteredA.size();
1891 if (PREPICKRESCATTER && nScatA > 0) iScatA = min( nScatA - 1,
1892 int( rndmPtr->flat() * double(nScatA) ) );
1895 xfModPrepData xfDataB = beamBPtr->xfModPrep(-1, pT2Fac);
1896 for (
int iScat = 0; iScat < nScatA; ++iScat) {
1897 if (PREPICKRESCATTER && iScat != iScatA)
continue;
1898 int iA = scatteredA[iScat];
1899 int id1Tmp =
event[iA].id();
1902 double x1Tmp =
event[iA].pPos() / eCM;
1903 double sHatMax = x1Tmp * beamBPtr->xMax() * sCM;
1904 if (sHatMax < 4. * pT2)
continue;
1907 double dyMax = log( sqrt(0.25 * sHatMax / pT2)
1908 * (1. + sqrtpos(1. - 4. * pT2 / sHatMax)) );
1909 double dy = dyMax * (2. * rndmPtr->flat() - 1.);
1913 double m2Tmp =
event[iA].m2();
1914 double sHatTmp = m2Tmp + 4. * pT2 * pow2(cosh(dy));
1915 double x2Tmp = (sHatTmp - m2Tmp) /(x1Tmp * sCM);
1916 double tauTmp = sHatTmp / sCM;
1917 double root = sqrtpos(1. - xT2 / tauTmp);
1918 double tHatTmp = -0.5 * sHatTmp * (1. - root);
1919 double uHatTmp = -0.5 * sHatTmp * (1. + root);
1923 double xPDF2sum = 0.;
1926 for (
int id = -nQuarkIn;
id <= nQuarkIn; ++id) {
1927 if (
id == 0)
continue;
1928 xPDF2[
id+10] = beamBPtr->xfMPI(
id, x2Tmp, pT2Fac, xfDataB);
1929 xPDF2sum += xPDF2[
id+10];
1931 xPDF2[10] = (9./4.) * beamBPtr->xfMPI(21, x2Tmp, pT2Fac, xfDataB);
1932 xPDF2sum += xPDF2[10];
1935 int id2Tmp = -nQuarkIn - 1;
1936 double temp = xPDF2sum * rndmPtr->flat();
1937 do { xPDF2now = xPDF2[(++id2Tmp) + 10]; temp -= xPDF2now;}
1938 while (temp > 0. && id2Tmp < nQuarkIn);
1939 if (id2Tmp == 0) id2Tmp = 21;
1944 if (id1Tmp == 21 && id2Tmp == 21) sigma2Tmp = &sigma2gg;
1945 else if (id1Tmp == 21 || id2Tmp == 21) sigma2Tmp = &sigma2qg;
1946 else if (id1Tmp == -id2Tmp) sigma2Tmp = &sigma2qqbarSame;
1947 else sigma2Tmp = &sigma2qq;
1948 double gluFac = (id2Tmp == 21) ? 4. / 9. : 1.;
1953 double dSigmaPartonCorr = Kfactor * gluFac
1954 * sigma2Tmp->sigma( id1Tmp, id2Tmp, x1Tmp, x2Tmp, sHatTmp, tHatTmp,
1955 uHatTmp, alpS, alpEM);
1958 double volumePhSp = 4. *dyMax;
1959 double dSigmaCorr = dSigmaPartonCorr * xPDF2sum * volumePhSp;
1964 double pT2massive = pT2;
1965 dSigmaCorr *= pow2( pT2massive / (pT2massive + pT20) );
1968 if (PREPICKRESCATTER) dSigmaCorr *= nScatA;
1971 dSigmaSum += dSigmaCorr;
1972 dSigmaResc += dSigmaCorr;
1975 if (dSigmaCorr > rndmPtr->flat() * dSigmaSum) {
1985 sigma2Sel = sigma2Tmp;
1986 pickOtherSel = sigma2Tmp->pickedOther();
1991 int nScatB = scatteredB.size();
1993 if (PREPICKRESCATTER && nScatB > 0) iScatB = min( nScatB - 1,
1994 int( rndmPtr->flat() * double(nScatB) ) );
1997 xfModPrepData xfDataA = beamAPtr->xfModPrep(-1, pT2Fac);
1998 for (
int iScat = 0; iScat < nScatB; ++iScat) {
1999 if (PREPICKRESCATTER && iScat != iScatB)
continue;
2000 int iB = scatteredB[iScat];
2001 int id2Tmp =
event[iB].id();
2004 double x2Tmp =
event[iB].pNeg() / eCM;
2005 double sHatMax = beamAPtr->xMax() * x2Tmp * sCM;
2006 if (sHatMax < 4. * pT2)
continue;
2009 double dyMax = log( sqrt(0.25 * sHatMax / pT2)
2010 * (1. + sqrtpos(1. - 4. * pT2 / sHatMax)) );
2011 double dy = dyMax * (2. * rndmPtr->flat() - 1.);
2015 double m2Tmp =
event[iB].m2();
2016 double sHatTmp = m2Tmp + 4. * pT2 * pow2(cosh(dy));
2017 double x1Tmp = (sHatTmp - m2Tmp) /(x2Tmp * sCM);
2018 double tauTmp = sHatTmp / sCM;
2019 double root = sqrtpos(1. - xT2 / tauTmp);
2020 double tHatTmp = -0.5 * sHatTmp * (1. - root);
2021 double uHatTmp = -0.5 * sHatTmp * (1. + root);
2025 double xPDF1sum = 0.;
2028 for (
int id = -nQuarkIn;
id <= nQuarkIn; ++id) {
2029 if (
id == 0)
continue;
2030 xPDF1[
id+10] = beamAPtr->xfMPI(
id, x1Tmp, pT2Fac, xfDataA);
2031 xPDF1sum += xPDF1[
id+10];
2033 xPDF1[10] = (9./4.) * beamAPtr->xfMPI(21, x1Tmp, pT2Fac, xfDataA);
2034 xPDF1sum += xPDF1[10];
2037 int id1Tmp = -nQuarkIn - 1;
2038 double temp = xPDF1sum * rndmPtr->flat();
2039 do { xPDF1now = xPDF1[(++id1Tmp) + 10]; temp -= xPDF1now;}
2040 while (temp > 0. && id1Tmp < nQuarkIn);
2041 if (id1Tmp == 0) id1Tmp = 21;
2046 if (id1Tmp == 21 && id2Tmp == 21) sigma2Tmp = &sigma2gg;
2047 else if (id1Tmp == 21 || id2Tmp == 21) sigma2Tmp = &sigma2qg;
2048 else if (id1Tmp == -id2Tmp) sigma2Tmp = &sigma2qqbarSame;
2049 else sigma2Tmp = &sigma2qq;
2050 double gluFac = (id1Tmp == 21) ? 4. / 9. : 1.;
2055 double dSigmaPartonCorr = Kfactor * gluFac
2056 * sigma2Tmp->sigma( id1Tmp, id2Tmp, x1Tmp, x2Tmp, sHatTmp, tHatTmp,
2057 uHatTmp, alpS, alpEM);
2060 double volumePhSp = 4. *dyMax;
2061 double dSigmaCorr = dSigmaPartonCorr * xPDF1sum * volumePhSp;
2066 double pT2massive = pT2;
2067 dSigmaCorr *= pow2( pT2massive / (pT2massive + pT20) );
2070 if (PREPICKRESCATTER) dSigmaCorr *= nScatB;
2073 dSigmaSum += dSigmaCorr;
2074 dSigmaResc += dSigmaCorr;
2077 if (dSigmaCorr > rndmPtr->flat() * dSigmaSum) {
2087 sigma2Sel = sigma2Tmp;
2088 pickOtherSel = sigma2Tmp->pickedOther();
2094 if (allowDoubleRes) {
2095 for (
int iScat1 = 0; iScat1 < nScatA; ++iScat1) {
2096 if (PREPICKRESCATTER && iScat1 != iScatA)
continue;
2097 int iA = scatteredA[iScat1];
2098 int id1Tmp =
event[iA].id();
2099 for (
int iScat2 = 0; iScat2 < nScatB; ++iScat2) {
2100 if (PREPICKRESCATTER && iScat2 != iScatB)
continue;
2101 int iB = scatteredB[iScat2];
2102 int id2Tmp =
event[iB].id();
2105 double sHatTmp = (
event[iA].p() +
event[iB].p()).m2Calc();
2106 if (sHatTmp < 4. * pT2)
continue;
2109 double x1Tmp =
event[iA].pPos() / eCM;
2110 double x2Tmp =
event[iB].pNeg() / eCM;
2111 double tauTmp = sHatTmp / sCM;
2112 double root = sqrtpos(1. - xT2 / tauTmp);
2113 double tHatTmp = -0.5 * sHatTmp * (1. - root);
2114 double uHatTmp = -0.5 * sHatTmp * (1. + root);
2118 if (id1Tmp == 21 && id2Tmp == 21) sigma2Tmp = &sigma2gg;
2119 else if (id1Tmp == 21 || id2Tmp == 21) sigma2Tmp = &sigma2qg;
2120 else if (id1Tmp == -id2Tmp) sigma2Tmp = &sigma2qqbarSame;
2121 else sigma2Tmp = &sigma2qq;
2126 double dSigmaPartonCorr = Kfactor
2127 * sigma2Tmp->sigma( id1Tmp, id2Tmp, x1Tmp, x2Tmp, sHatTmp, tHatTmp,
2128 uHatTmp, alpS, alpEM);
2132 double dSigmaCorr = dSigmaPartonCorr / max(ROOTMIN, root);
2137 double pT2massive = pT2;
2138 dSigmaCorr *= pow2( pT2massive / (pT2massive + pT20) );
2141 if (PREPICKRESCATTER) dSigmaCorr *= nScatA * nScatB;
2144 dSigmaSum += dSigmaCorr;
2145 dSigmaResc += dSigmaCorr;
2148 if (dSigmaCorr > rndmPtr->flat() * dSigmaSum) {
2158 sigma2Sel = sigma2Tmp;
2159 pickOtherSel = sigma2Tmp->pickedOther();
2176 void MultipartonInteractions::overlapInit() {
2179 nAvg = sigmaInt / sigmaND;
2182 double deltaB = BSTEP;
2183 if (bProfile == 2) deltaB *= min( 0.5, 2.5 * coreRadius);
2184 if (bProfile == 3) deltaB *= max(1., pow(2. / expPow, 1. / expPow));
2192 double overlapNow = 0.;
2193 double probNow = 0.;
2194 double overlapInt = 0.5;
2195 double overlap2Int = 0.;
2196 double probInt = 0.;
2197 double probOverlapInt = 0.;
2198 double bProbInt = 0.;
2199 normPi = 1. / (2. * M_PI);
2202 bool pastBDiv =
false;
2203 double overlapHighB = 0.;
2210 double rescale2 = 1.;
2211 if (bProfile == 4) {
2213 kNow = XDEP_A0 / 2.0;
2219 if (stepDir == 1) kNow *= 2.;
2220 else if (stepDir == -1) kNow *= 0.5;
2221 else kNow = kLow + (nAvg - nLow) * (kHigh - kLow) / (nHigh - nLow);
2224 if (bProfile <= 0 || bProfile > 4) {
2225 probInt = 0.5 * M_PI * (1. - exp(-kNow));
2226 probOverlapInt = probInt / M_PI;
2230 nNow = M_PI * kNow * overlapInt / probInt;
2233 }
else if (bProfile < 4) {
2236 overlapInt = (bProfile == 3) ? 0. : 0.5;
2239 probOverlapInt = 0.;
2245 double b = -0.5 * deltaB;
2249 bArea = 2. * M_PI * b * deltaB;
2252 if (bProfile == 1) {
2253 overlapNow = normPi * exp( -b*b);
2254 }
else if (bProfile == 2) {
2255 overlapNow = normPi * ( fracA * exp( -min(EXPMAX, b*b))
2256 + fracB * exp( -min(EXPMAX, b*b / radius2B)) / radius2B
2257 + fracC * exp( -min(EXPMAX, b*b / radius2C)) / radius2C );
2259 overlapNow = normPi * exp( -pow( b, expPow));
2260 overlapInt += bArea * overlapNow;
2262 if (pastBDiv) overlapHighB += bArea * overlapNow;
2265 probNow = 1. - exp( -min(EXPMAX, M_PI * kNow * overlapNow));
2266 overlap2Int += bArea * pow2(overlapNow);
2267 probInt += bArea * probNow;
2268 probOverlapInt += bArea * overlapNow * probNow;
2269 bProbInt += b * bArea * probNow;
2272 if (!pastBDiv && probNow < PROBATLOWB) {
2273 bDiv = b + 0.5 * deltaB;
2278 }
while (b < 1. || b * probNow > BMAX);
2281 nNow = M_PI * kNow * overlapInt / probInt;
2284 }
else if (bProfile == 4) {
2285 rescale2 = pow2(kNow / XDEP_A0);
2287 double b = 0.5 * bstepNow;
2288 for (
int bBin = 0; bBin < XDEP_BBIN; bBin++) {
2289 double bArea = 2. * M_PI * b * bstepNow;
2290 double pIntNow = 1 - exp( -min(EXPMAX, sigmaIntWgt[bBin] / rescale2) );
2291 probInt += bArea * rescale2 * pIntNow;
2301 if (stepDir == -1) stepDir = 0;
2305 if (stepDir == 1) stepDir = -1;
2309 }
while (abs(nNow - nAvg) > KCONVERGE * nAvg);
2312 if (bProfile >= 0 && bProfile < 4) {
2313 double avgOverlap = probOverlapInt / probInt;
2314 zeroIntCorr = probOverlapInt / overlapInt;
2315 normOverlap = normPi * zeroIntCorr / avgOverlap;
2316 bAvg = bProbInt / probInt;
2317 enhanceBavg = (overlap2Int * probInt) / pow2(overlapInt);
2320 }
else if (bProfile == 4) {
2325 double b = 0.5 * bstepNow;
2326 for (
int bBin = 0; bBin < XDEP_BBIN; bBin++) {
2327 double bArea = 2. * M_PI * b * bstepNow;
2328 double pIntNow = 1. - exp( -min(EXPMAX, sigmaIntWgt[bBin] / rescale2) );
2329 bAvg += sqrt(rescale2) * b * bArea * rescale2 * pIntNow;
2330 zeroIntCorr += bArea * sigmaIntWgt[bBin] * pIntNow;
2334 zeroIntCorr /= sigmaInt;
2338 infoPtr->seta0MPI(a0now * XDEP_SMB2FM);
2339 a02now = a0now * a0now;
2340 double xMin = 2. * pTmin / infoPtr->eCM();
2341 a2max = a0now * (XDEP_A1 + a1 * log(1. / xMin));
2347 if (bProfile > 0 && bProfile <= 3) {
2348 probLowB = M_PI * bDiv*bDiv;
2349 double probHighB = M_PI * kNow * overlapHighB;
2350 if (bProfile == 1) probHighB = M_PI * kNow * 0.5 * exp( -bDiv*bDiv);
2351 else if (bProfile == 2) {
2352 fracAhigh = fracA * exp( -bDiv*bDiv);
2353 fracBhigh = fracB * exp( -bDiv*bDiv / radius2B);
2354 fracChigh = fracC * exp( -bDiv*bDiv / radius2C);
2355 fracABChigh = fracAhigh + fracBhigh + fracChigh;
2356 probHighB = M_PI * kNow * 0.5 * fracABChigh;
2358 cDiv = pow( bDiv, expPow);
2359 cMax = max(2. * expRev, cDiv);
2361 probLowB /= (probLowB + probHighB);
2371 void MultipartonInteractions::overlapFirst() {
2374 if (bProfile <= 0 || bProfile > 4) {
2376 enhanceB = enhanceBmax = enhanceBnow = zeroIntCorr;
2383 double overlapNow = 0.;
2384 if ( userHooksPtr && userHooksPtr->canSetImpactParameter() ) {
2385 bNow = userHooksPtr->doSetImpactParameter() * bAvg;
2386 isAtLowB = ( bNow < bDiv );
2388 if (bProfile == 1) overlapNow = normPi * exp( -min(EXPMAX, bNow*bNow));
2389 else if (bProfile == 2) overlapNow = normPi *
2390 ( fracA * exp( -min(EXPMAX, bNow*bNow))
2391 + fracB * exp( -min(EXPMAX, bNow*bNow / radius2B)) / radius2B
2392 + fracC * exp( -min(EXPMAX, bNow*bNow / radius2C)) / radius2C );
2393 else overlapNow = normPi * exp( -pow( bNow, expPow));
2395 enhanceB = enhanceBmax = enhanceBnow = (normOverlap / normPi) * overlapNow;
2404 double probAccept = 0.;
2408 if (rndmPtr->flat() < probLowB) {
2410 bNow = bDiv * sqrt(rndmPtr->flat());
2413 if (bProfile == 1) overlapNow = normPi * exp( -bNow*bNow);
2414 else if (bProfile == 2) overlapNow = normPi *
2415 ( fracA * exp( -bNow*bNow)
2416 + fracB * exp( -bNow*bNow / radius2B) / radius2B
2417 + fracC * exp( -bNow*bNow / radius2C) / radius2C );
2418 else overlapNow = normPi * exp( -pow( bNow, expPow));
2419 probAccept = 1. - exp( -min(EXPMAX, M_PI * kNow * overlapNow));
2426 if (bProfile == 1) {
2427 bNow = sqrt(bDiv*bDiv - log(rndmPtr->flat()));
2428 overlapNow = normPi * exp( -min(EXPMAX, bNow*bNow));
2429 }
else if (bProfile == 2) {
2430 double pickFrac = rndmPtr->flat() * fracABChigh;
2431 if (pickFrac < fracAhigh)
2432 bNow = sqrt(bDiv*bDiv - log(rndmPtr->flat()));
2433 else if (pickFrac < fracAhigh + fracBhigh)
2434 bNow = sqrt(bDiv*bDiv - radius2B * log(rndmPtr->flat()));
2435 else bNow = sqrt(bDiv*bDiv - radius2C * log(rndmPtr->flat()));
2436 overlapNow = normPi * ( fracA * exp( -min(EXPMAX, bNow*bNow))
2437 + fracB * exp( -min(EXPMAX, bNow*bNow / radius2B)) / radius2B
2438 + fracC * exp( -min(EXPMAX, bNow*bNow / radius2C)) / radius2C );
2444 }
else if (hasLowPow) {
2445 double cNow, acceptC;
2447 cNow = cDiv - 2. * log(rndmPtr->flat());
2448 acceptC = pow(cNow / cMax, expRev) * exp( -0.5 * (cNow - cMax));
2449 }
while (acceptC < rndmPtr->flat());
2450 bNow = pow( cNow, 1. / expPow);
2451 overlapNow = normPi * exp( -cNow);
2456 double cNow, acceptC;
2458 cNow = cDiv - log(rndmPtr->flat());
2459 acceptC = pow(cNow / cDiv, expRev);
2460 }
while (acceptC < rndmPtr->flat());
2461 bNow = pow( cNow, 1. / expPow);
2462 overlapNow = normPi * exp( -cNow);
2464 double temp = M_PI * kNow *overlapNow;
2465 probAccept = (1. - exp( -min(EXPMAX, temp))) / temp;
2469 }
while (probAccept < rndmPtr->flat());
2472 enhanceB = enhanceBmax = enhanceBnow = (normOverlap / normPi) * overlapNow;
2485 void MultipartonInteractions::overlapNext(
Event& event,
double pTscale,
2489 if (rehashB && bSelHard < 3) {
2492 bNow = infoPtr->bMPI();
2493 if (bSelHard == 2) bNow = sqrt(bNow);
2495 double b2 = bNow * bNow;
2498 if (bProfile == 1) {
2499 double expb2 = exp( -min(EXPMAX, b2));
2500 enhanceB = enhanceBmax = enhanceBnow = normOverlap * expb2;
2501 }
else if (bProfile == 2) {
2502 enhanceB = enhanceBmax = enhanceBnow = normOverlap *
2503 ( fracA * exp( -min(EXPMAX, b2))
2504 + fracB * exp( -min(EXPMAX, b2 / radius2B)) / radius2B
2505 + fracC * exp( -min(EXPMAX, b2 / radius2C)) / radius2C );
2507 double cNow = pow( bNow, expPow);
2508 enhanceB = enhanceBmax = enhanceBnow = normOverlap * exp(-cNow);
2518 enhanceB = enhanceBmax = enhanceBnow = zeroIntCorr;
2519 if (bProfile <= 0 || bProfile > 4)
return;
2522 if (bSelScale == 1) {
2524 for (
int i = 5; i <
event.size(); ++i)
if (event[i].isFinal()) {
2525 mmT.push_back( event[i].m() + event[i].mT() );
2526 for (
int j =
int(mmT.size()) - 1; j > 0; --j)
2527 if (mmT[j] > mmT[j - 1]) swap( mmT[j], mmT[j - 1] );
2529 pTscale = 0.5 * mmT[0];
2530 for (
int j = 1; j < int(mmT.size()); ++j) pTscale += mmT[j] / (j + 1.);
2531 }
else if (bSelScale == 2) pTscale =
event.scale();
2532 double pT2scale = pTscale*pTscale;
2535 if (bProfile == 4) {
2536 double pTtrial = 0.;
2539 double expb2 = rndmPtr->flat();
2540 double w1 = XDEP_A1 + a1 * log(1. / infoPtr->x1());
2541 double w2 = XDEP_A1 + a1 * log(1. / infoPtr->x2());
2542 double fac = a02now * (w1 * w1 + w2 * w2);
2543 b2now = - fac * log(expb2);
2549 enhanceB = sigmaND / M_PI / fac * expb2;
2550 enhanceBmax = sigmaND / 2. / M_PI / a02now
2551 * exp( -b2now / 2. / a2max );
2554 pTtrial = pTnext(pTmax, pTmin, event);
2555 }
while (pTtrial > pTscale);
2565 if (bProfile == 1) {
2566 double expb2 = rndmPtr->flat();
2568 enhanceB = enhanceBmax = enhanceBnow = normOverlap * expb2;
2569 bNow = sqrt( -log(expb2));
2572 }
else if (bProfile == 2) {
2573 double bType = rndmPtr->flat();
2574 double b2 = -log( rndmPtr->flat() );
2575 if (bType < fracA) ;
2576 else if (bType < fracA + fracB) b2 *= radius2B;
2577 else b2 *= radius2C;
2579 enhanceB = enhanceBmax = enhanceBnow = normOverlap *
2580 ( fracA * exp( -min(EXPMAX, b2))
2581 + fracB * exp( -min(EXPMAX, b2 / radius2B)) / radius2B
2582 + fracC * exp( -min(EXPMAX, b2 / radius2C)) / radius2C );
2589 }
else if (bProfile == 3 && hasLowPow) {
2590 double cNow, acceptC;
2591 double probLowC = expRev / (expRev + pow(2., expRev) * exp( - expRev));
2593 if (rndmPtr->flat() < probLowC) {
2594 cNow = 2. * expRev * rndmPtr->flat();
2595 acceptC = pow( cNow / expRev, expRev) * exp(expRev - cNow);
2597 cNow = 2. * (expRev - log( rndmPtr->flat() ));
2598 acceptC = pow(0.5 * cNow / expRev, expRev)
2599 * exp(expRev - 0.5 * cNow);
2601 }
while (acceptC < rndmPtr->flat());
2603 enhanceB = enhanceBmax = enhanceBnow = normOverlap *exp(-cNow);
2604 bNow = pow( cNow, 1. / expPow);
2608 }
else if (bProfile == 3 && !hasLowPow) {
2609 double cNow, acceptC;
2610 double probLowC = expPow / (2. * exp(-1.) + expPow);
2612 if (rndmPtr->flat() < probLowC) {
2613 cNow = pow( rndmPtr->flat(), 0.5 * expPow);
2614 acceptC = exp(-cNow);
2616 cNow = 1. - log( rndmPtr->flat() );
2617 acceptC = pow( cNow, expRev);
2619 }
while (acceptC < rndmPtr->flat());
2621 enhanceB = enhanceBmax = enhanceBnow = normOverlap * exp(-cNow);
2622 bNow = pow( cNow, 1. / expPow);
2626 }
while (sudakov(pT2scale, enhanceB) < rndmPtr->flat());
2637 void MultipartonInteractions::statistics(
bool resetStat) {
2640 cout <<
"\n *------- PYTHIA Multiparton Interactions Statistics -----"
2644 <<
" | Note: excludes hardest subprocess if already listed above "
2648 <<
" | Subprocess Code | Times"
2652 <<
" |------------------------------------------------------------"
2659 for ( map<int, int>::iterator iter = nGen.begin(); iter != nGen.end();
2661 int code = iter -> first;
2662 int number = iter->second;
2663 numberSum += number;
2667 bool foundName =
false;
2668 SigmaMultiparton* dSigma;
2669 for (
int i = 0; i < 4; ++i) {
2670 if (i == 0) dSigma = &sigma2gg;
2671 else if (i == 1) dSigma = &sigma2qg;
2672 else if (i == 2) dSigma = &sigma2qqbarSame;
2673 else dSigma = &sigma2qq;
2674 int nProc = dSigma->nProc();
2675 for (
int iProc = 0; iProc < nProc; ++iProc)
2676 if (dSigma->codeProc(iProc) == code) {
2677 name = dSigma->nameProc(iProc);
2680 if (foundName)
break;
2684 cout <<
" | " << left << setw(40) << name << right << setw(5) << code
2685 <<
" | " << setw(11) << number <<
" |\n";
2691 <<
" | " << left << setw(45) <<
"sum" << right <<
" | " << setw(11)
2692 << numberSum <<
" |\n";
2697 <<
" *------- End PYTHIA Multiparton Interactions Statistics ----"
2701 if (resetStat) resetStatistics();