There are two ways, which are slightly different, to run the Pythia event generator in the context of the Starsim application. In the original (old) design, the dynamic library served both as an adapter and a container for the standard Pythia library that would typically come with a CERNLIB distribution. The problem with this approach is of course that Pythia in itself is not a static piece of software and receives periodic updates. It is difficult or impossible, therefore, to modify the component without affecting, in one way or another, various analyses as the consistency of the code is broken at some point.

It possible, however, to refactor the Pythia adaptor in such a way that the Pythia library proper can be loaded separately. This gives the user the ability to choose a specific version of the Pythia code to be run in their simulation. Different users, therefore, can use different versions of Pythia concurrently in Starsim, which is in everybody's interest. The thus modified wrapper was given the mneumonic name (it should be easy to memorize since "b"-pythia follows "a"-pythia). We have also decided the freeze the Pythia version linked into at 6.205, and select subsequent versions as explained on the bottom of this page.

In the following, we present both the "old way" of running Pythia (i.e. tied to a specific version) and the new one (whereby the version can be requested dynamically at run time).

Using Pythia 6.205

Listed below is the KUMAC macro that can be used to run your own Pythia simulation, specifically utilizing version 6.205 of the Pythia code and without the ability to switch. This would be fine for most STAR applications at the time of this writing (mid-2007). Please pay attention to the comments embedded in the code. Additional notes:
  • the script below explicitely refers to which contains Pythia 6.205
  • don't forget to seed the random number generator if you'll be doing a series of runs
  • make sure you specify the correct geometry tag
  • specify a different output file for each run
  • pay attention to the physics parameters used in the simulation; you will need to consult the Pythia manual for meaning fo those
  • the number of triggers on the bottom of the macro can be set to anything, just remember that the resulting files can be large and unwieldy if that number is too large. As a rule of thumb, we usually don't go over 5k event per file in production
gfile o my_pythia_file.fz
detp geom y2006
make geometry
gclose all
* define a beam with 100um transverse sigma and 60cm sigma in Z
vsig  0.01  60.0
* Cut on eta (+-6.3) to avoid having to handle massive showers caused by the spectators
* Cut on vertex Z (+-30 cm)
gkine -1 0 0 100 -6.3 6.3 0 6.29 -30.0 30.0
* load pythia
gexec $STAR_LIB/
* specify parameters
ENER 200.0     ! Collision energy
MSEL 1         ! Collision type
MSUB (11)=1    ! Subprocess choice
MSUB (12)=1
MSUB (13)=1
MSUB (28)=1
MSUB (53)=1
MSUB (68)=1
* Make the following stable:
MDCY (102,1)=0  ! PI0 111
MDCY (106,1)=0  ! PI+ 211
MDCY (109,1)=0  ! ETA 221
MDCY (116,1)=0  ! K+ 321
MDCY (112,1)=0  ! K_SHORT 310
MDCY (105,1)=0  ! K_LONG 130
MDCY (164,1)=0  ! LAMBDA0 3122
MDCY (167,1)=0  ! SIGMA0 3212
MDCY (162,1)=0  ! SIGMA- 3112
MDCY (169,1)=0  ! SIGMA+ 3222
MDCY (172,1)=0  ! Xi- 3312
MDCY (174,1)=0  ! Xi0 3322
MDCY (176,1)=0  ! OMEGA- 3334
* seed the random generator
rndm 13 19
* trigger - change to trigger the desired number of times
trig 10

Specifying the Pythia version dynamically

In addition to the "frozen" version 6.205 which can be used as explained above, there is currently one more version that can be loaded, namely 6.410. Going forward, more versions will be added to the code base and to the collection of STAR libraries, as needed.

In order to use version 6.410, the user needs to simply replace the following line in the above script
gexec $STAR_LIB/
gexec $STAR_LIB/
gexec $STAR_LIB/