1 // SigmaProcess.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2010 Torbjorn Sjostrand.
3 // PYTHIA is licenced under the GNU GPL version 2, see COPYING for details.
4 // Please respect the MCnet Guidelines, see GUIDELINES for details.
6 // Header file for hard-process differential cross sections.
7 // SigmaProcess: base class for cross sections.
8 // Sigma0Process: base class for unresolved processes, derived from above.
9 // Sigma1Process: base class for 2 -> 1 processes, derived from above.
10 // Sigma2Process: base class for 2 -> 2 processes, derived from above.
11 // Sigma3Process: base class for 2 -> 3 processes, derived from above.
12 // SigmaLHAProcess: wrapper class for Les Houches Accord external input.
13 // Actual physics processes are found in separate files:
14 // SigmaQCD for QCD processes;
15 // SigmaEW for electroweak processes (including photon production);
16 // SigmaOnia for charmonium and bottomonium processes;
17 // SigmaHiggs for Higgs processes;
18 // SigmaSUSY for supersymmetric production;
19 // SigmaLeftRightSym for processes in left-right-symmetric scenarios;
20 // SigmaLeptoquark for leptoquark production.
21 // SigmaExtraDim for processes in scenarios for extra dimensions;
22 // SigmaGeneric for generic scalar/fermion/vector pair production.
24 #ifndef Pythia8_SigmaProcess_H
25 #define Pythia8_SigmaProcess_H
28 #include "BeamParticle.h"
31 #include "LesHouches.h"
32 #include "ParticleData.h"
33 #include "PartonDistributions.h"
34 #include "PythiaComplex.h"
35 #include "PythiaStdlib.h"
36 #include "ResonanceWidths.h"
38 #include "SigmaTotal.h"
39 #include "StandardModel.h"
40 #include "SusyLesHouches.h"
44 //==========================================================================
46 // InBeam is a simple helper class for partons and their flux in a beam.
53 InBeam( int idIn = 0) : id(idIn), pdf(0.) {}
61 //==========================================================================
63 // InPair is a simple helper class for colliding parton pairs and their flux.
70 InPair( int idAIn = 0, int idBIn = 0) : idA(idAIn), idB(idBIn),
71 pdfA(0.), pdfB(0.), pdfSigma(0.) {}
75 double pdfA, pdfB, pdfSigma;
79 //==========================================================================
81 // SigmaProcess is the base class for cross section calculations.
88 virtual ~SigmaProcess() {}
90 // Perform simple initialization and store pointers.
91 void init(Info* infoPtrIn, Settings* settingsPtrIn,
92 ParticleData* particleDataPtrIn, Rndm* rndmPtrIn,
93 BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn, Couplings* couplings,
94 SigmaTotal* sigmaTotPtrIn = 0, SusyLesHouches* slhaPtr = 0);
96 // Store or replace Les Houches pointer.
97 void setLHAPtr( LHAup* lhaUpPtrIn) {lhaUpPtr = lhaUpPtrIn;}
99 // Initialize process. Only used for some processes.
100 virtual void initProc() {}
102 // Set up allowed flux of incoming partons. Default is no flux.
103 virtual bool initFlux();
105 // Input and complement kinematics for resolved 2 -> 1 process.
106 // Usage: set1Kin( x1in, x2in, sHin).
107 virtual void set1Kin( double , double , double ) {}
109 // Input and complement kinematics for resolved 2 -> 2 process.
110 // Usage: set2Kin( x1in, x2in, sHin, tHin, m3in, m4in, runBW3in, runBW4in).
111 virtual void set2Kin( double , double , double , double , double ,
112 double, double, double ) {}
114 // Ditto, but for Multiple Interactions applications, so different input.
115 // Usage: set2KinMI( x1in, x2in, sHin, tHin, uHin,
116 // alpSin, alpEMin, needMasses, m3in, m4in)
117 virtual void set2KinMI( double , double , double , double ,
118 double , double , double , bool , double , double ) {}
120 // Input and complement kinematics for resolved 2 -> 3 process.
121 // Usage: set3Kin( x1in, x2in, sHin, p3prel, p4prel, p5prel,
122 // m3in, m4in, m5in, runBW3in, runBW4in, runBW5in);
123 virtual void set3Kin( double , double , double , Vec4 , Vec4 , Vec4 ,
124 double , double , double , double , double , double ) {}
126 // Calculate flavour-independent parts of cross section.
127 virtual void sigmaKin() {}
129 // Evaluate sigma for unresolved, sigmaHat(sHat) for 2 -> 1 processes,
130 // d(sigmaHat)/d(tHat) for (resolved) 2 -> 2 processes, and |M|^2 for
131 // 2 -> 3 processes. Answer in "native" units, either mb or GeV^-2.
132 virtual double sigmaHat() {return 0.;}
134 // Wrapper to sigmaHat, to (a) store current incoming flavours and
135 // (b) convert from GeV^-2 to mb where required.
136 // For 2 -> 1/2 also (c) convert from from |M|^2 to d(sigmaHat)/d(tHat).
137 virtual double sigmaHatWrap(int id1in = 0, int id2in = 0) {
138 id1 = id1in; id2 = id2in;
139 return ( convert2mb() ? CONVERT2MB * sigmaHat() : sigmaHat() ); }
141 // Convolute above with parton flux and K factor. Sum over open channels.
142 virtual double sigmaPDF();
144 // Select incoming parton channel and extract parton densities (resolved).
145 void pickInState(int id1in = 0, int id2in = 0);
147 // Select flavour, colour and anticolour.
148 virtual void setIdColAcol() {}
150 // Perform kinematics for a Multiple Interaction, in its rest frame.
151 virtual bool final2KinMI( int = 0, int = 0, Vec4 = 0., Vec4 = 0.,
152 double = 0., double = 0.) {return true;}
154 // Evaluate weight for simultaneous flavours (only gamma*/Z0 gamma*/Z0).
155 // Usage: weightDecayFlav( process).
156 virtual double weightDecayFlav( Event&) {return 1.;}
158 // Evaluate weight for decay angular configuration.
159 // Usage: weightDecay( process, iResBeg, iResEnd), where
160 // iResBeg <= i < iResEnd is range of sister partons to test decays of.
161 virtual double weightDecay( Event&, int, int) {return 1.;}
163 // Set scale, when that is missing for an external LHA process.
164 virtual void setScale() {}
166 // Process name and code, and the number of final-state particles.
167 virtual string name() const {return "unnamed process";}
168 virtual int code() const {return 0;}
169 virtual int nFinal() const {return 2;}
171 // Need to know which incoming partons to set up interaction for.
172 virtual string inFlux() const {return "unknown";}
174 // Need to know whether to convert cross section answer from GeV^-2 to mb.
175 virtual bool convert2mb() const {return true;}
177 // For 2 -> 2 process optional conversion from |M|^2 to d(sigmaHat)/d(tHat).
178 virtual bool convertM2() const {return false;}
180 // Special treatment needed for Les Houches processes.
181 virtual bool isLHA() const {return false;}
183 // Special treatment needed for elastic and diffractive processes.
184 virtual bool isMinBias() const {return false;}
185 virtual bool isResolved() const {return true;}
186 virtual bool isDiffA() const {return false;}
187 virtual bool isDiffB() const {return false;}
189 // Special treatment needed for SUSY processes.
190 virtual bool isSUSY() const {return false;}
192 // Special treatment needed if negative cross sections allowed.
193 virtual bool allowNegativeSigma() const {return false;}
195 // Flavours in 2 -> 2/3 processes where masses needed from beginning.
196 // (For a light quark masses will be used in the final kinematics,
197 // but not at the matrix-element level. For a gluon no masses at all.)
198 virtual int id3Mass() const {return 0;}
199 virtual int id4Mass() const {return 0;}
200 virtual int id5Mass() const {return 0;}
202 // Special treatment needed if process contains an s-channel resonance.
203 virtual int resonanceA() const {return 0;}
204 virtual int resonanceB() const {return 0;}
206 // 2 -> 2 and 2 -> 3 processes only through s-channel exchange.
207 virtual bool isSChannel() const {return false;}
209 // NOAM: Insert an intermediate resonance in 2 -> 1 -> 2 (or 3) listings.
210 virtual int idSChannel() const {return 0;}
212 // QCD 2 -> 3 processes need special phase space selection machinery.
213 virtual bool isQCD3body() const {return false;}
215 // Special treatment in 2 -> 3 with two massive propagators.
216 virtual int idTchan1() const {return 0;}
217 virtual int idTchan2() const {return 0;}
218 virtual double tChanFracPow1() const {return 0.3;}
219 virtual double tChanFracPow2() const {return 0.3;}
220 virtual bool useMirrorWeight() const {return false;}
222 // Special process-specific gamma*/Z0 choice if >=0 (e.g. f fbar -> H0 Z0).
223 virtual int gmZmode() const {return -1;}
225 // Tell whether tHat and uHat are swapped (= same as swap 3 and 4).
226 bool swappedTU() const {return swapTU;}
228 // Give back particle properties: flavours, colours, masses, or all.
229 int id(int i) const {return idSave[i];}
230 int col(int i) const {return colSave[i];}
231 int acol(int i) const {return acolSave[i];}
232 double m(int i) const {return mSave[i];}
233 Particle getParton(int i) const {return parton[i];}
235 // Give back couplings and parton densities. Not all known for minbias.
236 double Q2Ren() const {return Q2RenSave;}
237 double alphaEMRen() const {return alpEM;}
238 double alphaSRen() const {return alpS;}
239 double Q2Fac() const {return Q2FacSave;}
240 double pdf1() const {return pdf1Save;}
241 double pdf2() const {return pdf2Save;}
243 // Give back angles; relevant only for multipe-interactions processes.
244 double thetaMI() const {return atan2( sinTheta, cosTheta);}
245 double phiMI() const {return phi;}
246 double sHBetaMI() const {return sHBeta;}
247 double pT2MI() const {return pT2Mass;}
248 double pTMIFin() const {return pTFin;}
253 SigmaProcess() {for (int i = 0; i < 6; ++i) mSave[i] = 0.;}
255 // Constants: could only be changed in the code itself.
256 static const double CONVERT2MB, MASSMARGIN, COMPRELERR;
257 static const int NCOMPSTEP;
259 // Pointer to various information on the generation.
262 // Pointer to the settings database.
263 Settings* settingsPtr;
265 // Pointer to the particle data table.
266 ParticleData* particleDataPtr;
268 // Pointer to the random number generator.
271 // Pointers to incoming beams.
272 BeamParticle* beamAPtr;
273 BeamParticle* beamBPtr;
275 // Pointer to Standard Model couplings, including alphaS and alphaEM.
276 Couplings* couplingsPtr;
278 // Pointer to the total/elastic/diffractive cross section object.
279 SigmaTotal* sigmaTotPtr;
281 // Pointer to the SLHA object.
282 SusyLesHouches* slhaPtr;
284 // Pointer to LHAup for generating external events.
287 // Initialization data, normally only set once.
288 int nQuarkIn, renormScale1, renormScale2, renormScale3, renormScale3VV,
289 factorScale1, factorScale2, factorScale3, factorScale3VV;
290 double Kfactor, mcME, mbME, mmuME, mtauME, renormMultFac, renormFixScale,
291 factorMultFac, factorFixScale;
293 // CP violation parameters for Higgs sector, normally only set once.
294 int higgsH1parity, higgsH2parity, higgsA3parity;
295 double higgsH1eta, higgsH2eta, higgsA3eta;
297 // Information on incoming beams.
300 bool isLeptonA, isLeptonB, hasLeptonBeams;
302 // Partons in beams, with PDF's.
303 vector<InBeam> inBeamA;
304 vector<InBeam> inBeamB;
305 void addBeamA(int idIn) {inBeamA.push_back(InBeam(idIn));}
306 void addBeamB(int idIn) {inBeamB.push_back(InBeam(idIn));}
307 int sizeBeamA() const {return inBeamA.size();}
308 int sizeBeamB() const {return inBeamB.size();}
310 // Allowed colliding parton pairs, with pdf's.
311 vector<InPair> inPair;
312 void addPair(int idAIn, int idBIn) {
313 inPair.push_back(InPair(idAIn, idBIn));}
314 int sizePair() const {return inPair.size();}
316 // Store common subprocess kinematics quantities.
319 // Store Q2 renormalization and factorization scales, and related values.
320 double Q2RenSave, alpEM, alpS, Q2FacSave, x1Save, x2Save, pdf1Save,
321 pdf2Save, sigmaSumSave;
323 // Store flavour, colour, anticolour, mass, angles and the whole particle.
324 int id1, id2, id3, id4, id5;
325 int idSave[6], colSave[6], acolSave[6];
326 double mSave[6], cosTheta, sinTheta, phi, sHMass, sHBeta, pT2Mass, pTFin;
329 // Calculate and store all modified masses and four-vectors
330 // intended for matrix elements. Return false if failed.
331 virtual bool setupForME() {return true;}
336 // Store whether tHat and uHat are swapped (= same as swap 3 and 4).
339 // Set flavour, colour and anticolour.
340 void setId( int id1in = 0, int id2in = 0, int id3in = 0, int id4in = 0,
341 int id5in = 0) {idSave[1] = id1in; idSave[2] = id2in; idSave[3] = id3in;
342 idSave[4] = id4in; idSave[5] = id5in;}
343 void setColAcol( int col1 = 0, int acol1 = 0,
344 int col2 = 0, int acol2 = 0, int col3 = 0, int acol3 = 0,
345 int col4 = 0, int acol4 = 0, int col5 = 0, int acol5 = 0) {
346 colSave[1] = col1; acolSave[1] = acol1; colSave[2] = col2;
347 acolSave[2] = acol2; colSave[3] = col3; acolSave[3] = acol3;
348 colSave[4] = col4; acolSave[4] = acol4; colSave[5] = col5;
349 acolSave[5] = acol5; }
350 void swapColAcol() { swap(colSave[1], acolSave[1]);
351 swap(colSave[2], acolSave[2]); swap(colSave[3], acolSave[3]);
352 swap(colSave[4], acolSave[4]); swap(colSave[5], acolSave[5]);}
353 void swapCol1234() { swap(colSave[1], colSave[2]);
354 swap(colSave[3], colSave[4]); swap(acolSave[1], acolSave[2]);
355 swap(acolSave[3], acolSave[4]);}
356 void swapCol12() { swap(colSave[1], colSave[2]);
357 swap(acolSave[1], acolSave[2]);}
358 void swapCol34() { swap(colSave[3], colSave[4]);
359 swap(acolSave[3], acolSave[4]);}
361 // Common code for top and Higgs secondary decay angular weights.
362 double weightTopDecay( Event& process, int iResBeg, int iResEnd);
363 double weightHiggsDecay( Event& process, int iResBeg, int iResEnd);
367 //==========================================================================
369 // Sigma0Process is the base class for unresolved and minimum-bias processes.
370 // It is derived from SigmaProcess.
372 class Sigma0Process : public SigmaProcess {
377 virtual ~Sigma0Process() {}
379 // Number of final-state particles.
380 virtual int nFinal() const {return 2;};
382 // No partonic flux to be set up.
383 virtual bool initFlux() {return true;}
385 // Evaluate sigma for unresolved processes.
386 virtual double sigmaHat() {return 0.;}
388 // Since no PDF's there is no difference from above.
389 virtual double sigmaPDF() {return sigmaHat();}
391 // Answer for these processes already in mb, so do not convert.
392 virtual bool convert2mb() const {return false;}
401 //==========================================================================
403 // Sigma1Process is the base class for 2 -> 1 processes.
404 // It is derived from SigmaProcess.
406 class Sigma1Process : public SigmaProcess {
411 virtual ~Sigma1Process() {}
413 // Number of final-state particles.
414 virtual int nFinal() const {return 1;};
416 // Input and complement kinematics for resolved 2 -> 1 process.
417 virtual void set1Kin( double x1in, double x2in, double sHin) {
418 store1Kin( x1in, x2in, sHin); sigmaKin();}
420 // Evaluate sigmaHat(sHat) for resolved 2 -> 1 processes.
421 virtual double sigmaHat() {return 0.;}
423 // Wrapper to sigmaHat, to (a) store current incoming flavours,
424 // (b) convert from GeV^-2 to mb where required, and
425 // (c) convert from |M|^2 to d(sigmaHat)/d(tHat) where required.
426 virtual double sigmaHatWrap(int id1in = 0, int id2in = 0);
433 // Store kinematics and set scales for resolved 2 -> 1 process.
434 virtual void store1Kin( double x1in, double x2in, double sHin);
436 // Calculate modified masses and four-vectors for matrix elements.
437 virtual bool setupForME();
441 //==========================================================================
443 // Sigma2Process is the base class for 2 -> 2 processes.
444 // It is derived from SigmaProcess.
446 class Sigma2Process : public SigmaProcess {
451 virtual ~Sigma2Process() {}
453 // Number of final-state particles.
454 virtual int nFinal() const {return 2;};
456 // Input and complement kinematics for resolved 2 -> 2 process.
457 virtual void set2Kin( double x1in, double x2in, double sHin,
458 double tHin, double m3in, double m4in, double runBW3in,
459 double runBW4in) { store2Kin( x1in, x2in, sHin, tHin, m3in, m4in,
460 runBW3in, runBW4in); sigmaKin();}
462 // Ditto, but for Multiple Interactions applications, so different input.
463 virtual void set2KinMI( double x1in, double x2in, double sHin,
464 double tHin, double uHin, double alpSin, double alpEMin,
465 bool needMasses, double m3in, double m4in) {
466 store2KinMI( x1in, x2in, sHin, tHin, uHin, alpSin, alpEMin,
467 needMasses, m3in, m4in); sigmaKin();}
469 // Evaluate d(sigmaHat)/d(tHat) for resolved 2 -> 2 processes.
470 virtual double sigmaHat() {return 0.;}
472 // Wrapper to sigmaHat, to (a) store current incoming flavours,
473 // (b) convert from GeV^-2 to mb where required, and
474 // (c) convert from |M|^2 to d(sigmaHat)/d(tHat) where required.
475 virtual double sigmaHatWrap(int id1in = 0, int id2in = 0) {
476 id1 = id1in; id2 = id2in; double sigmaTmp = sigmaHat();
477 if (convertM2()) sigmaTmp /= 16. * M_PI * sH2;
478 if (convert2mb()) sigmaTmp *= CONVERT2MB; return sigmaTmp;}
480 // Perform kinematics for a Multiple Interaction, in its rest frame.
481 virtual bool final2KinMI( int i1Res = 0, int i2Res = 0, Vec4 p1Res = 0.,
482 Vec4 p2Res = 0., double m1Res = 0., double m2Res = 0.);
489 // Store kinematics and set scales for resolved 2 -> 2 process.
490 virtual void store2Kin( double x1in, double x2in, double sHin,
491 double tHin, double m3in, double m4in, double runBW3in,
493 virtual void store2KinMI( double x1in, double x2in, double sHin,
494 double tHin, double uHin, double alpSin, double alpEMin,
495 bool needMasses, double m3in, double m4in);
497 // Calculate modified masses and four-vectors for matrix elements.
498 virtual bool setupForME();
500 // Store subprocess kinematics quantities.
501 double tH, uH, tH2, uH2, m3, s3, m4, s4, pT2, runBW3, runBW4;
505 //==========================================================================
507 // Sigma3Process is the base class for 2 -> 3 processes.
508 // It is derived from SigmaProcess.
510 class Sigma3Process : public SigmaProcess {
515 virtual ~Sigma3Process() {}
517 // Number of final-state particles.
518 virtual int nFinal() const {return 3;};
520 // Input and complement kinematics for resolved 2 -> 3 process.
521 virtual void set3Kin( double x1in, double x2in, double sHin,
522 Vec4 p3cmIn, Vec4 p4cmIn, Vec4 p5cmIn, double m3in, double m4in,
523 double m5in, double runBW3in, double runBW4in, double runBW5in) {
524 store3Kin( x1in, x2in, sHin, p3cmIn, p4cmIn, p5cmIn, m3in, m4in, m5in,
525 runBW3in, runBW4in, runBW5in); sigmaKin();}
527 // Evaluate d(sigmaHat)/d(tHat) for resolved 2 -> 3 processes.
528 virtual double sigmaHat() {return 0.;}
535 // Store kinematics and set scales for resolved 2 -> 3 process.
536 virtual void store3Kin( double x1in, double x2in, double sHin,
537 Vec4 p3cmIn, Vec4 p4cmIn, Vec4 p5cmIn, double m3in, double m4in,
538 double m5in, double runBW3in, double runBW4in, double runBW5in);
540 // Calculate modified masses and four-vectors for matrix elements.
541 virtual bool setupForME();
543 // Store subprocess kinematics quantities.
544 double m3, s3, m4, s4, m5, s5, runBW3, runBW4, runBW5;
545 Vec4 p3cm, p4cm, p5cm;
549 //==========================================================================
551 // SigmaLHAProcess is a wrapper class for Les Houches Accord external input.
552 // It is derived from SigmaProcess.
554 class SigmaLHAProcess : public SigmaProcess {
562 virtual ~SigmaLHAProcess() {}
564 // No partonic flux to be set up.
565 virtual bool initFlux() {return true;}
567 // Dummy function: action is put in PhaseSpaceLHA.
568 virtual double sigmaPDF() {return 1.;}
570 // Set scale, when that is missing for an external LHA process.
571 virtual void setScale();
573 // Info on the subprocess.
574 virtual string name() const {return "Les Houches User Process(es)";}
575 virtual int code() const {return 9999;}
577 // Number of final-state particles depends on current process choice.
578 virtual int nFinal() const;
580 // Answer for these processes not in GeV^-2, so do not do this conversion.
581 virtual bool convert2mb() const {return false;}
583 // Ensure special treatment of Les Houches processes.
584 virtual bool isLHA() const {return true;}
586 // Special treatment needed if negative cross sections allowed.
587 virtual bool allowNegativeSigma() const {
588 return (lhaUpPtr->strategy() < 0);}
594 //==========================================================================
596 } // end namespace Pythia8
598 #endif // Pythia8_SigmaProcess_H