StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SpaceShower.h
1 // SpaceShower.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 the spacelike initial-state showers.
7 // SpaceDipoleEnd: radiating dipole end in ISR.
8 // SpaceShower: handles the showering description.
9 
10 #ifndef Pythia8_SpaceShower_H
11 #define Pythia8_SpaceShower_H
12 
13 #include "Basics.h"
14 #include "BeamParticle.h"
15 #include "Event.h"
16 #include "Info.h"
17 #include "ParticleData.h"
18 #include "PartonSystems.h"
19 #include "PythiaStdlib.h"
20 #include "Settings.h"
21 #include "StandardModel.h"
22 #include "UserHooks.h"
23 
24 namespace Pythia8 {
25 
26 //==========================================================================
27 
28 // Data on radiating dipole ends, only used inside SpaceShower.
29 
31 
32 public:
33 
34  // Constructor.
35  SpaceDipoleEnd( int systemIn = 0, int sideIn = 0, int iRadiatorIn = 0,
36  int iRecoilerIn = 0, double pTmaxIn = 0., int colTypeIn = 0,
37  int chgTypeIn = 0, int MEtypeIn = 0, bool normalRecoilIn = true) :
38  system(systemIn), side(sideIn), iRadiator(iRadiatorIn),
39  iRecoiler(iRecoilerIn), pTmax(pTmaxIn), colType(colTypeIn),
40  chgType(chgTypeIn), MEtype(MEtypeIn), normalRecoil(normalRecoilIn),
41  nBranch(0), pT2Old(0.), zOld(0.5) { }
42 
43  // Store values for trial emission.
44  void store( int idDaughterIn, int idMotherIn, int idSisterIn,
45  double x1In, double x2In, double m2DipIn, double pT2In, double zIn,
46  double xMoIn, double Q2In, double mSisterIn, double m2SisterIn,
47  double pT2corrIn) {idDaughter = idDaughterIn; idMother = idMotherIn;
48  idSister = idSisterIn; x1 = x1In; x2 = x2In; m2Dip = m2DipIn;
49  pT2 = pT2In; z = zIn; xMo = xMoIn; Q2 = Q2In; mSister = mSisterIn;
50  m2Sister = m2SisterIn; pT2corr = pT2corrIn;}
51 
52  // Basic properties related to evolution and matrix element corrections.
53  int system, side, iRadiator, iRecoiler;
54  double pTmax;
55  int colType, chgType, MEtype;
56  bool normalRecoil;
57 
58  // Properties specific to current trial emission.
59  int nBranch, idDaughter, idMother, idSister, iFinPol;
60  double x1, x2, m2Dip, pT2, z, xMo, Q2, mSister, m2Sister, pT2corr,
61  pT2Old, zOld, asymPol;
62 
63 } ;
64 
65 //==========================================================================
66 
67 // The SpaceShower class does spacelike showers.
68 
69 class SpaceShower {
70 
71 public:
72 
73  // Constructor.
74  SpaceShower() {}
75 
76  // Destructor.
77  virtual ~SpaceShower() {}
78 
79  // Initialize various pointers.
80  // (Separated from rest of init since not virtual.)
81  void initPtr(Info* infoPtrIn, Settings* settingsPtrIn,
82  ParticleData* particleDataPtrIn, Rndm* rndmPtrIn,
83  PartonSystems* partonSystemsPtrIn, UserHooks* userHooksPtrIn) {
84  infoPtr = infoPtrIn; settingsPtr = settingsPtrIn;
85  particleDataPtr = particleDataPtrIn; rndmPtr = rndmPtrIn;
86  partonSystemsPtr = partonSystemsPtrIn; userHooksPtr = userHooksPtrIn;}
87 
88  // Initialize generation. Possibility to force re-initialization by hand.
89  virtual void init(BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn);
90 
91  // New beams possible for handling of hard diffraction. (Not virtual.)
92  void reassignBeamPtrs( BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn)
93  {beamAPtr = beamAPtrIn; beamBPtr = beamBPtrIn;}
94 
95  // Find whether to limit maximum scale of emissions, and whether to dampen.
96  virtual bool limitPTmax( Event& event, double Q2Fac = 0.,
97  double Q2Ren = 0.);
98 
99  // Potential enhancement factor of pTmax scale for hardest emission.
100  virtual double enhancePTmax() const {return pTmaxFudge;}
101 
102  // Prepare system for evolution; identify ME.
103  virtual void prepare( int iSys, Event& event, bool limitPTmaxIn = true);
104 
105  // Update dipole list after each FSR emission. Currently superfluous.
106  // Usage: update( iSys, event).
107  virtual void update( int , Event& ) {}
108 
109  // Select next pT in downwards evolution.
110  virtual double pTnext( Event& event, double pTbegAll, double pTendAll,
111  int nRadIn = -1);
112 
113  // ME corrections and kinematics that may give failure.
114  virtual bool branch( Event& event);
115 
116  // Tell which system was the last processed one.
117  int system() const {return iSysSel;}
118 
119  // Flag for failure in branch(...) that will force a retry of parton level.
120  bool doRestart() const {return rescatterFail;}
121 
122  // Print dipole list; for debug mainly.
123  virtual void list(ostream& os = cout) const;
124 
125 protected:
126 
127  // Pointer to various information on the generation.
128  Info* infoPtr;
129 
130  // Pointer to the settings database.
131  Settings* settingsPtr;
132 
133  // Pointer to the particle data table.
134  ParticleData* particleDataPtr;
135 
136  // Pointer to the random number generator.
137  Rndm* rndmPtr;
138 
139  // Pointers to the two incoming beams.
140  BeamParticle* beamAPtr;
141  BeamParticle* beamBPtr;
142 
143  // Pointer to information on subcollision parton locations.
144  PartonSystems* partonSystemsPtr;
145 
146  // Pointer to userHooks object for user interaction with program.
147  UserHooks* userHooksPtr;
148 
149  // Store properties to be returned by methods.
150  bool rescatterFail;
151  int iSysSel;
152  double pTmaxFudge;
153 
154 private:
155 
156  // Constants: could only be changed in the code itself.
157  static const bool DEBUG;
158  static const int MAXLOOPTINYPDF;
159  static const double CTHRESHOLD, BTHRESHOLD, EVALPDFSTEP, TINYPDF,
160  TINYKERNELPDF, TINYPT2, HEAVYPT2EVOL, HEAVYXEVOL, EXTRASPACEQ,
161  LAMBDA3MARGIN, LEPTONXMIN, LEPTONXMAX, LEPTONPT2MIN, LEPTONFUDGE;
162 
163  // Initialization data, normally only set once.
164  bool doQCDshower, doQEDshowerByQ, doQEDshowerByL, useSamePTasMPI,
165  doMEcorrections, doMEafterFirst, doPhiPolAsym, doPhiIntAsym,
166  doRapidityOrder, canVetoEmission;
167  int pTmaxMatch, pTdampMatch, alphaSorder, alphaEMorder, nQuarkIn,
168  enhanceScreening;
169  double pTdampFudge, mc, mb, m2c, m2b, alphaSvalue, alphaS2pi,
170  Lambda3flav, Lambda4flav, Lambda5flav, Lambda3flav2, Lambda4flav2,
171  Lambda5flav2, pT0Ref, ecmRef, ecmPow, pTmin, sCM, eCM, pT0,
172  pTminChgQ, pTminChgL, pT20, pT2min, pT2minChgQ, pT2minChgL,
173  pTmaxFudgeMPI, strengthIntAsym;
174 
175  // alphaStrong and alphaEM calculations.
176  AlphaStrong alphaS;
177  AlphaEM alphaEM;
178 
179  // Some current values.
180  bool sideA, dopTdamp;
181  int iNow, iRec, idDaughter, nRad, idResFirst, idResSecond;
182  double xDaughter, x1Now, x2Now, m2Dip, m2Rec, pT2damp, pTbegRef;
183 
184  // All dipole ends
185  vector<SpaceDipoleEnd> dipEnd;
186 
187  // Pointers to the current and hardest (so far) dipole ends.
188  int iDipNow, iSysNow;
189  SpaceDipoleEnd* dipEndNow;
190  int iDipSel;
191  SpaceDipoleEnd* dipEndSel;
192 
193  // Evolve a QCD dipole end.
194  void pT2nextQCD( double pT2begDip, double pT2endDip);
195 
196  // Evolve a QCD dipole end near heavy quark threshold region.
197  void pT2nearQCDthreshold( BeamParticle& beam, double m2Massive,
198  double m2Threshold, double xMaxAbs, double zMinAbs,
199  double zMaxMassive);
200 
201  // Evolve a QED dipole end.
202  void pT2nextQED( double pT2begDip, double pT2endDip);
203 
204  // Find class of ME correction.
205  int findMEtype( int iSys, Event& event);
206 
207  // Provide maximum of expected ME weight; for preweighting of evolution.
208  double calcMEmax( int MEtype, int idMother, int idDaughterIn);
209 
210  // Provide actual ME weight for current branching.
211  double calcMEcorr(int MEtype, int idMother, int idDaughterIn, double M2,
212  double z, double Q2);
213 
214  // Find coefficient of azimuthal asymmetry from gluon polarization.
215  void findAsymPol( Event& event, SpaceDipoleEnd* dip);
216 
217 };
218 
219 //==========================================================================
220 
221 } // end namespace Pythia8
222 
223 #endif // Pythia8_SpaceShower_H
Definition: beam.h:43