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) 2020 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/PhysicsBase.h"
19 #include "Pythia8/ProcessContainer.h"
20 #include "Pythia8/PythiaStdlib.h"
21 #include "Pythia8/ResonanceDecays.h"
22 #include "Pythia8/Settings.h"
23 #include "Pythia8/SigmaTotal.h"
24 #include "Pythia8/SusyCouplings.h"
25 #include "Pythia8/SLHAinterface.h"
26 #include "Pythia8/StandardModel.h"
27 #include "Pythia8/UserHooks.h"
28 
29 namespace Pythia8 {
30 
31 //==========================================================================
32 
33 // The ProcessLevel class contains the top-level routines to generate
34 // the characteristic "hard" process of an event.
35 
36 class ProcessLevel : public PhysicsBase {
37 
38 public:
39 
40  // Constructor.
41  ProcessLevel() = default;
42 
43  // Destructor to delete processes in containers.
44  ~ProcessLevel();
45 
46  // Initialization.
47  bool init(bool doLHAin, SLHAinterface* slhaInterfacePtrIn,
48  vector<SigmaProcess*>& sigmaPtrs, vector<PhaseSpace*>& phaseSpacePtrs);
49 
50  // Store or replace Les Houches pointer.
51  void setLHAPtr( LHAupPtr lhaUpPtrIn) {lhaUpPtr = lhaUpPtrIn;
52  if (iLHACont >= 0) containerPtrs[iLHACont]->setLHAPtr(lhaUpPtr);}
53 
54  // Generate the next "hard" process.
55  bool next( Event& process);
56 
57  // Special case: LHA input of resonance decay only.
58  bool nextLHAdec( Event& process);
59 
60  // Accumulate and update statistics (after possible user veto).
61  void accumulate( bool doAccumulate = true);
62 
63  // Print statistics on cross sections and number of events.
64  void statistics(bool reset = false);
65 
66  // Reset statistics.
67  void resetStatistics();
68 
69  // Add any junctions to the process event record list.
70  void findJunctions( Event& junEvent);
71 
72  // Initialize and call resonance decays separately.
73  void initDecays( LHAupPtr lhaUpPtrIn) {
74  containerLHAdec.setLHAPtr(lhaUpPtrIn, particleDataPtr, settingsPtr,
75  rndmPtr); }
76 
77  bool nextDecays( Event& process) { return resonanceDecays.next( process);}
78 
79 protected:
80 
81  virtual void onInitInfoPtr() override {
82  registerSubObject(resonanceDecays);
83  registerSubObject(gammaKin);
84  }
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, someHardSame,
93  cutsAgree, cutsOverlap, doResDecays, doISR, doMPI, doWt2;
94  int startColTag;
95  double maxPDFreweight, mHatMin1, mHatMax1, pTHatMin1, pTHatMax1, mHatMin2,
96  mHatMax2, 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 = -1;
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 SusyLesHouches object for interface to SUSY spectra.
116  SLHAinterface* slhaInterfacePtr;
117 
118  // Pointer to LHAup for generating external events.
119  LHAupPtr lhaUpPtr;
120 
121  // ResonanceDecay object does sequential resonance decays.
122  ResonanceDecays resonanceDecays;
123 
124  // Samples photon kinematics from leptons.
125  GammaKinematics gammaKin;
126 
127  // Generate the next event with one interaction.
128  bool nextOne( Event& process);
129 
130  // Generate the next event with two hard interactions.
131  bool nextTwo( Event& process);
132 
133  // Check that enough room for beam remnants in photon beam.
134  bool roomForRemnants();
135 
136  // Append the second to the first process list.
137  void combineProcessRecords( Event& process, Event& process2);
138 
139  // Check that colours match up.
140  bool checkColours( Event& process);
141 
142  // Print statistics when two hard processes allowed.
143  void statistics2(bool reset);
144 
145 };
146 
147 //==========================================================================
148 
149 } // end namespace Pythia8
150 
151 #endif // Pythia8_ProcessLevel_H
Definition: AgUStep.h:26