[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Generating PYTHIA events




Hi Offliners,

    At the GlueX meeting this morning I said I'd send around 
instructions on generating events with pythia. Eugene Chudakov has 
implemented pythia along with a low energy hadronic generator based on 
about a dozen of the most prominent reactions. This is in his "bggen" 
program which is located in src/programs/Simulation/bggen in the 
repository. There is a README file there that describes the program and 
its use which I have copied below.

The short instructions are:

1. Check out and build the Hall-D source code, including bggen
2. cd to src/programs/Simulation/bggen/run
3. Edit the file run.ffr to suit your needs. It is well commented and 
so, self explanatory.
   The default settings produce 1 second's worth of events (395k events) 
for incident photon
   energies ranging from 150MeV to 12GeV sampled from the collimated 
coherent brem. spectrum
4. Run "bggen" with no arguments from inside the run directory to 
produce the file "bggen.hddm"
   NOTE: One "gotcha" here is that many systems already have a program 
called "bggen" that
   has nothing to do with Hall-D/GlueX. Keep in mind that you may need 
to specify the bggen
   using the full path.
5. The file bggen.hddm can now be used with hdgeant. You can also make 
histos of the
   thrown values without full simulation using the mcthrown_hists plugin 
with hd_root via:

    hd_root --plugin=mcthrown_hists bggen.hddm

Questions regarding bggen can be sent directly to Eugene at gen@jlab.org
General questions regarding simulating and analyzing the bggen output 
can be sent to me at davidl@jlab.org

Regards,
-David

   E.Chudakov       Jan 17, 2008 

   This directory contains the code and tools to generate the 
photoproduction
   of hadronic events in a wide energy range of E>0.15 GeV, matching the 
total
   photoproduction cross section. It can be used to calculate the hadronic
   background for GLUEX etc.
     The photon beam spectrum is calculated using the code from R.Jones for
   the coherent bremsstrahlung.

   There are two effective energy ranges:
     1) E>3 GeV       : PYTHIA is used
     2) 0.15<E<3 GeV  : a mixture of 10 dominating exclusive processes 
is used.
        The cross section energy dependences and kinematical 
parameterizations
        are taken from data.
        For the single pion production differential cross sections, the 
SAID
        code from I.Strakovski is used.

   The user specifies the beam energy range, say 0.15 - 12 GeV.
   The beam energy spectrum multiplied by the total cross section is used
   to generate the photon energy for each event simulated.
   Switching between the modes 1) and 2) is automatic and depends on the 
energy. 

   Directories:
     code/   - contains the code
     run/    - directory to run the code
     paw/    - auxiliary directory to analyze the resulting ntuple

   Several files are used for the input. Three files are stable:
   - pythia.dat        - contains PYTHIA definitions adjusted for 
photoproduction (HERMES)
   - pythia-geant.map  - mapping of GEANT <--> PYTHIA particle codes
   - particle.dat      - a list of particle properties used for the low 
energy mode (2)

   One file is used to control the job and to set the number of events 
to simulate,
   the energy range etc.
   - fort.15 linked to run.ffr - list of commands and definitions in the 
FFREAD format
   An example of the file is attached:
-------------------------------------------------------------------
LIST
C
C ===    INPUT file for BGGEN
C
TRIG     395000         number of events to simulate
C                       We expect 395kHz of hadronic rate at high luminosity
C -- writing out events
C        HDDM  simple  ntuple
WROUT      1      1     1  

NPRIEV   100            number of events to print
EPHLIM   0.15 12.       energy range in GeV

RNDMSEQ    0            random number sequence     integer values

EELEC     12.           electron beam energy
EPEAK      9.           coherent peak energy
ZCOLLIM   7600.         distance to the collimator in cm

EPYTHMIN     3.         minimal energy for PYTHIA simulation

STOP
-------------------------------------------------------------------

 

   Compilation:
        > cd code
        > make
             makes ./.bin/bggen


   Running:
      > cd ../run/
      > ../code/.bin/*/bggen > log

      Output files:

      bggen.his   - histograms

      1) bggen.hddm  - HDDM file with events
      2) bggen.dat   - sequential file with events
      3) bggen.nt    - CW-ntuple with events
      See the flag WROUT.


   In order to study the output one can use the ntuple:
      > cd ../paw/
      PAW> exec example_1    - plots several variables of interest

      A code to read the output file bggen.dat:
      > cd ../paw/
      > make
      > ./bgg_read.exe

   An example of the event printout is attached.
   The first 2 lines describe the beam and the target particles:
   1) GEANT code
   2) Particle Data Group code (PDG) = KF (PYTHIA)
   3) mass
   4)-6) - 3-momentum
   The next lines are the secondary particles:
   1) #
   2) GEANT code
   3)-7) PYTHIA-type codes:
      -  k1 =1 - final particle, <>1 - intermediate particle (not to be 
used with GEANT)
      -  k2 =KF=PDG code
      -  k3 >0 - reference to the origin particle #=k3
      -  k4 >0 - the first # of the decay product
      -  k5 >0 - the last  # of the decay product
   8) mass
   9)-11) - 3-momentum

 Event     95  Process=   0   PYTHIA
        GEANT    PDG          mass       Px      Py      Pz     
 beam       1     22         0.0000      0.000   0.000  11.896
 target    14   2212         0.9383      0.000   0.000   0.000
   #   GEANT  k1  kf=PDG  origin decay pr   mass        Px      Py      Pz
   1     0    12     -2      0   5   5      0.3300     -0.098   0.112   
2.564
   2     0    11      2      0   5   5      0.3300      0.104  -0.043   
0.364
   3     0    12      2      0   8   8      0.3300      0.098  -0.112   
9.123
   4     0    11   2101      0   8   8      0.5793     -0.104   0.043  
-0.156
   5     0    11     91      1   6   7      0.9954      0.006   0.069   
2.929
   6     9     1   -211      5   0   0      0.1396      0.060   0.212   
1.116
   7     0    11    213      5  13  14      0.6969     -0.054  -0.143   
1.813
   8     0    11     92      3   9  12      3.8021     -0.006  -0.069   
8.968
   9    17     1    221      8   0   0      0.5475      0.226   0.286   
1.786
  10     8     1    211      8   0   0      0.1396      0.157  -0.346   
4.118
  11     0    11    331      8  15  17      0.9579      0.101   0.016   
1.864
  12    13     1   2112      8   0   0      0.9396     -0.491  -0.025   
1.199
  13     8     1    211      7   0   0      0.1396     -0.009  -0.169   
1.788
  14     7     1    111      7   0   0      0.1350     -0.045   0.026   
0.025
  15     7     1    111     11   0   0      0.1350      0.105   0.085   
0.225
  16     7     1    111     11   0   0      0.1350      0.117  -0.065   
0.373
  17    17     1    221     11   0   0      0.5475     -0.120  -0.004   
1.266
 Event     96  Process=   1   p pi0          
 beam       1     22         0.0000      0.000   0.000   0.267
 target    14   2212         0.9383      0.000   0.000   0.000
   1    14     1   2212      0   0   0      0.9383      0.067  -0.114   
0.334
   2     7     1    111      0   0   0      0.1350     -0.067   0.114  
-0.067
 Event     97  Process=   4   p rho0         
 beam       1     22         0.0000      0.000   0.000   1.387
 target    14   2212         0.9383      0.000   0.000   0.000
   1    14     1   2212      0   0   0      0.9383      0.363   0.120   
0.715
   2     0    10    113      0   3   4      0.7616     -0.363  -0.120   
0.673
   3     8     1    211      2   0   0      0.1396     -0.063   0.245   
0.473
   4     9     1   -211      2   0   0      0.1396     -0.300  -0.365   
0.200


  The output printout contains:
 ====================================================================================================
 Events Simulated:     10000     Reference interaction rate:      394.67 kHz
  process                    events     fraction   range
 ----------------------------------------------------------------------------------------------------
      0  PYTHIA                2161      21.6 %     3.00<E<12.00 GeV
 ----------------------------------------------------------------------------------------------------
      1  p pi0                 2241      22.4 %     0.15<E< 3.00 GeV
      2  n pi+                 2877      28.8 %                     
      3  p pi+ pi-              336       3.4 %                     
      4  p rho0                 272       2.7 %                     
      5  Delta++ pi-            677       6.8 %                     
      6  p pi0 pi0              187       1.9 %                     
      7  n pi+ pi0              758       7.6 %                     
      8  p eta                   62       0.6 %                     
      9  p pi+ pi- pi0          314       3.1 %                     
     10  n pi+ pi+ pi-          115       1.1 %                     
 ----------------------------------------------------------------------------------------------------




-- 

------------------------------------------------------------------------
  David Lawrence Ph.D.
  Staff Scientist                 Office: (757)269-5567   [[[  [   [ [       
  Jefferson Lab                   Pager:  (757)584-5567   [  [ [ [ [ [   
  http://www.jlab.org/~davidl     davidl@jlab.org         [[[  [[ [[ [[[
------------------------------------------------------------------------