Warning, /eic.github.io/_software/pythia6.md is written in an unsupported language. File is not indexed.
0001 ---
0002 title: PYTHIA6 with Radiative Corrections
0003 name: pythia6
0004 category: pythia
0005 layout: default
0006 ---
0007
0008 {% include layouts/title.md %}
0009
0010 * TOC
0011 {:toc}
0012
0013
0014 #### About
0015
0016 Based on PYTHIA 6.4.28 with radiative corrections and output
0017 modifications to support [eic-smear](eicsmear.html).
0018
0019 Currently hosted on [GitLab](https://gitlab.com/eic/mceg/PYTHIA-RAD-CORR)
0020
0021 Contacts
0022 * Kolja Kauder <kkauder@bnl.gov>
0023 * Elke Aschenauer <elke@bnl.gov>
0024
0025
0026 #### Overview of PYTHIA
0027
0028 * For e-p collisions, only versions of PYTHIA 6.4 can be used, the
0029 absolute latest version 6.4.28 is part of this package and all improvements are integrated.
0030 * Over the years we have implemented many changes to PYTHIA to correct some problems we found and to integrate some e-A physics. All is documented [here](#PYTHIAChanges).
0031 Pythia8 does not yet fully support e-p collisions.
0032 * Note the [webpage](http://pythia6.hepforge.org), the
0033 [manual](http://www.thep.lu.se/~torbjorn/pythia/lutp0613man2.pdf),
0034 and the [notes on updates](http://www.hepforge.org/archive/pythia6/update_notes-6.4.28.txt) after the manual got published.
0035 * A file containing all particle codes and decay channels with branching ratios implemented in pythia: [PYTHIA PDG](http://www.phenix.bnl.gov/WWW/publish/elke/EIC/Files-for-Wiki/Pythia.6.4.particles.codes.and.decays.txt).
0036
0037 ##### Pythia processes important in e-p #####
0038
0039
0040 | Subprocess | \# | Description |
0041 |----------------------------|-------------------------------------|-------------|
0042 | **SOFT VMD**||
0043 | V N → V N | 91 | elastic VMD |
0044 | V N → X N | 92 | single\-diffractive VMD |
0045 | V N → V X | 93 | single\-diffractive VMD |
0046 | V N → X X | 94 | double\-diffractive VMD |
0047 | V N → X | 95 | soft non\-diffractive VMD low\-pT |
0048 | **QCD 2→2** | | |
0049 | | 96 | semihard QCD 2→2 |
0050 | **RESOLVED \(hard VMD and anomalous\)** | | |
0051 | qq → qq | 11 | QCD 2 → 2\(q\) |
0052 | q qbar → q qbar | 12 | |
0053 | q qbar → gg | 13 | |
0054 | gq → gq | 28 | |
0055 | qg → qg | 28 | QCD 2 → 2\(g\) |
0056 | gg → q qbar | 53 | |
0057 | gg → gg | 68 | |
0058 | **DIRECT** | | |
0059 | γ<sup>*</sup>q → q | 99 | LO DIS |
0060 | γ<sup>*</sup>T q → qg | 131 | \(transverse\) QCDC |
0061 | γ<sup>*</sup>L q → qg | 132 | \(longitudinal\) QCDC |
0062 | γ<sup>*</sup>T g → q qbar | 135 | \(transverse\) PGF |
0063 | γ<sup>*</sup>L g → q qbar | 136 | \(longitudinal\) PGF |
0064 {:.table-bordered}
0065 {:.table-striped}
0066
0067 <br />
0068 **VMD** Vector Meson Dominance, describing the elastic diffractive
0069 production of Vector Mesons.
0070 <br />
0071 **QCDC**: QCD-Compton, radiation of a gluon
0072 from incoming or outgoing quark lines.
0073 <br />
0074 **PGF**: Photon Gluon Fusion.
0075 <br />
0076
0077 #### Running pythiaeRHIC
0078
0079 In the standard setup in the singularity cvmfs environment or at BNL, the code, executable, steering files,
0080 plus shared libraries for PYTHIA and RADGEN, can be found in
0081 ```
0082 $EICDIRECTORY/PACKAGES/PYTHIA-RAD-CORR
0083 $EICDIRECTORY/lib
0084 $EICDIRECTORY/bin
0085 ```
0086
0087 The executable `pythiaeRHIC` (in the future most likely renamed to pythia-eic) is the program for running PYTHIA.
0088 It is based on PYTHIA 6.4.28 and was modified to include radiative corrections using [RADGEN](#radiative-corrections).
0089
0090 To run, the executable reads options from standard input
0091 and is controlled via steering cards and input redirection, with
0092 optional output redirection to a log file. The name of the output file
0093 is specified in the steering card.
0094 ```
0095 pythiaeRHIC < STEER_FILE > out.log
0096 ```
0097
0098 A practical example, assuming $EICDIRECTORY was set and the package
0099 installed as above, is:
0100 ```
0101 $EICDIRECTORY/bin/pythiaeRHIC < $EICDIRECTORY/PACKAGES/PYTHIA-RAD-CORR/STEER-FILES-Other/ep_noradcor.20x250.quicktest
0102 ```
0103
0104 The output ASCII format is described [below](#ASCII output file structure).
0105
0106
0107 <!--Output can be produced in a ROOT tree format, described [here](eicsmear.html), or an ASCII file, described [[#ASCII output file structure | below]].
0108 See the included README for further instructions on building and running.-->
0109
0110
0111 ##### Using Radiative Corrections
0112
0113 * Create a directory called radgen in the area you want to run the code.
0114 * Either generate the lookup table for your cuts and beam energy settings first...
0115 ```
0116 pythiaeRHIC < input.data_make-radcor.eic
0117 ```
0118 * ... or use one of the files already generated in
0119 ```
0120 $EICDIRECTORY/PACKAGES/PYTHIA-RAD-CORR/radgen
0121 ```
0122 Files are named "radgen(electron beam energy)x(proton beam energy)", for example "radgen10x100" or "radgen4x100".
0123 * 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
0124 pythiaeRHIC < input.data_radcor.eic > XXX.log
0125
0126 * The above are example steering files. The main difference to running without radiative corrections is the switch in line 9 of a steering file:
0127 ```
0128 switch for rad corrections !* 0: no, 1: yes, 2: generate lookup table
0129 ```
0130 However, settings for x and y have to be appropriate. The following should work in most cases:
0131 ```
0132 1e-05,0.99 ! xmin and xmax
0133 5e-03,0.99 ! ymin and ymax
0134 ```
0135
0136 ##### Steering files
0137 A variety of steering files can be found in the `STEER-*`
0138 directories. Which ones appropriately reflect the physics you wish to
0139 implement is beyond the scope of this document. Please contact the EIC
0140 UG for advice.
0141
0142
0143
0144
0145 ##### Executables
0146 * `pyMaineRHIC_v2.f` is the main program used to generate `pythiaeRHICe`
0147 * `pythiaMain.cpp` and `UsingCardPythiaMain.cpp` are C++ implementations using either the class interface functions or the same steering file as the fortran driver. They are not currently producing standard ASCII output however and are meant as demonstrators only. The reason for this is that output generation is hard-coded into multiple places inside the pythia and radgen fortran files.
0148
0149
0150 <!--
0151 ===Original version===
0152
0153 The original version of the code supported ASCII output only, but is the same in physics content (e.g. supporting radiative corrections).
0154 An installation is located at
0155 /afs/rhic.bnl.gov/eic/PACKAGES/PYTHIA-RAD-CORR-32BIT
0156 This directory contains several example steer files, named "input.data. XXXXX.eic", which also work with the new code.
0157 There are also generated [[#2) with radiative corrections | RADGEN lookup tables]].
0158 Here are example files for [[Media:Input.data.eAu_noradcorr.eic.pdf | eAu]] and [[Media:Input.data.ep_noradcorr.eic.pdf | ep]].
0159 The main program, named pyMaineRHIC.f, can be viewed [[Media:PyMaineRHIC-Jan2012.pdf | here]].
0160 Several other routines are needed, which are in the same directory.
0161 -->
0162
0163 ##### Output file structure
0164
0165 The output file is in a text format which has the following structure:
0166 * 1st line: <tt>PYTHIA EVENT FILE</tt>
0167 * 2nd line: <tt>============================================</tt>
0168 * 3rd line: Information on event wise variables stored in the file:
0169
0170 | I: | 0 (line index) |
0171 | ------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
0172 | ievent: | eventnumber running from 1 to XXX |
0173 | genevent: | trials to generate this event |
0174 | subprocess: | pythia subprocess (MSTI(1)), for details see table above |
0175 | nucleon: | hadron beam type (MSTI(12)) |
0176 | targetparton: | parton hit in the target (MSTI(16)) |
0177 | xtargparton: | x of target parton (PARI(34)) |
0178 | 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)) |
0179 | xbeamparton: | x of beam parton (PARI(33)) |
0180 | thetabeamparton: | theta of beam parton (PARI(53)) |
0181 | truey, trueQ2, truex, trueW2, trueNu: | are the kinematic variables of the event. |
0182 | | If radiative corrections are turned on they are different from what is calculated from the scattered lepton. |
0183 | | If radiative corrections are turned off they are the same as what is calculated from the scattered lepton |
0184 | leptonphi: | phi of the lepton (VINT(313)) |
0185 | s\_hat: | shat of the process (PARI(14)) |
0186 | t\_hat: | Mandelstam t (PARI(15)) |
0187 | u\_hat: | Mandelstm u (PARI(16)) |
0188 | pt2\_hat: | pthat^2 of the hard scattering (PARI(18)) |
0189 | Q2\_hat: | Q2hat of the hard scattering (PARI(22)), |
0190 | F2, F1, R, sigma\_rad, SigRadCor: | information used and needed in the radiative correction code |
0191 | EBrems: | energy of the radiative photon in the nuclear rest frame |
0192 | photonflux: | flux factor from PYTHIA (VINT(319)) |
0193 | nrTracks: | number of tracks in this event, includes also virtual particles |
0194 {:.table-bordered}
0195 {:.table-striped}
0196
0197 * 4th line: <tt>============================================</tt>
0198 * 5th line: Information on track-wise variables stored in the file:
0199
0200 | I: | line index, runs from 1 to nrTracks |
0201 | ------- | -------------------------------------------------------------------------------------------------------- |
0202 | K(I,1): | status code KS (1: stable particles 11: particles which decay 55; radiative photon) |
0203 | K(I,2): | particle KF code (211: pion, 2112:n, ....) |
0204 | K(I,3): | line number of parent particle |
0205 | K(I,4): | normally the line number of the first daughter; it is 0 for an undecayed particle or unfragmented parton |
0206 | K(I,5): | normally the line number of the last daughter; it is 0 for an undecayed particle or unfragmented parton. |
0207 | P(I,1): | px of particle |
0208 | P(I,2): | py of particle |
0209 | P(I,3): | pz of particle |
0210 | P(I,4): | Energy of particle |
0211 | P(I,5): | mass of particle |
0212 | V(I,1): | x vertex information |
0213 | V(I,2): | y vertex information |
0214 | V(I,3): | z vertex information |
0215 {:.table-bordered}
0216 {:.table-striped}
0217 <br />
0218
0219 * 6th line: <tt>============================================</tt>
0220 * 7th line: event information for first event
0221 * 8th line: <tt>============================================</tt>
0222 * 9th to X-1 line: track-wise info of 1st event
0223 * Xth line <tt>============================================</tt>
0224
0225 **For each subsequent event, lines 7 through X repeat analogously.**
0226
0227 ##### How to analyze events
0228
0229 The recommended way is to create and use a ROOT tree with the `BuildTree` function and other tools provided by [eic-smear](eicsmear.html).
0230 Some guidelines regarding Monte Carlo normalization can be found [here](https://wiki.bnl.gov/eic/index.php/Simulations#MC_Analysis_Techniques).
0231
0232 ##### TPythia6
0233 ROOT supports an interface to PYTHIA via the class TPythia6. This allows PYTHIA to be configured, run and analysed from within a ROOT session, which can be a more convenient than using PYTHIA as a separate programme. The EIC installations of ROOT support TPythia6, but be aware that the version of PYTHIA interfaced with ROOT is the "vanilla" distribution, and hence lacks the EIC additions. If you require these for your analysis you should only use the standalone pythiaeRHIC program.
0234 This means you miss:
0235 * the possibility for radiative corrections
0236 * a correct treatment of the pt of the remnant
0237 * all the improvements to the VMD model in PYTHIA to describe the HERA exclusive VM data
0238 * the possibility to run with nuclear PDFs
0239
0240 <br />
0241 <br />
0242 <br />
0243
0244
0245 #### Installation
0246
0247 It is recommended to take advantage of the pre-installed versions on the lab farms or
0248 the available stand-alone [singularity](eicsmear_generators_singularity.html) or [escalate](escalate_singularity_1.html) containers.
0249
0250 However, the package can also be built using cmake and make.
0251
0252
0253 ##### Prerequisites
0254 - gfortran
0255 - LHAPDF5
0256 - ROOT
0257 - cmake
0258 - CERNLIB
0259
0260 ##### Basic installation
0261
0262 (Adapt directories etc as appropriate.)
0263
0264 ```
0265 cd ${EICDIRECTORY}/PACKAGES
0266 git clone https://gitlab.com/eic/mceg/PYTHIA-RAD-CORR.git
0267 cd ${EICDIRECTORY}/PACKAGES/PYTHIA-RAD-CORR
0268 mkdir build; cd build
0269 cmake ../ -DCMAKE_INSTALL_PREFIX=${EICDIRECTORY}
0270 make -j 8 install
0271 ```
0272 This will produce warnings of the form
0273 ```
0274 Warning: $ should be the last specifier in format at (1)
0275 ```
0276 which should be okay (it is a g77 extension allowed by gfortran).
0277
0278 Executables require LHAPDF5 installed and links executables against it.
0279
0280
0281 ##### CHANGES with respect to the build_pythia6.sh script
0282
0283 * LHAPDF-related:
0284 * pdfset.f structm.f structp.f are removed (renamed)
0285 * sugra.f is emptied out
0286
0287 * Fix for older pythia versions:
0288 * pyalps.f doesn't need to be changed in 6.4.28
0289 (build script only affects commented out old code)
0290
0291 * Random number generation change:
0292 * Replace default routine by call to ranlux
0293 * pyr.f
0294 * Added ranlux.f v 1.2 (Deleted an include line) to avoid issues linking
0295 against cernlib
0296
0297 * PHYSICS:
0298 * pydiff.f
0299 * pydisg.f
0300 * pygaga.f
0301 * pyrand.f
0302 * pyremn.f
0303 * pysgqc.f
0304 * pysigh.f
0305 * pyxtot.f
0306 * pydata.f
0307 * pyptdirc.f
0308
0309 * Added in top directory:
0310 * radgen.f
0311 * radgen_event.f
0312 * radgen_init.f
0313 * gmc_random.f
0314 * pyth_xsec.f
0315 * pythia_radgen_extras.f
0316
0317
0318 #### Radiative Corrections ####
0319
0320 The code implemented in PYTHIA to calculate radiative corrections is called RADGEN.
0321 The writeup on it can be found [here](http://arXiv.org/pdf/hep-ph/9906408).
0322 The following steps have been done to implement it in PYTHIA:
0323 * change the subroutine pygaga.f so it calls RADGEN after you have thrown y and Q2
0324 * get the true y and Q2 from RADGEN and the radiated photon
0325 * Pythia will continue to now generate an event based on this y and Q2
0326 * Pythia still operates under accept reject, the extra weight from the radiative corrections is absorbed in the flux factor
0327
0328 ##### Additional Info on radiative corrections #####
0329 Webpages with codes:
0330 * [http://www.jlab.org/RC](http://www.jlab.org/RC)
0331 * [http://www.desy.de/~heramc/mclist.html](http://www.desy.de/~heramc/mclist.html)
0332 * Nuclear beams in HERA.
0333
0334 Other references:
0335 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.
0336 To be published in the proceedings of Workshop on Future Physics at HERA,
0337 Hamburg, Germany, 25-26 Sep 1995.
0338 In *Hamburg 1995/96, Future physics at HERA* 887-926.
0339 e-Print: hep-ph/9610423
0340 and the references 5 and 6 in this article.
0341 To find them check [here](http://www.desy.de/~heraws96/).