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) 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 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  Couplings* couplingsPtrIn, SigmaTotal* sigmaTotPtrIn, bool doLHAin,
50  SLHAinterface* slhaInterfacePtrIn, UserHooks* userHooksPtrIn,
51  vector<SigmaProcess*>& sigmaPtrs, ostream& os = cout);
52 
53  // Store or replace Les Houches pointer.
54  void setLHAPtr( LHAup* lhaUpPtrIn) {lhaUpPtr = lhaUpPtrIn;
55  if (iLHACont >= 0) containerPtrs[iLHACont]->setLHAPtr(lhaUpPtr);}
56 
57  // Generate the next "hard" process.
58  bool next( Event& process);
59 
60  // Special case: LHA input of resonance decay only.
61  bool nextLHAdec( Event& process);
62 
63  // Accumulate and update statistics (after possible user veto).
64  void accumulate();
65 
66  // Print statistics on cross sections and number of events.
67  void statistics(bool reset = false, ostream& os = cout);
68 
69  // Reset statistics.
70  void resetStatistics();
71 
72  // Add any junctions to the process event record list.
73  void findJunctions( Event& junEvent);
74 
75  // Initialize and call resonance decays separately.
76  void initDecays( Info* infoPtrIn, ParticleData* particleDataPtrIn,
77  Rndm* rndmPtrIn, LHAup* lhaUpPtrIn) { infoPtr = infoPtrIn;
78  resonanceDecays.init( infoPtrIn, particleDataPtrIn, rndmPtrIn);
79  containerLHAdec.setLHAPtr(lhaUpPtrIn, particleDataPtrIn); }
80  bool nextDecays( Event& process) { return resonanceDecays.next( process);}
81 
82 private:
83 
84  // Constants: could only be changed in the code itself.
85  static const int MAXLOOP;
86 
87  // Generic info for process generation.
88  bool doSecondHard, doSameCuts, allHardSame, noneHardSame,
89  someHardSame, cutsAgree, cutsOverlap, doResDecays;
90  int nImpact, startColTag;
91  double mHatMin1, mHatMax1, pTHatMin1, pTHatMax1, mHatMin2, mHatMax2,
92  pTHatMin2, pTHatMax2, sigmaND, sumImpactFac, sum2ImpactFac;
93 
94  // Vector of containers of internally-generated processes.
95  vector<ProcessContainer*> containerPtrs;
96  int iContainer, iLHACont;
97  double sigmaMaxSum;
98 
99  // Ditto for optional choice of a second hard process.
100  vector<ProcessContainer*> container2Ptrs;
101  int i2Container;
102  double sigma2MaxSum;
103 
104  // Single half-dummy container for LHA input of resonance decay only.
105  ProcessContainer containerLHAdec;
106 
107  // Pointer to various information on the generation.
108  Info* infoPtr;
109 
110  // Pointer to the particle data table.
111  ParticleData* particleDataPtr;
112 
113  // Pointer to the random number generator.
114  Rndm* rndmPtr;
115 
116  // Pointers to the two incoming beams.
117  BeamParticle* beamAPtr;
118  BeamParticle* beamBPtr;
119 
120  // Pointer to Standard Model couplings, including alphaS and alphaEM.
121  Couplings* couplingsPtr;
122 
123  // Pointer to SigmaTotal object needed to handle soft QCD processes.
124  SigmaTotal* sigmaTotPtr;
125 
126  // Pointer to SusyLesHouches object for interface to SUSY spectra.
127  SLHAinterface* slhaInterfacePtr;
128 
129  // Pointer to userHooks object for user interaction with program.
130  UserHooks* userHooksPtr;
131 
132  // Pointer to LHAup for generating external events.
133  LHAup* lhaUpPtr;
134 
135  // ResonanceDecay object does sequential resonance decays.
136  ResonanceDecays resonanceDecays;
137 
138  // Generate the next event with one interaction.
139  bool nextOne( Event& process);
140 
141  // Generate the next event with two hard interactions.
142  bool nextTwo( Event& process);
143 
144  // Append the second to the first process list.
145  void combineProcessRecords( Event& process, Event& process2);
146 
147  // Check that colours match up.
148  bool checkColours( Event& process);
149 
150  // Print statistics when two hard processes allowed.
151  void statistics2(bool reset, ostream& os = cout);
152 
153 };
154 
155 //==========================================================================
156 
157 } // end namespace Pythia8
158 
159 #endif // Pythia8_ProcessLevel_H
Definition: AgUStep.h:26