Difference between revisions of "PYTHIA"

From EIC
Jump to navigation Jump to search
(Updates to reflect new version with direct ROOT output, plus some changes for formatting and typos.)
Line 1: Line 1:
== Documentation on PYTHIA: ==
+
== Overview of PYTHIA: ==
* for ep only versions of PYTHIA 6.4 can be used
+
* For e-p collisions only versions of PYTHIA 6.4 can be used. Pythia8 does not yet support e-p collisions.
* its www-page http://home.thep.lu.se/~torbjorn/pythiaaux/recent.html
+
* Its webpage: http://home.thep.lu.se/~torbjorn/pythiaaux/recent.html.
* the manual http://home.thep.lu.se/~torbjorn/pythia/lutp0613man2.pdf<br>
+
* The manual: http://home.thep.lu.se/~torbjorn/pythia/lutp0613man2.pdf.
* a file containing all particle codes and decay channels with branching ratios implemented in pythia ([http://www.phenix.bnl.gov/WWW/publish/elke/EIC/Files-for-Wiki/Pythia.6.4.particles.codes.and.decays.txt [PYTHIA PDG]])
+
* A file containing all particle codes and decay channels with branching ratios implemented in pythia: [http://www.phenix.bnl.gov/WWW/publish/elke/EIC/Files-for-Wiki/Pythia.6.4.particles.codes.and.decays.txt [PYTHIA PDG]].
==== Pythia processes important in ep ====
+
 
 +
==== Pythia processes important in e-p ====
  
 
{| class="wikitable" style="text-align:left" border="1" cellpadding="3" cellspacing="0"
 
{| class="wikitable" style="text-align:left" border="1" cellpadding="3" cellspacing="0"
Line 92: Line 93:
 
!(longitudinal) PGF
 
!(longitudinal) PGF
 
|}
 
|}
VMD: Vector Meson Dominance, describing the elastic diffractive production of Vector Mesons<br>
+
VMD: Vector Meson Dominance, describing the elastic diffractive production of Vector Mesons.
QCDC: QCD-Compton, radiation of a gluon from incoming or outgoing quark lines<br>
+
QCDC: QCD-Compton, radiation of a gluon from incoming or outgoing quark lines.
PGF: Photon Gluon Fusion<br>
+
PGF: Photon Gluon Fusion.
 +
 
 +
==pythiaeRHIC==
  
== Running PYTHIA ==
+
pythiaeRHIC is the EIC science task force's programme for running PYTHIA.
the code can be found on the afs directory for EIC at BNL
+
It is based on PYTHIA 6.4.13 and was modified to include radiative corrections using [[#Documentation on Radiative Corrections: | RADGEN]].
  "/afs/rhic.bnl.gov/eic/PACKAGES/PYTHIA-RAD-CORR"
+
The main programme can be viewed [http://svn.racf.bnl.gov/svn/eic/Generators/pythiaeRHIC/trunk/erhic/pythia6.f95 here].
 +
Installations can be found under the EIC AFS directory, numbered by version.
 +
e.g. version 1.0.0 is located at
 +
  /afs/rhic.bnl.gov/eic/PACKAGES/pythiaeRHIC/1.0.0
 +
The code can also be checked out from the EIC Subversion repository.
 +
To check out a particular version e.g. 1.0.0, do:
 +
svn checkout http://svn.racf.bnl.gov/svn/eic/Generators/pythiaeRHIC/tags/1.0.0 pythiaeRHIC
 +
To check out the version with the latest updates, do:
 +
svn checkout http://svn.racf.bnl.gov/svn/eic/Generators/pythiaeRHIC/trunk pythiaeRHIC
 +
It is compiled using configure and make.
 +
Building the programme generates an executable named ''pythiaeRHIC'', plus shared libraries for PYTHIA and RADGEN.
 +
Input is provided by a steer file, an example of which is included with the distribution (see [[#Original version | below]] for the location of more examples).
 +
Output can be produced in a ROOT tree format, described [[eic-smear | here]], or an ASCII file, described [[#ASCII output file structure | below]].
 +
See the included README for further instructions on building and running.
  
this is code is based on PYTHIA 6.4.13 and was modified to include radiative corrections using [[#Documentation on Radiative Corrections: | RadGen]].<br>
+
===Original version===
The main program is in the same directory and called [https://wiki.bnl.gov/eic/upload/PyMaineRHIC-Jan2012.pdf [pyMaineRHIC.f]], several other routines are needed which are in the same directory.<br>
 
The executable is in the same directory and called pythiaeRHIC<br>
 
There are several steer files (named: input.data. XXXXX.eic) provided in this directory to run PYTHIA and get reasonable output
 
Here example files for [[Media:Input.data.eAu_noradcorr.eic.pdf‎ | eAu]] and [[Media:Input.data.ep_noradcorr.eic.pdf‎ | ep]]
 
  
=== How to Run the Code ===
+
The original version of the code supported ASCII output only, but is the same in physics content (e.g. supporting radiative corrections).
==== without radiative corrections ====
+
An installation is located at
  pythiaeRHIC < input.data_noradcor.eic > XXX.log 
+
/afs/rhic.bnl.gov/eic/PACKAGES/PYTHIA-RAD-CORR-32BIT
input.data_noradcor.eic is one of the steer file examples in the directory to run PYTHIA with settings tuned for Hermes, and/or H1 and ZEUS.<br>
+
This directory contains several example steer files, named "input.data. XXXXX.eic", which also work with the new code.
If you want to run only elastic vector meson production the example steer file is "input.data_noradcor.VM.eic"
+
There are also generated [[#2) with radiative corrections | RADGEN lookup tables]].
 +
Here are example files for [[Media:Input.data.eAu_noradcorr.eic.pdf‎ | eAu]] and [[Media:Input.data.ep_noradcorr.eic.pdf‎ | ep]].
 +
The main program, named pyMaineRHIC.f, can be viewed [[Media:PyMaineRHIC-Jan2012.pdf | here]].
 +
Several other routines are needed, which are in the same directory.
  
==== with radiative corrections ====
+
=== ASCII output file structure ===
* create a directory called radgen in the area you want to run the code
 
* you either need to generate the lookup table for your cuts and beam energy settings first <br>
 
    pythiaeRHIC < input.data_make-radcor.eic
 
* or you can use one of the files already generated<br>
 
the directories are in
 
  "/afs/rhic.bnl.gov/eic/PACKAGES/PYTHIA-RAD-CORR"
 
and called radgen(ebeamB)x(pbeamE), like  radgen10x100 or radgen4x100 or .......
 
* to run the code than with radiative corrections simply change the steer file to either
 
    input.data_radcor.eic or input.data_radcor.VM.eic and type pythiaeRHIC < input.data_radcor.eic > XXX.log
 
  
=== Output file structure ===
+
The output file text format has the following structure:
the output file is in a text format which has the following structure.<br>
+
* 1st line:  "PYTHIA EVENT FILE"
* 1st line:  PYTHIA EVENT FILE  
 
 
* 2nd line: "============================================"
 
* 2nd line: "============================================"
<br>
 
 
* 3rd line: Information on event wise variables stored in the file
 
* 3rd line: Information on event wise variables stored in the file
 
{| class="wikitable" style="text-align:left" border="1" cellpadding="2" cellspacing="0"
 
{| class="wikitable" style="text-align:left" border="1" cellpadding="2" cellspacing="0"
Line 176: Line 180:
 
| nrTracks: || number of tracks in this event, includes also virtual particles
 
| nrTracks: || number of tracks in this event, includes also virtual particles
 
|}
 
|}
<br>
 
 
* 4th line: "============================================"
 
* 4th line: "============================================"
<br>
 
 
* 5th line: Information on track wise variables stored in the file
 
* 5th line: Information on track wise variables stored in the file
 
{| class="wikitable" style="text-align:left" border="1" cellpadding="2" cellspacing="0"
 
{| class="wikitable" style="text-align:left" border="1" cellpadding="2" cellspacing="0"
Line 215: Line 217:
 
* Xth line "=============== Event finished ==============="
 
* Xth line "=============== Event finished ==============="
  
'''the information from line 7 to X repeats for each event.'''
+
The first six lines form the file header, while '''the information from line 7 to X repeats for each event'''.
 +
A ROOT file can be generated from the ASCII file using the [[BuildTree]] routine.
 +
The produced tree is equivalent to that produced directly by pythiaeRHIC.
 +
 
 +
== Using pythiaeRHIC ==
 +
 
 +
=== How to Run the Code ===
 +
 
 +
==== 1) without radiative corrections ====
 +
Use redirection to input a steer file to configure pythiaeRHIC's behavior [and optionally direct messages to a log file]:
 +
  pythiaeRHIC < input.data_noradcor.eic [ > XXX.log ]
 +
The "input.data_noradcor.eic" steer file is one of the steer file examples, with settings tuned for Hermes, and/or H1 and ZEUS.
 +
If you want to run only elastic vector meson production the example steer file is "input.data_noradcor.VM.eic"
 +
 
 +
==== 2) with radiative corrections ====
 +
 
 +
* Create a directory called radgen in the area you want to run the code.
 +
* Either generate the lookup table for your cuts and beam energy settings first…
 +
    pythiaeRHIC < input.data_make-radcor.eic
 +
* …or use one of the files already generated, located here:
 +
/afs/rhic.bnl.gov/eic/PACKAGES/PYTHIA-RAD-CORR-32BIT/radgen
 +
Files are named "radgen(electron beam energy)x(proton beam energy)", for example "radgen10x100" or "radgen4x100".
 +
* To run the code with radiative corrections simply change the steer file to either input.data_radcor.eic or input.data_radcor.VM.eic and type
 +
pythiaeRHIC < input.data_radcor.eic > XXX.log
 +
 
 +
=== Monte Carlo normalization===
  
=== How to analyze events ===
+
To normalize your counts to a cross section you need two pieces of information:
* create a root tree
+
<ol>
there are root macros available to convert the output txt-files into root trees.<br>
+
<li>the total number of event trials, NGEN(0,3), which is printed to the screen/logfile when PYTHIA finishes.</li>
Details how to run the macros can be found [https://wiki.bnl.gov/eic/index.php/ROOT [here]]
+
<li>the total integrated cross section, PARI(1), printed in microbarn (10<sup>-6</sup>) to the screen/logfile when PYTHIA finishes.</li>
 +
</ol>
 +
Both these values are also written to the output ROOT file as TObjStrings.
 +
Recall that
  
===== MC normalization=====
+
'''Counts = Integrated Luminosity x Cross Section'''.
to normalize your counts to cross section you need two informations
+
The cross section represented by some event count is
* the total number of trials (NGEN(0,3)), it is printed to the screen/logfile if PYTHIA finishes
+
count * total integrated cross section / total number of trials
* the total integrated cross section (PARI(1)), the unit is microbarn (10^-6), it is printed to the screen/logfile if PYTHIA finishes<br>
+
To calculate the corresponding luminosity represented by the generated events
<br>
+
Luminosity = total number of trials / total integrated cross section
'''Counts = Luminosity x Cross Section'''<br>
 
<br>
 
  
==> count * total integrated cross section /total number of trials
+
== Documentation on Radiative Corrections ==
to calculate the corresponding luminosity
 
==> total number of trials/ total integrated cross section
 
  
== Documentation on Radiative Corrections: ==
+
The code implemented in PYTHIA to calculate radiative corrections is called RADGEN.
the code implemented in PTHIA to calculate radiative corrections is called RADGEN<br>
+
The writeup on it can be found [http://arXiv.org/pdf/hep-ph/9906408 here].
The writeup on it can be found here [http://arXiv.org/pdf/hep-ph/9906408 [hep-ph/9906408]]<br>
 
 
The following steps have been done to implement it in PYTHIA:
 
The following steps have been done to implement it in PYTHIA:
* change the subroutine pygaga.f so it calls radgen after you have thrown y and Q2
+
* change the subroutine pygaga.f so it calls RADGEN after you have thrown y and Q2
* get the true y and Q2 from radgen and the radiated photon
+
* get the true y and Q2 from RADGEN and the radiated photon
 
* Pythia will continue to now generate an event based on this y and Q2
 
* Pythia will continue to now generate an event based on this y and Q2
 
* Pythia still operates under accept reject, the extra weigt from the radiative corrections is absorbed in the flux factor
 
* Pythia still operates under accept reject, the extra weigt from the radiative corrections is absorbed in the flux factor
  
 
=== Additional Info on radiative corrections ===
 
=== Additional Info on radiative corrections ===
www-pages with codes
+
Webpages with codes:
 
* [http://www.jlab.org/RC/ [http://www.jlab.org/RC/]]
 
* [http://www.jlab.org/RC/ [http://www.jlab.org/RC/]]
 
* [http://www.desy.de/~heramc/mclist.html [http://www.desy.de/~heramc/mclist.html]]
 
* [http://www.desy.de/~heramc/mclist.html [http://www.desy.de/~heramc/mclist.html]]
 
* Nuclear beams in HERA.
 
* Nuclear beams in HERA.
 +
Other references:
 
M. Arneodo, (Turin U. & INFN, Cosenza) , A. Bialas, (Jagiellonian U.) , M.W. Krasny, (Paris U., VI-VII & Paris U., VI-VII) , T. Sloan, (Lancaster U.) , M. Strikman, (Penn State U.) . Sep 1996. 40pp.
 
M. Arneodo, (Turin U. & INFN, Cosenza) , A. Bialas, (Jagiellonian U.) , M.W. Krasny, (Paris U., VI-VII & Paris U., VI-VII) , T. Sloan, (Lancaster U.) , M. Strikman, (Penn State U.) . Sep 1996. 40pp.
 
To be published in the proceedings of Workshop on Future Physics at HERA,  
 
To be published in the proceedings of Workshop on Future Physics at HERA,  

Revision as of 17:21, 19 October 2012

Overview of PYTHIA:

Pythia processes important in e-p

Subprocess # Description
soft VMD
V N → V N 91 elastic VMD
V N → V X 92 single-diffractive VMD
V N → XN 93 single-diffractive VMD
V N → XX 94 double-diffractive VMD
V N → X 95 soft non-diffractive VMD low-pT
QCD 2→2
96 semihard QCD 2→2
RESOLVED (hard VMD and anomalous)
qq → qq 11 QCD 2 → 2(q)
q qbar → q qbar 12
q qbar → gg 13
gq → gq 28
qg → qg 28 QCD 2 → 2(g)
gg → q qbar 53
gg → gg 68
DIRECT
γ∗q → q 99 LO DIS
γ∗T q → qg 131 (transverse) QCDC
γ∗L q → qg 132 (longitudinal) QCDC
γ∗T g → q qbar 135 (transverse) PGF
γ∗L g → q qbar 136 (longitudinal) PGF

VMD: Vector Meson Dominance, describing the elastic diffractive production of Vector Mesons. QCDC: QCD-Compton, radiation of a gluon from incoming or outgoing quark lines. PGF: Photon Gluon Fusion.

pythiaeRHIC

pythiaeRHIC is the EIC science task force's programme for running PYTHIA. It is based on PYTHIA 6.4.13 and was modified to include radiative corrections using RADGEN. The main programme can be viewed here. Installations can be found under the EIC AFS directory, numbered by version. e.g. version 1.0.0 is located at

/afs/rhic.bnl.gov/eic/PACKAGES/pythiaeRHIC/1.0.0

The code can also be checked out from the EIC Subversion repository. To check out a particular version e.g. 1.0.0, do:

svn checkout http://svn.racf.bnl.gov/svn/eic/Generators/pythiaeRHIC/tags/1.0.0 pythiaeRHIC

To check out the version with the latest updates, do:

svn checkout http://svn.racf.bnl.gov/svn/eic/Generators/pythiaeRHIC/trunk pythiaeRHIC

It is compiled using configure and make. Building the programme generates an executable named pythiaeRHIC, plus shared libraries for PYTHIA and RADGEN. Input is provided by a steer file, an example of which is included with the distribution (see below for the location of more examples). Output can be produced in a ROOT tree format, described here, or an ASCII file, described below. See the included README for further instructions on building and running.

Original version

The original version of the code supported ASCII output only, but is the same in physics content (e.g. supporting radiative corrections). An installation is located at

/afs/rhic.bnl.gov/eic/PACKAGES/PYTHIA-RAD-CORR-32BIT

This directory contains several example steer files, named "input.data. XXXXX.eic", which also work with the new code. There are also generated RADGEN lookup tables. Here are example files for eAu and ep. The main program, named pyMaineRHIC.f, can be viewed here. Several other routines are needed, which are in the same directory.

ASCII output file structure

The output file text format has the following structure:

  • 1st line: "PYTHIA EVENT FILE"
  • 2nd line: "============================================"
  • 3rd line: Information on event wise variables stored in the file
I: 0 (line index)
ievent: eventnumber running from 1 to XXX
genevent: trials to generate this event
subprocess: pythia subprocess (MSTI(1)), for details see table above
nucleon: hadron beam type (MSTI(12))
targetparton: parton hit in the target (MSTI(16))
xtargparton: x of target parton (PARI(34))
beamparton: in case of resolved photon processes and soft VMD the virtual photon has a hadronic structure. This gives the info which parton interacted with the target parton (MSTI(15))
xbeamparton: x of beam parton (PARI(33))
thetabeamparton: theta of beam parton (PARI(53))
truey, trueQ2, truex, trueW2, trueNu: are the kinematic variables of the event.
If radiative corrections are turned on they are different from what is calculated from the scattered lepton.
If radiative corrections are turned off they are the same as what is calculated from the scattered lepton
leptonphi: phi of the lepton (VINT(313))
s_hat: shat of the process (PARI(14))
t_hat: Mandelstam t (PARI(15))
u_hat: Mandelstm u (PARI(16))
pt2_hat: pthat^2 of the hard scattering (PARI(18))
Q2_hat: Q2hat of the hard scattering (PARI(22)),
F2, F1, R, sigma_rad, SigRadCor: information used and needed in the radiative correction code
EBrems: energy of the radiative photon in the nuclear rest frame
photonflux: flux factor from PYTHIA (VINT(319))
nrTracks: number of tracks in this event, includes also virtual particles
  • 4th line: "============================================"
  • 5th line: Information on track wise variables stored in the file
I: line index, runs from 1 to nrTracks
K(I,1): status code KS (1: stable particles 11: particles which decay 55; radiative photon)
K(I,2): particle KF code (211: pion, 2112:n, ....)
K(I,3): line number of parent particle
K(I,4): normally the line number of the first daughter; it is 0 for an undecayed particle or unfragmented parton
K(I,5): normally the line number of the last daughter; it is 0 for an undecayed particle or unfragmented parton.
P(I,1): px of particle
P(I,2): py of particle
P(I,3): pz of particle
P(I,4): Energy of particle
P(I,5): mass of particle
V(I,1): x vertex information
V(I,2): y vertex information
V(I,3): z vertex information
  • 6th line: "============================================"
  • 7th line: event information for first event
  • 8th line: "============================================"
  • 9th to X-1 line: trackwise info of 1st event
  • Xth line "=============== Event finished ==============="

The first six lines form the file header, while the information from line 7 to X repeats for each event. A ROOT file can be generated from the ASCII file using the BuildTree routine. The produced tree is equivalent to that produced directly by pythiaeRHIC.

Using pythiaeRHIC

How to Run the Code

1) without radiative corrections

Use redirection to input a steer file to configure pythiaeRHIC's behavior [and optionally direct messages to a log file]:

 pythiaeRHIC < input.data_noradcor.eic [ > XXX.log ]

The "input.data_noradcor.eic" steer file is one of the steer file examples, with settings tuned for Hermes, and/or H1 and ZEUS. If you want to run only elastic vector meson production the example steer file is "input.data_noradcor.VM.eic"

2) with radiative corrections

  • Create a directory called radgen in the area you want to run the code.
  • Either generate the lookup table for your cuts and beam energy settings first…
    pythiaeRHIC < input.data_make-radcor.eic
  • …or use one of the files already generated, located here:
/afs/rhic.bnl.gov/eic/PACKAGES/PYTHIA-RAD-CORR-32BIT/radgen

Files are named "radgen(electron beam energy)x(proton beam energy)", for example "radgen10x100" or "radgen4x100".

  • To run the code with radiative corrections simply change the steer file to either input.data_radcor.eic or input.data_radcor.VM.eic and type
pythiaeRHIC < input.data_radcor.eic > XXX.log

Monte Carlo normalization

To normalize your counts to a cross section you need two pieces of information:

  1. the total number of event trials, NGEN(0,3), which is printed to the screen/logfile when PYTHIA finishes.
  2. the total integrated cross section, PARI(1), printed in microbarn (10-6) to the screen/logfile when PYTHIA finishes.

Both these values are also written to the output ROOT file as TObjStrings. Recall that

Counts = Integrated Luminosity x Cross Section. The cross section represented by some event count is

count * total integrated cross section / total number of trials

To calculate the corresponding luminosity represented by the generated events

Luminosity = total number of trials / total integrated cross section

Documentation on Radiative Corrections

The code implemented in PYTHIA to calculate radiative corrections is called RADGEN. The writeup on it can be found here. The following steps have been done to implement it in PYTHIA:

  • change the subroutine pygaga.f so it calls RADGEN after you have thrown y and Q2
  • get the true y and Q2 from RADGEN and the radiated photon
  • Pythia will continue to now generate an event based on this y and Q2
  • Pythia still operates under accept reject, the extra weigt from the radiative corrections is absorbed in the flux factor

Additional Info on radiative corrections

Webpages with codes:

Other references: M. Arneodo, (Turin U. & INFN, Cosenza) , A. Bialas, (Jagiellonian U.) , M.W. Krasny, (Paris U., VI-VII & Paris U., VI-VII) , T. Sloan, (Lancaster U.) , M. Strikman, (Penn State U.) . Sep 1996. 40pp. To be published in the proceedings of Workshop on Future Physics at HERA, Hamburg, Germany, 25-26 Sep 1995. In *Hamburg 1995/96, Future physics at HERA* 887-926. e-Print: hep-ph/9610423 and the references 5 and 6 in this article to find them check [here]