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.
6 // This file contains the main class for parton-level event generation
7 // PartonLevel: administrates showers, multiple interactions and remnants.
9 #ifndef Pythia8_PartonLevel_H
10 #define Pythia8_PartonLevel_H
13 #include "BeamParticle.h"
14 #include "BeamRemnants.h"
17 #include "MultipleInteractions.h"
18 #include "ParticleData.h"
19 #include "PartonSystems.h"
20 #include "PythiaStdlib.h"
22 #include "SigmaTotal.h"
23 #include "SpaceShower.h"
24 #include "StandardModel.h"
25 #include "TimeShower.h"
26 #include "UserHooks.h"
30 //==========================================================================
32 // The PartonLevel class contains the top-level routines to generate
33 // the partonic activity of an event.
40 PartonLevel() : userHooksPtr(0) {}
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);
52 // Generate the next parton-level process.
53 bool next( Event& process, Event& event);
55 // Tell whether failure was due to vetoing.
56 bool hasVetoed() const {return doVeto;}
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);}
68 // Constants: could only be changed in the code itself.
69 static const int NTRY;
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;
78 // Event generation strategy. Number of steps. Maximum pT scales.
80 int nMI, nISR, nFSRinProc, nFSRinRes, nISRhard, nFSRhard,
81 typeLatest, nVetoStep, typeVetoStep, nVetoMIStep, iSysNow;
82 double pTsaveMI, pTsaveISR, pTsaveFSR, pTvetoPT;
84 // Current event properties.
85 bool isMinBias, isDiffA, isDiffB, isDiff, isSingleDiff, isDoubleDiff,
86 isResolved, isResolvedA, isResolvedB;
87 int sizeProcess, sizeEvent;
90 // Pointer to various information on the generation.
93 // Pointer to the particle data table.
94 ParticleData* particleDataPtr;
96 // Pointer to the random number generator.
99 // Pointers to the two incoming beams.
100 BeamParticle* beamAPtr;
101 BeamParticle* beamBPtr;
103 // Spare copies of normal pointers. Pointers to Pomeron beam-inside-beam.
104 BeamParticle* beamHadAPtr;
105 BeamParticle* beamHadBPtr;
106 BeamParticle* beamPomAPtr;
107 BeamParticle* beamPomBPtr;
109 // Pointers to Standard Model couplings.
110 Couplings* couplingsPtr;
112 // Pointer to information on subcollision parton locations.
113 PartonSystems* partonSystemsPtr;
115 // Pointer to userHooks object for user interaction with program.
116 UserHooks* userHooksPtr;
118 // Pointers to timelike showers for resonance decays and the rest.
119 TimeShower* timesDecPtr;
120 TimeShower* timesPtr;
122 // Pointer to spacelike showers.
123 SpaceShower* spacePtr;
125 // The generator classes for multiple interactions.
126 MultipleInteractions multiMB;
127 MultipleInteractions multiSDA;
128 MultipleInteractions multiSDB;
129 MultipleInteractions* multiPtr;
131 // The generator class to construct beam-remnant kinematics.
132 BeamRemnants remnants;
134 // Resolved diffraction: find how many systems should have it.
135 int decideResolvedDiff( Event& process);
137 // Set up an unresolved process, i.e. elastic or diffractive.
138 bool setupUnresolvedSys( Event& process, Event& event);
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.
145 // Resolved diffraction: pick whether to have it and set up for it.
146 void setupResolvedDiff( int iHardLoop, Event& process);
148 // Resolved diffraction: restore normal behaviour.
149 void leaveResolvedDiff( int iHardLoop, Event& event);
151 // Perform showers in resonance decay chains.
152 bool resonanceShowers( Event& process, Event& event);
154 // Position in main event record of hard partons before showers.
155 vector<int> iPosBefShow;
159 //==========================================================================
161 } // end namespace Pythia8
163 #endif // Pythia8_PartonLevel_H