Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Pythia6 Class Reference

#include <Pythia6.hh>

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 ()
 

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

137  : fParticles(0),
138  fPyjets(0),
139  fPydat1(0),
140  fPydat3(0)
141 {
145 
146  // Protect against multiple objects. All access should be via the
147  // Instance member function.
148  if ( fgInstance ) {
149  std::cerr << "There's already an instance of Pythia6" << std::endl;
150  exit (1);
151  }
152 
153  fParticles = new ParticleVector();
154 
155  // Initialize common-blocks
156  fPyjets = (Pyjets_t*) pythia6_common_address("PYJETS");
157  fPydat1 = (Pydat1_t*) pythia6_common_address("PYDAT1");
158  fPydat3 = (Pydat3_t*) pythia6_common_address("PYDAT3");
159 
160  // Alternative way to initialize common-blocks
161  // usind direct declaration of pythia6 common blocks
162  // fPyjets = &pyjets_;
163  // fPydat1 = &pydat1_;
164  // fPydat3 = &pydat3_;
165 }
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
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 ( )
virtual

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

Definition at line 169 of file Pythia6.cc.

170 {
173 
174  if ( fParticles ) {
175  ParticleVector::const_iterator it;
176  for ( it = fParticles->begin(); it != fParticles->end(); it++ )
177  delete *it;
178  delete fParticles;
179  }
180 }

Member Function Documentation

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
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
ParticleVector* Pythia6::ImportParticles ( )
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 218 of file Pythia6.cc.

219 {
229 
230  if ( particles == 0 ) return 0;
231 
232  ParticleVector::const_iterator it;
233  for ( it = particles->begin(); it != particles->end(); it++ )
234  delete *it;
235  particles->clear();
236 
237  int numpart = fPyjets->N;
238  int nparts=0;
239  if (!strcmp(option,"") || !strcmp(option,"Final")) {
240  for (int i = 0; i<numpart; i++) {
241 
242  if (fPyjets->K[0][i] == 1) {
243  //
244  // Use the common block values for the TParticle constructor
245  //
246  particles->push_back(
247  new Pythia6Particle(
248  fPyjets->K[0][i] ,
249  fPyjets->K[1][i] ,
250  fPyjets->K[2][i] ,
251  fPyjets->K[3][i] ,
252  fPyjets->K[4][i] ,
253  fPyjets->P[0][i] ,
254  fPyjets->P[1][i] ,
255  fPyjets->P[2][i] ,
256  fPyjets->P[3][i] ,
257  fPyjets->P[4][i] ,
258  fPyjets->V[0][i] ,
259  fPyjets->V[1][i] ,
260  fPyjets->V[2][i] ,
261  fPyjets->V[3][i] ,
262  fPyjets->V[4][i]));
263 
264  // if(gDebug) printf("%d %d %d! ",i,fPyjets->K[1][i],numpart);
265  nparts++;
266  }
267  }
268  }
269  else if (!strcmp(option,"All")) {
270  for (int i = 0; i<numpart; i++) {
271  particles->push_back(
272  new Pythia6Particle(
273  fPyjets->K[0][i] ,
274  fPyjets->K[1][i] ,
275  fPyjets->K[2][i] ,
276  fPyjets->K[3][i] ,
277  fPyjets->K[4][i] ,
278  fPyjets->P[0][i] ,
279  fPyjets->P[1][i] ,
280  fPyjets->P[2][i] ,
281  fPyjets->P[3][i] ,
282  fPyjets->P[4][i] ,
283  fPyjets->V[0][i] ,
284  fPyjets->V[1][i] ,
285  fPyjets->V[2][i] ,
286  fPyjets->V[3][i] ,
287  fPyjets->V[4][i]));
288  }
289  nparts=numpart;
290  }
291 
292  return nparts;
293 }
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
Pythia6 * Pythia6::Instance ( void  )
static

Static access method

Definition at line 125 of file Pythia6.cc.

126 {
128 
129  if ( ! fgInstance ) fgInstance = new Pythia6();
130 
131  return fgInstance;
132 }
Pythia6()
Definition: Pythia6.cc:136

Here is the call graph for this function:

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

194 {
212 
213  py1ent(ip, kf, pe, theta, phi);
214 }
#define py1ent
Definition: Pythia6.cc:99
int Pythia6::Pycomp ( int  kf)

Interface with fortran routine pycomp

Definition at line 184 of file Pythia6.cc.

185 {
187 
188  return pycomp(&kf);
189 }
#define pycomp
Definition: Pythia6.cc:98
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; }
static constexpr double m
Definition: G4SIunits.hh:129
int MDCY[3][500]
Definition: Pythia6.hh:112
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; }
static constexpr double m
Definition: G4SIunits.hh:129
int MDME[2][KNDCAY]
Definition: Pythia6.hh:113
void Pythia6::SetMSTJ ( int  i,
int  m 
)
inline

Definition at line 182 of file Pythia6.hh.

182 { fPydat1->MSTJ[i-1] = m; }
int MSTJ[200]
Definition: Pythia6.hh:105
static constexpr double m
Definition: G4SIunits.hh:129

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