File indexing completed on 2025-01-18 10:06:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #ifndef Pythia8_MultipartonInteractions_H
0011 #define Pythia8_MultipartonInteractions_H
0012
0013 #include "Pythia8/Basics.h"
0014 #include "Pythia8/BeamParticle.h"
0015 #include "Pythia8/Event.h"
0016 #include "Pythia8/Info.h"
0017 #include "Pythia8/PartonSystems.h"
0018 #include "Pythia8/PartonVertex.h"
0019 #include "Pythia8/PhysicsBase.h"
0020 #include "Pythia8/PythiaStdlib.h"
0021 #include "Pythia8/Settings.h"
0022 #include "Pythia8/SigmaTotal.h"
0023 #include "Pythia8/SigmaProcess.h"
0024 #include "Pythia8/StandardModel.h"
0025 #include "Pythia8/UserHooks.h"
0026
0027 namespace Pythia8 {
0028
0029
0030
0031
0032
0033
0034
0035 class SigmaMultiparton {
0036
0037 public:
0038
0039
0040 SigmaMultiparton() : nChan(), needMasses(), useNarrowBW3(), useNarrowBW4(),
0041 m3Fix(), m4Fix(), sHatMin(), sigmaT(), sigmaU(), sigmaTval(), sigmaUval(),
0042 sigmaTsum(), sigmaUsum(), pickOther(), pickedU(), particleDataPtr(),
0043 rndmPtr() {}
0044
0045
0046 bool init(int inState, int processLevel, Info* infoPtr,
0047 BeamParticle* beamAPtr, BeamParticle* beamBPtr);
0048
0049
0050 void updateBeamIDs() {
0051 for (int i = 0; i < nChan; ++i) sigmaT[i]->updateBeamIDs();
0052 for (int i = 0; i < nChan; ++i) sigmaU[i]->updateBeamIDs(); }
0053
0054
0055 double sigma( int id1, int id2, double x1, double x2, double sHat,
0056 double tHat, double uHat, double alpS, double alpEM,
0057 bool restore = false, bool pickOtherIn = false);
0058
0059
0060 bool pickedOther() {return pickOther;}
0061
0062
0063 SigmaProcessPtr sigmaSel();
0064 bool swapTU() {return pickedU;}
0065
0066
0067 int nProc() const {return nChan;}
0068 int codeProc(int iProc) const {return sigmaT[iProc]->code();}
0069 string nameProc(int iProc) const {return sigmaT[iProc]->name();}
0070
0071 private:
0072
0073
0074 static const double MASSMARGIN, OTHERFRAC;
0075
0076
0077 int nChan;
0078 vector<bool> needMasses, useNarrowBW3, useNarrowBW4;
0079 vector<double> m3Fix, m4Fix, sHatMin;
0080
0081
0082 vector<SigmaProcessPtr> sigmaT, sigmaU;
0083
0084
0085 vector<double> sigmaTval, sigmaUval;
0086 double sigmaTsum, sigmaUsum;
0087 bool pickOther, pickedU;
0088
0089
0090 ParticleData* particleDataPtr;
0091 Rndm* rndmPtr;
0092
0093 };
0094
0095
0096
0097
0098
0099
0100 class MultipartonInteractions : public PhysicsBase {
0101
0102 public:
0103
0104
0105 MultipartonInteractions() : allowRescatter(), allowDoubleRes(), canVetoMPI(),
0106 doPartonVertex(), doVarEcm(), setAntiSame(), setAntiSameNow(),
0107 pTmaxMatch(), alphaSorder(),
0108 alphaEMorder(), alphaSnfmax(), bProfile(), processLevel(), bSelScale(),
0109 rescatterMode(), nQuarkIn(), nSample(), enhanceScreening(), pT0paramMode(),
0110 alphaSvalue(), Kfactor(), pT0Ref(), ecmRef(), ecmPow(), pTmin(),
0111 coreRadius(), coreFraction(), expPow(), ySepResc(), deltaYResc(),
0112 sigmaPomP(), mPomP(), pPomP(), mMaxPertDiff(), mMinPertDiff(), a1(),
0113 a0now(), a02now(), bstepNow(), a2max(), b2now(), enhanceBmax(),
0114 enhanceBnow(), id1Save(), id2Save(), pT2Save(), x1Save(), x2Save(),
0115 sHatSave(), tHatSave(), uHatSave(), alpSsave(), alpEMsave(), pT2FacSave(),
0116 pT2RenSave(), xPDF1nowSave(), xPDF2nowSave(), scaleLimitPTsave(),
0117 dSigmaDtSelSave(), vsc1(), vsc2(), hasPomeronBeams(), hasLowPow(),
0118 globalRecoilFSR(), iDiffSys(), nMaxGlobalRecoilFSR(), bSelHard(), eCM(),
0119 sCM(), pT0(), pT20(), pT2min(), pTmax(), pT2max(), pT20R(), pT20minR(),
0120 pT20maxR(), pT20min0maxR(), pT2maxmin(), sigmaND(), pT4dSigmaMax(),
0121 pT4dProbMax(), dSigmaApprox(), sigmaInt(), sudExpPT(), zeroIntCorr(),
0122 normOverlap(), nAvg(), kNow(), normPi(), bAvg(), bDiv(), probLowB(),
0123 radius2B(), radius2C(), fracA(), fracB(), fracC(), fracAhigh(),
0124 fracBhigh(), fracChigh(), fracABChigh(), expRev(), cDiv(), cMax(),
0125 enhanceBavg(), bIsSet(false), bSetInFirst(), isAtLowB(), pickOtherSel(),
0126 id1(), id2(), i1Sel(), i2Sel(), id1Sel(), id2Sel(), iPDFA(), nPDFA(1),
0127 bNow(), enhanceB(), pT2(), pT2shift(), pT2Ren(), pT2Fac(), x1(),
0128 x2(), xT(), xT2(), tau(), y(), sHat(), tHat(), uHat(), alpS(), alpEM(),
0129 xPDF1now(), xPDF2now(), dSigmaSum(), x1Sel(), x2Sel(), sHatSel(),
0130 tHatSel(), uHatSel(), iPDFAsave(), nStep(), iStepFrom(), iStepTo(),
0131 eCMsave(), eStepMin(), eStepMax(), eStepSize(), eStepMix(), eStepFrom(),
0132 eStepTo(), beamOffset(), mGmGmMin(), mGmGmMax(), hasGamma(),
0133 isGammaGamma(), isGammaHadron(), isHadronGamma(), partonVertexPtr(),
0134 sigma2Sel(), dSigmaDtSel() {}
0135
0136
0137 bool init( bool doMPIinit, int iDiffSysIn,
0138 BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn,
0139 PartonVertexPtr partonVertexPtrIn, bool hasGammaIn = false);
0140
0141
0142 void initSwitchID( const vector<int>& idAListIn) {
0143 idAList = idAListIn; nPDFA = idAList.size();
0144 mpis = vector<MPIInterpolationInfo>(nPDFA);}
0145
0146
0147 void setBeamID(int iPDFAin) { iPDFA = iPDFAin;
0148 sigma2gg.updateBeamIDs(); sigma2qg.updateBeamIDs();
0149 sigma2qqbarSame.updateBeamIDs(); sigma2qq.updateBeamIDs();
0150 setAntiSameNow = setAntiSame && particleDataPtr->hasAnti(infoPtr->idA())
0151 && particleDataPtr->hasAnti(infoPtr->idB());}
0152
0153
0154 void reset();
0155
0156
0157 void pTfirst();
0158
0159
0160 void setupFirstSys( Event& process);
0161
0162
0163
0164 bool limitPTmax( Event& event);
0165 double scaleLimitPT() const {return scaleLimitPTsave;}
0166
0167
0168 void prepare(Event& event, double pTscale = 1000., bool rehashB = false) {
0169 if (!bSetInFirst) overlapNext(event, pTscale, rehashB); }
0170
0171
0172 double pTnext( double pTbegAll, double pTendAll, Event& event);
0173
0174
0175 bool scatter( Event& event);
0176
0177
0178 void setEmpty() {pT2Ren = alpS = alpEM = x1 = x2 = pT2Fac
0179 = xPDF1now = xPDF2now = 0.; bIsSet = false;}
0180
0181
0182 double Q2Ren() const {return pT2Ren;}
0183 double alphaSH() const {return alpS;}
0184 double alphaEMH() const {return alpEM;}
0185 double x1H() const {return x1;}
0186 double x2H() const {return x2;}
0187 double Q2Fac() const {return pT2Fac;}
0188 double pdf1() const {return (id1 == 21 ? 4./9. : 1.) * xPDF1now;}
0189 double pdf2() const {return (id2 == 21 ? 4./9. : 1.) * xPDF2now;}
0190 double bMPI() const {return (bIsSet) ? bNow : 0.;}
0191 double enhanceMPI() const {return (bIsSet) ? enhanceB / zeroIntCorr : 1.;}
0192 double enhanceMPIavg() const {return enhanceBavg;}
0193
0194
0195
0196 int getVSC1() const {return vsc1;}
0197 int getVSC2() const {return vsc2;}
0198
0199
0200
0201 int getBeamOffset() const {return beamOffset;}
0202 void setBeamOffset(int offsetIn) {beamOffset = offsetIn;}
0203
0204
0205
0206 void accumulate() { int iBeg = (infoPtr->isNonDiffractive()) ? 0 : 1;
0207 for (int i = iBeg; i < infoPtr->nMPI(); ++i)
0208 ++nGen[ infoPtr->codeMPI(i) ];}
0209 void statistics(bool resetStat = false);
0210 void resetStatistics() { for ( map<int, int>::iterator iter = nGen.begin();
0211 iter != nGen.end(); ++iter) iter->second = 0; }
0212
0213 private:
0214
0215
0216 static const bool SHIFTFACSCALE, PREPICKRESCATTER;
0217 static const double SIGMAFUDGE, RPT20, PT0STEP, SIGMASTEP, PT0MIN,
0218 EXPPOWMIN, PROBATLOWB, BSTEP, BMAX, EXPMAX,
0219 KCONVERGE, CONVERT2MB, ROOTMIN, ECMDEV, WTACCWARN,
0220 SIGMAMBLIMIT;
0221
0222
0223 bool allowRescatter, allowDoubleRes, canVetoMPI, doPartonVertex, doVarEcm,
0224 setAntiSame, setAntiSameNow, allowIDAswitch;
0225 int pTmaxMatch, alphaSorder, alphaEMorder, alphaSnfmax, bProfile,
0226 processLevel, bSelScale, rescatterMode, nQuarkIn, nSample,
0227 enhanceScreening, pT0paramMode, reuseInit;
0228 double alphaSvalue, Kfactor, pT0Ref, ecmRef, ecmPow, pTmin, coreRadius,
0229 coreFraction, expPow, ySepResc, deltaYResc, sigmaPomP, mPomP, pPomP,
0230 mMaxPertDiff, mMinPertDiff;
0231 string initFile;
0232
0233
0234
0235 static const int XDEP_BBIN;
0236 static const double XDEP_A0, XDEP_A1, XDEP_BSTEP, XDEP_BSTEPINC,
0237 XDEP_CUTOFF, XDEP_WARN, XDEP_SMB2FM;
0238
0239
0240
0241 vector <double> sigmaIntWgt, sigmaSumWgt;
0242
0243
0244
0245
0246
0247
0248
0249
0250
0251
0252 double a1, a0now, a02now, bstepNow, a2max, b2now, enhanceBmax, enhanceBnow;
0253
0254
0255 int id1Save, id2Save;
0256 double pT2Save, x1Save, x2Save, sHatSave, tHatSave, uHatSave,
0257 alpSsave, alpEMsave, pT2FacSave, pT2RenSave, xPDF1nowSave,
0258 xPDF2nowSave, scaleLimitPTsave;
0259 SigmaProcessPtr dSigmaDtSelSave;
0260
0261
0262
0263 int vsc1, vsc2;
0264
0265
0266 bool hasPomeronBeams, hasLowPow, globalRecoilFSR;
0267 int iDiffSys, nMaxGlobalRecoilFSR, bSelHard;
0268 double eCM, sCM, pT0, pT20, pT2min, pTmax, pT2max, pT20R, pT20minR,
0269 pT20maxR, pT20min0maxR, pT2maxmin, sigmaND, pT4dSigmaMax,
0270 pT4dProbMax, dSigmaApprox, sigmaInt, sudExpPT[101],
0271 zeroIntCorr, normOverlap, nAvg, kNow, normPi, bAvg, bDiv,
0272 probLowB, radius2B, radius2C, fracA, fracB, fracC, fracAhigh,
0273 fracBhigh, fracChigh, fracABChigh, expRev, cDiv, cMax,
0274 enhanceBavg;
0275
0276
0277 bool bIsSet, bSetInFirst, isAtLowB, pickOtherSel;
0278 int id1, id2, i1Sel, i2Sel, id1Sel, id2Sel, iPDFA, nPDFA;
0279 vector<int> idAList;
0280 double bNow, enhanceB, pT2, pT2shift, pT2Ren, pT2Fac, x1, x2, xT, xT2,
0281 tau, y, sHat, tHat, uHat, alpS, alpEM, xPDF1now, xPDF2now,
0282 dSigmaSum, x1Sel, x2Sel, sHatSel, tHatSel, uHatSel;
0283
0284
0285 int iPDFAsave, nStep, iStepFrom, iStepTo;
0286 double eCMsave, eStepMin, eStepMax, eStepSize, eStepMix, eStepFrom, eStepTo;
0287
0288
0289 struct MPIInterpolationInfo {
0290 int nStepSave;
0291 double eStepMinSave, eStepMaxSave, eStepSizeSave;
0292 vector<double> pT0Save, pT4dSigmaMaxSave, pT4dProbMaxSave,
0293 sigmaIntSave, zeroIntCorrSave, normOverlapSave, kNowSave,
0294 bAvgSave, bDivSave, probLowBSave,
0295 fracAhighSave, fracBhighSave, fracChighSave,
0296 fracABChighSave, cDivSave, cMaxSave;
0297 vector<array<double, 101> > sudExpPTSave;
0298
0299 void init(int nStepIn);
0300 };
0301
0302 vector<MPIInterpolationInfo> mpis;
0303
0304
0305 int beamOffset;
0306 double mGmGmMin, mGmGmMax;
0307 bool hasGamma, isGammaGamma, isGammaHadron, isHadronGamma;
0308
0309
0310 PartonVertexPtr partonVertexPtr;
0311
0312
0313 SigmaMultiparton sigma2gg, sigma2qg, sigma2qqbarSame, sigma2qq;
0314 SigmaMultiparton* sigma2Sel;
0315 SigmaProcessPtr dSigmaDtSel;
0316
0317
0318 map<int, int> nGen;
0319
0320
0321 AlphaStrong alphaS;
0322 AlphaEM alphaEM;
0323
0324
0325 vector<int> scatteredA, scatteredB;
0326
0327
0328 void upperEnvelope();
0329
0330
0331 void jetCrossSection();
0332
0333
0334 bool saveMPIdata();
0335 bool loadMPIdata();
0336
0337
0338 double sudakov(double pT2sud, double enhance = 1.);
0339
0340
0341 double fastPT2( double pT2beg);
0342
0343
0344
0345 double sigmaPT2scatter(bool isFirst = false, bool doSymmetrize = false);
0346
0347
0348 void findScatteredPartons( Event& event);
0349
0350
0351 double sigmaPT2rescatter( Event& event);
0352
0353
0354 void overlapInit();
0355
0356
0357
0358 void overlapFirst();
0359 void overlapNext(Event& event, double pTscale, bool rehashB);
0360
0361 };
0362
0363
0364
0365 }
0366
0367 #endif