StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
MultipartonInteractions.h
1 // MultipartonInteractions.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2018 Torbjorn Sjostrand.
3 // PYTHIA is licenced under the GNU GPL v2 or later, see COPYING for details.
4 // Please respect the MCnet Guidelines, see GUIDELINES for details.
5 
6 // This file contains the main classes for multiparton interactions physics.
7 // SigmaMultiparton stores allowed processes by in-flavour combination.
8 // MultipartonInteractions: generates multiparton parton-parton interactions.
9 
10 #ifndef Pythia8_MultipartonInteractions_H
11 #define Pythia8_MultipartonInteractions_H
12 
13 #include "Pythia8/Basics.h"
14 #include "Pythia8/BeamParticle.h"
15 #include "Pythia8/Event.h"
16 #include "Pythia8/Info.h"
17 #include "Pythia8/PartonSystems.h"
18 #include "Pythia8/PartonVertex.h"
19 #include "Pythia8/PythiaStdlib.h"
20 #include "Pythia8/Settings.h"
21 #include "Pythia8/SigmaTotal.h"
22 #include "Pythia8/SigmaProcess.h"
23 #include "Pythia8/StandardModel.h"
24 #include "Pythia8/UserHooks.h"
25 
26 namespace Pythia8 {
27 
28 //==========================================================================
29 
30 // SigmaMultiparton is a helper class to MultipartonInteractions.
31 // It packs pointers to the allowed processes for different
32 // flavour combinations and levels of ambition.
33 
34 class SigmaMultiparton {
35 
36 public:
37 
38  // Constructor.
39  SigmaMultiparton() {}
40 
41  // Destructor.
42  ~SigmaMultiparton() {
43  for (int i = 0; i < int(sigmaT.size()); ++i) delete sigmaT[i];
44  for (int i = 0; i < int(sigmaU.size()); ++i) delete sigmaU[i];}
45 
46  // Initialize list of processes.
47  bool init(int inState, int processLevel, Info* infoPtr,
48  Settings* settingsPtr, ParticleData* particleDataPtr, Rndm* rndmPtrIn,
49  BeamParticle* beamAPtr, BeamParticle* beamBPtr, Couplings* couplingsPtr);
50 
51  // Calculate cross section summed over possibilities.
52  double sigma( int id1, int id2, double x1, double x2, double sHat,
53  double tHat, double uHat, double alpS, double alpEM,
54  bool restore = false, bool pickOtherIn = false);
55 
56  // Return whether the other, rare processes were selected.
57  bool pickedOther() {return pickOther;}
58 
59  // Return one subprocess, picked according to relative cross sections.
60  SigmaProcess* sigmaSel();
61  bool swapTU() {return pickedU;}
62 
63  // Return code or name of a specified process, for statistics table.
64  int nProc() const {return nChan;}
65  int codeProc(int iProc) const {return sigmaT[iProc]->code();}
66  string nameProc(int iProc) const {return sigmaT[iProc]->name();}
67 
68 private:
69 
70  // Constants: could only be changed in the code itself.
71  static const double MASSMARGIN, OTHERFRAC;
72 
73  // Number of processes. Some use massive matrix elements.
74  int nChan;
75  vector<bool> needMasses;
76  vector<double> m3Fix, m4Fix, sHatMin;
77 
78  // Vector of process list, one for t-channel and one for u-channel.
79  vector<SigmaProcess*> sigmaT, sigmaU;
80 
81  // Values of cross sections in process list above.
82  vector<double> sigmaTval, sigmaUval;
83  double sigmaTsum, sigmaUsum;
84  bool pickOther, pickedU;
85 
86  // Pointer to the random number generator.
87  Rndm* rndmPtr;
88 
89 };
90 
91 //==========================================================================
92 
93 // The MultipartonInteractions class contains the main methods for the
94 // generation of multiparton parton-parton interactions in hadronic collisions.
95 
96 class MultipartonInteractions {
97 
98 public:
99 
100  // Constructor.
101  MultipartonInteractions() : bIsSet(false) {}
102 
103  // Initialize the generation process for given beams.
104  bool init( bool doMPIinit, int iDiffSysIn, Info* infoPtrIn,
105  Settings& settings, ParticleData* particleDataPtr, Rndm* rndmPtrIn,
106  BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn,
107  Couplings* couplingsPtrIn, PartonSystems* partonSystemsPtrIn,
108  SigmaTotal* sigmaTotPtrIn, UserHooks* userHooksPtrIn,
109  PartonVertex* partonVertexPtrIn, bool hasGammaIn = false);
110 
111  // Reset impact parameter choice and update the CM energy.
112  void reset();
113 
114  // Select first = hardest pT in nondiffractive process.
115  void pTfirst();
116 
117  // Set up kinematics for first = hardest pT in nondiffractive process.
118  void setupFirstSys( Event& process);
119 
120  // Find whether to limit maximum scale of emissions.
121  // Provide sum pT / 2 as potential limit where relevant.
122  bool limitPTmax( Event& event);
123  double scaleLimitPT() const {return scaleLimitPTsave;}
124 
125  // Prepare system for evolution.
126  void prepare(Event& event, double pTscale = 1000., bool rehashB = false) {
127  if (!bSetInFirst) overlapNext(event, pTscale, rehashB); }
128 
129  // Select next pT in downwards evolution.
130  double pTnext( double pTbegAll, double pTendAll, Event& event);
131 
132  // Set up kinematics of acceptable interaction.
133  bool scatter( Event& event);
134 
135  // Set "empty" values to avoid query of undefined quantities.
136  void setEmpty() {pT2Ren = alpS = alpEM = x1 = x2 = pT2Fac
137  = xPDF1now = xPDF2now = 0.; bIsSet = false;}
138 
139  // Get some information on current interaction.
140  double Q2Ren() const {return pT2Ren;}
141  double alphaSH() const {return alpS;}
142  double alphaEMH() const {return alpEM;}
143  double x1H() const {return x1;}
144  double x2H() const {return x2;}
145  double Q2Fac() const {return pT2Fac;}
146  double pdf1() const {return (id1 == 21 ? 4./9. : 1.) * xPDF1now;}
147  double pdf2() const {return (id2 == 21 ? 4./9. : 1.) * xPDF2now;}
148  double bMPI() const {return (bIsSet) ? bNow : 0.;}
149  double enhanceMPI() const {return (bIsSet) ? enhanceB / zeroIntCorr : 1.;}
150  double enhanceMPIavg() const {return enhanceBavg;}
151 
152  // For x-dependent matter profile, return incoming valence/sea
153  // decision from trial interactions.
154  int getVSC1() const {return vsc1;}
155  int getVSC2() const {return vsc2;}
156 
157  // Set the offset wrt. to normal beam particle positions for hard diffraction
158  // and for photon beam from lepton.
159  int getBeamOffset() const {return beamOffset;}
160  void setBeamOffset(int offsetIn) {beamOffset = offsetIn;}
161 
162  // Update and print statistics on number of processes.
163  // Note: currently only valid for nondiffractive systems, not diffraction??
164  void accumulate() { int iBeg = (infoPtr->isNonDiffractive()) ? 0 : 1;
165  for (int i = iBeg; i < infoPtr->nMPI(); ++i)
166  ++nGen[ infoPtr->codeMPI(i) ];}
167  void statistics(bool resetStat = false);
168  void resetStatistics() { for ( map<int, int>::iterator iter = nGen.begin();
169  iter != nGen.end(); ++iter) iter->second = 0; }
170 
171 private:
172 
173  // Constants: could only be changed in the code itself.
174  static const bool SHIFTFACSCALE, PREPICKRESCATTER;
175  static const double SIGMAFUDGE, RPT20, PT0STEP, SIGMASTEP, PT0MIN,
176  EXPPOWMIN, PROBATLOWB, BSTEP, BMAX, EXPMAX,
177  KCONVERGE, CONVERT2MB, ROOTMIN, ECMDEV, WTACCWARN,
178  SIGMAMBLIMIT;
179 
180  // Initialization data, read from Settings.
181  bool allowRescatter, allowDoubleRes, canVetoMPI, doPartonVertex;
182  int pTmaxMatch, alphaSorder, alphaEMorder, alphaSnfmax, bProfile,
183  processLevel, bSelScale, rescatterMode, nQuarkIn, nSample,
184  enhanceScreening, pT0paramMode;
185  double alphaSvalue, Kfactor, pT0Ref, ecmRef, ecmPow, pTmin, coreRadius,
186  coreFraction, expPow, ySepResc, deltaYResc, sigmaPomP, mPomP, pPomP,
187  mMaxPertDiff, mMinPertDiff;
188 
189  // x-dependent matter profile:
190  // Constants.
191  static const int XDEP_BBIN;
192  static const double XDEP_A0, XDEP_A1, XDEP_BSTEP, XDEP_BSTEPINC,
193  XDEP_CUTOFF, XDEP_WARN, XDEP_SMB2FM;
194 
195  // Table of Int( dSigma/dX * O(b, X), dX ) in bins of b for fast
196  // integration. Only needed during initialisation.
197  vector <double> sigmaIntWgt, sigmaSumWgt;
198 
199  // a1: value of a1 constant, taken from settings database.
200  // a0now (a02now): tuned value of a0 (squared value).
201  // bstepNow: current size of bins in b.
202  // a2max: given an xMin, a maximal (squared) value of the
203  // width, to be used in overestimate Omax(b).
204  // enhanceBmax, retain enhanceB as enhancement factor for the hardest
205  // enhanceBnow: interaction. Use enhanceBmax as overestimate for fastPT2,
206  // and enhanceBnow to store the value for the current
207  // interaction.
208  double a1, a0now, a02now, bstepNow, a2max, b2now, enhanceBmax, enhanceBnow;
209 
210  // Storage for trial interactions.
211  int id1Save, id2Save;
212  double pT2Save, x1Save, x2Save, sHatSave, tHatSave, uHatSave,
213  alpSsave, alpEMsave, pT2FacSave, pT2RenSave, xPDF1nowSave,
214  xPDF2nowSave, scaleLimitPTsave;
215  SigmaProcess *dSigmaDtSelSave;
216 
217  // vsc1, vsc2: for minimum-bias events with trial interaction, store
218  // decision on whether hard interaction was valence or sea.
219  int vsc1, vsc2;
220 
221  // Other initialization data.
222  bool hasBaryonBeams, hasPomeronBeams, hasLowPow, globalRecoilFSR;
223  int iDiffSys, nMaxGlobalRecoilFSR, bSelHard;
224  double eCM, sCM, pT0, pT20, pT2min, pTmax, pT2max, pT20R, pT20minR,
225  pT20maxR, pT20min0maxR, pT2maxmin, sigmaND, pT4dSigmaMax,
226  pT4dProbMax, dSigmaApprox, sigmaInt, sudExpPT[101],
227  zeroIntCorr, normOverlap, nAvg, kNow, normPi, bAvg, bDiv,
228  probLowB, radius2B, radius2C, fracA, fracB, fracC, fracAhigh,
229  fracBhigh, fracChigh, fracABChigh, expRev, cDiv, cMax,
230  enhanceBavg;
231 
232  // Properties specific to current system.
233  bool bIsSet, bSetInFirst, isAtLowB, pickOtherSel;
234  int id1, id2, i1Sel, i2Sel, id1Sel, id2Sel;
235  double bNow, enhanceB, pT2, pT2shift, pT2Ren, pT2Fac, x1, x2, xT, xT2,
236  tau, y, sHat, tHat, uHat, alpS, alpEM, xPDF1now, xPDF2now,
237  dSigmaSum, x1Sel, x2Sel, sHatSel, tHatSel, uHatSel;
238 
239  // Stored values for mass interpolation for diffractive systems.
240  int nStep, iStepFrom, iStepTo;
241  double eCMsave, eStepSize, eStepSave, eStepFrom, eStepTo, pT0Save[5],
242  pT4dSigmaMaxSave[5], pT4dProbMaxSave[5], sigmaIntSave[5],
243  sudExpPTSave[5][101], zeroIntCorrSave[5], normOverlapSave[5],
244  kNowSave[5], bAvgSave[5], bDivSave[5], probLowBSave[5],
245  fracAhighSave[5], fracBhighSave[5], fracChighSave[5],
246  fracABChighSave[5], cDivSave[5], cMaxSave[5];
247 
248  // Beam offset wrt. normal situation and other photon-related parameters.
249  int beamOffset;
250  double mGmGmMin, mGmGmMax;
251  bool hasGamma, isGammaGamma, isGammaHadron, isHadronGamma;
252 
253  // Pointer to various information on the generation.
254  Info* infoPtr;
255 
256  // Pointer to the random number generator.
257  Rndm* rndmPtr;
258 
259  // Pointers to the two incoming beams.
260  BeamParticle* beamAPtr;
261  BeamParticle* beamBPtr;
262 
263  // Pointers to Standard Model couplings.
264  Couplings* couplingsPtr;
265 
266  // Pointer to information on subcollision parton locations.
267  PartonSystems* partonSystemsPtr;
268 
269  // Pointer to total cross section parametrization.
270  SigmaTotal* sigmaTotPtr;
271 
272  // Pointer to user hooks.
273  UserHooks* userHooksPtr;
274 
275  // Pointer to assign space-time vertices during parton evolution.
276  PartonVertex* partonVertexPtr;
277 
278  // Collections of parton-level 2 -> 2 cross sections. Selected one.
279  SigmaMultiparton sigma2gg, sigma2qg, sigma2qqbarSame, sigma2qq;
280  SigmaMultiparton* sigma2Sel;
281  SigmaProcess* dSigmaDtSel;
282 
283  // Statistics on generated 2 -> 2 processes.
284  map<int, int> nGen;
285 
286  // alphaStrong and alphaEM calculations.
287  AlphaStrong alphaS;
288  AlphaEM alphaEM;
289 
290  // Scattered partons.
291  vector<int> scatteredA, scatteredB;
292 
293  // Determine constant in d(Prob)/d(pT2) < const / (pT2 + r * pT20)^2.
294  void upperEnvelope();
295 
296  // Integrate the parton-parton interaction cross section.
297  void jetCrossSection();
298 
299  // Evaluate "Sudakov form factor" for not having a harder interaction.
300  double sudakov(double pT2sud, double enhance = 1.);
301 
302  // Do a quick evolution towards the next smaller pT.
303  double fastPT2( double pT2beg);
304 
305  // Calculate the actual cross section, either for the first interaction
306  // (including at initialization) or for any subsequent in the sequence.
307  double sigmaPT2scatter(bool isFirst = false);
308 
309  // Find the partons that may rescatter.
310  void findScatteredPartons( Event& event);
311 
312  // Calculate the actual cross section for a rescattering.
313  double sigmaPT2rescatter( Event& event);
314 
315  // Calculate factor relating matter overlap and interaction rate.
316  void overlapInit();
317 
318  // Pick impact parameter and interaction rate enhancement,
319  // either before the first interaction (for nondiffractive) or after it.
320  void overlapFirst();
321  void overlapNext(Event& event, double pTscale, bool rehashB);
322 
323 };
324 
325 //==========================================================================
326 
327 } // end namespace Pythia8
328 
329 #endif // Pythia8_MultipartonInteractions_H
Definition: AgUStep.h:26