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