P G S

Simple simulation package for generic collider detectors


This page contains the documentation and code for the PGS package (formerly known as SHW, used in the Tevatron Run 2 SUSY/Higgs Workshop), a set of routines for generating/reading/writing PYTHIA/ISAJET events and performaing a simple simulation of events from high-energy particle collisions. Originally designed for the Tevatron collider detectors, PGS can be used quite generally to study generic collider detector physics at other machines.

PGS has been successfully built under Linux, and should be easily portable to other Unix platforms.

By the way, "PGS" is pronounced pee-gee-ess, not "pigs"...  ;)


The PGS package provides The actual code comes in a tar file with everything you need to run the PGS package, including Linux binaries created with the g77 compiler. In addition you will need STDHEP, and PYTHIA or ISAJET to generate events. These are available here: The program allows use of TAUOLA to decay tau leptons properly, taking into account their polarization. TAUOLA is included in the main PGS tar file.

You also need a recent version of CERNLIB , including PDFLIB.  Note: you may need to add the qualifier " -lsnl " to the compile/link script, mkpgs.

Make sure you hit the reload button on the code page before saving - Netscape caches older versions. You should get version 3.3.

All user-accessible data is stored in common blocks in the include file pgs.inc. The main program directly generates or reads in events, then performs a simple trigger simulation, generating a list of trigger objects. The program then makes a list of reconstructed photons, electrons, muons, hadronic tau decays, and jets (including b-tag information) according to the detector parameters given.

The reconstruction efficiency for physics objects (photons, electrons, muons, taus, jets) depends greatly on the environment. Thus, the best way to perform a simple simulation is to generate a list of reconstructed tracks, and generate a list of calorimeter tower energies, based on parametrizations and measurements from the actual detector and full detector simulations. Then one can perform object reconstruction much as is done in the real data analysis.

This approach works well for photons, electrons, taus, and jets. For muons, one can simply parametrize the efficiency, including fiducial coverage. For b-tagging, one can also parametrize the efficiency for jets in some ficudial region. Thus for muons and b-tags one can start with generated objects (mu or b), match to a track or jet, and then apply the efficiency.

The simulation presently does NOT simulate the following effects:

Getting Started

Your first step is to download and unpack the tar files. They have a self-evident directory structure. Under Linux, you need not recompile the libraries. However, you will need to create and environment variables pointing to various directories:

> setenv PGS    <your pgs location>
> setenv PYTHIA <your pythia location>
> setenv ISAJET <your isajet location>
> setenv STDHEP <your stdhep location>
> setenv CRNLIB <your cernlib location>

You should take one of the main programs in the examples and modify the subroutine pgs_user_analysis to perform your own analysis. Follow the template, which allows initialization, event processing, and wrap-up at the end. To compile, use the example script. For pgs_taus.f, for example, issue the command

> $PGS/scripts/mkpgs_linux taus

which will create an executable called taus.

Event Storage and I/O

For event storage and I/O, the program adheres to the STDHEP standard, which uses the HEPEVT common block for storage of generated events. This common block is included in the PGS include file pgs.inc. There is another standard STDHEP common block, STDTBL, which contains a table of particle properties (name, mass, and width).

To save generator files on disk, you simply need to set the value of pgs_output_file to your file name, and then, in pgs_user_analysis, call pgs_write_event('event'). Note, however, that this does NOT save the reconstructed objects, etc. This ONLY saves the generator information. So, upon re-reading the event and re-simulating, you will get different results! Also, the resulting generator files are quite large, about 40 kbyte/event.

To avoid big files, though, PGS can run PYTHIA/ISAJET directly. This is determined by what you put in your main program for the variable "optpgs"...see the examples.

Submitting code to PGS

This project relies on your input! We especially need code for trigger object ID, and some numbers for the reconstructed object ID. Take a look at the subroutine pgs_find_photons inside pgs_library.f, and for trigger objects look at pgs_find_jet_trig.

Write your code, test it if possible, and send it to me for inclusion in pgs_library.f. Please send it as a plain text file, by email. Sending me the entire pgs_library.f file, or a tar file, just means a lot of extra work. Keep it simple, use "implicit none" and reference the pgs.inc commons only. Let's avoid having to read external files and the like. If you perceive a need for changing pgs.inc, let's discuss it - it isn't written in stone!

For photons, electrons, taus, and jets, we can use the calorimeter clusters and track list to actually do the ID as if it were the real experiment. If we have done the calorimeter job properly, the efficiencies should be realistic. For muons, we can apply simple efficiency numbers. For jets, we can use the calorimeter clusters as a start, and then apply efficiency numbers for b-tagging.

Version History

version number  date  changes 
16 May 1998  first release 
1.1  20 May 1998  TAUOLA bug fix 
1.2  28 May 1998 

bugs fixed in shw_fill_call and shw_find_clusters, causing spurious jets (thanks to Ray Culbertson);

bug fixed in muon energy calculation; changed calorimeter dimensions to 0.1 in eta, 0.224 in phi (80 by 28 cells);

moved "pi" into PGS.inc 

1.3  10 June 1998  Added c- and b-tagging, new Culbertson photon/electron trigger/finding. 
1.4  1 July 1998  bug fix to tauola.f: declare "ran" 
1.5  9 July 1998  bug fix to shw_find muons: allow + muons! (kudos to Ben Kilminster of Rochester); now have fake rates in charm, b jet tagging 
1.6  10 July 1998  minor bug fix to b, c tagging: vecobj was filled improperly (more kudos to Ben Kilminster again!) 
1.7  12 July 1998  minor bug fix to b tagging: impact efficiency incorrect (even more kudos to Ben Kilminster again!) 
1.8  17 Aug 1998 

bug fix to electron cluster finding (eta calculated incorrectly);

bug fix to jet cluster finding (phi wrap at 24, not nphimax) 

1.9  8 Sep
1998 
new features: muon trigger, track resolution, change to b- and c-jet matching (see README, code...); 

added comments describing calling sequence to shw_library.f 

bug fixes: (thanks to Joe Lykken, Konstantin Matchev) muons were depositing energy incorrectly, neutralinos, gravitinos now deposit no energy; 

2.0 
16 Sep 1998 
new features: b/c tagging now use single random number and common z vertex; 

electron direction now taken from track; 

fix for call sequence in track resolution; 

fix for muon charge value 

2.1 
21 Dec 1998 
fix: "begin" command to shw_write_event, shw_read_event 

fix: muon triggers listed as type 2 

fix: in shw_unique_id, resolve contention between muon and electron 

fix: z vertex cut was being ignored in b/c tagging...this will reduce tagging rates slightly 

2.2 
2 Feb 1999 
fix: electron direction not taken entirely from track 

new feature: jet clustering cone size now user-settable

2.3 
25 Jun 1999 
added mkshw_linux script 

removed READONLY from OPEN statements (for g77 under Linux) 

changed ran to ranf in tdrand in tauola.f (for g77 under Linux) 

changed declaration of "test" in pdecay in tauola.f to real 

changed SIGEE to XSIGEE in tauola.f to avoid name conflict with ISAJET 

3.0 
6 Jun 2001 
change name to PGS 

add user utilities for tau decay, kinematics 

restructure libraries 

set detector parameters via file

3.1
7 July 2001
allow user to change PYTHIA beam/energy

include vlhc.par for VLHC studies 

calorimeter array size increased for VLHC  

3.2
17 July 2001
bug fix in pgs_find_electron_photon_trig (thanks to  Simona Rolli!)

change in tau finding: use tracks for direction 

3.3
2 Nov 2005

bug fix in pgs_find_taus (thanks to Steve Mrenna)

routines pgs_unique_id and pgs_object_cuts now in library

tau cuts not applied during tau_finding

Revised November 2005