StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
PartonLevel.h
1 // PartonLevel.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2014 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, multiparton interactions and remnants.
8 
9 #ifndef Pythia8_PartonLevel_H
10 #define Pythia8_PartonLevel_H
11 
12 #include "Pythia8/Basics.h"
13 #include "Pythia8/BeamParticle.h"
14 #include "Pythia8/BeamRemnants.h"
15 #include "Pythia8/Event.h"
16 #include "Pythia8/Info.h"
17 #include "Pythia8/MultipartonInteractions.h"
18 #include "Pythia8/ParticleData.h"
19 #include "Pythia8/PartonSystems.h"
20 #include "Pythia8/PythiaStdlib.h"
21 #include "Pythia8/ResonanceDecays.h"
22 #include "Pythia8/RHadrons.h"
23 #include "Pythia8/Settings.h"
24 #include "Pythia8/SigmaTotal.h"
25 #include "Pythia8/SpaceShower.h"
26 #include "Pythia8/StandardModel.h"
27 #include "Pythia8/TimeShower.h"
28 #include "Pythia8/UserHooks.h"
29 #include "Pythia8/MergingHooks.h"
30 
31 namespace Pythia8 {
32 
33 //==========================================================================
34 
35 // The PartonLevel class contains the top-level routines to generate
36 // the partonic activity of an event.
37 
38 class PartonLevel {
39 
40 public:
41 
42  // Constructor.
43  PartonLevel() : userHooksPtr(0) {}
44 
45  // Initialization of all classes at the parton level.
46  bool init( Info* infoPtrIn, Settings& settings,
47  ParticleData* particleDataPtrIn, Rndm* rndmPtrIn,
48  BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn,
49  BeamParticle* beamPomAPtrIn, BeamParticle* beamPomBPtrIn,
50  Couplings* couplingsPtrIn, PartonSystems* partonSystemsPtrIn,
51  SigmaTotal* sigmaTotPtr, TimeShower* timesDecPtrIn,
52  TimeShower* timesPtrIn, SpaceShower* spacePtrIn,
53  RHadrons* rHadronsPtrIn, UserHooks* userHooksPtrIn,
54  MergingHooks* mergingHooksPtr, bool useAsTrial);
55 
56  // Generate the next parton-level process.
57  bool next( Event& process, Event& event);
58 
59  // Perform showers in resonance decay chains. (For special cases.)
60  void setupShowerSys( Event& process, Event& event);
61  bool resonanceShowers( Event& process, Event& event, bool skipForR);
62 
63  // Perform decays and showers of W and Z emitted in shower.
64  bool wzDecayShowers( Event& event);
65 
66  // Tell whether failure was due to vetoing.
67  bool hasVetoed() const {return doVeto;}
68 
69  // Accumulate, print and reset statistics.
70  void accumulate() {if (isResolved && !isDiff) multiPtr->accumulate();}
71  void statistics(bool reset = false) {
72  if (doMPI) multiMB.statistics(reset);}
73  // For now no separate statistics for diffraction??
74  //if (doMPISDA && doDiffraction) multiSDA.statistics(reset);
75  //if (doMPISDB && doDiffraction) multiSDB.statistics(reset);}
76  void resetStatistics() { if (doMPI) multiMB.resetStatistics(); }
77 
78  // Reset PartonLevel object for trial shower usage.
79  void resetTrial();
80  // Provide the pT scale of the last branching in the shower.
81  double pTLastInShower(){ return pTLastBranch; }
82  // Provide the type of the last branching in the shower.
83  int typeLastInShower(){ return typeLastBranch; }
84 
85 private:
86 
87  // Constants: could only be changed in the code itself.
88  static const int NTRY;
89 
90  // Initialization data, mainly read from Settings.
91  bool doNonDiff, doDiffraction, doMPI, doMPIMB, doMPISDA, doMPISDB,
92  doMPICD, doMPIinit, doISR, doFSRduringProcess, doFSRafterProcess,
93  doFSRinResonances, doRemnants, doSecondHard, hasLeptonBeams,
94  hasPointLeptons, canVetoPT, canVetoStep, canVetoMPIStep,
95  canVetoEarly, canSetScale, allowRH, earlyResDec, vetoWeakJets,
96  canReconResSys;
97  double mMinDiff, mWidthDiff, pMaxDiff, vetoWeakDeltaR2;
98 
99  // Event generation strategy. Number of steps. Maximum pT scales.
100  bool doVeto;
101  int nMPI, nISR, nFSRinProc, nFSRinRes, nISRhard, nFSRhard,
102  typeLatest, nVetoStep, typeVetoStep, nVetoMPIStep, iSysNow;
103  double pTsaveMPI, pTsaveISR, pTsaveFSR, pTvetoPT;
104 
105  // Current event properties.
106  bool isNonDiff, isDiffA, isDiffB, isDiffC, isDiff, isSingleDiff,
107  isDoubleDiff, isCentralDiff, isResolved, isResolvedA,
108  isResolvedB, isResolvedC;
109  int sizeProcess, sizeEvent, nHardDone, nHardDoneRHad, iDS;
110  double eCMsave;
111  vector<bool> inRHadDecay;
112  vector<int> iPosBefShow;
113 
114  // Pointer to various information on the generation.
115  Info* infoPtr;
116 
117  // Pointer to the particle data table.
118  ParticleData* particleDataPtr;
119 
120  // Pointer to the random number generator.
121  Rndm* rndmPtr;
122 
123  // Pointers to the two incoming beams.
124  BeamParticle* beamAPtr;
125  BeamParticle* beamBPtr;
126 
127  // Spare copies of normal pointers. Pointers to Pomeron beam-inside-beam.
128  BeamParticle* beamHadAPtr;
129  BeamParticle* beamHadBPtr;
130  BeamParticle* beamPomAPtr;
131  BeamParticle* beamPomBPtr;
132 
133  // Pointers to Standard Model couplings.
134  Couplings* couplingsPtr;
135 
136  // Pointer to information on subcollision parton locations.
137  PartonSystems* partonSystemsPtr;
138 
139  // Pointer to userHooks object for user interaction with program.
140  UserHooks* userHooksPtr;
141 
142  // Pointers to timelike showers for resonance decays and the rest.
143  TimeShower* timesDecPtr;
144  TimeShower* timesPtr;
145 
146  // Pointer to spacelike showers.
147  SpaceShower* spacePtr;
148 
149  // The generator classes for multiparton interactions.
150  MultipartonInteractions multiMB;
151  MultipartonInteractions multiSDA;
152  MultipartonInteractions multiSDB;
153  MultipartonInteractions multiCD;
154  MultipartonInteractions* multiPtr;
155 
156  // The generator class to construct beam-remnant kinematics.
157  BeamRemnants remnants;
158  // Separate instance for central diffraction.
159  BeamRemnants remnantsCD;
160 
161  // The RHadrons class is used to fragment off and decay R-hadrons.
162  RHadrons* rHadronsPtr;
163 
164  // ResonanceDecay object does sequential resonance decays.
165  ResonanceDecays resonanceDecays;
166 
167  // Resolved diffraction: find how many systems should have it.
168  int decideResolvedDiff( Event& process);
169 
170  // Set up an unresolved process, i.e. elastic or diffractive.
171  bool setupUnresolvedSys( Event& process, Event& event);
172 
173  // Set up the hard process, excluding subsequent resonance decays.
174  void setupHardSys( Event& process, Event& event);
175 
176  // Resolved diffraction: pick whether to have it and set up for it.
177  void setupResolvedDiff( Event& process);
178 
179  // Resolved diffraction: restore normal behaviour.
180  void leaveResolvedDiff( int iHardLoop, Event& process, Event& event);
181 
182  // Pointer to MergingHooks object for user interaction with the merging.
183  MergingHooks* mergingHooksPtr;
184  // Parameters to specify trial shower usage
185  bool doTrial;
186  int nTrialEmissions;
187  // Parameters to store to veto trial showers
188  double pTLastBranch;
189  int typeLastBranch;
190  // Parameters to specify merging usage
191  bool canRemoveEvent, canRemoveEmission;
192 
193 };
194 
195 //==========================================================================
196 
197 } // end namespace Pythia8
198 
199 #endif // Pythia8_PartonLevel_H
Definition: AgUStep.h:26