From EIC
Jump to navigation Jump to search
  • CAUTION: obsolete material *

ESIM is a detector simulation framework based on GEANT3, with a special language (Mortran) to simplify describing detector geometry. The geometrical description of a detector, or a part of the detector system, is written as a separate module which is dynamically compiled and loaded into the framework. More details on the simulation framework can be found in the ESIM manual. Some details about geometrical shapes which can be implemented are [here]. For a summary of detector design considerations which have been followed, see Detector Design

Getting Started

The software for a Linux machine can be found in this tar file. After you download it, untar it in a directory which is in your default PATH:

tar xfvz

Alternatively, if you have an EIC account, you can run the program version installed in the directory /afs/ Add this directory to your path with (in csh)

setenv PATH /afs/$PATH

or (in bash)

export PATH=/afs/$PATH

After this, you can use the esim executable from any directory.


To make sure everything is installed correctly you can run a built-in test, simulating a room with two chairs that have a screw as a sensitive detector. This should help you to understand the basics of detector simulations with ESIM. Your first session may look like this:

mkdir mysim 
cd mysim 
tar xfvz <somewhere>/ 
setenv PATH .:$PATH


setenv PATH /afs/$PATH 
cp -p /afs/ .


esim.exe -w 1
esim> debug on
esim> make roomgeo
esim> gclose all
esim> gkine 100 5 0 10
esim> switch 2 3
esim> trig

Running a Simple eRHIC Detector Geometry

A simple eRHIC detector layout can be simulated using file. After downloading it (or, if you have an EIC account, you can copy it from /afs/, you can run as following:

esim.exe -w 1
make edicgeo.age
dcut edic x 0.1 10 10 0.01 0.01

You should get this layout.

Generating a Geometry RZ file from ESIM (for use by GEANT4 or ROOT)

To output a geometry RZ file, from an inputfile (for example named myfavoritegeo.age), run the following:

esim.exe -w 1
make myfavoritegeo.age
rz/file 1 myfavoritegeo.rz on

Note: The ESIM we are using is a 32-bit executable. Therefore in order to use the rz file you'll need a 32-bit GEANT installation (for rztog4) or a 32-bit root installation (for g2root).

Running PYTHIA in ESIM

It is possible to run the PYTHIA event generator (version 6.4.21) directly in ESIM using this tar file. If you have a eRHIC account you can get it from /afs/ area.

After you download and untar it, do "make apythia" in ESIM (without quotes). This command compiles the Pythia code and the interactive interface and loads them into ESIM as a shared library. The steering is done with simple commands, described via an interactive help menu accessed by typing "help pythia" (without quotes). The generated events are stored in the standard Pythia common block HEPEVT and are directly accessible for detector simulations. They can also be save in a file for subsequent input.

An example of a simple session is below:

tar xfvz /afs/ 
esim.exe -w 0
esim> make apythia
esim> help pythia
esim> frame CMS
esim> beam  e- p+
esim> ener 900
esim> msel 1
esim> trig 1
esim> call pylist(1)           - to see the whole parton tree
esim> gprint kine              - to see only the particles going into detector 

Running RAPGAP Events in ESIM

This section is under development.

Events generated by RAPGAP can be replicated in ESIM using the file "esimread.age". Using this example you will see constant magnetic fields for the solenoid and dipoles. Copies of all relevant files can be found in /afs/

An example of a simple session is below:

esim.exe -w 1
esim> make edicgeo
esim> make mflegeo
esim> debug on
esim> gclose all
esim> make esimread
esim> swit 2 3
esim> gkine -1 0 0 1 -6 6 0 6.3
esim> gfile u testevents.txt e
esim> dcut edic x .1 10 10 .2 .2      - a zoomed in view of the ip; manipulate the variables for different views
esim> trig