StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ProcessLevel.h
1 // ProcessLevel.h is a part of the PYTHIA event generator.
2 // Copyright (C) 2018 Torbjorn Sjostrand.
3 // PYTHIA is licenced under the GNU GPL v2 or later, see COPYING for details.
4 // Please respect the MCnet Guidelines, see GUIDELINES for details.
5 
6 // This file contains the main class for process-level event generation.
7 // ProcessLevel: administrates the selection of "hard" process.
8 
9 #ifndef Pythia8_ProcessLevel_H
10 #define Pythia8_ProcessLevel_H
11 
12 #include "Pythia8/Basics.h"
13 #include "Pythia8/BeamParticle.h"
14 #include "Pythia8/Event.h"
15 #include "Pythia8/Info.h"
16 #include "Pythia8/ParticleData.h"
17 #include "Pythia8/PartonDistributions.h"
18 #include "Pythia8/ProcessContainer.h"
19 #include "Pythia8/PythiaStdlib.h"
20 #include "Pythia8/ResonanceDecays.h"
21 #include "Pythia8/Settings.h"
22 #include "Pythia8/SigmaTotal.h"
23 #include "Pythia8/SusyCouplings.h"
24 #include "Pythia8/SLHAinterface.h"
25 #include "Pythia8/StandardModel.h"
26 #include "Pythia8/UserHooks.h"
27 
28 namespace Pythia8 {
29 
30 //==========================================================================
31 
32 // The ProcessLevel class contains the top-level routines to generate
33 // the characteristic "hard" process of an event.
34 
35 class ProcessLevel {
36 
37 public:
38 
39  // Constructor.
40  ProcessLevel() : iLHACont(-1) {}
41 
42  // Destructor to delete processes in containers.
43  ~ProcessLevel();
44 
45  // Initialization.
46  bool init( Info* infoPtrIn, Settings& settings,
47  ParticleData* particleDataPtrIn, Rndm* rndmPtrIn,
48  BeamParticle* beamAPtrIn, BeamParticle* beamBPtrIn,
49  BeamParticle* beamGamAPtrIn, BeamParticle* beamGamBPtrIn,
50  BeamParticle* beamVMDAPtrIn, BeamParticle* beamVMDBPtrIn,
51  Couplings* couplingsPtrIn, SigmaTotal* sigmaTotPtrIn, bool doLHAin,
52  SLHAinterface* slhaInterfacePtrIn, UserHooks* userHooksPtrIn,
53  vector<SigmaProcess*>& sigmaPtrs, vector<PhaseSpace*>& phaseSpacePtrs);
54 
55  // Store or replace Les Houches pointer.
56  void setLHAPtr( LHAup* lhaUpPtrIn) {lhaUpPtr = lhaUpPtrIn;
57  if (iLHACont >= 0) containerPtrs[iLHACont]->setLHAPtr(lhaUpPtr);}
58 
59  // Generate the next "hard" process.
60  bool next( Event& process);
61 
62  // Special case: LHA input of resonance decay only.
63  bool nextLHAdec( Event& process);
64 
65  // Accumulate and update statistics (after possible user veto).
66  void accumulate( bool doAccumulate = true);
67 
68  // Print statistics on cross sections and number of events.
69  void statistics(bool reset = false);
70 
71  // Reset statistics.
72  void resetStatistics();
73 
74  // Add any junctions to the process event record list.
75  void findJunctions( Event& junEvent);
76 
77  // Initialize and call resonance decays separately.
78  void initDecays( Info* infoPtrIn, Settings &settings,
79  ParticleData* particleDataPtrIn, Rndm* rndmPtrIn, LHAup* lhaUpPtrIn) {
80  infoPtr = infoPtrIn;
81  resonanceDecays.init( infoPtrIn, particleDataPtrIn, rndmPtrIn);
82  containerLHAdec.setLHAPtr(lhaUpPtrIn, particleDataPtrIn, &settings,
83  rndmPtrIn); }
84  bool nextDecays( Event& process) { return resonanceDecays.next( process);}
85 
86 private:
87 
88  // Constants: could only be changed in the code itself.
89  static const int MAXLOOP;
90 
91  // Generic info for process generation.
92  bool doSecondHard, doSameCuts, allHardSame, noneHardSame,
93  someHardSame, cutsAgree, cutsOverlap, doResDecays, doISR, doMPI;
94  int startColTag;
95  double mHatMin1, mHatMax1, pTHatMin1, pTHatMax1, mHatMin2, mHatMax2,
96  pTHatMin2, pTHatMax2, sigmaND;
97 
98  // Info for process generation with photon beams.
99  bool beamHasGamma;
100  int gammaMode;
101 
102  // Vector of containers of internally-generated processes.
103  vector<ProcessContainer*> containerPtrs;
104  int iContainer, iLHACont;
105  double sigmaMaxSum;
106 
107  // Ditto for optional choice of a second hard process.
108  vector<ProcessContainer*> container2Ptrs;
109  int i2Container;
110  double sigma2MaxSum;
111 
112  // Single half-dummy container for LHA input of resonance decay only.
113  ProcessContainer containerLHAdec;
114 
115  // Pointer to various information on the generation.
116  Info* infoPtr;
117 
118  // Pointer to the particle data table.
119  ParticleData* particleDataPtr;
120 
121  // Pointer to the random number generator.
122  Rndm* rndmPtr;
123 
124  // Pointers to the two incoming beams.
125  BeamParticle* beamAPtr;
126  BeamParticle* beamBPtr;
127 
128  // Pointers to the two possible photon beams inside the incoming beams.
129  BeamParticle* beamGamAPtr;
130  BeamParticle* beamGamBPtr;
131 
132  // Pointers to the two possible photon beams inside the incoming beams.
133  BeamParticle* beamVMDAPtr;
134  BeamParticle* beamVMDBPtr;
135 
136  // Pointer to Standard Model couplings, including alphaS and alphaEM.
137  Couplings* couplingsPtr;
138 
139  // Pointer to SigmaTotal object needed to handle soft QCD processes.
140  SigmaTotal* sigmaTotPtr;
141 
142  // Pointer to SusyLesHouches object for interface to SUSY spectra.
143  SLHAinterface* slhaInterfacePtr;
144 
145  // Pointer to userHooks object for user interaction with program.
146  UserHooks* userHooksPtr;
147 
148  // Pointer to LHAup for generating external events.
149  LHAup* lhaUpPtr;
150 
151  // ResonanceDecay object does sequential resonance decays.
152  ResonanceDecays resonanceDecays;
153 
154  // Samples photon kinematics from leptons.
155  GammaKinematics gammaKin;
156 
157  // Generate the next event with one interaction.
158  bool nextOne( Event& process);
159 
160  // Generate the next event with two hard interactions.
161  bool nextTwo( Event& process);
162 
163  // Check that enough room for beam remnants in photon beam.
164  bool roomForRemnants();
165 
166  // Append the second to the first process list.
167  void combineProcessRecords( Event& process, Event& process2);
168 
169  // Check that colours match up.
170  bool checkColours( Event& process);
171 
172  // Print statistics when two hard processes allowed.
173  void statistics2(bool reset);
174 
175 };
176 
177 //==========================================================================
178 
179 } // end namespace Pythia8
180 
181 #endif // Pythia8_ProcessLevel_H
Definition: AgUStep.h:26