BDSIM
can be downloaded from
https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim.
This site also contains information on documentation, projects and installation.
Alternatively, a development version is from the Git repository, instructions are at
https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BDsimInstall.
Download the tarball and extract the source code. Make sure Geant4 is installed
and appropriate environment variables defined.
Then go through the configuration procedure by running the ./configure
script.
./configure
It will create a Makefile from template defined in Makefile.in. You may want to edit the Makefile manually to meet your needs (if your CLHEP version is greater than 2.x put -DCLHEP_VERSION=9). Then start the compilation by typing
make
If the compilation is successful the bdsim
executable should be created
in $(BDSIM)/bin/$(ARCH) where $(BDSIM) is the directory specified during
configuration, and $(ARCH) is of the form $(OSTYPE)-$(COMPILER), eg Linux-g++.
Next, set up the (DY)LD_LIBRARY_PATH variable to
point to the ./parser directory, and also to the directory where libbdsim.so
is if building shared libraries.
BDSIM
is invoked by the command
bdsim
options
where the options are
--file=<filename> : specify the lattice file --output=<fmt> : output format (root|ascii), default ascii --outfile=<file> : output file name. Will be appended with _N where N = 0, 1, 2, 3... etc. --vis_mac=<file> : visualization macro script, default vis.mac --gflash=N : whether or not to turn on gFlash fast shower parameterisation. Default 0. --gflashemax=N : maximum energy for gflash shower parameterisation in GeV. Default 10000. --gflashemin=N : minimum energy for gflash shower parameterisation in GeV. Default 0.1. --help : display this message --verbose : display general parameters before run --verbose_event : display information for every event --verbose_step : display tracking information after each step --verbose_event_num=N : display tracking information for event number N --batch : batch mode - no graphics --outline=<file> : print geometry/optics info to <file> --outline_type=<fmt> : type of outline format where fmt = optics | survey --materials : list materials included in BDSIM by default
To run BDSIM one first has to define the beamline geometry in a file which is
then passes to BDSIM via the --file
command line option, for example
bdsim --file=line.gmad --output=root --batch
The next section describes how to do it in more detail.