source: HiSusy/trunk/Pythia8/pythia8170/include/PhaseSpace.h @ 1

Last change on this file since 1 was 1, checked in by zerwas, 11 years ago

first import of structure, PYTHIA8 and DELPHES

File size: 17.1 KB
Line 
1// PhaseSpace.h is a part of the PYTHIA event generator.
2// Copyright (C) 2012 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.
5
6// Header file for phase space generators in kinematics selection.
7// PhaseSpace: base class for phase space generators.
8// Base class for derived classes> 2 ->1 , 2 -> 2, 2 -> 2 elastic/diffractive,
9// 2 -> 2 minbias, 2 -> 3, Les Houches.
10
11#ifndef Pythia8_PhaseSpace_H
12#define Pythia8_PhaseSpace_H
13
14#include "Basics.h"
15#include "BeamParticle.h"
16#include "Info.h"
17#include "LesHouches.h"
18#include "MultipartonInteractions.h"
19#include "ParticleData.h"
20#include "PartonDistributions.h"
21#include "PythiaStdlib.h"
22#include "SigmaProcess.h"
23#include "SigmaTotal.h"
24#include "Settings.h"
25#include "StandardModel.h"
26#include "UserHooks.h"
27
28namespace Pythia8 {
29
30//==========================================================================
31
32// Forward reference to the UserHooks class.
33class UserHooks;
34 
35//==========================================================================
36
37// PhaseSpace is a base class for  phase space generators
38// used in the selection of hard-process kinematics.
39
40class PhaseSpace {
41
42public:
43
44  // Destructor.
45  virtual ~PhaseSpace() {}
46
47  // Perform simple initialization and store pointers.
48  void init(bool isFirst, SigmaProcess* sigmaProcessPtrIn, 
49    Info* infoPtrIn, Settings* settingsPtrIn, ParticleData* particleDataPtrIn,
50    Rndm* rndmPtrIn, BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn, 
51    Couplings* couplingsPtrIn, SigmaTotal* sigmaTotPtrIn, 
52    UserHooks* userHooksPtrIn);
53
54  // Update the CM energy of the event.
55  void newECM(double eCMin) {eCM = eCMin; s = eCM * eCM;}
56
57  // Store or replace Les Houches pointer.
58  void setLHAPtr(LHAup* lhaUpPtrIn) {lhaUpPtr = lhaUpPtrIn;} 
59
60  // A pure virtual method, wherein an optimization procedure
61  // is used to determine how phase space should be sampled.
62  virtual bool setupSampling() = 0; 
63
64  // A pure virtual method, wherein a trial event kinematics
65  // is to be selected in the derived class.
66  virtual bool trialKin(bool inEvent = true, bool repeatSame = false) = 0; 
67
68  // A pure virtual method, wherein the accepted event kinematics
69  // is to be constructed in the derived class.
70  virtual bool finalKin() = 0; 
71
72  // Allow for nonisotropic decays when ME's available.
73  void   decayKinematics( Event& process);
74
75  // Give back current or maximum cross section, or set latter.
76  double sigmaNow() const {return sigmaNw;}
77  double sigmaMax() const {return sigmaMx;}
78  double biasSelectionWeight()  const {return biasWt;}
79  bool   newSigmaMax() const {return newSigmaMx;}
80  void   setSigmaMax(double sigmaMaxIn) {sigmaMx = sigmaMaxIn;}
81
82  // For Les Houches with negative event weight needs
83  virtual double sigmaSumSigned() const {return sigmaMx;}
84 
85  // Give back constructed four-vectors and known masses.
86  Vec4   p(int i)   const {return pH[i];} 
87  double m(int i)   const {return mH[i];}
88
89  // Give back other event properties.
90  double ecm()      const {return eCM;}
91  double x1()       const {return x1H;}
92  double x2()       const {return x2H;}
93  double sHat()     const {return sH;}
94  double tHat()     const {return tH;}
95  double uHat()     const {return uH;}
96  double pTHat()    const {return pTH;}
97  double thetaHat() const {return theta;}
98  double phiHat()   const {return phi;}
99  double runBW3()   const {return runBW3H;}
100  double runBW4()   const {return runBW4H;}
101  double runBW5()   const {return runBW5H;}
102
103  // Inform whether beam particles are resolved in partons or scatter directly.
104  virtual bool isResolved() const {return true;}
105
106protected:
107
108  // Constructor.
109  PhaseSpace() {}
110
111  // Constants: could only be changed in the code itself.
112  static const int    NMAXTRY, NTRY3BODY;
113  static const double SAFETYMARGIN, TINY, EVENFRAC, SAMESIGMA, WIDTHMARGIN, 
114                      SAMEMASS, MASSMARGIN, EXTRABWWTMAX, THRESHOLDSIZE, 
115                      THRESHOLDSTEP, YRANGEMARGIN, LEPTONXMIN, LEPTONXMAX, 
116                      LEPTONXLOGMIN, LEPTONXLOGMAX, LEPTONTAUMIN,
117                      SHATMINZ, PT2RATMINZ, WTCORRECTION[11];
118
119  // MBR constants: form factor appoximation with two exponents.
120  static const double FFA1, FFA2,FFB1, FFB2; 
121
122  // Pointer to cross section.
123  SigmaProcess* sigmaProcessPtr; 
124
125  // Pointer to various information on the generation.
126  Info*         infoPtr;
127
128  // Pointer to the settings database.
129  Settings*     settingsPtr;
130
131  // Pointer to the particle data table.
132  ParticleData* particleDataPtr;
133
134  // Pointer to the random number generator.
135  Rndm*         rndmPtr;
136
137  // Pointers to incoming beams.
138  BeamParticle* beamAPtr;
139  BeamParticle* beamBPtr;
140
141  // Pointer to Standard Model couplings.
142  Couplings*         couplingsPtr;
143 
144  // Pointer to the total/elastic/diffractive cross section object.
145  SigmaTotal*   sigmaTotPtr;
146
147  // Pointer to userHooks object for user interaction with program.
148  UserHooks*    userHooksPtr;
149
150  // Pointer to LHAup for generating external events.
151  LHAup*        lhaUpPtr;
152
153  // Initialization data, normally only set once.
154  bool   useBreitWigners, doEnergySpread, showSearch, showViolation,
155         increaseMaximum;
156  int    gmZmodeGlobal;
157  double mHatGlobalMin, mHatGlobalMax, pTHatGlobalMin, pTHatGlobalMax, 
158         pTHatMinDiverge, minWidthBreitWigners;
159 
160  // Information on incoming beams.
161  int    idA, idB;
162  double mA, mB, eCM, s; 
163  bool   hasLeptonBeams, hasPointLeptons;
164
165 // Cross section information.
166  bool   newSigmaMx, canModifySigma, canBiasSelection, canBias2Sel;
167  int    gmZmode;
168  double bias2SelPow, bias2SelRef, wtBW, sigmaNw, sigmaMx, sigmaPos, 
169         sigmaNeg, biasWt;
170
171  // Process-specific kinematics properties, almost always available.
172  double mHatMin, mHatMax, sHatMin, sHatMax, pTHatMin, pTHatMax, 
173         pT2HatMin, pT2HatMax; 
174
175  // Event-specific kinematics properties, almost always available.
176  double x1H, x2H, m3, m4, m5, s3, s4, s5, mHat, sH, tH, uH, pAbs, p2Abs, 
177         pTH, theta, phi, betaZ;
178  Vec4   pH[6];
179  double mH[6];
180
181  // Reselect decay products momenta isotropically in phase space.
182  void decayKinematicsStep( Event& process, int iRes);
183
184  // Much common code for normal 2 -> 1, 2 -> 2 and 2 -> 3 cases:
185
186  // Determine how phase space should be sampled.
187  void setup3Body();
188  bool setupSampling123(bool is2, bool is3, ostream& os = cout); 
189
190  // Select a trial kinematics phase space point.
191  bool trialKin123(bool is2, bool is3, bool inEvent = true, 
192    ostream& os = cout); 
193
194  // Presence and properties of any s-channel resonances.
195  int    idResA, idResB;
196  double mResA, mResB, GammaResA, GammaResB, tauResA, tauResB, widResA, 
197         widResB;
198  bool   sameResMass;
199
200  // Kinematics properties specific to 2 -> 1/2/3.
201  bool   useMirrorWeight; 
202  double tau, y, z, tauMin, tauMax, yMax, zMin, zMax, ratio34, unity34, 
203         zNeg, zPos, wtTau, wtY, wtZ, wt3Body, runBW3H, runBW4H, runBW5H, 
204         intTau0, intTau1, intTau2, intTau3, intTau4, intTau5, intTau6, 
205         intY0, intY12, intY34, intY56, mTchan1, sTchan1, mTchan2, sTchan2, 
206         frac3Flat, frac3Pow1, frac3Pow2; 
207  Vec4   p3cm, p4cm, p5cm;
208
209  // Coefficients for optimized selection in 2 -> 1/2/3.
210  int    nTau, nY, nZ;
211  double tauCoef[8], yCoef[8], zCoef[8], tauCoefSum[8], yCoefSum[8], 
212         zCoefSum[8];
213
214  // Calculate kinematical limits for 2 -> 1/2/3.
215  bool limitTau(bool is2, bool is3);
216  bool limitY();
217  bool limitZ();
218
219  // Select kinematical variable between defined limits for 2 -> 1/2/3.
220  void selectTau(int iTau, double tauVal, bool is2);
221  void selectY(int iY, double yVal);
222  void selectZ(int iZ, double zVal);
223  bool select3Body();
224
225  // Solve equation system for better phase space coefficients in 2 -> 1/2/3.
226  void solveSys( int n, int bin[8], double vec[8], double mat[8][8],
227    double coef[8], ostream& os = cout); 
228
229  // Properties specific to resonance mass selection in 2 -> 2 and 2 -> 3.
230  bool   useBW[6]; 
231  int    idMass[6];
232  double mPeak[6], sPeak[6], mWidth[6], mMin[6], mMax[6], mw[6], wmRat[6], 
233         mLower[6], mUpper[6], sLower[6], sUpper[6], fracFlat[6], fracInv[6], 
234         fracInv2[6], atanLower[6], atanUpper[6], intBW[6], intFlat[6], 
235         intInv[6], intInv2[6]; 
236
237  // Setup mass selection for one resonance at a time. Split in two parts.
238  void   setupMass1(int iM);
239  void   setupMass2(int iM, double distToThresh);
240
241  // Do mass selection and find the associated weight.
242  void   trialMass(int iM);
243  double weightMass(int iM);
244
245};
246 
247//==========================================================================
248
249// A derived class with 2 -> 1 kinematics set up in tau, y.
250
251class PhaseSpace2to1tauy : public PhaseSpace {
252
253public:
254
255  // Constructor.
256  PhaseSpace2to1tauy() {}
257
258  // Optimize subsequent kinematics selection.
259  virtual bool setupSampling() {if (!setupMass()) return false;
260    return setupSampling123(false, false);} 
261
262  // Construct the trial kinematics.
263  virtual bool trialKin(bool inEvent = true, bool = false) {wtBW = 1.; 
264    return trialKin123(false, false, inEvent);}
265
266  // Construct the final event kinematics.
267  virtual bool finalKin();
268
269private:
270
271  // Set up allowed mass range.
272  bool setupMass();
273
274};
275 
276//==========================================================================
277
278// A derived class with 2 -> 2 kinematics set up in tau, y, z = cos(theta).
279
280class PhaseSpace2to2tauyz : public PhaseSpace {
281
282public:
283
284  // Constructor.
285  PhaseSpace2to2tauyz() {}
286
287  // Optimize subsequent kinematics selection.
288  virtual bool setupSampling() {if (!setupMasses()) return false; 
289    return setupSampling123(true, false);} 
290
291  // Construct the trial kinematics.
292  virtual bool trialKin(bool inEvent = true, bool = false) {
293    if (!trialMasses()) return false; 
294    return trialKin123(true, false, inEvent);}
295
296  // Construct the final event kinematics.
297  virtual bool finalKin();
298
299private:
300
301  // Set up for fixed or Breit-Wigner mass selection.
302  bool setupMasses();
303
304  // Select fixed or Breit-Wigner-distributed masses.
305  bool trialMasses();
306
307  // Pick off-shell initialization masses when on-shell not allowed.
308  bool constrainedM3M4();
309  bool constrainedM3();
310  bool constrainedM4();
311
312};
313 
314//==========================================================================
315
316// A derived class with 2 -> 2 kinematics set up for elastic scattering.
317
318class PhaseSpace2to2elastic : public PhaseSpace {
319
320public:
321
322  // Constructor.
323  PhaseSpace2to2elastic() {}
324
325  // Construct the trial or final event kinematics.
326  virtual bool setupSampling(); 
327  virtual bool trialKin(bool inEvent = true, bool = false); 
328  virtual bool finalKin(); 
329
330  // Are beam particles resolved in partons or scatter directly?
331  virtual bool isResolved() const {return false;}
332
333private:
334
335  // Constants: could only be changed in the code itself.
336  static const double EXPMAX, CONVERTEL;
337
338  // Kinematics properties specific to 2 -> 2 elastic.
339  bool   useCoulomb;
340  double s1, s2, bSlope, lambda12S, tLow, tUpp, tAux, sigmaTot, rho,
341         lambda, tAbsMin, phaseCst, alphaEM0, sigmaNuc, sigmaCou, signCou;
342
343 // Calculation of alphaElectromagnetic.
344 AlphaEM alphaEM;
345
346};
347 
348//==========================================================================
349
350// A derived class with 2 -> 2 kinematics set up for diffractive scattering.
351
352class PhaseSpace2to2diffractive : public PhaseSpace {
353
354public:
355
356  // Constructor.
357  PhaseSpace2to2diffractive(bool isDiffAin = false, bool isDiffBin = false)
358    : isDiffA(isDiffAin), isDiffB(isDiffBin) {}
359
360  // Construct the trial or final event kinematics.
361  virtual bool setupSampling(); 
362  virtual bool trialKin(bool inEvent = true, bool = false); 
363  virtual bool finalKin(); 
364
365  // Are beam particles resolved in partons or scatter directly?
366  virtual bool isResolved() const {return false;}
367
368private:
369
370  // Constants: could only be changed in the code itself.
371  static const int    NTRY;
372  static const double EXPMAX, DIFFMASSMARGIN;
373
374  // Initialization data, in constructor or read from Settings.
375  bool   isDiffA, isDiffB;
376  int    PomFlux;
377  double epsilonPF, alphaPrimePF;
378
379  // Initialization: kinematics properties specific to 2 -> 2 diffractive.
380  double m3ElDiff, m4ElDiff, s1, s2, lambda12, lambda34, tLow, tUpp,
381         cRes, sResXB, sResAX, sProton, bMin, bSlope, bSlope1, bSlope2, 
382         probSlope1, xIntPF, xtCorPF, mp24DL, coefDL, tAux, tAux1, tAux2;
383   
384  // Parameters for MBR model.
385  double sdpmax, ddpmax, dymin0, dymax, amx, am1, am2, t;
386  double eps, alph, alph2, m2min, dyminSD, dyminDD, dyminSigSD, dyminSigDD;
387 
388};
389
390//==========================================================================
391
392// A derived class with 2 -> 3 kinematics set up for central diffractive
393// scattering.
394
395class PhaseSpace2to3diffractive : public PhaseSpace {
396
397public:
398
399  // Constructor.
400  PhaseSpace2to3diffractive() {}
401
402  // Construct the trial or final event kinematics.
403  virtual bool setupSampling(); 
404  virtual bool trialKin(bool inEvent = true, bool = false); 
405  virtual bool finalKin(); 
406
407  // Are beam particles resolved in partons or scatter directly?
408  virtual bool isResolved() const {return false;}
409
410 private:
411 
412  // Constants: could only be changed in the code itself.
413  static const int    NTRY, NINTEG2;
414  static const double EXPMAX, DIFFMASSMIN, DIFFMASSMARGIN;
415   
416  // Local variables to calculate DPE kinematics.
417  int    PomFlux;
418  double epsilonPF, alphaPrimePF, s1, s2, m5min, s5min, tLow[2], tUpp[2], 
419         bMin[2], tAux[2], bSlope1, bSlope2, probSlope1[2], tAux1[2], 
420         tAux2[2], bSlope, xIntPF, xIntInvPF, xtCorPF, mp24DL, coefDL, 
421         epsMBR, alphMBR, m2minMBR, dyminMBR, dyminSigMBR, dyminInvMBR, 
422         dpepmax, t1, t2;
423  Vec4   p1, p2, p3, p4, p5;
424
425};
426 
427//==========================================================================
428
429// A derived class for minumum bias events. Hardly does anything, since
430// the real action is taken care of by the MultipartonInteractions class.
431
432class PhaseSpace2to2minbias : public PhaseSpace {
433
434public:
435
436  // Constructor.
437  PhaseSpace2to2minbias() {}
438
439  // Construct the trial or final event kinematics.
440  virtual bool setupSampling() {sigmaNw = sigmaProcessPtr->sigmaHat();
441    sigmaMx = sigmaNw; return true;}
442  virtual bool trialKin( bool , bool = false) {return true;} 
443  virtual bool finalKin() {return true;}
444
445private:
446
447};
448 
449//==========================================================================
450
451// A derived class with 2 -> 3 kinematics 1 + 2 -> 3 + 4 + 5 set up in
452// tau, y, pT2_4, pT2_5, phi_4, phi_5 and y_3 (partial cylindrical symmetry).
453
454class PhaseSpace2to3tauycyl : public PhaseSpace {
455
456public:
457
458  // Constructor.
459  PhaseSpace2to3tauycyl() {}
460
461  // Optimize subsequent kinematics selection.
462  virtual bool setupSampling() {if (!setupMasses()) return false; 
463    setup3Body(); return setupSampling123(false, true);} 
464
465  // Construct the trial kinematics.
466  virtual bool trialKin(bool inEvent = true, bool = false) {
467    if (!trialMasses()) return false; 
468    return trialKin123(false, true, inEvent);}
469
470  // Construct the final event kinematics.
471  virtual bool finalKin();
472
473private:
474
475  // Constants: could only be changed in the code itself.
476  static const int    NITERNR;
477
478  // Set up for fixed or Breit-Wigner mass selection.
479  bool setupMasses();
480
481  // Select fixed or Breit-Wigner-distributed masses.
482  bool trialMasses();
483
484};
485 
486//==========================================================================
487
488// A derived class with 2 -> 3 kinematics 1 + 2 -> 3 + 4 + 5 set up in
489// y3, y4, y5, pT2_3, pT2_5, phi_3 and phi_5, and with R separation cut.
490// Intended specifically for (essentially massless) 2 -> 3 QCD processes.
491
492class PhaseSpace2to3yyycyl : public PhaseSpace {
493
494public:
495
496  // Constructor.
497  PhaseSpace2to3yyycyl() {}
498
499  // Optimize subsequent kinematics selection.
500  virtual bool setupSampling(); 
501
502  // Construct the trial kinematics.
503  virtual bool trialKin(bool inEvent = true, bool = false); 
504
505  // Construct the final event kinematics.
506  virtual bool finalKin();
507
508private:
509
510  // Phase space cuts specifically for 2 -> 3 QCD processes.
511  double pTHat3Min, pTHat3Max, pTHat5Min, pTHat5Max, RsepMin, R2sepMin;
512  bool   hasBaryonBeams;
513
514  // Event kinematics choices.
515  double pT3Min, pT3Max, pT5Min, pT5Max, y3Max, y4Max, y5Max,
516         pT3, pT4, pT5, phi3, phi4, phi5, y3, y4, y5, dphi;
517  Vec4   pInSum;
518
519};
520
521//==========================================================================
522
523// A derived class for Les Houches events.
524
525class PhaseSpaceLHA : public PhaseSpace {
526
527public:
528
529  // Constructor.
530  PhaseSpaceLHA() {idProcSave = 0;}
531
532  // Find maximal cross section for comparison with internal processes.
533  virtual bool setupSampling();
534
535  // Construct the next process, by interface to Les Houches class.
536  virtual bool trialKin( bool , bool repeatSame = false); 
537
538  // Set scale, alpha_s and alpha_em if not done.
539  virtual bool finalKin() {sigmaProcessPtr->setScale(); return true;}
540
541  // For Les Houches with negative event weight needs
542  virtual double sigmaSumSigned() const {return sigmaSgn;}
543
544private:
545
546  // Constants.
547  static const double CONVERTPB2MB;
548
549  // Local properties.
550  int    strategy, stratAbs, nProc, idProcSave;
551  double xMaxAbsSum, xSecSgnSum, sigmaSgn;
552  vector<int>    idProc;
553  vector<double> xMaxAbsProc;
554
555};
556
557//==========================================================================
558
559} // end namespace Pythia8
560
561#endif // Pythia8_PhaseSpace_H
562 
Note: See TracBrowser for help on using the repository browser.