using option '-treename HLTesdTree' for EsdCollector, adding default parameter for...
[u/mrichter/AliRoot.git] / PYTHIA8 / pythia8130 / include / Pythia.h
CommitLineData
5ad4eb21 1// Pythia.h is a part of the PYTHIA event generator.
2// Copyright (C) 2008 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 event generation.
7// Pythia: provide the main user interface to everything else.
8
9#ifndef Pythia8_Pythia_H
10#define Pythia8_Pythia_H
11
12#include "Analysis.h"
13#include "Basics.h"
14#include "BeamParticle.h"
15#include "BeamShape.h"
16#include "Event.h"
17#include "FragmentationFlavZpT.h"
18#include "HadronLevel.h"
19#include "Info.h"
20#include "LesHouches.h"
21#include "PartonLevel.h"
22#include "ParticleData.h"
23#include "PartonDistributions.h"
24#include "ProcessLevel.h"
25#include "PythiaStdlib.h"
26#include "ResonanceWidths.h"
27#include "Settings.h"
28#include "SigmaTotal.h"
29#include "SpaceShower.h"
30#include "SusyLesHouches.h"
31#include "TimeShower.h"
32#include "UserHooks.h"
33
34namespace Pythia8 {
35
36//**************************************************************************
37
38// The Pythia class contains the top-level routines to generate an event.
39
40class Pythia {
41
42public:
43
44 // Constructor. (See Pythia.cc file.)
45 Pythia(string xmlDir = "../xmldoc");
46
47 // Destructor. (See Pythia.cc file.)
48 ~Pythia();
49
50 // Read in one update for a setting or particle data from a single line.
51 bool readString(string, bool warn = true);
52
53 // Read in updates for settings or particle data from user-defined file.
54 bool readFile(string, bool warn = true, int subrun = SUBRUNDEFAULT);
55 bool readFile(string fileName, int subrun) {
56 return readFile(fileName, true, subrun);}
57
58 // Possibility to pass in pointers to PDF's.
59 bool setPDFPtr( PDF* pdfAPtrIn, PDF* pdfBPtrIn, PDF* pdfHardAPtrIn = 0,
60 PDF* pdfHardBPtrIn = 0);
61
62 // Possibility to pass in pointer for external handling of some decays.
63 bool setDecayPtr( DecayHandler* decayHandlePtrIn,
64 vector<int> handledParticlesIn) {decayHandlePtr = decayHandlePtrIn;
65 handledParticles.resize(0);
66 for(int i = 0; i < int(handledParticlesIn.size()); ++i)
67 handledParticles.push_back( handledParticlesIn[i] ); return true;}
68
69 // Possibility to pass in pointer for external random number generation.
70 bool setRndmEnginePtr( RndmEngine* rndmEnginePtrIn)
71 { return Rndm::rndmEnginePtr( rndmEnginePtrIn);}
72
73 // Possibility to pass in pointer for user hooks.
74 bool setUserHooksPtr( UserHooks* userHooksPtrIn)
75 { userHooksPtr = userHooksPtrIn; return true;}
76
77 // Possibility to pass in pointer for beam shape.
78 bool setBeamShapePtr( BeamShape* beamShapePtrIn)
79 { beamShapePtr = beamShapePtrIn; return true;}
80
81 // Possibility to pass in pointer(s) for external cross section.
82 bool setSigmaPtr( SigmaProcess* sigmaPtrIn)
83 { sigmaPtrs.push_back( sigmaPtrIn); return true;}
84
85 // Possibility to pass in pointer(s) for external resonance.
86 bool setResonancePtr( ResonanceWidths* resonancePtrIn)
87 { resonancePtrs.push_back( resonancePtrIn); return true;}
88
89 // Possibility to pass in pointer for external showers.
90 bool setShowerPtr( TimeShower* timesDecPtrIn,
91 TimeShower* timesPtrIn = 0, SpaceShower* spacePtrIn = 0)
92 { timesDecPtr = timesDecPtrIn; timesPtr = timesPtrIn;
93 spacePtr = spacePtrIn; return true;}
94
95 // Initialization in the CM frame.
96 bool init( int idAin, int idBin, double eCMin);
97
98 // Initialization with two collinear beams, including fixed target.
99 bool init( int idAin, int idBin, double eAin, double eBin);
100
101 // Initialization with two acollinear beams.
102 bool init( int idAin, int idBin, double pxAin, double pyAin,
103 double pzAin, double pxBin, double pyBin, double pzBin);
104
105 // Initialization by a Les Houches Event File.
106 bool init( string LesHouchesEventFile, bool skipInit = false);
107
108 // Initialization using the Main beam variables.
109 bool init();
110
111 // Initialization according to the Les Houches Accord.
112 bool init( LHAup* lhaUpPtrIn);
113
114 // Generate the next event.
115 bool next();
116
117 // Generate only the hadronization/decay stage.
118 bool forceHadronLevel();
119
120 // Special routine to allow more decays if on/off switches changed.
121 bool moreDecays() {return hadronLevel.moreDecays(event);}
122
123 // List the current Les Houches event.
124 void LHAeventList(ostream& os = cout) {lhaUpPtr->listEvent(os);}
125
126 // Main routine to provide final statistics on generation.
127 void statistics(bool all = false, bool reset = true);
128
129 // Read in settings values: shorthand, not new functionality.
130 bool flag(string key) {return settings.flag(key);}
131 int mode(string key) {return settings.mode(key);}
132 double parm(string key) {return settings.parm(key);}
133 string word(string key) {return settings.word(key);}
134
135 // The event record for the parton-level central process.
136 Event process;
137
138 // The event record for the complete event history.
139 Event event;
140
141 // Information on the generation: current subprocess and error statistics.
142 Info info;
143
144 // Settings - is static but declared here for ease of use.
145 Settings settings;
146
147 // ParticleDataTable - is static but declared here for ease of use.
148 ParticleDataTable particleData;
149
150 // SusyLesHouches - SLHA object for interface to SUSY spectra.
151 SusyLesHouches slha;
152
153private:
154
155 // Constants: could only be changed in the code itself.
156 static const int NTRY, SUBRUNDEFAULT;
157
158 // Initialization data, extracted from database.
159 bool doProcessLevel, doPartonLevel, doHadronLevel, checkEvent;
160 int nErrList;
161 double epTolErr, epTolWarn;
162
163 // Initialization data, extracted from init(...) call.
164 bool isConstructed, isInit;
165 int idA, idB, frameType;
166 double mA, mB, pxA, pxB, pyA, pyB, pzA, pzB, eA, eB,
167 pzAcm, pzBcm, eCM, betaZ, gammaZ;
168 Vec4 pAinit, pBinit, pAnow, pBnow;
169 RotBstMatrix MfromCM, MtoCM;
170
171 // information for error checkout.
172 int nErrEvent;
173 vector<int> iErrId, iErrCol, iErrNan;
174
175 // Pointers to the parton distributions of the two incoming beams.
176 PDF* pdfAPtr;
177 PDF* pdfBPtr;
178
179 // Extra PDF pointers to be used in hard processes only.
180 PDF* pdfHardAPtr;
181 PDF* pdfHardBPtr;
182
183 // Keep track when "new" has been used and needs a "delete" for PDF's.
184 bool useNewPdfA, useNewPdfB, useNewPdfHard;
185
186 // The two incoming beams.
187 BeamParticle beamA;
188 BeamParticle beamB;
189
190 // LHAup object for generating external events.
191 bool doLHA, useNewLHA;
192 LHAup* lhaUpPtr;
193
194 // Pointer to external decay handler and list of particles it handles.
195 DecayHandler* decayHandlePtr;
196 vector<int> handledParticles;
197
198 // Pointer to UserHooks object for user interaction with program.
199 UserHooks* userHooksPtr;
200 bool hasUserHooks, doVetoProcess, doVetoPartons;
201
202 // Pointer to BeamShape object for beam momentum and interaction vertex.
203 BeamShape* beamShapePtr;
204 bool useNewBeamShape, doMomentumSpread, doVertexSpread;
205
206 // Pointers to external processes derived from the Pythia base classes.
207 vector<SigmaProcess*> sigmaPtrs;
208
209 // Pointers to external calculation of resonance widths.
210 vector<ResonanceWidths*> resonancePtrs;
211
212 // Pointers to timelike and spacelike showers.
213 TimeShower* timesDecPtr;
214 TimeShower* timesPtr;
215 SpaceShower* spacePtr;
216 bool useNewTimes, useNewSpace;
217
218 // The main generator class to define the core process of the event.
219 ProcessLevel processLevel;
220
221 // The main generator class to produce the parton level of the event.
222 PartonLevel partonLevel;
223
224 // The main generator class to produce the hadron level of the event.
225 HadronLevel hadronLevel;
226
227 // The total cross section class is used both on process and parton level.
228 SigmaTotal sigmaTot;
229
230 // Write the Pythia banner, with symbol and version information.
231 void banner(ostream& os = cout);
232
233 // Check for lines in file that mark the beginning of new subrun.
234 int readSubrun(string line, bool warn = true, ostream& os = cout);
235
236 // Initialization routine to set up the whole generation machinery.
237 bool initInternal();
238
239 // Calculate kinematics at initialization.
240 bool initKinematics();
241
242 // Initialize tunes to e+e- and pp/ppbar data.
243 void initTunes();
244
245 // Recalculate kinematics for each event when beam momentum has a spread.
246 void nextKinematics();
247
248 // Boost from CM frame to lab frame, or inverse. Set production vertex.
249 void boostAndVertex(bool toLab, bool setVertex);
250
251 // Check that the final event makes sense.
252 bool check(ostream& os = cout);
253
254 // Auxiliary to set parton densities among list of possibilities.
255 PDF* getPDFPtr(int idIn, int sequence = 1);
256
257};
258
259//**************************************************************************
260
261} // end namespace Pythia8
262
263#endif // Pythia8_Pythia_H