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) 2012 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 "Basics.h"
13 #include "BeamParticle.h"
14 #include "Event.h"
15 #include "Info.h"
16 #include "ParticleData.h"
17 #include "PartonDistributions.h"
18 #include "ProcessContainer.h"
19 #include "PythiaStdlib.h"
20 #include "ResonanceDecays.h"
21 #include "Settings.h"
22 #include "SigmaTotal.h"
23 #include "SusyCouplings.h"
24 #include "SusyLesHouches.h"
25 #include "StandardModel.h"
26 #include "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  SusyLesHouches* slhaPtrIn, 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  // Accumulate and update statistics (after possible user veto).
61  void accumulate();
62 
63  // Print statistics on cross sections and number of events.
64  void statistics(bool reset = false, ostream& os = cout);
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 private:
73 
74  // Constants: could only be changed in the code itself.
75  static const int MAXLOOP;
76 
77  // Generic info for process generation.
78  bool doSecondHard, doSameCuts, allHardSame, noneHardSame,
79  someHardSame, cutsAgree, cutsOverlap, doResDecays;
80  int nImpact, startColTag;
81  double mHatMin1, mHatMax1, pTHatMin1, pTHatMax1, mHatMin2, mHatMax2,
82  pTHatMin2, pTHatMax2, sigmaND, sumImpactFac, sum2ImpactFac;
83 
84  // Vector of containers of internally-generated processes.
85  vector<ProcessContainer*> containerPtrs;
86  int iContainer, iLHACont;
87  double sigmaMaxSum;
88 
89  // Ditto for optional choice of a second hard process.
90  vector<ProcessContainer*> container2Ptrs;
91  int i2Container;
92  double sigma2MaxSum;
93 
94  // Pointer to various information on the generation.
95  Info* infoPtr;
96 
97  // Pointer to the particle data table.
98  ParticleData* particleDataPtr;
99 
100  // Pointer to the random number generator.
101  Rndm* rndmPtr;
102 
103  // Pointers to the two incoming beams.
104  BeamParticle* beamAPtr;
105  BeamParticle* beamBPtr;
106 
107  // Pointer to Standard Model couplings, including alphaS and alphaEM.
108  Couplings* couplingsPtr;
109 
110  // Pointer to SigmaTotal object needed to handle soft QCD processes.
111  SigmaTotal* sigmaTotPtr;
112 
113  // Pointer to SusyLesHouches object for interface to SUSY spectra.
114  SusyLesHouches* slhaPtr;
115 
116  // Pointer to userHooks object for user interaction with program.
117  UserHooks* userHooksPtr;
118 
119  // Pointer to LHAup for generating external events.
120  LHAup* lhaUpPtr;
121 
122  // Initialization of some SLHA blocks.
123  void initSLHA();
124 
125  // ResonanceDecay object does sequential resonance decays.
126  ResonanceDecays resonanceDecays;
127 
128  // Generate the next event with one interaction.
129  bool nextOne( Event& process);
130 
131  // Generate the next event with two hard interactions.
132  bool nextTwo( Event& process);
133 
134  // Append the second to the first process list.
135  void combineProcessRecords( Event& process, Event& process2);
136 
137  // Check that colours match up.
138  bool checkColours( Event& process);
139 
140  // Print statistics when two hard processes allowed.
141  void statistics2(bool reset, ostream& os = cout);
142 
143  // Statistics for Les Houches event classification.
144  vector<int> codeLHA, nEvtLHA;
145 
146 };
147 
148 //==========================================================================
149 
150 } // end namespace Pythia8
151 
152 #endif // Pythia8_ProcessLevel_H