]> git.uio.no Git - u/mrichter/AliRoot.git/blob - PYTHIA8/pythia8145/include/PartonLevel.h
New pythia8 version
[u/mrichter/AliRoot.git] / PYTHIA8 / pythia8145 / include / PartonLevel.h
1 // PartonLevel.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.
5
6 // This file contains the main class for parton-level event generation
7 // PartonLevel: administrates showers, multiple interactions and remnants.
8
9 #ifndef Pythia8_PartonLevel_H
10 #define Pythia8_PartonLevel_H
11
12 #include "Basics.h"
13 #include "BeamParticle.h"
14 #include "BeamRemnants.h"
15 #include "Event.h"
16 #include "Info.h"
17 #include "MultipleInteractions.h"
18 #include "ParticleData.h"
19 #include "PartonSystems.h"
20 #include "PythiaStdlib.h"
21 #include "Settings.h"
22 #include "SigmaTotal.h"
23 #include "SpaceShower.h"
24 #include "StandardModel.h"
25 #include "TimeShower.h"
26 #include "UserHooks.h"
27
28 namespace Pythia8 {
29  
30 //==========================================================================
31
32 // The PartonLevel class contains the top-level routines to generate
33 // the partonic activity of an event.
34
35 class PartonLevel {
36
37 public:
38
39   // Constructor. 
40   PartonLevel() : userHooksPtr(0) {} 
41  
42   // Initialization of all classes at the parton level.
43   bool init( Info* infoPtrIn, Settings& settings,
44     ParticleData* particleDataPtrIn, Rndm* rndmPtrIn, 
45     BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn, 
46     BeamParticle* beamPomAPtrIn, BeamParticle* beamPomBPtrIn, 
47     Couplings* couplingsPtrIn, PartonSystems* partonSystemsPtrIn, 
48     SigmaTotal* sigmaTotPtr, TimeShower* timesDecPtrIn, 
49     TimeShower* timesPtrIn, SpaceShower* spacePtrIn, 
50     UserHooks* userHooksPtrIn);
51  
52   // Generate the next parton-level process.
53   bool next( Event& process, Event& event); 
54
55   // Tell whether failure was due to vetoing.
56   bool hasVetoed() const {return doVeto;}
57
58   // Accumulate and print statistics.
59   void accumulate() {multiPtr->accumulate();}
60   void statistics(bool reset = false) {
61     if (doMI) multiMB.statistics(reset);}
62     // For now no separate statistics for diffraction??
63     //if (doMISDA && doDiffraction) multiSDA.statistics(reset); 
64     //if (doMISDB && doDiffraction) multiSDB.statistics(reset);}
65
66 private: 
67
68   // Constants: could only be changed in the code itself.
69   static const int NTRY;
70
71   // Initialization data, mainly read from Settings.
72   bool   doMinBias, doDiffraction, doMI, doMIMB, doMISDA, doMISDB, doMIinit, 
73          doISR, doFSRduringProcess, doFSRafterProcess,  doFSRinResonances, 
74          doRemnants, doSecondHard, hasLeptonBeams, hasPointLeptons, 
75          canVetoPT, canVetoStep, canVetoMIStep, canSetScale;
76   double mMinDiff, mWidthDiff;
77
78   // Event generation strategy. Number of steps. Maximum pT scales.
79   bool   doVeto;
80   int    nMI, nISR, nFSRinProc, nFSRinRes, nISRhard, nFSRhard, 
81          typeLatest, nVetoStep, typeVetoStep, nVetoMIStep, iSysNow;
82   double pTsaveMI, pTsaveISR, pTsaveFSR, pTvetoPT;
83
84   // Current event properties.
85   bool   isMinBias, isDiffA, isDiffB, isDiff, isSingleDiff, isDoubleDiff, 
86          isResolved, isResolvedA, isResolvedB;
87   int    sizeProcess, sizeEvent;
88   double eCMsave; 
89
90   // Pointer to various information on the generation.
91   Info*          infoPtr;
92
93   // Pointer to the particle data table.
94   ParticleData*  particleDataPtr;
95
96   // Pointer to the random number generator.
97   Rndm*          rndmPtr;
98
99   // Pointers to the two incoming beams.
100   BeamParticle*  beamAPtr;
101   BeamParticle*  beamBPtr;
102
103   // Spare copies of normal pointers. Pointers to Pomeron beam-inside-beam.
104   BeamParticle*  beamHadAPtr;  
105   BeamParticle*  beamHadBPtr;  
106   BeamParticle*  beamPomAPtr;
107   BeamParticle*  beamPomBPtr;
108
109   // Pointers to Standard Model couplings.
110   Couplings*     couplingsPtr;
111   
112   // Pointer to information on subcollision parton locations.
113   PartonSystems* partonSystemsPtr;
114
115   // Pointer to userHooks object for user interaction with program.
116   UserHooks*     userHooksPtr;
117
118   // Pointers to timelike showers for resonance decays and the rest.
119   TimeShower*    timesDecPtr;
120   TimeShower*    timesPtr;
121
122   // Pointer to spacelike showers.
123   SpaceShower*   spacePtr;
124
125   // The generator classes for multiple interactions.
126   MultipleInteractions  multiMB;
127   MultipleInteractions  multiSDA;
128   MultipleInteractions  multiSDB;
129   MultipleInteractions* multiPtr;
130
131   // The generator class to construct beam-remnant kinematics. 
132   BeamRemnants remnants;
133
134   // Resolved diffraction: find how many systems should have it.
135   int decideResolvedDiff( Event& process);
136
137   // Set up an unresolved process, i.e. elastic or diffractive.
138   bool setupUnresolvedSys( Event& process, Event& event);
139
140   // Set up the hard process, excluding subsequent resonance decays.
141   void setupHardSys( int iHardLoop, Event& process, Event& event);
142   // Keep track of how much of hard process has been handled.
143   int nHardDone;
144
145   // Resolved diffraction: pick whether to have it and set up for it.
146   void setupResolvedDiff( int iHardLoop, Event& process);
147
148   // Resolved diffraction: restore normal behaviour.
149   void leaveResolvedDiff( int iHardLoop, Event& event);
150
151   // Perform showers in resonance decay chains.
152   bool resonanceShowers( Event& process, Event& event); 
153
154   // Position in main event record of hard partons before showers.
155   vector<int> iPosBefShow;
156   
157 };
158
159 //==========================================================================
160
161 } // end namespace Pythia8
162
163 #endif // Pythia8_PartonLevel_H