Many tools are available for the simulation of ILC detectors and the analysis of results. There are three differents toolchains that can be used, corresponding to the LDC, SiD, and GLD detectors. The software suites corresponding to the first two detectors can simulate all 3 detector concepts, so there is no strict division on which tools should be used for a certain detector study.
The ALCPG and SLAC use the SLIC Simulations Package (C++) with the org.lcsim for reconstruction and analysis using Java. This system also uses the JAS3 graphical analysis environment. Much of the functionality within org.lcsim comes from the FreeHep Java Library.
There is a C++ framework developed under ECFA that uses Mokka for the simulator with the MARLIN tool for analysis and reconstruction.
Finally, the ACFA group has a suite of softare based on the ROOT framework.
The LCSim Software Index has links to all the primary tools for ILC Detector Simulations. The Portals Section lists sites that cover full suites of software.
SLIC is the recommended simulator because it allows great flexibility and power in the specification of the detector geometry. LCDD provides a 100% runtime description of the detector and its associated properties, including the detailed volume hierarchy, assignment and properties of sensitive detectors, and the specification of detector component identifiers, among many other features. In practice, writing files in this standardized format is much easier than trying to author custom C++ code for each proposed full detector design and their subdetectors.
The org.lcsim package is recommended, because it uses the Java programming language, which is generally much easier to get started with and use than C++, especially for those with only partial time to devote to ILC research. Additionally, JAS3 provides a number of integrated tools such as the WIRED event display and an AIDA-compliant plotter.
The remainder of this FAQ focuses (almost exclusively) on the US/ALCPG/SLAC software suite based on SLIC and org.lcsim. The LCIO file format and its different language implementations ensure a basic level of interoperability between the three disparate systems should you want to "mix and match". |
The linearcollider.org forum is an appropriate place to post your questions on detector simulations and reconstruction and analysis.
The SLAC Jira Bugtracker allows users to submit bug reports or make feature requests.
The projects relavent to ILC are ...
Each package will be covered in more detail within this FAQ.
Several packages are used by org.lcsim that are not specific to ILC simulations. There is a separate FreeHep bugtracker for these projects. These Jira projects include ...
Contact Tony Johnson <tony_johnson@slac.stanford.edu> to obtain an account on either of these systems.
SLIC stands for "Simulator for the Linear Collider". It is a full simulation package that uses the Geant4 Monte Carlo toolkit to simulate the passage of particles through the detector. SLIC outputs LCIO files that can be analysed using a variety of language bindings, including Java, C++, FORTRAN, and Python. SLIC uses a separate backend for the input of detector data called Linear Collider Detector Description (LCDD), which itself is based on the GDML project from CERN.
The SLIC Confluence page is the best source for up-to-date information on this software package.
Jeremy McCormick <jeremym@slac.stanford.edu> is the primary author and maintainer of SLIC. The handling of MCParticles in SLIC was based on earlier work by Ron Cassell <cassell@slac.stanford.edu> from a package called Linear Collider Simulator (LCS). Much work has also been done by Ron to verify and debug the LCIO output files.
Fermilab: Here are instructions for Fermilab users on getting started with SLIC.
SLAC: Here are instructions for SLAC users on running slic from the public Unix machines at the lab. SLIC can be used on any of the load-balanced interactive Linux clusters, including noric, iris, and yakut.
NICADD: A copy of SLIC is available on the NICADD Linux clusters at /k2data/APPS/SimDist.
These are known working configurations of platform and compiler.
platform |
compiler |
compiler version |
---|---|---|
Linux |
g++ |
3.3, 3.4 |
OSX |
g++ |
4.0 |
Windows (Cygwin) |
g++ |
3.4 |
The only supported compiler is g++. Other versions may work, but these are the ones that are known to build successfully.
SimDist downloads contain binaries for Linux, OSX, and Windows.
These are located at ...
http://www.lcsim.org/dist/slic/ |
To download a Linux release, use these commands.
wget http://www.lcsim.org/dist/slic/slic-1_13_3-Linux-g%2B%2B-bin.tar.gz tar -zxvf slic-1_13_3-Linux-g++-bin.tar.gz |
The SimDist package bundles together all the dependencies of SLIC into one project. This greatly simplifies the build process.
SimDist has a run script at scripts/slic.sh which will setup the LD_LIBRARY_PATH to contain the Xerces lib directory and execute the current slic binary from the packages/slic/[slic_version] directory.
It is useable from anywhere on the host where it was installed.
/path/to/my/SimDist/scripts/slic.sh [options] |
This script passes all arguments to slic, so use it as you would the normal binary.
Follow the build instructions for the SimDist project to make binaries for your platform.
Building SLIC and its dependencies "from scratch" is not encouraged now that the SimDist project can manage this build procedure.
There are separate instructions for building on Linux and building on Windws if you must do this.
If you installed SLIC in the recommended way, the only runtime dependency would be the Xerces C++ shared library. The Xerces library directory needs to be added to the LD_LIBRARY_PATH (bash), so that the loader can find this library when slic executes.
export LD_LIBRARY_PATH=/path/to/my/xerces/install/lib:$LD_LIBRARY_PATH |
If you see this error, it means that the LD_LIBRARY_PATH has not been set correctly.
./slic/bin/Linux-g++/slic: error while loading shared libraries: libxerces-c.so.27: cannot open shared object file: No such file or directory |
The SimDist run script will set this variable automatically.
Assuming you are within the slic package's top directory you would run it with this command.
./bin/$G4SYSTEM/slic [options] |
The G4SYSTEM variable depends on your platform. For instance, on Linux, it is set to Linux-g++, so the command would be ...
./bin/Linux-g++/slic [options] |
To see explanations of slic's command-line options, use the "-h" option.
slic -h |
This will print slic usage and exit.
Typing slic -h will print the available command-line options.
************************ * Command Line Options * ************************ Option Full Name Min Args Max Args Macro Command Description --------------------------------------------------------------------------------------------------------------------------- -h --help 0 0 /slic/usage Print SLIC usage. -n --interactive 0 0 /control/interactive Start a Geant4 interactive session. -v --version 0 0 /slic/version Print SLIC version. -m --macro 1 1 /control/execute Execute Geant4 commands from a file. -g --lcdd-url 1 1 /lcdd/url Set LCDD geometry file URL. -i --event-file 1 1 /generator/filename Set event input file full path. -o --lcio-file 1 1 /lcio/filename Set name of LCIO output file. -p --lcio-path 1 1 /lcio/path Set directory for LCIO output. -O --autoname 0 1 /lcio/autoname Automatically name the LCIO output file. -x --lcio-delete 0 0 /lcio/fileExists delete Delete an existing LCIO file. -r --run-events 1 1 /run/beamOn Run # of events. -s --skip-events 1 1 /generator/skipEvents Set number of events to skip. -l --physics-list 1 1 /physics/select Set Geant4 physics list. -L --log-file 0 0 /log/filename Set logfile name. -d --seed 0 1 /random/seed Set the random seed. (No argument seeds with time.) |
Each option is mapped in a straightforward way to a corresponding Geant4 UI command, so the same exact commands can be executed either from the command prompt or in the Geant4 interactive terminal.
The command
slic -v |
prints the SLIC version, along with a lot of other information (probably too much).
Simulator for the Linear Collider; SLIC; v1r13p6; Jeremy McCormick and Ron Cassell; SLAC; Tue Apr 4 17:32:07 PDT 2006 |
The /slic/version command will do the same from a macro or UI terminal.
SLIC prints a splash screen as it starts up with the version, build date, and other information.
************************************************************* App : Simulator for the Linear Collider (SLIC) Version : v1r13p6 Date : Tue Apr 4 17:32:07 PDT 2006 Authors : Jeremy McCormick and Ron Cassell Inst : SLAC WWW : http://www.lcsim.org/software/slic Contact : jeremym@slac.stanford.edu ************************************************************* |
The Geant4 toolkit prints a splash screen that SLIC displays when it starts up.
************************************************************* Geant4 version Name: geant4-08-00-patch-01 (10-February-2006) Copyright : Geant4 Collaboration Reference : NIM A 506 (2003), 250-303 WWW : http://cern.ch/geant4 ************************************************************* |
The Geant4 version in the figure above is 8.0.p01.
SLIC commands are added into various directories within the Geant4 UI hierarchy. From interactive mode, use this command to print information on a SLIC or LCDD command.
help [command] |
Those directories containing only SLIC or LCDD commands are marked with SLIC or LCDD.
/lcio/ LCIO output commands. [SLIC] |
Type
help [dir] |
or
help [command] |
for information about the user interface directory or command. Of course, this requires that the programmer actually put in some useful help string. Most commands and directories have such information.
You can put Geant4 UI commands into one or more macro files that slic can execute. This is done with the "-m" switch. There can be any number of these switches given to slic at the commandline. For instance, this command will execute the two macros init.mac and run.mac.
slic -m init.mac -m run.mac |
The macros are executed in the order given at the command-line.
If macros are interspersed throughout the command switches, then SLIC will also execute each command in order.
slic -m init.mac -x -o output -p myDir -m run.mac |
First init.mac will be executed. Then the three commands corresonding to the "-xop" switches and finally run.mac presumably executes the /run/beamOn command.
SLIC can be started in interactive mode using the -n option or the /control/interactive UI command.
This command will start Geant4 in PreInit mode where the geometry is not loaded.
slic -n |
Other commands may also be executed before the interactive mode starts.
slic -g myGeom.lcdd -n |
The LCDD file will be constructed, so the simulator will start in Idle mode.
The following command illustrates some of the options that could be used in a typical batch run.
slic -g myGeom.lcdd \ # geometry file -i events.stdhep \ # StdHep input file -p lcio/ \ # path for LCIO output file -o output.slcio \ # name of LCIO output file -x \ # delete existing LCIO file -r 1234 \ # seed the random engine -s 100 \ # number of events to skip -r 1000 # number of events to run |
In bash, direct all output to a file, as follows.
slic &> job.log & |
Now use the tail command to look at the output file as the job progresses.
tail -f job.log |
The BeginEvent and EndEvent markers are the best indicators of the job's progress.
Most batch systems will provide logging services, and the tail command can be used on these files, too.
The bsub command is used to run SLIC on LSF.
This is an example of submitting a job to run 1000 events through the sid00 detector on the xlong batch queue.
bsub -q xlong -o `pwd`/job.log -e `pwd`/err.log time slic -g sid00.lcdd -i events.stdhep -o events_sid00 -r 1000 |
LSF accepts plain bash scripts to start jobs. Mine usually use a few for loops to run combinations of geometries with StdHep files.
for g in $(ls *.lcdd); do for s in $(ls stdhep/*.stdhep); do fname=$(basename ${s%.*})_$(basename ${g%.*}) bsub -o `pwd`/$fname.log -e `pwd`/$fname.err -q xlong time slic -g $g -i $i -o $fname done done |
The stdhep directory should contain a symlink to the StdHep files used for input events.
Example LSF submission scripts can be found in Jeremy McCormick's jobs directory on the SLAC Linux machines at ~jeremym/work/jobs.
TODO: An old version works on Condor but probably not SimDist. I will get this running at NICADD.
No. But I am working on it.
Because getting things to run on the Grid is hard.
The current directory is always searched for the XSD files, first.
The GDML_SCHEMA_DIR environment variable may point to a single directory where all XSD files should be located. LCDD uses GDML for entity resolution, also, so the LCDD schemas can be placed in this directory, also.
From the lcdd directory, execute make schema_install to copy all the GDML and LCDD schemas in the schemas directory to another existing directory.
The -O switch turns on SLIC's auto-naming feature, which will give the output file a reasonable name based on the event generator used and the name (or tag) of the geometry. The /lcio/autoname command is the corresponding UI command.
The autoname feature can be customized by providing arguments to the /lcio/autoname command. These specify fields that should be inserted in the automatically generated filename.
Here is a summary of these options.
field |
description |
---|---|
binary |
basename of the slic binary |
application |
the string 'SLIC' |
version |
SLIC's version string from VERSION |
geometry |
geometry tag from the LCDD header |
date |
current date |
event |
description of the current event from the generator |
eventNumber |
number of events |
run |
run number |
The following command illustrates the autoname feature.
/lcio/autoname event application version geometry |
It would result in an automatically-generated name similar to neutrons_SLIC_v1r13p6_myGeometry.
The -x option or /lcio/fileExists delete option will cause an existing LCIO file to be overwritten.
The -s option or /generator/skipEvents command take the number of events to skip as an argument. This is only applicable to file-based event sources such as StdHep or LCIO files.
The -r option or the /random/seed command controls the CLHEP random seed setting. Without an argument, the current time is used as a seed. Otherwise, an integer argument is used as the seed.
Dumping random state is a built-in feature of Geant4.
Turn on the save feature.
/random/setSavingFlag true |
This will cause the random state for each event to be saved to currentEvent.rndm.
To save the current event to a unique file, use this command.
/random/saveThisEvent |
This copies currentEvent.rndm to runXXXevtYYY.rndm.
To do this for every event, put the saveThisEvent command in a macro called rndmSave.mac and run events in this fashion.
/run/beamOn 1000 rndmSave.mac |
This will cause the random state to be dumped for every event.
The /random/setDirectoryName command sets the base directory where the rndm files will be placed.
To restore the random state, use this Geant4 UI command.
/random/resetEngineFrom currentEvent.rndm |
This can be used to "replay" events of interest. This feature will probably be used with SLIC's skipEvents feature in order to jump to the event first before restoring its random state.
/random/resetEngineFrom run0event1000.rndm /generator/skipEvents 1000 |
Execute the command /physics/printLists to see the available Geant4 physics lists.
The -l option or /physics/select command takes the name of the physics list to use as an argument.
/physics/select LHEP |
This must happen in the PreInit stage. Once the simulator is in Idle state, the physics list is set permanently for that run, and SLIC must be restarted to use a different list.
A number of options are available for tweaking the handling of transportation through the magnetic field in the /field command directory.
The command selectStepper sets the integrator, where the argument can be one of the following.
G4ClassicalRK4 G4ExplicitEuler G4HelixExplicitEuler G4HelixHeum G4HelixImplicitEuler G4HelixSimpleRunge G4ImplicitEuler G4CashKarpRKF45 G4SimpleHeum G4SimpleRunge |
The command setDeltaOneStep sets the maximum stepsize that will be taken in the field.
The command setDeltaIntersection sets the maximum distance from the chord line.
Refer to the Electromagnetic Fields Chapter of the Geant4 Application Guide for more details on these settings.
The -r switch sets the number of events to run, and it corresponds to Geant4's built-in /run/beamOn command.
SLIC can read StdHep files using Willy Langeveld's lightweight XDR interface from Lelaps.
An MCParticles collection of an LCIO file can also be used as a source of events, which is useful for repeating events run in other simulation frameworks.
To select a StdHep file with physics events, use the -i switch or /generator/filename command followed by an absolute or relative path to the file. Any file with an extension of .stdhep or .xdr will be automatically interpretted as a StdHep file.
SLIC also accepts LCIO files as event sources. Use the commands as if the file were a StdHep source, and the LCIO generator will be automatically selected if the file has the extension of .slcio.
The LCIO event generator feature is an experimental feature that has not undergone much testing (e.g. There be bugs here!). |
Geant4 includes a flexible and powerful particle generator called the General Particle Source or GPS.
Execute this command to select GPS as the event source.
/generator/select gps |
Actually, GPS is the default, but this can be used to switch if another generator is being used (e.g. in interactive mode).
Refer to the GPS User's Guide for detailed instructions on using this tool.
There are also a few sample GPS macros in the slic CVS project at macros/gps*.mac_.
Geant4 includes a simple particle gun that can be selected with this command.
/generator/select gun |
However, GPS is the recommended single particle source, and the G4ParticleGun should be considered deprecated, in my opinion.
Use the command /generator/dumpEvent to display information about the current generator and its event.
There are only a limited number of
SLIC Runner is a Java program that uses Swing.
TODO: Fix SLIC Runner to work with latest SLIC.
The built-in GUIs of Geant4 are available, including the XM interface.
LCIO stands for Linear Collider IO. It is the standard data format for exchanging event data between different ILC software, including simulators and reconstruction and analysis tools.
The LCDD system supports reading both plain GDML and LCDD files from SLIC.
To read in a "plain" GDML file, simply use the "-g" option as you normally would ...
slic -g myGeom.gdml |
The LCDD system will use the GDML schema instead of LCDD and the geometry should be loaded successfully.
Compact detectors are kept at this base url in zip files.
http://www.lcsim.org/detectors |
For instance, this is the location of the sid00 zip file.
http://www.lcsim.org/detectors/sid00.zip |
The org.lcsim conditions system will use this URL automatically. Otherwise, a tool like wget can be used to download it manually.
A list of available compact detectors is kept at this URL.
http://www.lcsim.org/detectors/taglist.txt |
LCPhys is used by all three of the main ILC simulation packages, SLIC, Mokka, and JUPITER.