Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Private Attributes | Static Private Attributes | List of all members
Pythia6 Class Reference

The C++ interface class to Pythia6. More...

#include <Doxymodules_eventgenerator.h>

Public Member Functions

 Pythia6 ()
 
virtual ~Pythia6 ()
 
int Pycomp (int kf)
 
void Py1ent (int line, int kf, double pe, double theta, double phi)
 
ParticleVectorImportParticles ()
 
int ImportParticles (ParticleVector *particles, const char *option="")
 
void SetMSTJ (int i, int m)
 
int GetMDCY (int i, int j)
 
int GetKFDP (int i, int j)
 
void SetMDCY (int i, int j, int m)
 
void SetMDME (int i, int j, int m)
 

Static Public Member Functions

static Pythia6Instance ()
 

Private Attributes

ParticleVectorfParticles
 
Pyjets_tfPyjets
 
Pydat1_tfPydat1
 
Pydat3_tfPydat3
 

Static Private Attributes

static Pythia6fgInstance = 0
 

Detailed Description

The C++ interface class to Pythia6.

According to TPythia6 class from Root: (The TPythia6 class is an interface class to F77 routines in Pythia6 // CERNLIB event generators, written by T.Sjostrand.)
http://root.cern.ch/ see http://root.cern.ch/root/License.html

The complete Pythia6 documentation can be found at: http://home.thep.lu.se/~torbjorn/pythiaaux/recent.html

Definition at line 117 of file Doxymodules_eventgenerator.h.

Constructor & Destructor Documentation

◆ Pythia6()

Pythia6::Pythia6 ( )

Pythia6 constructor: creates a vector of Pythia6Particle in which it will store all particles. Note that there may be only one functional Pythia6 object at a time, so it's not use to create more than one instance of it.

Definition at line 135 of file Pythia6.cc.

136 : fParticles(0),
137 fPyjets(0),
138 fPydat1(0),
139 fPydat3(0)
140{
141/// Pythia6 constructor: creates a vector of Pythia6Particle in which it will
142/// store all particles. Note that there may be only one functional Pythia6
143/// object at a time, so it's not use to create more than one instance of it.
144
145 // Protect against multiple objects. All access should be via the
146 // Instance member function.
147 if ( fgInstance ) {
148 std::cerr << "There's already an instance of Pythia6" << std::endl;
149 exit (1);
150 }
151
153
154 // Initialize common-blocks
158
159 // Alternative way to initialize common-blocks
160 // usind direct declaration of pythia6 common blocks
161 // fPyjets = &pyjets_;
162 // fPydat1 = &pydat1_;
163 // fPydat3 = &pydat3_;
164}
void * pythia6_common_address(const char *)
std::vector< Pythia6Particle * > ParticleVector
Definition Pythia6.hh:148
ParticleVector * fParticles
Definition Pythia6.hh:193
Pydat3_t * fPydat3
Definition Pythia6.hh:196
static Pythia6 * fgInstance
Definition Pythia6.hh:191
Pydat1_t * fPydat1
Definition Pythia6.hh:195
Pyjets_t * fPyjets
Definition Pythia6.hh:194
PYDAT1 common-block.
Definition Pythia6.hh:101
PYDAT3 common-block.
Definition Pythia6.hh:110
PYJETS common-block.
Definition Pythia6.hh:91

◆ ~Pythia6()

Pythia6::~Pythia6 ( )
virtual

Destroy the object, delete and dispose all Pythia6Particles currently on list.

Definition at line 168 of file Pythia6.cc.

169{
170/// Destroy the object, delete and dispose all Pythia6Particles currently on
171/// list.
172
173 if ( fParticles ) {
174 ParticleVector::const_iterator it;
175 for ( it = fParticles->begin(); it != fParticles->end(); it++ )
176 delete *it;
177 delete fParticles;
178 }
179}

Member Function Documentation

◆ Instance()

Pythia6 * Pythia6::Instance ( )
static

Static access method

Definition at line 124 of file Pythia6.cc.

125{
126/// Static access method
127
128 if ( ! fgInstance ) fgInstance = new Pythia6();
129
130 return fgInstance;
131}
Pythia6()
Definition Pythia6.cc:135

◆ Pycomp()

int Pythia6::Pycomp ( int  kf)

Interface with fortran routine pycomp

Definition at line 183 of file Pythia6.cc.

184{
185/// Interface with fortran routine pycomp
186
187 return pycomp(&kf);
188}
#define pycomp
Definition Pythia6.cc:97

◆ Py1ent()

void Pythia6::Py1ent ( int  line,
int  kf,
double  pe,
double  theta,
double  phi 
)

Add one entry to the event record, i.e. either a parton or a particle.

IP: normally line number for the parton/particle. There are two exceptions:

If IP = 0: line number 1 is used and PYEXEC is called. If IP < 0: line -IP is used, with status code K(-IP,2)=2 rather than 1; thus a parton system may be built up by filling all but the last parton of the system with IP < 0.
KF: parton/particle flavour code (PDG code) PE: parton/particle energy. If PE is smaller than the mass, the parton/particle is taken to be at rest.
THETA: PHI: polar and azimuthal angle for the momentum vector of the parton/particle.

Definition at line 192 of file Pythia6.cc.

193{
194/// Add one entry to the event record, i.e. either a parton or a
195/// particle.
196///
197/// IP: normally line number for the parton/particle. There are two
198/// exceptions:
199///
200/// If IP = 0: line number 1 is used and PYEXEC is called.
201/// If IP < 0: line -IP is used, with status code K(-IP,2)=2
202/// rather than 1; thus a parton system may be built
203/// up by filling all but the last parton of the
204/// system with IP < 0.
205/// KF: parton/particle flavour code (PDG code)
206/// PE: parton/particle energy. If PE is smaller than the mass,
207/// the parton/particle is taken to be at rest.
208/// THETA:
209/// PHI: polar and azimuthal angle for the momentum vector of the
210/// parton/particle.
211
212 py1ent(ip, kf, pe, theta, phi);
213}
#define py1ent
Definition Pythia6.cc:98

◆ ImportParticles() [1/2]

ParticleVector * Pythia6::ImportParticles ( )

◆ ImportParticles() [2/2]

int Pythia6::ImportParticles ( ParticleVector particles,
const char *  option = "" 
)

Default primary creation method. It reads the /HEPEVT/ common block which has been filled by the GenerateEvent method. If the event generator does not use the HEPEVT common block, This routine has to be overloaded by the subclasses. The function loops on the generated particles and store them in the TClonesArray pointed by the argument particles. The default action is to store only the stable particles (ISTHEP = 1) This can be demanded explicitly by setting the option = "Final" If the option = "All", all the particles are stored.

Definition at line 217 of file Pythia6.cc.

218{
219/// Default primary creation method. It reads the /HEPEVT/ common block which
220/// has been filled by the GenerateEvent method. If the event generator does
221/// not use the HEPEVT common block, This routine has to be overloaded by
222/// the subclasses.
223/// The function loops on the generated particles and store them in
224/// the TClonesArray pointed by the argument particles.
225/// The default action is to store only the stable particles (ISTHEP = 1)
226/// This can be demanded explicitly by setting the option = "Final"
227/// If the option = "All", all the particles are stored.
228
229 if ( particles == 0 ) return 0;
230
231 ParticleVector::const_iterator it;
232 for ( it = particles->begin(); it != particles->end(); it++ )
233 delete *it;
234 particles->clear();
235
236 int numpart = fPyjets->N;
237 int nparts=0;
238 if (!strcmp(option,"") || !strcmp(option,"Final")) {
239 for (int i = 0; i<numpart; i++) {
240
241 if (fPyjets->K[0][i] == 1) {
242 //
243 // Use the common block values for the TParticle constructor
244 //
245 particles->push_back(
246 new Pythia6Particle(
247 fPyjets->K[0][i] ,
248 fPyjets->K[1][i] ,
249 fPyjets->K[2][i] ,
250 fPyjets->K[3][i] ,
251 fPyjets->K[4][i] ,
252 fPyjets->P[0][i] ,
253 fPyjets->P[1][i] ,
254 fPyjets->P[2][i] ,
255 fPyjets->P[3][i] ,
256 fPyjets->P[4][i] ,
257 fPyjets->V[0][i] ,
258 fPyjets->V[1][i] ,
259 fPyjets->V[2][i] ,
260 fPyjets->V[3][i] ,
261 fPyjets->V[4][i]));
262
263 // if(gDebug) printf("%d %d %d! ",i,fPyjets->K[1][i],numpart);
264 nparts++;
265 }
266 }
267 }
268 else if (!strcmp(option,"All")) {
269 for (int i = 0; i<numpart; i++) {
270 particles->push_back(
271 new Pythia6Particle(
272 fPyjets->K[0][i] ,
273 fPyjets->K[1][i] ,
274 fPyjets->K[2][i] ,
275 fPyjets->K[3][i] ,
276 fPyjets->K[4][i] ,
277 fPyjets->P[0][i] ,
278 fPyjets->P[1][i] ,
279 fPyjets->P[2][i] ,
280 fPyjets->P[3][i] ,
281 fPyjets->P[4][i] ,
282 fPyjets->V[0][i] ,
283 fPyjets->V[1][i] ,
284 fPyjets->V[2][i] ,
285 fPyjets->V[3][i] ,
286 fPyjets->V[4][i]));
287 }
288 nparts=numpart;
289 }
290
291 return nparts;
292}
int K[5][4000]
Definition Pythia6.hh:94
double P[5][4000]
Definition Pythia6.hh:95
double V[5][4000]
Definition Pythia6.hh:96
int N
Definition Pythia6.hh:92
Structure for Pythia6 particle properties.
Definition Pythia6.hh:119

◆ SetMSTJ()

void Pythia6::SetMSTJ ( int  i,
int  m 
)
inline

Definition at line 181 of file Pythia6.hh.

181{ fPydat1->MSTJ[i-1] = m; }
int MSTJ[200]
Definition Pythia6.hh:104

◆ GetMDCY()

int Pythia6::GetMDCY ( int  i,
int  j 
)
inline

Definition at line 185 of file Pythia6.hh.

185{ return fPydat3->MDCY[j-1][i-1]; }
int MDCY[3][500]
Definition Pythia6.hh:111

◆ GetKFDP()

int Pythia6::GetKFDP ( int  i,
int  j 
)
inline

Definition at line 186 of file Pythia6.hh.

186{ return fPydat3->KFDP[j-1][i-1]; }
int KFDP[5][KNDCAY]
Definition Pythia6.hh:114

◆ SetMDCY()

void Pythia6::SetMDCY ( int  i,
int  j,
int  m 
)
inline

Definition at line 187 of file Pythia6.hh.

187{ fPydat3->MDCY[j-1][i-1] = m; }

◆ SetMDME()

void Pythia6::SetMDME ( int  i,
int  j,
int  m 
)
inline

Definition at line 188 of file Pythia6.hh.

188{ fPydat3->MDME[j-1][i-1] = m; }
int MDME[2][KNDCAY]
Definition Pythia6.hh:112

Member Data Documentation

◆ fgInstance

Pythia6 * Pythia6::fgInstance = 0
staticprivate

Definition at line 191 of file Pythia6.hh.

◆ fParticles

ParticleVector* Pythia6::fParticles
private

Definition at line 193 of file Pythia6.hh.

◆ fPyjets

Pyjets_t* Pythia6::fPyjets
private

Definition at line 194 of file Pythia6.hh.

◆ fPydat1

Pydat1_t* Pythia6::fPydat1
private

Definition at line 195 of file Pythia6.hh.

◆ fPydat3

Pydat3_t* Pythia6::fPydat3
private

Definition at line 196 of file Pythia6.hh.


The documentation for this class was generated from the following files:

Applications | User Support | Publications | Collaboration