Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions
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 128 of file Pythia6.cc.

References pythia6_common_address().

Referenced by Instance().

129  : fParticles(0),
130  fPyjets(0),
131  fPydat1(0),
132  fPydat3(0)
133 {
134 /// Pythia6 constructor: creates a vector of Pythia6Particle in which it will
135 /// store all particles. Note that there may be only one functional Pythia6
136 /// object at a time, so it's not use to create more than one instance of it.
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 }
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
Pythia6::~Pythia6 ( )
virtual

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

Definition at line 155 of file Pythia6.cc.

156 {
157 /// Destroy the object, delete and dispose all Pythia6Particles currently on
158 /// list.
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 }

Member Function Documentation

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

Definition at line 187 of file Pythia6.hh.

References Pydat3_t::KFDP.

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.

References Pydat3_t::MDCY.

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

References Pyjets_t::K, Pyjets_t::N, Pyjets_t::P, and Pyjets_t::V.

205 {
206 /// Default primary creation method. It reads the /HEPEVT/ common block which
207 /// has been filled by the GenerateEvent method. If the event generator does
208 /// not use the HEPEVT common block, This routine has to be overloaded by
209 /// the subclasses.
210 /// The function loops on the generated particles and store them in
211 /// the TClonesArray pointed by the argument particles.
212 /// The default action is to store only the stable particles (ISTHEP = 1)
213 /// This can be demanded explicitly by setting the option = "Final"
214 /// If the option = "All", all the particles are stored.
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
Pythia6 * Pythia6::Instance ( void  )
static

Static access method

Definition at line 117 of file Pythia6.cc.

References Pythia6().

118 {
119 /// Static access method
120 
121  if ( ! fgInstance ) fgInstance = new Pythia6();
122 
123  return fgInstance;
124 }
Pythia6()
Definition: Pythia6.cc:128
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.

References py1ent.

180 {
181 /// Add one entry to the event record, i.e. either a parton or a
182 /// particle.
183 ///
184 /// IP: normally line number for the parton/particle. There are two
185 /// exceptions:
186 ///
187 /// If IP = 0: line number 1 is used and PYEXEC is called.
188 /// If IP < 0: line -IP is used, with status code K(-IP,2)=2
189 /// rather than 1; thus a parton system may be built
190 /// up by filling all but the last parton of the
191 /// system with IP < 0.
192 /// KF: parton/particle flavour code (PDG code)
193 /// PE: parton/particle energy. If PE is smaller than the mass,
194 /// the parton/particle is taken to be at rest.
195 /// THETA:
196 /// PHI: polar and azimuthal angle for the momentum vector of the
197 /// parton/particle.
198 
199  py1ent(ip, kf, pe, theta, phi);
200 }
#define py1ent
Definition: Pythia6.cc:99
int Pythia6::Pycomp ( int  kf)

Interface with fortran routine pycomp

Definition at line 170 of file Pythia6.cc.

References pycomp.

171 {
172 /// Interface with fortran routine pycomp
173 
174  return pycomp(&kf);
175 }
#define pycomp
Definition: Pythia6.cc:98
void Pythia6::SetMDCY ( int  i,
int  j,
int  m 
)
inline

Definition at line 188 of file Pythia6.hh.

References python.hepunit::m, and Pydat3_t::MDCY.

188 { fPydat3->MDCY[j-1][i-1] = m; }
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.

References python.hepunit::m, and Pydat3_t::MDME.

189 { fPydat3->MDME[j-1][i-1] = m; }
int MDME[2][KNDCAY]
Definition: Pythia6.hh:113
void Pythia6::SetMSTJ ( int  i,
int  m 
)
inline

Definition at line 182 of file Pythia6.hh.

References python.hepunit::m, and Pydat1_t::MSTJ.

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

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