Geant4  10.02.p03
Pythia6 Class Reference

#include <Pythia6.hh>

Collaboration diagram for Pythia6:

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 163 of file Pythia6.hh.

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 128 of file Pythia6.cc.

129  : fParticles(0),
130  fPyjets(0),
131  fPydat1(0),
132  fPydat3(0)
133 {
137 
138  // Protect against multiple objects. All access should be via the
139  // Instance member function.
140  if ( fgInstance ) {
141  std::cerr << "There's already an instance of Pythia6" << std::endl;
142  exit (1);
143  }
144 
145  fParticles = new ParticleVector();
146 
147  // initialize common-blocks
148  fPyjets = (Pyjets_t*) pythia6_common_address("PYJETS");
149  fPydat1 = (Pydat1_t*) pythia6_common_address("PYDAT1");
150  fPydat3 = (Pydat3_t*) pythia6_common_address("PYDAT3");
151 }
ParticleVector * fParticles
Definition: Pythia6.hh:194
Pydat1_t * fPydat1
Definition: Pythia6.hh:196
static Pythia6 * fgInstance
Definition: Pythia6.hh:192
PYDAT3 common-block.
Definition: Pythia6.hh:110
void * pythia6_common_address(const char *)
std::vector< Pythia6Particle * > ParticleVector
Definition: Pythia6.hh:149
PYJETS common-block.
Definition: Pythia6.hh:91
Pyjets_t * fPyjets
Definition: Pythia6.hh:195
Pydat3_t * fPydat3
Definition: Pythia6.hh:197
PYDAT1 common-block.
Definition: Pythia6.hh:101
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~Pythia6()

Pythia6::~Pythia6 ( )
virtual

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

Definition at line 155 of file Pythia6.cc.

156 {
159 
160  if ( fParticles ) {
161  ParticleVector::const_iterator it;
162  for ( it = fParticles->begin(); it != fParticles->end(); it++ )
163  delete *it;
164  delete fParticles;
165  }
166 }
ParticleVector * fParticles
Definition: Pythia6.hh:194

Member Function Documentation

◆ GetKFDP()

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

Definition at line 187 of file Pythia6.hh.

187 { return fPydat3->KFDP[j-1][i-1]; }
int KFDP[5][KNDCAY]
Definition: Pythia6.hh:115
Pydat3_t * fPydat3
Definition: Pythia6.hh:197
Here is the caller graph for this function:

◆ GetMDCY()

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

Definition at line 186 of file Pythia6.hh.

186 { return fPydat3->MDCY[j-1][i-1]; }
int MDCY[3][500]
Definition: Pythia6.hh:112
Pydat3_t * fPydat3
Definition: Pythia6.hh:197
Here is the caller graph for this function:

◆ ImportParticles() [1/2]

ParticleVector* Pythia6::ImportParticles ( )
Here is the caller graph for this function:

◆ 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 204 of file Pythia6.cc.

205 {
215 
216  if ( particles == 0 ) return 0;
217 
218  ParticleVector::const_iterator it;
219  for ( it = particles->begin(); it != particles->end(); it++ )
220  delete *it;
221  particles->clear();
222 
223  int numpart = fPyjets->N;
224  int nparts=0;
225  if (!strcmp(option,"") || !strcmp(option,"Final")) {
226  for (int i = 0; i<numpart; i++) {
227 
228  if (fPyjets->K[0][i] == 1) {
229  //
230  // Use the common block values for the TParticle constructor
231  //
232  particles->push_back(
233  new Pythia6Particle(
234  fPyjets->K[0][i] ,
235  fPyjets->K[1][i] ,
236  fPyjets->K[2][i] ,
237  fPyjets->K[3][i] ,
238  fPyjets->K[4][i] ,
239  fPyjets->P[0][i] ,
240  fPyjets->P[1][i] ,
241  fPyjets->P[2][i] ,
242  fPyjets->P[3][i] ,
243  fPyjets->P[4][i] ,
244  fPyjets->V[0][i] ,
245  fPyjets->V[1][i] ,
246  fPyjets->V[2][i] ,
247  fPyjets->V[3][i] ,
248  fPyjets->V[4][i]));
249 
250  // if(gDebug) printf("%d %d %d! ",i,fPyjets->K[1][i],numpart);
251  nparts++;
252  }
253  }
254  }
255  else if (!strcmp(option,"All")) {
256  for (int i = 0; i<numpart; i++) {
257  particles->push_back(
258  new Pythia6Particle(
259  fPyjets->K[0][i] ,
260  fPyjets->K[1][i] ,
261  fPyjets->K[2][i] ,
262  fPyjets->K[3][i] ,
263  fPyjets->K[4][i] ,
264  fPyjets->P[0][i] ,
265  fPyjets->P[1][i] ,
266  fPyjets->P[2][i] ,
267  fPyjets->P[3][i] ,
268  fPyjets->P[4][i] ,
269  fPyjets->V[0][i] ,
270  fPyjets->V[1][i] ,
271  fPyjets->V[2][i] ,
272  fPyjets->V[3][i] ,
273  fPyjets->V[4][i]));
274  }
275  nparts=numpart;
276  }
277 
278  return nparts;
279 }
Structure for Pythia6 particle properties.
Definition: Pythia6.hh:119
int N
Definition: Pythia6.hh:93
double P[5][4000]
Definition: Pythia6.hh:96
int K[5][4000]
Definition: Pythia6.hh:95
double V[5][4000]
Definition: Pythia6.hh:97
Pyjets_t * fPyjets
Definition: Pythia6.hh:195

◆ Instance()

Pythia6 * Pythia6::Instance ( void  )
static

Static access method

Definition at line 117 of file Pythia6.cc.

118 {
120 
121  if ( ! fgInstance ) fgInstance = new Pythia6();
122 
123  return fgInstance;
124 }
static Pythia6 * fgInstance
Definition: Pythia6.hh:192
Pythia6()
Definition: Pythia6.cc:128
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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 179 of file Pythia6.cc.

180 {
198 
199  py1ent(ip, kf, pe, theta, phi);
200 }
#define py1ent
Definition: Pythia6.cc:99
Here is the caller graph for this function:

◆ Pycomp()

int Pythia6::Pycomp ( int  kf)

Interface with fortran routine pycomp

Definition at line 170 of file Pythia6.cc.

171 {
173 
174  return pycomp(&kf);
175 }
#define pycomp
Definition: Pythia6.cc:98
Here is the caller graph for this function:

◆ SetMDCY()

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

Definition at line 188 of file Pythia6.hh.

188 { fPydat3->MDCY[j-1][i-1] = m; }
int MDCY[3][500]
Definition: Pythia6.hh:112
Pydat3_t * fPydat3
Definition: Pythia6.hh:197
static const double m
Definition: G4SIunits.hh:128
Here is the caller graph for this function:

◆ SetMDME()

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

Definition at line 189 of file Pythia6.hh.

189 { fPydat3->MDME[j-1][i-1] = m; }
int MDME[2][KNDCAY]
Definition: Pythia6.hh:113
Pydat3_t * fPydat3
Definition: Pythia6.hh:197
static const double m
Definition: G4SIunits.hh:128
Here is the caller graph for this function:

◆ SetMSTJ()

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

Definition at line 182 of file Pythia6.hh.

182 { fPydat1->MSTJ[i-1] = m; }
Pydat1_t * fPydat1
Definition: Pythia6.hh:196
int MSTJ[200]
Definition: Pythia6.hh:105
static const double m
Definition: G4SIunits.hh:128
Here is the caller graph for this function:

Member Data Documentation

◆ fgInstance

Pythia6 * Pythia6::fgInstance = 0
staticprivate

Definition at line 192 of file Pythia6.hh.

◆ fParticles

ParticleVector* Pythia6::fParticles
private

Definition at line 194 of file Pythia6.hh.

◆ fPydat1

Pydat1_t* Pythia6::fPydat1
private

Definition at line 196 of file Pythia6.hh.

◆ fPydat3

Pydat3_t* Pythia6::fPydat3
private

Definition at line 197 of file Pythia6.hh.

◆ fPyjets

Pyjets_t* Pythia6::fPyjets
private

Definition at line 195 of file Pythia6.hh.


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