<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.hep.ucl.ac.uk/pbt/pbtWiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=JamesChappell</id>
	<title>PBTWiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://www.hep.ucl.ac.uk/pbt/pbtWiki/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=JamesChappell"/>
	<link rel="alternate" type="text/html" href="https://www.hep.ucl.ac.uk/pbt/wiki/Special:Contributions/JamesChappell"/>
	<updated>2026-04-14T21:52:48Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/BDSIM&amp;diff=1889</id>
		<title>Software/BDSIM</title>
		<link rel="alternate" type="text/html" href="https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/BDSIM&amp;diff=1889"/>
		<updated>2018-11-27T09:34:25Z</updated>

		<summary type="html">&lt;p&gt;JamesChappell: /* Running BDSIM Simulations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== BDSIM ==&lt;br /&gt;
&lt;br /&gt;
BDSIM (Beam Delivery Simulation) is a program that uses a suite of high energy physics software including Geant4, CLHEP &amp;amp; ROOT to build a 3D model of an accelerator and simulate the passage of particles through both the vacuum and the material of the accelerator itself seamlessly.&lt;br /&gt;
&lt;br /&gt;
*Useful Links:&lt;br /&gt;
** [https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim RHUL BDSIM Webpage]&lt;br /&gt;
** [http://www.pp.rhul.ac.uk/bdsim/manual/index.html BDSIM Documentation]&lt;br /&gt;
** [https://bitbucket.org/jairhul/bdsim BDSIM Bitbucket Page]&lt;br /&gt;
** [http://www.pp.rhul.ac.uk/bdsim/manual/installation.html Official Installation Guide]&lt;br /&gt;
&lt;br /&gt;
This is a tutorial about installing and using BDSIM. BDSIM is installed on the HEP Linux cluster at UCL. You will need an account on that cluster to be able to use this software, run example tutorials and create your own simulations. &lt;br /&gt;
&lt;br /&gt;
== Running BDSIM Simulations ==&lt;br /&gt;
&lt;br /&gt;
In order to run BDSIM simulations, you will either need to download and install the software yourself or make use of the existing installation on the UCL HEP Linux cluster.&lt;br /&gt;
&lt;br /&gt;
In order to use the UCL HEP Linux cluster, you will need a HEP account: please contact Dr. Simon Jolly for more details. &lt;br /&gt;
&lt;br /&gt;
=== Running on the UCL HEP Linux Cluster (EasyBuild) ===&lt;br /&gt;
&lt;br /&gt;
In order to run &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; simulations on the UCL HEP Cluster, you must source the BDSIM PBT environment from a system within the cluster that is running CentOS7. This can be done using the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ source /unix/pbt/software/scripts/bdsim.sh &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets up all the required EasyBuild modules and environment variables. The version of BDSIM that is used within this script is not the latest build (v1.1.0 instead of v1.2.+) but should be stable. If a newer version is required then contact James Chappell and he will compile a newer version for you to use.&lt;br /&gt;
&lt;br /&gt;
Now your system is ready to use &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;. To check that it is working correctly, test the built-in help function: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should produce an output explaining all the possible options that can be used within &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Running on the UCL HEP Linux Cluster (Old) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;These instructions are now out of date and it is not recommended that you use this version of BDSIM unless you have experience with the pain of compiling BDSIM, Geant4 and all their dependencies. Whenever possible, use the EasyBuild version. Contact Simon Jolly or James Chappell if any required functionality is missing.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; simulations on the UCL HEP Cluster, you must first source the development version of the PBT environment from a system within the cluster that is running either CentOS7 or Scientific Linux V6. This can be done using the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ source /unix/pbt/software/scripts/pbt.sh -vd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; the &#039;-d&#039; flag is essential as this sources the script that links the latest development software available on the PBT section of the cluster. &lt;br /&gt;
&lt;br /&gt;
Now your system is ready to use &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;. To check that it is working correctly, test the built-in help function: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should produce an output explaining all the possible options that can be used within &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Required Software ==&lt;br /&gt;
&lt;br /&gt;
BDSIM requires the following software to be installed:&lt;br /&gt;
&lt;br /&gt;
* Recent compiler with full C++11 support - proven compiler versions are GCC v4.9 or higher, or Clang 6 or higher.&lt;br /&gt;
* CMake v2.8.12 or higher&lt;br /&gt;
* CLHEP v2.1.3.1 or higher&lt;br /&gt;
* ROOT v6.x or higher&lt;br /&gt;
* Geant4 v4.10 or higher&lt;br /&gt;
* Flex v2.5.37 or higher&lt;br /&gt;
* Bison v2.3 or higher&lt;br /&gt;
&lt;br /&gt;
These are all installed on the UCL HEP cluster.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
&lt;br /&gt;
; Website: https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim&lt;br /&gt;
&lt;br /&gt;
; Latest Version: 0.9.9.2 (19th October 2017)&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
The installation process follows the general process described on the [[Software/Geant4/UCL HEP Cluster|UCL HEP Linux Cluster]] page.  &lt;br /&gt;
The basic method used is as follows:&lt;br /&gt;
&lt;br /&gt;
# Check that all the prerequisites for building &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; are installed (see above);&lt;br /&gt;
# Download the latest version of the source code;&lt;br /&gt;
# Create a build folder;&lt;br /&gt;
# Configure, build and install &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; from within the build folder.&lt;br /&gt;
&lt;br /&gt;
=== Download BDSIM from its central repository ===&lt;br /&gt;
&lt;br /&gt;
The BDSIM source code can be downloaded from its git repository using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; $ git clone --recursive &amp;lt;nowiki&amp;gt;https://bitbucket.org/jairhul/bdsim&amp;lt;/nowiki&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This creates a &amp;lt;code&amp;gt;/bdsim&amp;lt;/code&amp;gt; folder within your current folder. This folder contains all the code, examples, documentation and associated Python packages.&lt;br /&gt;
&lt;br /&gt;
=== Configure, build and install &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When installing &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;, all the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment variables must be available. This can be tested using the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; $ echo $G4 &amp;lt;tab&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment variables are available, you should see an output similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
$G4ABLADATA          $G4NEUTRONHPDATA      $G4REALSURFACEDATA &lt;br /&gt;
$G4ENSDFSTATEDATA    $G4NEUTRONXSDATA      $G4SAIDXSDATA &lt;br /&gt;
$G4LEDATA            $G4PIIDATA            $G4SHARE &lt;br /&gt;
$G4LEVELGAMMADATA    $G4RADIOACTIVEDATA    $G4VERSION &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This output corresponds to using the UCL PBT environment, but it will be dependent on the installed &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; modules. If this does not return a list of environment variables, make sure you have correctly sourced the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment script and updated all relevant path variables.&lt;br /&gt;
&lt;br /&gt;
Once the source code has been downloaded, a build directory should be created alongside the &amp;lt;code&amp;gt;src&amp;lt;/code&amp;gt; to hold the compiled &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; files before they are moved to their final installation location.&lt;br /&gt;
&lt;br /&gt;
On the UCL HEP Linux Cluster, the build directory should be created in &amp;lt;code&amp;gt;/unix/pbt/software/build&amp;lt;/code&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /unix/pbt/software/build&lt;br /&gt;
$ mkdir bdsim&lt;br /&gt;
$ cd bdsim&lt;br /&gt;
$ mkdir bdsim-0.9.9.2-build&lt;br /&gt;
$ cd bdsim-0.9.9.2-build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike other software installed on the UCL HEP Linux Cluster, there are a number of ways to configure the software before building. Using the &amp;lt;code&amp;gt;ccmake&amp;lt;/code&amp;gt; command, each configuration option can be set interactively:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cmake ../../../src/bdsim/bdsim-bitbucket/&lt;br /&gt;
&lt;br /&gt;
$ ccmake .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CMake opens an interactive configuration program. Set the options as required for your system e.g. on the UCL HEP Cluster:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CMAKE_INSTALL_PREFIX     /unix/pbt/software/dev/bdsim-0.9.9.2/&lt;br /&gt;
USE_AWAKE                ON&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;CMAKE_INSTALL_PREFIX=/unix/pbt/software/dev/bdsim-0.9.9.2&amp;lt;/code&amp;gt; flag specifies that the resulting &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; should be installed in the directory &amp;lt;code&amp;gt;/unix/pbt/software/dev/bdsim-0.9.9.2&amp;lt;/code&amp;gt; after compilation: this should be changed to suit the particular installation in question.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;c&#039;&#039; to configure.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;g&#039;&#039; to generate and exit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; can then be compiled and installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ make&lt;br /&gt;
$ make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Multiple examples are provided with the source code and can be found in the original build folder. A complete list of examples and tutorials for running them can be found at http://www.pp.rhul.ac.uk/bdsim/manual/examples/examples.html&lt;br /&gt;
&lt;br /&gt;
Here, the simpleMachine example will be demonstrated.&lt;br /&gt;
&lt;br /&gt;
First, navigate to the examples within build directory and find simpleMachine:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /unix/pbt/software/build/bdsim/bdsim-0.92-dev/bdsim-build-updated/examples&lt;br /&gt;
$ cd simpleMachine&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the simulation via the GUI use the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=sm.gmad&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An interface should load up and display the simpleMachine setup. It has a few drift beam pipes with a quadrupole, collimator and sector bend dipole magnet. To run the simulation once with any output exported to a file called &amp;lt;code&amp;gt;output.root&amp;lt;/code&amp;gt;, use the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=sm.gmad --outfile=output&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From within the GUI command line, type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/run/beamOn 1&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will execute a single run of the simulation with the output data exported to &amp;lt;code&amp;gt;output.root&amp;lt;/code&amp;gt;. This can then be analysed from within ROOT by following the tutorial at http://www.pp.rhul.ac.uk/bdsim/manual/output_analysis.html.&lt;br /&gt;
&lt;br /&gt;
To run this simulation in Batch mode, the following command can be used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=sm.gmad --outfile=output --batch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Batch mode has no interactive interface, but as a consequence is much faster and exits the program once it has finished. For simulations with large numbers of particles within the beam, this is the preferred method of use.&lt;br /&gt;
&lt;br /&gt;
== AWAKE Spectrometer Simulation ==&lt;br /&gt;
&lt;br /&gt;
A model of the AWAKE spectrometer is available at &amp;lt;code&amp;gt;/unix/pdpwa/AWAKE_spectrometer/spectrometer&amp;lt;/code&amp;gt;. This model (&amp;lt;code&amp;gt;spectrometer.gmad&amp;lt;/code&amp;gt;) describes the spectrometer, downstream of the plasma cell, and includes the quadrupole magnets, drift sections and the spectrometer. Also included in this folder are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;options.gmad&amp;lt;/code&amp;gt; - includes definitions of constants used within the spectrometer model.&lt;br /&gt;
* &amp;lt;code&amp;gt;spec_test.C&amp;lt;/code&amp;gt; - a ROOT macro that plots and fits the Energy vs. position on the screen for particles that pass through the spectrometer.&lt;br /&gt;
* &amp;lt;code&amp;gt;vis.mac&amp;lt;/code&amp;gt; - settings for the interactive BDSIM GUI.&lt;br /&gt;
* &amp;lt;code&amp;gt;README&amp;lt;/code&amp;gt; - instructions on running the simulation.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
&lt;br /&gt;
First source the BDSIM environment as described [[#Running on the UCL HEP Linux Cluster| above]]. To run the simulation using the test electron beam (E = 0 -&amp;gt; 10 GeV), use the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=spectrometer.gmad --outfile=output --batch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output is then stored in a file called &amp;lt;code&amp;gt;output.root&amp;lt;/code&amp;gt;. There one supplied script for analysis of this output: &amp;lt;code&amp;gt;spec_test.C&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
==== ROOT Macro ====&lt;br /&gt;
&lt;br /&gt;
The analysis script provided is a ROOT Macro that automatically plots the energy of the particle against the x-position on the screen and then fits this curve for comparison to the analytic model. It allows easy confirmation that the simulation is working as expected. It can be used via:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ root&lt;br /&gt;
root &amp;gt; .x spec_test.C&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Python Scripts - Creating Field Maps ===&lt;br /&gt;
&lt;br /&gt;
There is a directory called &amp;lt;code&amp;gt;python_scripts&amp;lt;/code&amp;gt; within the AWAKE spectrometer example directory on the UCL HEP cluster. The script &amp;lt;code&amp;gt;uniformfield.py&amp;lt;/code&amp;gt; can be used to generate uniform magnetic field maps that can be used within the AWAKE spectrometer simulation. &lt;br /&gt;
&lt;br /&gt;
==== Setting up pyBDSIM ====&lt;br /&gt;
&lt;br /&gt;
BDSIM comes with a group of python modules that can be used to create and visualise aspects of the simulation, e.g. beam distributions and field maps. More information on these modules can be found at http://www.pp.rhul.ac.uk/bdsim/manual/python_modules.html. To download these modules from bitbucket, use the following commands from within your BDSIM source directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git pull&lt;br /&gt;
$ git submodule init&lt;br /&gt;
$ git submodule update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile the modules, use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd utils&lt;br /&gt;
$ make&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compilation assumes you are using a python environment with &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt; installed. If you are running this on the UCL HEP cluster, then follow the instructions on https://www.hep.ucl.ac.uk/twiki/bin/view/Computing/UsingPython to create a virtual environment in which you can install the modules.&lt;br /&gt;
&lt;br /&gt;
==== Creating a uniform magnetic field map ====&lt;br /&gt;
&lt;br /&gt;
To create a uniform magnetic field map, you can use the python script &amp;lt;code&amp;gt;uniformfield.py&amp;lt;/code&amp;gt; in the following way from the command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ python uniformfield.py --fieldstrength &amp;lt;fieldstrength&amp;gt; --length &amp;lt;length&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where you insert your desired values for the field strength (in T) and length (in m). The length variable must equal the length value given to &amp;lt;code&amp;gt;spectrometer.gmad&amp;lt;/code&amp;gt; when defining the &amp;lt;code&amp;gt;awakespectrometer&amp;lt;/code&amp;gt; class. It is required due to the way the spectrometer field map is defined within the source code. If you do not give the same length value, the field will be placed in the wrong position within the simulation and the results will be incorrect.&lt;/div&gt;</summary>
		<author><name>JamesChappell</name></author>
	</entry>
	<entry>
		<id>https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/BDSIM&amp;diff=1888</id>
		<title>Software/BDSIM</title>
		<link rel="alternate" type="text/html" href="https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/BDSIM&amp;diff=1888"/>
		<updated>2018-11-27T09:32:50Z</updated>

		<summary type="html">&lt;p&gt;JamesChappell: /* Running BDSIM Simulations */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== BDSIM ==&lt;br /&gt;
&lt;br /&gt;
BDSIM (Beam Delivery Simulation) is a program that uses a suite of high energy physics software including Geant4, CLHEP &amp;amp; ROOT to build a 3D model of an accelerator and simulate the passage of particles through both the vacuum and the material of the accelerator itself seamlessly.&lt;br /&gt;
&lt;br /&gt;
*Useful Links:&lt;br /&gt;
** [https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim RHUL BDSIM Webpage]&lt;br /&gt;
** [http://www.pp.rhul.ac.uk/bdsim/manual/index.html BDSIM Documentation]&lt;br /&gt;
** [https://bitbucket.org/jairhul/bdsim BDSIM Bitbucket Page]&lt;br /&gt;
** [http://www.pp.rhul.ac.uk/bdsim/manual/installation.html Official Installation Guide]&lt;br /&gt;
&lt;br /&gt;
This is a tutorial about installing and using BDSIM. BDSIM is installed on the HEP Linux cluster at UCL. You will need an account on that cluster to be able to use this software, run example tutorials and create your own simulations. &lt;br /&gt;
&lt;br /&gt;
== Running BDSIM Simulations ==&lt;br /&gt;
&lt;br /&gt;
In order to run BDSIM simulations, you will either need to download and install the software yourself or make use of the existing installation on the UCL HEP Linux cluster.&lt;br /&gt;
&lt;br /&gt;
In order to use the UCL HEP Linux cluster, you will need a HEP account: please contact Dr. Simon Jolly for more details. &lt;br /&gt;
&lt;br /&gt;
=== Running on the UCL HEP Linux Cluster (EasyBuild) ===&lt;br /&gt;
&lt;br /&gt;
In order to run &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; simulations on the UCL HEP Cluster, you must source the BDSIM PBT environment from a system within the cluster that is running CentOS7. This can be done using the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ source /unix/pbt/software/scripts/bdsim.sh &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This sets up all the required EasyBuild modules and environment variables. The version of BDSIM that is used within this script is not the latest build (v1.1.0 instead of v1.2.+) but should be stable. If a newer version is required then contact James Chappell and he will compile a newer version for you to use.&lt;br /&gt;
&lt;br /&gt;
=== Running on the UCL HEP Linux Cluster (Old) ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;These instructions are now out of date and it is not recommended that you use this version of BDSIM unless you have experience with the pain of compiling BDSIM, Geant4 and all their dependencies. Whenever possible, use the EasyBuild version. Contact Simon Jolly or James Chappell if any required functionality is missing.&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
In order to run &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; simulations on the UCL HEP Cluster, you must first source the development version of the PBT environment from a system within the cluster that is running either CentOS7 or Scientific Linux V6. This can be done using the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ source /unix/pbt/software/scripts/pbt.sh -vd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; the &#039;-d&#039; flag is essential as this sources the script that links the latest development software available on the PBT section of the cluster. &lt;br /&gt;
&lt;br /&gt;
Now your system is ready to use &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;. To check that it is working correctly, test the built-in help function: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should produce an output explaining all the possible options that can be used within &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Required Software ==&lt;br /&gt;
&lt;br /&gt;
BDSIM requires the following software to be installed:&lt;br /&gt;
&lt;br /&gt;
* Recent compiler with full C++11 support - proven compiler versions are GCC v4.9 or higher, or Clang 6 or higher.&lt;br /&gt;
* CMake v2.8.12 or higher&lt;br /&gt;
* CLHEP v2.1.3.1 or higher&lt;br /&gt;
* ROOT v6.x or higher&lt;br /&gt;
* Geant4 v4.10 or higher&lt;br /&gt;
* Flex v2.5.37 or higher&lt;br /&gt;
* Bison v2.3 or higher&lt;br /&gt;
&lt;br /&gt;
These are all installed on the UCL HEP cluster.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
&lt;br /&gt;
; Website: https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim&lt;br /&gt;
&lt;br /&gt;
; Latest Version: 0.9.9.2 (19th October 2017)&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
The installation process follows the general process described on the [[Software/Geant4/UCL HEP Cluster|UCL HEP Linux Cluster]] page.  &lt;br /&gt;
The basic method used is as follows:&lt;br /&gt;
&lt;br /&gt;
# Check that all the prerequisites for building &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; are installed (see above);&lt;br /&gt;
# Download the latest version of the source code;&lt;br /&gt;
# Create a build folder;&lt;br /&gt;
# Configure, build and install &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; from within the build folder.&lt;br /&gt;
&lt;br /&gt;
=== Download BDSIM from its central repository ===&lt;br /&gt;
&lt;br /&gt;
The BDSIM source code can be downloaded from its git repository using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; $ git clone --recursive &amp;lt;nowiki&amp;gt;https://bitbucket.org/jairhul/bdsim&amp;lt;/nowiki&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This creates a &amp;lt;code&amp;gt;/bdsim&amp;lt;/code&amp;gt; folder within your current folder. This folder contains all the code, examples, documentation and associated Python packages.&lt;br /&gt;
&lt;br /&gt;
=== Configure, build and install &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When installing &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;, all the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment variables must be available. This can be tested using the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; $ echo $G4 &amp;lt;tab&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment variables are available, you should see an output similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
$G4ABLADATA          $G4NEUTRONHPDATA      $G4REALSURFACEDATA &lt;br /&gt;
$G4ENSDFSTATEDATA    $G4NEUTRONXSDATA      $G4SAIDXSDATA &lt;br /&gt;
$G4LEDATA            $G4PIIDATA            $G4SHARE &lt;br /&gt;
$G4LEVELGAMMADATA    $G4RADIOACTIVEDATA    $G4VERSION &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This output corresponds to using the UCL PBT environment, but it will be dependent on the installed &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; modules. If this does not return a list of environment variables, make sure you have correctly sourced the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment script and updated all relevant path variables.&lt;br /&gt;
&lt;br /&gt;
Once the source code has been downloaded, a build directory should be created alongside the &amp;lt;code&amp;gt;src&amp;lt;/code&amp;gt; to hold the compiled &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; files before they are moved to their final installation location.&lt;br /&gt;
&lt;br /&gt;
On the UCL HEP Linux Cluster, the build directory should be created in &amp;lt;code&amp;gt;/unix/pbt/software/build&amp;lt;/code&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /unix/pbt/software/build&lt;br /&gt;
$ mkdir bdsim&lt;br /&gt;
$ cd bdsim&lt;br /&gt;
$ mkdir bdsim-0.9.9.2-build&lt;br /&gt;
$ cd bdsim-0.9.9.2-build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike other software installed on the UCL HEP Linux Cluster, there are a number of ways to configure the software before building. Using the &amp;lt;code&amp;gt;ccmake&amp;lt;/code&amp;gt; command, each configuration option can be set interactively:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cmake ../../../src/bdsim/bdsim-bitbucket/&lt;br /&gt;
&lt;br /&gt;
$ ccmake .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CMake opens an interactive configuration program. Set the options as required for your system e.g. on the UCL HEP Cluster:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CMAKE_INSTALL_PREFIX     /unix/pbt/software/dev/bdsim-0.9.9.2/&lt;br /&gt;
USE_AWAKE                ON&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;CMAKE_INSTALL_PREFIX=/unix/pbt/software/dev/bdsim-0.9.9.2&amp;lt;/code&amp;gt; flag specifies that the resulting &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; should be installed in the directory &amp;lt;code&amp;gt;/unix/pbt/software/dev/bdsim-0.9.9.2&amp;lt;/code&amp;gt; after compilation: this should be changed to suit the particular installation in question.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;c&#039;&#039; to configure.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;g&#039;&#039; to generate and exit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; can then be compiled and installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ make&lt;br /&gt;
$ make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Multiple examples are provided with the source code and can be found in the original build folder. A complete list of examples and tutorials for running them can be found at http://www.pp.rhul.ac.uk/bdsim/manual/examples/examples.html&lt;br /&gt;
&lt;br /&gt;
Here, the simpleMachine example will be demonstrated.&lt;br /&gt;
&lt;br /&gt;
First, navigate to the examples within build directory and find simpleMachine:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /unix/pbt/software/build/bdsim/bdsim-0.92-dev/bdsim-build-updated/examples&lt;br /&gt;
$ cd simpleMachine&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the simulation via the GUI use the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=sm.gmad&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An interface should load up and display the simpleMachine setup. It has a few drift beam pipes with a quadrupole, collimator and sector bend dipole magnet. To run the simulation once with any output exported to a file called &amp;lt;code&amp;gt;output.root&amp;lt;/code&amp;gt;, use the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=sm.gmad --outfile=output&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From within the GUI command line, type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/run/beamOn 1&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will execute a single run of the simulation with the output data exported to &amp;lt;code&amp;gt;output.root&amp;lt;/code&amp;gt;. This can then be analysed from within ROOT by following the tutorial at http://www.pp.rhul.ac.uk/bdsim/manual/output_analysis.html.&lt;br /&gt;
&lt;br /&gt;
To run this simulation in Batch mode, the following command can be used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=sm.gmad --outfile=output --batch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Batch mode has no interactive interface, but as a consequence is much faster and exits the program once it has finished. For simulations with large numbers of particles within the beam, this is the preferred method of use.&lt;br /&gt;
&lt;br /&gt;
== AWAKE Spectrometer Simulation ==&lt;br /&gt;
&lt;br /&gt;
A model of the AWAKE spectrometer is available at &amp;lt;code&amp;gt;/unix/pdpwa/AWAKE_spectrometer/spectrometer&amp;lt;/code&amp;gt;. This model (&amp;lt;code&amp;gt;spectrometer.gmad&amp;lt;/code&amp;gt;) describes the spectrometer, downstream of the plasma cell, and includes the quadrupole magnets, drift sections and the spectrometer. Also included in this folder are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;options.gmad&amp;lt;/code&amp;gt; - includes definitions of constants used within the spectrometer model.&lt;br /&gt;
* &amp;lt;code&amp;gt;spec_test.C&amp;lt;/code&amp;gt; - a ROOT macro that plots and fits the Energy vs. position on the screen for particles that pass through the spectrometer.&lt;br /&gt;
* &amp;lt;code&amp;gt;vis.mac&amp;lt;/code&amp;gt; - settings for the interactive BDSIM GUI.&lt;br /&gt;
* &amp;lt;code&amp;gt;README&amp;lt;/code&amp;gt; - instructions on running the simulation.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
&lt;br /&gt;
First source the BDSIM environment as described [[#Running on the UCL HEP Linux Cluster| above]]. To run the simulation using the test electron beam (E = 0 -&amp;gt; 10 GeV), use the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=spectrometer.gmad --outfile=output --batch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output is then stored in a file called &amp;lt;code&amp;gt;output.root&amp;lt;/code&amp;gt;. There one supplied script for analysis of this output: &amp;lt;code&amp;gt;spec_test.C&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
==== ROOT Macro ====&lt;br /&gt;
&lt;br /&gt;
The analysis script provided is a ROOT Macro that automatically plots the energy of the particle against the x-position on the screen and then fits this curve for comparison to the analytic model. It allows easy confirmation that the simulation is working as expected. It can be used via:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ root&lt;br /&gt;
root &amp;gt; .x spec_test.C&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Python Scripts - Creating Field Maps ===&lt;br /&gt;
&lt;br /&gt;
There is a directory called &amp;lt;code&amp;gt;python_scripts&amp;lt;/code&amp;gt; within the AWAKE spectrometer example directory on the UCL HEP cluster. The script &amp;lt;code&amp;gt;uniformfield.py&amp;lt;/code&amp;gt; can be used to generate uniform magnetic field maps that can be used within the AWAKE spectrometer simulation. &lt;br /&gt;
&lt;br /&gt;
==== Setting up pyBDSIM ====&lt;br /&gt;
&lt;br /&gt;
BDSIM comes with a group of python modules that can be used to create and visualise aspects of the simulation, e.g. beam distributions and field maps. More information on these modules can be found at http://www.pp.rhul.ac.uk/bdsim/manual/python_modules.html. To download these modules from bitbucket, use the following commands from within your BDSIM source directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git pull&lt;br /&gt;
$ git submodule init&lt;br /&gt;
$ git submodule update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile the modules, use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd utils&lt;br /&gt;
$ make&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compilation assumes you are using a python environment with &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt; installed. If you are running this on the UCL HEP cluster, then follow the instructions on https://www.hep.ucl.ac.uk/twiki/bin/view/Computing/UsingPython to create a virtual environment in which you can install the modules.&lt;br /&gt;
&lt;br /&gt;
==== Creating a uniform magnetic field map ====&lt;br /&gt;
&lt;br /&gt;
To create a uniform magnetic field map, you can use the python script &amp;lt;code&amp;gt;uniformfield.py&amp;lt;/code&amp;gt; in the following way from the command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ python uniformfield.py --fieldstrength &amp;lt;fieldstrength&amp;gt; --length &amp;lt;length&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where you insert your desired values for the field strength (in T) and length (in m). The length variable must equal the length value given to &amp;lt;code&amp;gt;spectrometer.gmad&amp;lt;/code&amp;gt; when defining the &amp;lt;code&amp;gt;awakespectrometer&amp;lt;/code&amp;gt; class. It is required due to the way the spectrometer field map is defined within the source code. If you do not give the same length value, the field will be placed in the wrong position within the simulation and the results will be incorrect.&lt;/div&gt;</summary>
		<author><name>JamesChappell</name></author>
	</entry>
	<entry>
		<id>https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/BDSIM&amp;diff=1384</id>
		<title>Software/BDSIM</title>
		<link rel="alternate" type="text/html" href="https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/BDSIM&amp;diff=1384"/>
		<updated>2018-03-07T11:41:09Z</updated>

		<summary type="html">&lt;p&gt;JamesChappell: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== BDSIM ==&lt;br /&gt;
&lt;br /&gt;
BDSIM (Beam Delivery Simulation) is a program that uses a suite of high energy physics software including Geant4, CLHEP &amp;amp; ROOT to build a 3D model of an accelerator and simulate the passage of particles through both the vacuum and the material of the accelerator itself seamlessly.&lt;br /&gt;
&lt;br /&gt;
*Useful Links:&lt;br /&gt;
** [https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim RHUL BDSIM Webpage]&lt;br /&gt;
** [http://www.pp.rhul.ac.uk/bdsim/manual/index.html BDSIM Documentation]&lt;br /&gt;
** [https://bitbucket.org/jairhul/bdsim BDSIM Bitbucket Page]&lt;br /&gt;
** [http://www.pp.rhul.ac.uk/bdsim/manual/installation.html Official Installation Guide]&lt;br /&gt;
&lt;br /&gt;
This is a tutorial about installing and using BDSIM. BDSIM is installed on the HEP Linux cluster at UCL. You will need an account on that cluster to be able to use this software, run example tutorials and create your own simulations. &lt;br /&gt;
&lt;br /&gt;
== Running BDSIM Simulations ==&lt;br /&gt;
&lt;br /&gt;
In order to run BDSIM simulations, you will either need to download and install the software yourself or make use of the existing installation on the UCL HEP Linux cluster.&lt;br /&gt;
&lt;br /&gt;
In order to use the UCL HEP Linux cluster, you will need a HEP account: please contact Dr. Simon Jolly for more details. &lt;br /&gt;
&lt;br /&gt;
=== Running on the UCL HEP Linux Cluster ===&lt;br /&gt;
&lt;br /&gt;
In order to run &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; simulations on the UCL HEP Cluster, you must first source the development version of the PBT environment from a system within the cluster that is running either CentOS7 or Scientific Linux V6. This can be done using the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ source /unix/pbt/software/scripts/pbt.sh -vd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; the &#039;-d&#039; flag is essential as this sources the script that links the latest development software available on the PBT section of the cluster. &lt;br /&gt;
&lt;br /&gt;
Now your system is ready to use &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;. To check that it is working correctly, test the built-in help function: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should produce an output explaining all the possible options that can be used within &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Required Software ==&lt;br /&gt;
&lt;br /&gt;
BDSIM requires the following software to be installed:&lt;br /&gt;
&lt;br /&gt;
* Recent compiler with full C++11 support - proven compiler versions are GCC v4.9 or higher, or Clang 6 or higher.&lt;br /&gt;
* CMake v2.8.12 or higher&lt;br /&gt;
* CLHEP v2.1.3.1 or higher&lt;br /&gt;
* ROOT v6.x or higher&lt;br /&gt;
* Geant4 v4.10 or higher&lt;br /&gt;
* Flex v2.5.37 or higher&lt;br /&gt;
* Bison v2.3 or higher&lt;br /&gt;
&lt;br /&gt;
These are all installed on the UCL HEP cluster.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
&lt;br /&gt;
; Website: https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim&lt;br /&gt;
&lt;br /&gt;
; Latest Version: 0.9.9.2 (19th October 2017)&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
The installation process follows the general process described on the [[Software/Geant4/UCL HEP Cluster|UCL HEP Linux Cluster]] page.  &lt;br /&gt;
The basic method used is as follows:&lt;br /&gt;
&lt;br /&gt;
# Check that all the prerequisites for building &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; are installed (see above);&lt;br /&gt;
# Download the latest version of the source code;&lt;br /&gt;
# Create a build folder;&lt;br /&gt;
# Configure, build and install &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; from within the build folder.&lt;br /&gt;
&lt;br /&gt;
=== Download BDSIM from its central repository ===&lt;br /&gt;
&lt;br /&gt;
The BDSIM source code can be downloaded from its git repository using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; $ git clone --recursive &amp;lt;nowiki&amp;gt;https://bitbucket.org/jairhul/bdsim&amp;lt;/nowiki&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This creates a &amp;lt;code&amp;gt;/bdsim&amp;lt;/code&amp;gt; folder within your current folder. This folder contains all the code, examples, documentation and associated Python packages.&lt;br /&gt;
&lt;br /&gt;
=== Configure, build and install &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When installing &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;, all the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment variables must be available. This can be tested using the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; $ echo $G4 &amp;lt;tab&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment variables are available, you should see an output similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
$G4ABLADATA          $G4NEUTRONHPDATA      $G4REALSURFACEDATA &lt;br /&gt;
$G4ENSDFSTATEDATA    $G4NEUTRONXSDATA      $G4SAIDXSDATA &lt;br /&gt;
$G4LEDATA            $G4PIIDATA            $G4SHARE &lt;br /&gt;
$G4LEVELGAMMADATA    $G4RADIOACTIVEDATA    $G4VERSION &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This output corresponds to using the UCL PBT environment, but it will be dependent on the installed &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; modules. If this does not return a list of environment variables, make sure you have correctly sourced the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment script and updated all relevant path variables.&lt;br /&gt;
&lt;br /&gt;
Once the source code has been downloaded, a build directory should be created alongside the &amp;lt;code&amp;gt;src&amp;lt;/code&amp;gt; to hold the compiled &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; files before they are moved to their final installation location.&lt;br /&gt;
&lt;br /&gt;
On the UCL HEP Linux Cluster, the build directory should be created in &amp;lt;code&amp;gt;/unix/pbt/software/build&amp;lt;/code&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /unix/pbt/software/build&lt;br /&gt;
$ mkdir bdsim&lt;br /&gt;
$ cd bdsim&lt;br /&gt;
$ mkdir bdsim-0.9.9.2-build&lt;br /&gt;
$ cd bdsim-0.9.9.2-build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike other software installed on the UCL HEP Linux Cluster, there are a number of ways to configure the software before building. Using the &amp;lt;code&amp;gt;ccmake&amp;lt;/code&amp;gt; command, each configuration option can be set interactively:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cmake ../../../src/bdsim/bdsim-bitbucket/&lt;br /&gt;
&lt;br /&gt;
$ ccmake .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CMake opens an interactive configuration program. Set the options as required for your system e.g. on the UCL HEP Cluster:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CMAKE_INSTALL_PREFIX     /unix/pbt/software/dev/bdsim-0.9.9.2/&lt;br /&gt;
USE_AWAKE                ON&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;CMAKE_INSTALL_PREFIX=/unix/pbt/software/dev/bdsim-0.9.9.2&amp;lt;/code&amp;gt; flag specifies that the resulting &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; should be installed in the directory &amp;lt;code&amp;gt;/unix/pbt/software/dev/bdsim-0.9.9.2&amp;lt;/code&amp;gt; after compilation: this should be changed to suit the particular installation in question.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;c&#039;&#039; to configure.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;g&#039;&#039; to generate and exit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; can then be compiled and installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ make&lt;br /&gt;
$ make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Multiple examples are provided with the source code and can be found in the original build folder. A complete list of examples and tutorials for running them can be found at http://www.pp.rhul.ac.uk/bdsim/manual/examples/examples.html&lt;br /&gt;
&lt;br /&gt;
Here, the simpleMachine example will be demonstrated.&lt;br /&gt;
&lt;br /&gt;
First, navigate to the examples within build directory and find simpleMachine:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /unix/pbt/software/build/bdsim/bdsim-0.92-dev/bdsim-build-updated/examples&lt;br /&gt;
$ cd simpleMachine&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the simulation via the GUI use the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=sm.gmad&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An interface should load up and display the simpleMachine setup. It has a few drift beam pipes with a quadrupole, collimator and sector bend dipole magnet. To run the simulation once with any output exported to a file called &amp;lt;code&amp;gt;output.root&amp;lt;/code&amp;gt;, use the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=sm.gmad --outfile=output&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From within the GUI command line, type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/run/beamOn 1&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will execute a single run of the simulation with the output data exported to &amp;lt;code&amp;gt;output.root&amp;lt;/code&amp;gt;. This can then be analysed from within ROOT by following the tutorial at http://www.pp.rhul.ac.uk/bdsim/manual/output_analysis.html.&lt;br /&gt;
&lt;br /&gt;
To run this simulation in Batch mode, the following command can be used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=sm.gmad --outfile=output --batch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Batch mode has no interactive interface, but as a consequence is much faster and exits the program once it has finished. For simulations with large numbers of particles within the beam, this is the preferred method of use.&lt;br /&gt;
&lt;br /&gt;
== AWAKE Spectrometer Simulation ==&lt;br /&gt;
&lt;br /&gt;
A model of the AWAKE spectrometer is available at &amp;lt;code&amp;gt;/unix/pdpwa/AWAKE_spectrometer/spectrometer&amp;lt;/code&amp;gt;. This model (&amp;lt;code&amp;gt;spectrometer.gmad&amp;lt;/code&amp;gt;) describes the spectrometer, downstream of the plasma cell, and includes the quadrupole magnets, drift sections and the spectrometer. Also included in this folder are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;options.gmad&amp;lt;/code&amp;gt; - includes definitions of constants used within the spectrometer model.&lt;br /&gt;
* &amp;lt;code&amp;gt;spec_test.C&amp;lt;/code&amp;gt; - a ROOT macro that plots and fits the Energy vs. position on the screen for particles that pass through the spectrometer.&lt;br /&gt;
* &amp;lt;code&amp;gt;vis.mac&amp;lt;/code&amp;gt; - settings for the interactive BDSIM GUI.&lt;br /&gt;
* &amp;lt;code&amp;gt;README&amp;lt;/code&amp;gt; - instructions on running the simulation.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
&lt;br /&gt;
First source the BDSIM environment as described [[#Running on the UCL HEP Linux Cluster| above]]. To run the simulation using the test electron beam (E = 0 -&amp;gt; 10 GeV), use the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=spectrometer.gmad --outfile=output --batch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output is then stored in a file called &amp;lt;code&amp;gt;output.root&amp;lt;/code&amp;gt;. There one supplied script for analysis of this output: &amp;lt;code&amp;gt;spec_test.C&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
==== ROOT Macro ====&lt;br /&gt;
&lt;br /&gt;
The analysis script provided is a ROOT Macro that automatically plots the energy of the particle against the x-position on the screen and then fits this curve for comparison to the analytic model. It allows easy confirmation that the simulation is working as expected. It can be used via:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ root&lt;br /&gt;
root &amp;gt; .x spec_test.C&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Python Scripts - Creating Field Maps ===&lt;br /&gt;
&lt;br /&gt;
There is a directory called &amp;lt;code&amp;gt;python_scripts&amp;lt;/code&amp;gt; within the AWAKE spectrometer example directory on the UCL HEP cluster. The script &amp;lt;code&amp;gt;uniformfield.py&amp;lt;/code&amp;gt; can be used to generate uniform magnetic field maps that can be used within the AWAKE spectrometer simulation. &lt;br /&gt;
&lt;br /&gt;
==== Setting up pyBDSIM ====&lt;br /&gt;
&lt;br /&gt;
BDSIM comes with a group of python modules that can be used to create and visualise aspects of the simulation, e.g. beam distributions and field maps. More information on these modules can be found at http://www.pp.rhul.ac.uk/bdsim/manual/python_modules.html. To download these modules from bitbucket, use the following commands from within your BDSIM source directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ git pull&lt;br /&gt;
$ git submodule init&lt;br /&gt;
$ git submodule update&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To compile the modules, use:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd utils&lt;br /&gt;
$ make&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This compilation assumes you are using a python environment with &amp;lt;code&amp;gt;pip&amp;lt;/code&amp;gt; installed. If you are running this on the UCL HEP cluster, then follow the instructions on https://www.hep.ucl.ac.uk/twiki/bin/view/Computing/UsingPython to create a virtual environment in which you can install the modules.&lt;br /&gt;
&lt;br /&gt;
==== Creating a uniform magnetic field map ====&lt;br /&gt;
&lt;br /&gt;
To create a uniform magnetic field map, you can use the python script &amp;lt;code&amp;gt;uniformfield.py&amp;lt;/code&amp;gt; in the following way from the command line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ python uniformfield.py --fieldstrength &amp;lt;fieldstrength&amp;gt; --length &amp;lt;length&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where you insert your desired values for the field strength (in T) and length (in m). The length variable must equal the length value given to &amp;lt;code&amp;gt;spectrometer.gmad&amp;lt;/code&amp;gt; when defining the &amp;lt;code&amp;gt;awakespectrometer&amp;lt;/code&amp;gt; class. It is required due to the way the spectrometer field map is defined within the source code. If you do not give the same length value, the field will be placed in the wrong position within the simulation and the results will be incorrect.&lt;/div&gt;</summary>
		<author><name>JamesChappell</name></author>
	</entry>
	<entry>
		<id>https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/BDSIM&amp;diff=1383</id>
		<title>Software/BDSIM</title>
		<link rel="alternate" type="text/html" href="https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/BDSIM&amp;diff=1383"/>
		<updated>2018-03-07T11:00:43Z</updated>

		<summary type="html">&lt;p&gt;JamesChappell: /* Running on the UCL HEP Linux Cluster */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== BDSIM ==&lt;br /&gt;
&lt;br /&gt;
BDSIM (Beam Delivery Simulation) is a program that uses a suite of high energy physics software including Geant4, CLHEP &amp;amp; ROOT to build a 3D model of an accelerator and simulate the passage of particles through both the vacuum and the material of the accelerator itself seamlessly.&lt;br /&gt;
&lt;br /&gt;
*Useful Links:&lt;br /&gt;
** [https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim RHUL BDSIM Webpage]&lt;br /&gt;
** [http://www.pp.rhul.ac.uk/bdsim/manual/index.html BDSIM Documentation]&lt;br /&gt;
** [https://bitbucket.org/jairhul/bdsim BDSIM Bitbucket Page]&lt;br /&gt;
** [http://www.pp.rhul.ac.uk/bdsim/manual/installation.html Official Installation Guide]&lt;br /&gt;
&lt;br /&gt;
This is a tutorial about installing and using BDSIM. BDSIM is installed on the HEP Linux cluster at UCL. You will need an account on that cluster to be able to use this software, run example tutorials and create your own simulations. &lt;br /&gt;
&lt;br /&gt;
== Running BDSIM Simulations ==&lt;br /&gt;
&lt;br /&gt;
In order to run BDSIM simulations, you will either need to download and install the software yourself or make use of the existing installation on the UCL HEP Linux cluster.&lt;br /&gt;
&lt;br /&gt;
In order to use the UCL HEP Linux cluster, you will need a HEP account: please contact Dr. Simon Jolly for more details. &lt;br /&gt;
&lt;br /&gt;
=== Running on the UCL HEP Linux Cluster ===&lt;br /&gt;
&lt;br /&gt;
In order to run &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; simulations on the UCL HEP Cluster, you must first source the development version of the PBT environment from a system within the cluster that is running either CentOS7 or Scientific Linux V6. This can be done using the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ source /unix/pbt/software/scripts/pbt.sh -vd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; the &#039;-d&#039; flag is essential as this sources the script that links the latest development software available on the PBT section of the cluster. &lt;br /&gt;
&lt;br /&gt;
Now your system is ready to use &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;. To check that it is working correctly, test the built-in help function: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should produce an output explaining all the possible options that can be used within &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Required Software ==&lt;br /&gt;
&lt;br /&gt;
BDSIM requires the following software to be installed:&lt;br /&gt;
&lt;br /&gt;
* Recent compiler with full C++11 support - proven compiler versions are GCC v4.9 or higher, or Clang 6 or higher.&lt;br /&gt;
* CMake v2.8.12 or higher&lt;br /&gt;
* CLHEP v2.1.3.1 or higher&lt;br /&gt;
* ROOT v6.x or higher&lt;br /&gt;
* Geant4 v4.10 or higher&lt;br /&gt;
* Flex v2.5.37 or higher&lt;br /&gt;
* Bison v2.3 or higher&lt;br /&gt;
&lt;br /&gt;
These are all installed on the UCL HEP cluster.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
&lt;br /&gt;
; Website: https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim&lt;br /&gt;
&lt;br /&gt;
; Latest Version: 0.9.9.2 (19th October 2017)&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
The installation process follows the general process described on the [[Software/Geant4/UCL HEP Cluster|UCL HEP Linux Cluster]] page.  &lt;br /&gt;
The basic method used is as follows:&lt;br /&gt;
&lt;br /&gt;
# Check that all the prerequisites for building &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; are installed (see above);&lt;br /&gt;
# Download the latest version of the source code;&lt;br /&gt;
# Create a build folder;&lt;br /&gt;
# Configure, build and install &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; from within the build folder.&lt;br /&gt;
&lt;br /&gt;
=== Download BDSIM from its central repository ===&lt;br /&gt;
&lt;br /&gt;
The BDSIM source code can be downloaded from its git repository using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; $ git clone --recursive &amp;lt;nowiki&amp;gt;https://bitbucket.org/jairhul/bdsim&amp;lt;/nowiki&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This creates a &amp;lt;code&amp;gt;/bdsim&amp;lt;/code&amp;gt; folder within your current folder. This folder contains all the code, examples, documentation and associated Python packages.&lt;br /&gt;
&lt;br /&gt;
=== Configure, build and install &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When installing &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;, all the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment variables must be available. This can be tested using the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; $ echo $G4 &amp;lt;tab&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment variables are available, you should see an output similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
$G4ABLADATA          $G4NEUTRONHPDATA      $G4REALSURFACEDATA &lt;br /&gt;
$G4ENSDFSTATEDATA    $G4NEUTRONXSDATA      $G4SAIDXSDATA &lt;br /&gt;
$G4LEDATA            $G4PIIDATA            $G4SHARE &lt;br /&gt;
$G4LEVELGAMMADATA    $G4RADIOACTIVEDATA    $G4VERSION &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This output corresponds to using the UCL PBT environment, but it will be dependent on the installed &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; modules. If this does not return a list of environment variables, make sure you have correctly sourced the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment script and updated all relevant path variables.&lt;br /&gt;
&lt;br /&gt;
Once the source code has been downloaded, a build directory should be created alongside the &amp;lt;code&amp;gt;src&amp;lt;/code&amp;gt; to hold the compiled &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; files before they are moved to their final installation location.&lt;br /&gt;
&lt;br /&gt;
On the UCL HEP Linux Cluster, the build directory should be created in &amp;lt;code&amp;gt;/unix/pbt/software/build&amp;lt;/code&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /unix/pbt/software/build&lt;br /&gt;
$ mkdir bdsim&lt;br /&gt;
$ cd bdsim&lt;br /&gt;
$ mkdir bdsim-0.9.9.2-build&lt;br /&gt;
$ cd bdsim-0.9.9.2-build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike other software installed on the UCL HEP Linux Cluster, there are a number of ways to configure the software before building. Using the &amp;lt;code&amp;gt;ccmake&amp;lt;/code&amp;gt; command, each configuration option can be set interactively:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cmake ../../../src/bdsim/bdsim-bitbucket/&lt;br /&gt;
&lt;br /&gt;
$ ccmake .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CMake opens an interactive configuration program. Set the options as required for your system e.g. on the UCL HEP Cluster:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CMAKE_INSTALL_PREFIX     /unix/pbt/software/dev/bdsim-0.9.9.2/&lt;br /&gt;
USE_AWAKE                ON&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;CMAKE_INSTALL_PREFIX=/unix/pbt/software/dev/bdsim-0.9.9.2&amp;lt;/code&amp;gt; flag specifies that the resulting &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; should be installed in the directory &amp;lt;code&amp;gt;/unix/pbt/software/dev/bdsim-0.9.9.2&amp;lt;/code&amp;gt; after compilation: this should be changed to suit the particular installation in question.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;c&#039;&#039; to configure.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;g&#039;&#039; to generate and exit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; can then be compiled and installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ make&lt;br /&gt;
$ make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Multiple examples are provided with the source code and can be found in the original build folder. A complete list of examples and tutorials for running them can be found at http://www.pp.rhul.ac.uk/bdsim/manual/examples/examples.html&lt;br /&gt;
&lt;br /&gt;
Here, the simpleMachine example will be demonstrated.&lt;br /&gt;
&lt;br /&gt;
First, navigate to the examples within build directory and find simpleMachine:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /unix/pbt/software/build/bdsim/bdsim-0.92-dev/bdsim-build-updated/examples&lt;br /&gt;
$ cd simpleMachine&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the simulation via the GUI use the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=sm.gmad&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An interface should load up and display the simpleMachine setup. It has a few drift beam pipes with a quadrupole, collimator and sector bend dipole magnet. To run the simulation once with any output exported to a file called &amp;lt;code&amp;gt;output.root&amp;lt;/code&amp;gt;, use the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=sm.gmad --outfile=output&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From within the GUI command line, type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/run/beamOn 1&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will execute a single run of the simulation with the output data exported to &amp;lt;code&amp;gt;output.root&amp;lt;/code&amp;gt;. This can then be analysed from within ROOT by following the tutorial at http://www.pp.rhul.ac.uk/bdsim/manual/output_analysis.html.&lt;br /&gt;
&lt;br /&gt;
To run this simulation in Batch mode, the following command can be used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=sm.gmad --outfile=output --batch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Batch mode has no interactive interface, but as a consequence is much faster and exits the program once it has finished. For simulations with large numbers of particles within the beam, this is the preferred method of use.&lt;br /&gt;
&lt;br /&gt;
== Basic AWAKE Spectrometer Simulation ==&lt;br /&gt;
&lt;br /&gt;
A simple model of the AWAKE spectrometer is available at &amp;lt;code&amp;gt;/unix/pdpwa/AWAKE_spectrometer/spectrometer&amp;lt;/code&amp;gt;. This model (&amp;lt;code&amp;gt;spectrometer.gmad&amp;lt;/code&amp;gt;) describes the first part of the spectrometer, downstream of the plasma cell, and includes the quadrupole magnets and drift sections up until the dipole magnet. Also included in this folder are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;options.gmad&amp;lt;/code&amp;gt; - includes definitions of constants used within the spectrometer model.&lt;br /&gt;
* &amp;lt;code&amp;gt;analysisConfig.txt&amp;lt;/code&amp;gt; - a simple &amp;lt;code&amp;gt;rebdsim&amp;lt;/code&amp;gt; script that is used to produce histograms describing the position and momentum distributions at different points along the beam line. More information can be found at http://www.pp.rhul.ac.uk/bdsim/manual/output_analysis.html .&lt;br /&gt;
* &amp;lt;code&amp;gt;plot_xy.C&amp;lt;/code&amp;gt; - a ROOT macro that plots histograms describing the position and momentum distributions at different points along the beam line.&lt;br /&gt;
*&amp;lt;code&amp;gt;vis.mac&amp;lt;/code&amp;gt; - settings for the interactive BDSIM GUI.&lt;br /&gt;
*&amp;lt;code&amp;gt;README&amp;lt;/code&amp;gt; - instructions on running the simulation.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
&lt;br /&gt;
First source the BDSIM environment as described [[#Running on the UCL HEP Linux Cluster| above]]. To run the simulation using the default supplied electron beam (E = 1.3+/-0.4 GeV), use the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=spectrometer.gmad --batch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output is then stored in a file called &amp;lt;code&amp;gt;output_event.root&amp;lt;/code&amp;gt;. There are two supplied scripts for analysis of this output: &amp;lt;code&amp;gt;analysisConfig.txt&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;plot_xy.C&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
==== REBDSIM ====&lt;br /&gt;
&lt;br /&gt;
The first analysis script uses &amp;lt;code&amp;gt;rebdsim&amp;lt;/code&amp;gt;, a set of analysis codes that are compiled into a library that is supplied with BDSIM. It can be used via:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rebdsim analysisConfig.txt output_event.root analysis.root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the third option, &amp;lt;code&amp;gt;analysis.root&amp;lt;/code&amp;gt;, is the desired name of the output file. This can then be opened in ROOT:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ root analysis.root&lt;br /&gt;
root &amp;gt; TBrowser a;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second command opens a &amp;lt;code&amp;gt;TBrowser&amp;lt;/code&amp;gt; session. &amp;lt;code&amp;gt;TBrowser&amp;lt;/code&amp;gt; is an interactive GUI provided by ROOT that can be used to visualise data. The histograms produced by the &amp;lt;code&amp;gt;rebdsim&amp;lt;/code&amp;gt; analysis can be found under &amp;lt;code&amp;gt;EventHistograms;1&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
==== ROOT Macro ====&lt;br /&gt;
&lt;br /&gt;
The second analysis script provided is a ROOT Macro that automatically plots the position and momentum distributions at different points within the beam line in two separate canvasses. It allows easy visualisation of the evolution of the beam. It can be used via:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ root&lt;br /&gt;
root &amp;gt; .x plot_xy.C&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should look similar to the following images:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Evolution:&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:position.png | 900px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Momentum Evolution:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:momentum.png | 900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--== References ==--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{cite web |url=https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim |title=BDSIM - Accelerator Beamline Simulation Tool |last=Nevay |first=Laurence |date=30 August 2017 |website=Royal Holloway Physics TWiki |access-date=17 October 2017}}--&amp;gt;&lt;/div&gt;</summary>
		<author><name>JamesChappell</name></author>
	</entry>
	<entry>
		<id>https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/Geant4/UCL_HEP_Cluster&amp;diff=1382</id>
		<title>Software/Geant4/UCL HEP Cluster</title>
		<link rel="alternate" type="text/html" href="https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/Geant4/UCL_HEP_Cluster&amp;diff=1382"/>
		<updated>2018-03-07T11:00:06Z</updated>

		<summary type="html">&lt;p&gt;JamesChappell: /* Software Matrix */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
The UCL HEP Linux Cluster consists of a range of machines running Scientific Linux (CERN) 5 and Scientific Linux 6.  &lt;br /&gt;
This cluster provides a pre-compiled installation of Geant4 along with an environment for compiling code, running examples and viewing results.&lt;br /&gt;
&lt;br /&gt;
Although there are over 100 individual machines that can be used &amp;amp;mdash; most of which are the individual Linux desktop PCs within the HEP group running SL6 &amp;amp;mdash; access from outside the HEP group subnet is only possible through the central Linux server, &amp;lt;code&amp;gt;plus1&amp;lt;/code&amp;gt;, via ssh:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ssh -Y username@plus1.hep.ucl.ac.uk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
It is then possible to connect to individual Linux desktops, again by ssh.  &lt;br /&gt;
In order to do so, you will need to know the number of the PC you are connecting to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ ssh -Y username@pc1XX.hep.ucl.ac.uk&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
...where &amp;lt;code&amp;gt;1XX&amp;lt;/code&amp;gt; is the number of the PC you wish to connect to.  &lt;br /&gt;
&lt;br /&gt;
In order to access these machines, you will need to obtain an account from the UCL HEP Group Computing Support.  &lt;br /&gt;
Please contact Dr. Simon Jolly for instructions on obtaining an account.&lt;br /&gt;
&lt;br /&gt;
== Folder structure ==&lt;br /&gt;
&lt;br /&gt;
=== Disk ===&lt;br /&gt;
&lt;br /&gt;
There is a separate (large) disk for PBT work mounted on the Linux system at &amp;lt;code&amp;gt;/unix/pbt&amp;lt;/code&amp;gt;.  &lt;br /&gt;
When running simulations, you should create a subdirectory with your &amp;lt;code&amp;gt;username&amp;lt;/code&amp;gt; at &amp;lt;code&amp;gt;/unix/pbt/username&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
All software is enclosed in a folder at &amp;lt;code&amp;gt;/unix/pbt/software&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Source code ===&lt;br /&gt;
&lt;br /&gt;
Source code for building and installing software packages is kept in a separate folder at &amp;lt;code&amp;gt;/unix/pbt/software/src&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Environments ==&lt;br /&gt;
&lt;br /&gt;
Two separate environments are provide for PBT simulations: the &#039;&#039;&#039;Production&#039;&#039;&#039; environment for general use and the &#039;&#039;&#039;Development&#039;&#039;&#039; environment for testing changes or updates to the code.  &lt;br /&gt;
The &#039;&#039;&#039;Production&#039;&#039;&#039; environment is further subdivided depending on whether the machine you are logged in to is running SLC5 or SL6: the SLC5 legacy environment features an older version of Geant4 and related software that will not be updated.&lt;br /&gt;
&lt;br /&gt;
* The recommended &#039;&#039;&#039;Production&#039;&#039;&#039; environment for SL6 is stored in &amp;lt;code&amp;gt;/unix/pbt/software/prod-sl6&amp;lt;/code&amp;gt;;&lt;br /&gt;
* The &#039;&#039;&#039;Development&#039;&#039;&#039; environment for SL6 is stored in &amp;lt;code&amp;gt;/unix/pbt/software/dev&amp;lt;/code&amp;gt;: code is then subdivided into directories by application name;&lt;br /&gt;
* The legacy &#039;&#039;&#039;Production&#039;&#039;&#039; environment for SLC5 is stored in &amp;lt;code&amp;gt;/unix/pbt/software/prod&amp;lt;/code&amp;gt;: this is only accessible for users running on SLC5 machines.&lt;br /&gt;
&lt;br /&gt;
It is possible to select whether the &#039;&#039;&#039;Development&#039;&#039;&#039; or &#039;&#039;&#039;Production&#039;&#039;&#039; environment is launched under SL6 by adding the appropriate flags when calling the setup script (see [[#Scripts]] below).&lt;br /&gt;
&lt;br /&gt;
== Scripts ==&lt;br /&gt;
&lt;br /&gt;
Access to the PBT &#039;&#039;&#039;Production&#039;&#039;&#039; and &#039;&#039;&#039;Development&#039;&#039;&#039; environments is implemented by a single script, &amp;lt;code&amp;gt;pbt.sh&amp;lt;/code&amp;gt;.  &lt;br /&gt;
This calls a number of other utility scripts that set up the required PBT environment: these are all stored in &amp;lt;code&amp;gt;/unix/pbt/software/scripts/&amp;lt;/code&amp;gt;.  &lt;br /&gt;
The &amp;lt;code&amp;gt;pbt.sh&amp;lt;/code&amp;gt; script is called in the following way:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/unix/pbt/software/scripts/pbt.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will auto-detect whether you are running on a newer SL6 machine or a legacy SLC5 machine and set up the environment accordingly.  &lt;br /&gt;
&lt;br /&gt;
The steps carried out during setup are as follows:&lt;br /&gt;
# Check the environment and whether the user wishes to run in verbose or development mode (see below);&lt;br /&gt;
# Launch a new &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; shell with the appropriate Scientific Linux Developer Toolset (see below);&lt;br /&gt;
# Call the appropriate &amp;lt;code&amp;gt;bashrc&amp;lt;/code&amp;gt; script to begin environment setup; this in turn runs the following actions:&lt;br /&gt;
## Run the user&#039;s own &amp;lt;code&amp;gt;.bashrc&amp;lt;/code&amp;gt;;&lt;br /&gt;
## Set the environment name; &lt;br /&gt;
## Greeting with information for users;&lt;br /&gt;
## Define exit function with exit message when user exits environment;&lt;br /&gt;
## Call shell script to set up environment.&lt;br /&gt;
# The specific shell script then carries out the following actions:&lt;br /&gt;
## Set specific environment variables with locations of compiler, Geant4 etc.&lt;br /&gt;
## Add locations to path variables and remove duplicates (calls &amp;lt;code&amp;gt;setpaths.sh&amp;lt;/code&amp;gt; script);&lt;br /&gt;
## Define colours for scripts, prompt, etc (calls &amp;lt;code&amp;gt;definecolours.sh&amp;lt;code&amp;gt; script);&lt;br /&gt;
## Check versions of installed software and display results (calls &amp;lt;code&amp;gt;checkversions.sh&amp;lt;/code&amp;gt; script);&lt;br /&gt;
## Modify prompt to show environment name;&lt;br /&gt;
## Run &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; setup script and set additional settings;&lt;br /&gt;
&lt;br /&gt;
Adding the &amp;lt;code&amp;gt;-v&amp;lt;/code&amp;gt; flag enables the scripts to run in verbose mode, which displays the full paths when checking the versions of the installed software.  &lt;br /&gt;
Adding the &amp;lt;code&amp;gt;-d&amp;lt;/code&amp;gt; flag enables the &#039;&#039;&#039;Development&#039;&#039;&#039; environment to allow new software to be built without changing the &#039;&#039;&#039;Production&#039;&#039;&#039; setup needed by most users: this is only available on SL6 machines.&lt;br /&gt;
&lt;br /&gt;
When &amp;lt;code&amp;gt;pbt.sh&amp;lt;/code&amp;gt; is called, its first action after selecting the right environment is to launch a new &amp;lt;code&amp;gt;bash&amp;lt;/code&amp;gt; shell that provides a degree of isolation for setting up the desired PBT environment.  &lt;br /&gt;
Once the user has finished with the PBT environment, exiting the shell will deposit the user back into their previous environment.  &lt;br /&gt;
Launching a new shell also provides access to the correct Scientific Linux Developer Toolset: on SL6 this is &amp;lt;code&amp;gt;devtoolset-3&amp;lt;/code&amp;gt;, whereas SLC5 uses the older &amp;lt;code&amp;gt;devtoolset-2&amp;lt;/code&amp;gt;.  &lt;br /&gt;
In either case, the Developer Toolset is a Linux software collection providing various tools for developers, including more up-to-date versions of software required by &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt;, most notably including a newer version of &amp;lt;code&amp;gt;GCC&amp;lt;/code&amp;gt; (the &#039;&#039;&#039;GNU Compiler Collection&#039;&#039;&#039;).&lt;br /&gt;
&lt;br /&gt;
The following sub-directories are present within the &amp;lt;code&amp;gt;scripts&amp;lt;/code&amp;gt; directory:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;dev&amp;lt;/code&amp;gt; &amp;amp;mdash; contains scripts for setting up &#039;&#039;&#039;Development&#039;&#039;&#039; environment;&lt;br /&gt;
* &amp;lt;code&amp;gt;prod-sl6&amp;lt;/code&amp;gt; &amp;amp;mdash; contains scripts for setting up &#039;&#039;&#039;Production&#039;&#039;&#039; environment on SL6 machines;&lt;br /&gt;
* &amp;lt;code&amp;gt;prod-slc5&amp;lt;/code&amp;gt; &amp;amp;mdash; contains scripts for setting up &#039;&#039;&#039;Production&#039;&#039;&#039; environment on SLC5 machines;&lt;br /&gt;
* &amp;lt;code&amp;gt;shared&amp;lt;/code&amp;gt; &amp;amp;mdash; shared scripts used in the setup of all environments (see below);&lt;br /&gt;
* &amp;lt;code&amp;gt;old&amp;lt;/code&amp;gt; &amp;amp;mdash; legacy scripts used in previous environment setup on SLC5.&lt;br /&gt;
&lt;br /&gt;
The first 3 directories contain scripts that are almost identical, with small modifications to suit each environment.  &lt;br /&gt;
Along with the shared scripts, these are described below: substitute &amp;lt;code&amp;gt;xxx&amp;lt;/code&amp;gt; for the particular environment.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;/unix/pbt/software/scripts/xxx/pbt-xxx.sh&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
The 3 &amp;lt;code&amp;gt;pbt-xxx.sh&amp;lt;/code&amp;gt; scripts carry out the majority of the customisation for the particular environment.  &lt;br /&gt;
In particular, the following tasks are carried out:&lt;br /&gt;
&lt;br /&gt;
# Add locations to path variables;&lt;br /&gt;
# Define colours for scripts, prompt, etc.;&lt;br /&gt;
# Add locations to path variables and remove duplicates (calls &amp;lt;code&amp;gt;setpaths.sh&amp;lt;/code&amp;gt; script);&lt;br /&gt;
# Check versions of installed software and display results (calls &amp;lt;code&amp;gt;checkversions.sh&amp;lt;/code&amp;gt; script);&lt;br /&gt;
# Run Geant4 setup script;&lt;br /&gt;
&lt;br /&gt;
These scripts in turn make use of the following shared scripts.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;/unix/pbt/software/scripts/shared/definecolours.sh&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
This script defines various variables to represent colours for printing to the terminal and to file.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;/unix/pbt/software/scripts/shared/setpaths.sh&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
This script sets the various &amp;lt;code&amp;gt;PATH&amp;lt;/code&amp;gt; environment variables required for the specific environment and removes any duplicates.&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;/unix/pbt/software/scripts/shared/checkversions.sh&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
This script checks the versions (and optionally the paths/locations) of important software packages used in the PBT environment.  &lt;br /&gt;
&lt;br /&gt;
== Installations ==&lt;br /&gt;
&lt;br /&gt;
For each software package, the installation information is listed below.&lt;br /&gt;
The basic method used is as follows:&lt;br /&gt;
# Download the source tarball latest version to the &amp;lt;code&amp;gt;/unix/pbt/software/src&amp;lt;/code&amp;gt; folder.&lt;br /&gt;
# Extract the tarball to a subfolder within the &amp;lt;code&amp;gt;src&amp;lt;/code&amp;gt; folder using &amp;lt;code&amp;gt;tar -xvzf &amp;amp;lt;filename&amp;amp;gt;.tar.gz&amp;lt;/code&amp;gt;.&lt;br /&gt;
# Create a build folder at &amp;lt;code&amp;gt;/unix/pbt/software/build&amp;lt;/code&amp;gt; and set the working directory here.&lt;br /&gt;
# Run the specific configure, build and install steps for the package.&lt;br /&gt;
# Remove the build folder and extracted source folder, but keep the source tarball.&lt;br /&gt;
&lt;br /&gt;
The configure, build and install steps may be different for each package, and this is described per package below.&lt;br /&gt;
However, in most cases the steps follow the general steps below:&lt;br /&gt;
&lt;br /&gt;
# Change working directory to the build folder.&lt;br /&gt;
# Run the configuration script from the source folder to set the build options, including the customised installation prefix.&lt;br /&gt;
# Build the code.&lt;br /&gt;
# Install the code to the sandbox folder.&lt;br /&gt;
# (Optional) Move the compiled code to the desired location (only possible if the installation prefix cannot be specified).&lt;br /&gt;
&lt;br /&gt;
== Software Matrix ==&lt;br /&gt;
&lt;br /&gt;
The following software is installed on the HEP Linux cluster. &lt;br /&gt;
&lt;br /&gt;
CentOS7 Machines:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Software&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Version&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Source code&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Installed in dev?&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Installed by&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Working?&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Checked by&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Installed in prod?&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Installed by&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Working?&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Checked by&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Qt&#039;&#039;&#039;&lt;br /&gt;
|5.9.3&lt;br /&gt;
|src/geant4-prerequisites/qt/qtbase-github&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;cmake&#039;&#039;&#039;&lt;br /&gt;
|3.9.4&lt;br /&gt;
|src/geant4-prerequisites/cmake/cmake-gitlab&lt;br /&gt;
|Yes&lt;br /&gt;
|Bootstrap (James)&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes &lt;br /&gt;
|Bootstrap (James)&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;xerces-c&#039;&#039;&#039;&lt;br /&gt;
|3.2.0&lt;br /&gt;
|src/geant4-prerequisites/xerces-c/xerces-c-github&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;CLHEP&#039;&#039;&#039;&lt;br /&gt;
|2.3.4.5&lt;br /&gt;
|src/geant4-prerequisites/clhep/clhep-github&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;simage&#039;&#039;&#039;&lt;br /&gt;
|1.7.1a&lt;br /&gt;
|src/geant4-prerequisites/coin3d_mercurial/simage&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Coin3d&#039;&#039;&#039;&lt;br /&gt;
|4.0.0a&lt;br /&gt;
|src/geant4-prerequisites/coin3d_mercurial/coin-cmake&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;SoQt&#039;&#039;&#039;&lt;br /&gt;
|1.6.0a&lt;br /&gt;
|src/geant4-prerequisites/coin3d_mercurial/soqt&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes - missing config file so says &amp;quot;not found&amp;quot;&lt;br /&gt;
|James&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;SoXt&#039;&#039;&#039;&lt;br /&gt;
|1.3.1&lt;br /&gt;
|src/geant4-prerequisites/coin3d_mercurial/soxt&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Geant4&#039;&#039;&#039;&lt;br /&gt;
|4.10.03.p02&lt;br /&gt;
|src/geant4/geant4-github&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;DAWN&#039;&#039;&#039;&lt;br /&gt;
|3.90b&lt;br /&gt;
|src/geant4-addons/dawn&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|No&lt;br /&gt;
|James&lt;br /&gt;
|Yes (can copy from dev)&lt;br /&gt;
|James&lt;br /&gt;
|No&lt;br /&gt;
|Roisin&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;HepRApp&#039;&#039;&#039;&lt;br /&gt;
|3.15.4&lt;br /&gt;
|src/geant4-addons/heprapp&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon (Standalone .jar file)&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon (Standalone .jar file)&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Java Analysis Studio&#039;&#039;&#039;&lt;br /&gt;
|3.1.5&lt;br /&gt;
|src/geant4-addons/jas&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon (Standalone executables)&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon (Standalone executables)&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;gMocren&#039;&#039;&#039;&lt;br /&gt;
|4&lt;br /&gt;
|src/geant4-addons/gmocren&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon&lt;br /&gt;
|Unknown&lt;br /&gt;
|Simon (Standalone executables)&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon&lt;br /&gt;
|Unknown&lt;br /&gt;
|Simon (Standalone executables)&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;BDSIM&#039;&#039;&#039;&lt;br /&gt;
|0.9.9.3&lt;br /&gt;
|src/bdsim/bdsim-edited&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|No&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
SL6 Machines:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|&#039;&#039;&#039;Software&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Version&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Source code&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Installed in dev?&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Installed by&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Working?&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Checked by&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Installed in prod?&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Installed by&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Working?&#039;&#039;&#039;&lt;br /&gt;
|&#039;&#039;&#039;Checked by&#039;&#039;&#039;&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Qt&#039;&#039;&#039;&lt;br /&gt;
|5.5.1&lt;br /&gt;
|src/geant4-prerequisites/qt/qt-5.5.1&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon&lt;br /&gt;
|Yes&lt;br /&gt;
|Lawrence&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon&lt;br /&gt;
|Yes&lt;br /&gt;
|Lawrence&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;cmake&#039;&#039;&#039;&lt;br /&gt;
|3.5.2&lt;br /&gt;
|src/geant4-prerequisites/cmake&lt;br /&gt;
|Yes&lt;br /&gt;
|Static binaries (Simon)&lt;br /&gt;
|Yes&lt;br /&gt;
|Lawrence&lt;br /&gt;
|Yes &lt;br /&gt;
|Static binaries (Simon)&lt;br /&gt;
|Yes&lt;br /&gt;
|Lawrence&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;xerces-c&#039;&#039;&#039;&lt;br /&gt;
|3.1.3&lt;br /&gt;
|src/geant4-prerequisites/xerces-c&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon&lt;br /&gt;
|Yes&lt;br /&gt;
|Lawrence&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon&lt;br /&gt;
|Yes&lt;br /&gt;
|Lawrence&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;CLHEP&#039;&#039;&#039;&lt;br /&gt;
|2.3.1.1&lt;br /&gt;
|src/geant4-prerequisites/clhep&lt;br /&gt;
|Yes&lt;br /&gt;
|Lawrence&lt;br /&gt;
|Yes&lt;br /&gt;
|Lawrence&lt;br /&gt;
|Yes&lt;br /&gt;
|Lawrence&lt;br /&gt;
|Yes&lt;br /&gt;
|Lawrence&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;simage&#039;&#039;&#039;&lt;br /&gt;
|1.7.0&lt;br /&gt;
|src/geant4-prerequisites/coin3d&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon&lt;br /&gt;
|Yes&lt;br /&gt;
|Lawrence&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon&lt;br /&gt;
|Yes&lt;br /&gt;
|Lawrence&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Coin3d&#039;&#039;&#039;&lt;br /&gt;
|3.1.3&lt;br /&gt;
|src/geant4-prerequisites/coin3d&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon&lt;br /&gt;
|Yes&lt;br /&gt;
|Lawrence&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon&lt;br /&gt;
|Yes&lt;br /&gt;
|Lawrence&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;SoQt&#039;&#039;&#039;&lt;br /&gt;
|1.5.0&lt;br /&gt;
|src/geant4-prerequisites/coin3d&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon&lt;br /&gt;
|Yes&lt;br /&gt;
|Lawrence&lt;br /&gt;
|No &lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;SoXt&#039;&#039;&#039;&lt;br /&gt;
|1.3.0&lt;br /&gt;
|src/geant4-prerequisites/coin3d&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon&lt;br /&gt;
|Yes&lt;br /&gt;
|Lawrence&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon&lt;br /&gt;
|Yes&lt;br /&gt;
|Lawrence&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Geant4&#039;&#039;&#039;&lt;br /&gt;
|4.10.02.p01&lt;br /&gt;
|src/geant4/geant4.10.02.p01-source&lt;br /&gt;
|Yes&lt;br /&gt;
|Lawrence&lt;br /&gt;
|Yes&lt;br /&gt;
|Lawrence&lt;br /&gt;
|Yes&lt;br /&gt;
|Lawrence&lt;br /&gt;
|Yes&lt;br /&gt;
|Lawrence&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;DAWN&#039;&#039;&#039;&lt;br /&gt;
|3.90b&lt;br /&gt;
|src/geant4-addons/dawn&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon&lt;br /&gt;
|Yes (can copy from dev)&lt;br /&gt;
|Simon&lt;br /&gt;
|Yes&lt;br /&gt;
|Roisin&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;HepRApp&#039;&#039;&#039;&lt;br /&gt;
|3.15.4&lt;br /&gt;
|src/geant4-addons/heprapp&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon (Standalone .jar file)&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon (Standalone .jar file)&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;Java Analysis Studio&#039;&#039;&#039;&lt;br /&gt;
|3.1.5&lt;br /&gt;
|src/geant4-addons/jas&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon (Standalone executables)&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon (Standalone executables)&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;gMocren&#039;&#039;&#039;&lt;br /&gt;
|4&lt;br /&gt;
|src/geant4-addons/gmocren&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon&lt;br /&gt;
|Unknown&lt;br /&gt;
|Simon (Standalone executables)&lt;br /&gt;
|Yes&lt;br /&gt;
|Simon&lt;br /&gt;
|Unknown&lt;br /&gt;
|Simon (Standalone executables)&lt;br /&gt;
|-&lt;br /&gt;
|&#039;&#039;&#039;BDSIM&#039;&#039;&#039;&lt;br /&gt;
|0.9.9.3&lt;br /&gt;
|src/bdsim/bdsim-edited&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|Yes&lt;br /&gt;
|James&lt;br /&gt;
|No&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>JamesChappell</name></author>
	</entry>
	<entry>
		<id>https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/BDSIM&amp;diff=1272</id>
		<title>Software/BDSIM</title>
		<link rel="alternate" type="text/html" href="https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/BDSIM&amp;diff=1272"/>
		<updated>2018-01-31T16:10:54Z</updated>

		<summary type="html">&lt;p&gt;JamesChappell: /* Running on the UCL HEP Linux Cluster */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== BDSIM ==&lt;br /&gt;
&lt;br /&gt;
BDSIM (Beam Delivery Simulation) is a program that uses a suite of high energy physics software including Geant4, CLHEP &amp;amp; ROOT to build a 3D model of an accelerator and simulate the passage of particles through both the vacuum and the material of the accelerator itself seamlessly.&lt;br /&gt;
&lt;br /&gt;
*Useful Links:&lt;br /&gt;
** [https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim RHUL BDSIM Webpage]&lt;br /&gt;
** [http://www.pp.rhul.ac.uk/bdsim/manual/index.html BDSIM Documentation]&lt;br /&gt;
** [https://bitbucket.org/jairhul/bdsim BDSIM Bitbucket Page]&lt;br /&gt;
** [http://www.pp.rhul.ac.uk/bdsim/manual/installation.html Official Installation Guide]&lt;br /&gt;
&lt;br /&gt;
This is a tutorial about installing and using BDSIM. BDSIM is installed on the HEP Linux cluster at UCL. You will need an account on that cluster to be able to use this software, run example tutorials and create your own simulations. &lt;br /&gt;
&lt;br /&gt;
== Running BDSIM Simulations ==&lt;br /&gt;
&lt;br /&gt;
In order to run BDSIM simulations, you will either need to download and install the software yourself or make use of the existing installation on the UCL HEP Linux cluster.&lt;br /&gt;
&lt;br /&gt;
In order to use the UCL HEP Linux cluster, you will need a HEP account: please contact Dr. Simon Jolly for more details. &lt;br /&gt;
&lt;br /&gt;
=== Running on the UCL HEP Linux Cluster ===&lt;br /&gt;
&lt;br /&gt;
In order to run &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; simulations on the UCL HEP Cluster, you must first source the development version of the PBT environment from a system within the cluster that is running either CentOS7 or Scientific Linux V6. This can be done using the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ source /unix/pbt/software/scripts/centos7_pbt.sh -vd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; the &#039;-d&#039; flag is essential as this sources the script that links the latest development software available on the PBT section of the cluster. &lt;br /&gt;
&lt;br /&gt;
Now your system is ready to use &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;. To check that it is working correctly, test the built-in help function: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should produce an output explaining all the possible options that can be used within &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Required Software ==&lt;br /&gt;
&lt;br /&gt;
BDSIM requires the following software to be installed:&lt;br /&gt;
&lt;br /&gt;
* Recent compiler with full C++11 support - proven compiler versions are GCC v4.9 or higher, or Clang 6 or higher.&lt;br /&gt;
* CMake v2.8.12 or higher&lt;br /&gt;
* CLHEP v2.1.3.1 or higher&lt;br /&gt;
* ROOT v6.x or higher&lt;br /&gt;
* Geant4 v4.10 or higher&lt;br /&gt;
* Flex v2.5.37 or higher&lt;br /&gt;
* Bison v2.3 or higher&lt;br /&gt;
&lt;br /&gt;
These are all installed on the UCL HEP cluster.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
&lt;br /&gt;
; Website: https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim&lt;br /&gt;
&lt;br /&gt;
; Latest Version: 0.9.9.2 (19th October 2017)&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
The installation process follows the general process described on the [[Software/Geant4/UCL HEP Cluster|UCL HEP Linux Cluster]] page.  &lt;br /&gt;
The basic method used is as follows:&lt;br /&gt;
&lt;br /&gt;
# Check that all the prerequisites for building &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; are installed (see above);&lt;br /&gt;
# Download the latest version of the source code;&lt;br /&gt;
# Create a build folder;&lt;br /&gt;
# Configure, build and install &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; from within the build folder.&lt;br /&gt;
&lt;br /&gt;
=== Download BDSIM from its central repository ===&lt;br /&gt;
&lt;br /&gt;
The BDSIM source code can be downloaded from its git repository using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; $ git clone --recursive &amp;lt;nowiki&amp;gt;https://bitbucket.org/jairhul/bdsim&amp;lt;/nowiki&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This creates a &amp;lt;code&amp;gt;/bdsim&amp;lt;/code&amp;gt; folder within your current folder. This folder contains all the code, examples, documentation and associated Python packages.&lt;br /&gt;
&lt;br /&gt;
=== Configure, build and install &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When installing &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;, all the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment variables must be available. This can be tested using the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; $ echo $G4 &amp;lt;tab&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment variables are available, you should see an output similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
$G4ABLADATA          $G4NEUTRONHPDATA      $G4REALSURFACEDATA &lt;br /&gt;
$G4ENSDFSTATEDATA    $G4NEUTRONXSDATA      $G4SAIDXSDATA &lt;br /&gt;
$G4LEDATA            $G4PIIDATA            $G4SHARE &lt;br /&gt;
$G4LEVELGAMMADATA    $G4RADIOACTIVEDATA    $G4VERSION &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This output corresponds to using the UCL PBT environment, but it will be dependent on the installed &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; modules. If this does not return a list of environment variables, make sure you have correctly sourced the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment script and updated all relevant path variables.&lt;br /&gt;
&lt;br /&gt;
Once the source code has been downloaded, a build directory should be created alongside the &amp;lt;code&amp;gt;src&amp;lt;/code&amp;gt; to hold the compiled &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; files before they are moved to their final installation location.&lt;br /&gt;
&lt;br /&gt;
On the UCL HEP Linux Cluster, the build directory should be created in &amp;lt;code&amp;gt;/unix/pbt/software/build&amp;lt;/code&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /unix/pbt/software/build&lt;br /&gt;
$ mkdir bdsim&lt;br /&gt;
$ cd bdsim&lt;br /&gt;
$ mkdir bdsim-0.9.9.2-build&lt;br /&gt;
$ cd bdsim-0.9.9.2-build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike other software installed on the UCL HEP Linux Cluster, there are a number of ways to configure the software before building. Using the &amp;lt;code&amp;gt;ccmake&amp;lt;/code&amp;gt; command, each configuration option can be set interactively:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cmake ../../../src/bdsim/bdsim-bitbucket/&lt;br /&gt;
&lt;br /&gt;
$ ccmake .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CMake opens an interactive configuration program. Set the options as required for your system e.g. on the UCL HEP Cluster:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CMAKE_INSTALL_PREFIX     /unix/pbt/software/dev/bdsim-0.9.9.2/&lt;br /&gt;
USE_AWAKE                ON&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;CMAKE_INSTALL_PREFIX=/unix/pbt/software/dev/bdsim-0.9.9.2&amp;lt;/code&amp;gt; flag specifies that the resulting &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; should be installed in the directory &amp;lt;code&amp;gt;/unix/pbt/software/dev/bdsim-0.9.9.2&amp;lt;/code&amp;gt; after compilation: this should be changed to suit the particular installation in question.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;c&#039;&#039; to configure.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;g&#039;&#039; to generate and exit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; can then be compiled and installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ make&lt;br /&gt;
$ make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Multiple examples are provided with the source code and can be found in the original build folder. A complete list of examples and tutorials for running them can be found at http://www.pp.rhul.ac.uk/bdsim/manual/examples/examples.html&lt;br /&gt;
&lt;br /&gt;
Here, the simpleMachine example will be demonstrated.&lt;br /&gt;
&lt;br /&gt;
First, navigate to the examples within build directory and find simpleMachine:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /unix/pbt/software/build/bdsim/bdsim-0.92-dev/bdsim-build-updated/examples&lt;br /&gt;
$ cd simpleMachine&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the simulation via the GUI use the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=sm.gmad&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An interface should load up and display the simpleMachine setup. It has a few drift beam pipes with a quadrupole, collimator and sector bend dipole magnet. To run the simulation once with any output exported to a file called &amp;lt;code&amp;gt;output.root&amp;lt;/code&amp;gt;, use the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=sm.gmad --outfile=output&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From within the GUI command line, type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/run/beamOn 1&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will execute a single run of the simulation with the output data exported to &amp;lt;code&amp;gt;output.root&amp;lt;/code&amp;gt;. This can then be analysed from within ROOT by following the tutorial at http://www.pp.rhul.ac.uk/bdsim/manual/output_analysis.html.&lt;br /&gt;
&lt;br /&gt;
To run this simulation in Batch mode, the following command can be used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=sm.gmad --outfile=output --batch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Batch mode has no interactive interface, but as a consequence is much faster and exits the program once it has finished. For simulations with large numbers of particles within the beam, this is the preferred method of use.&lt;br /&gt;
&lt;br /&gt;
== Basic AWAKE Spectrometer Simulation ==&lt;br /&gt;
&lt;br /&gt;
A simple model of the AWAKE spectrometer is available at &amp;lt;code&amp;gt;/unix/pdpwa/AWAKE_spectrometer/spectrometer&amp;lt;/code&amp;gt;. This model (&amp;lt;code&amp;gt;spectrometer.gmad&amp;lt;/code&amp;gt;) describes the first part of the spectrometer, downstream of the plasma cell, and includes the quadrupole magnets and drift sections up until the dipole magnet. Also included in this folder are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;options.gmad&amp;lt;/code&amp;gt; - includes definitions of constants used within the spectrometer model.&lt;br /&gt;
* &amp;lt;code&amp;gt;analysisConfig.txt&amp;lt;/code&amp;gt; - a simple &amp;lt;code&amp;gt;rebdsim&amp;lt;/code&amp;gt; script that is used to produce histograms describing the position and momentum distributions at different points along the beam line. More information can be found at http://www.pp.rhul.ac.uk/bdsim/manual/output_analysis.html .&lt;br /&gt;
* &amp;lt;code&amp;gt;plot_xy.C&amp;lt;/code&amp;gt; - a ROOT macro that plots histograms describing the position and momentum distributions at different points along the beam line.&lt;br /&gt;
*&amp;lt;code&amp;gt;vis.mac&amp;lt;/code&amp;gt; - settings for the interactive BDSIM GUI.&lt;br /&gt;
*&amp;lt;code&amp;gt;README&amp;lt;/code&amp;gt; - instructions on running the simulation.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
&lt;br /&gt;
First source the BDSIM environment as described [[#Running on the UCL HEP Linux Cluster| above]]. To run the simulation using the default supplied electron beam (E = 1.3+/-0.4 GeV), use the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=spectrometer.gmad --batch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output is then stored in a file called &amp;lt;code&amp;gt;output_event.root&amp;lt;/code&amp;gt;. There are two supplied scripts for analysis of this output: &amp;lt;code&amp;gt;analysisConfig.txt&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;plot_xy.C&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
==== REBDSIM ====&lt;br /&gt;
&lt;br /&gt;
The first analysis script uses &amp;lt;code&amp;gt;rebdsim&amp;lt;/code&amp;gt;, a set of analysis codes that are compiled into a library that is supplied with BDSIM. It can be used via:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rebdsim analysisConfig.txt output_event.root analysis.root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the third option, &amp;lt;code&amp;gt;analysis.root&amp;lt;/code&amp;gt;, is the desired name of the output file. This can then be opened in ROOT:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ root analysis.root&lt;br /&gt;
root &amp;gt; TBrowser a;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second command opens a &amp;lt;code&amp;gt;TBrowser&amp;lt;/code&amp;gt; session. &amp;lt;code&amp;gt;TBrowser&amp;lt;/code&amp;gt; is an interactive GUI provided by ROOT that can be used to visualise data. The histograms produced by the &amp;lt;code&amp;gt;rebdsim&amp;lt;/code&amp;gt; analysis can be found under &amp;lt;code&amp;gt;EventHistograms;1&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
==== ROOT Macro ====&lt;br /&gt;
&lt;br /&gt;
The second analysis script provided is a ROOT Macro that automatically plots the position and momentum distributions at different points within the beam line in two separate canvasses. It allows easy visualisation of the evolution of the beam. It can be used via:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ root&lt;br /&gt;
root &amp;gt; .x plot_xy.C&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should look similar to the following images:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Evolution:&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:position.png | 900px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Momentum Evolution:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:momentum.png | 900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--== References ==--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{cite web |url=https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim |title=BDSIM - Accelerator Beamline Simulation Tool |last=Nevay |first=Laurence |date=30 August 2017 |website=Royal Holloway Physics TWiki |access-date=17 October 2017}}--&amp;gt;&lt;/div&gt;</summary>
		<author><name>JamesChappell</name></author>
	</entry>
	<entry>
		<id>https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/BDSIM&amp;diff=1175</id>
		<title>Software/BDSIM</title>
		<link rel="alternate" type="text/html" href="https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/BDSIM&amp;diff=1175"/>
		<updated>2017-10-25T14:16:43Z</updated>

		<summary type="html">&lt;p&gt;JamesChappell: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== BDSIM ==&lt;br /&gt;
&lt;br /&gt;
BDSIM (Beam Delivery Simulation) is a program that uses a suite of high energy physics software including Geant4, CLHEP &amp;amp; ROOT to build a 3D model of an accelerator and simulate the passage of particles through both the vacuum and the material of the accelerator itself seamlessly.&lt;br /&gt;
&lt;br /&gt;
*Useful Links:&lt;br /&gt;
** [https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim RHUL BDSIM Webpage]&lt;br /&gt;
** [http://www.pp.rhul.ac.uk/bdsim/manual/index.html BDSIM Documentation]&lt;br /&gt;
** [https://bitbucket.org/jairhul/bdsim BDSIM Bitbucket Page]&lt;br /&gt;
** [http://www.pp.rhul.ac.uk/bdsim/manual/installation.html Official Installation Guide]&lt;br /&gt;
&lt;br /&gt;
This is a tutorial about installing and using BDSIM. BDSIM is installed on the HEP Linux cluster at UCL. You will need an account on that cluster to be able to use this software, run example tutorials and create your own simulations. &lt;br /&gt;
&lt;br /&gt;
== Running BDSIM Simulations ==&lt;br /&gt;
&lt;br /&gt;
In order to run BDSIM simulations, you will either need to download and install the software yourself or make use of the existing installation on the UCL HEP Linux cluster.&lt;br /&gt;
&lt;br /&gt;
In order to use the UCL HEP Linux cluster, you will need a HEP account: please contact Dr. Simon Jolly for more details. &lt;br /&gt;
&lt;br /&gt;
=== Running on the UCL HEP Linux Cluster ===&lt;br /&gt;
&lt;br /&gt;
In order to run &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; simulations on the UCL HEP Cluster, you must first source the development version of the PBT environment from a system within the cluster that is running Scientific Linux V6. This can be done using the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ source /unix/pbt/software/scripts/pbt.sh -vd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; the &#039;-d&#039; flag is essential as this sources the script that links the latest development software available on the PBT section of the cluster. &lt;br /&gt;
&lt;br /&gt;
Following this, a second script must be sourced in order to create the environment required to run &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ source /unix/pbt/software/scripts/bdsim_setup.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now your system is ready to use &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;. To check that it is working correctly, test the built-in help function: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should produce an output explaining all the possible options that can be used within &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Required Software ==&lt;br /&gt;
&lt;br /&gt;
BDSIM requires the following software to be installed:&lt;br /&gt;
&lt;br /&gt;
* Recent compiler with full C++11 support - proven compiler versions are GCC v4.9 or higher, or Clang 6 or higher.&lt;br /&gt;
* CMake v2.8.12 or higher&lt;br /&gt;
* CLHEP v2.1.3.1 or higher&lt;br /&gt;
* ROOT v6.x or higher&lt;br /&gt;
* Geant4 v4.10 or higher&lt;br /&gt;
* Flex v2.5.37 or higher&lt;br /&gt;
* Bison v2.3 or higher&lt;br /&gt;
&lt;br /&gt;
These are all installed on the UCL HEP cluster.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
&lt;br /&gt;
; Website: https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim&lt;br /&gt;
&lt;br /&gt;
; Latest Version: 0.9.9.2 (19th October 2017)&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
The installation process follows the general process described on the [[Software/Geant4/UCL HEP Cluster|UCL HEP Linux Cluster]] page.  &lt;br /&gt;
The basic method used is as follows:&lt;br /&gt;
&lt;br /&gt;
# Check that all the prerequisites for building &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; are installed (see above);&lt;br /&gt;
# Download the latest version of the source code;&lt;br /&gt;
# Create a build folder;&lt;br /&gt;
# Configure, build and install &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; from within the build folder.&lt;br /&gt;
&lt;br /&gt;
=== Download BDSIM from its central repository ===&lt;br /&gt;
&lt;br /&gt;
The BDSIM source code can be downloaded from its git repository using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; $ git clone --recursive &amp;lt;nowiki&amp;gt;https://bitbucket.org/jairhul/bdsim&amp;lt;/nowiki&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This creates a &amp;lt;code&amp;gt;/bdsim&amp;lt;/code&amp;gt; folder within your current folder. This folder contains all the code, examples, documentation and associated Python packages.&lt;br /&gt;
&lt;br /&gt;
=== Configure, build and install &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When installing &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;, all the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment variables must be available. This can be tested using the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; $ echo $G4 &amp;lt;tab&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment variables are available, you should see an output similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
$G4ABLADATA          $G4NEUTRONHPDATA      $G4REALSURFACEDATA &lt;br /&gt;
$G4ENSDFSTATEDATA    $G4NEUTRONXSDATA      $G4SAIDXSDATA &lt;br /&gt;
$G4LEDATA            $G4PIIDATA            $G4SHARE &lt;br /&gt;
$G4LEVELGAMMADATA    $G4RADIOACTIVEDATA    $G4VERSION &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This output corresponds to using the UCL PBT environment, but it will be dependent on the installed &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; modules. If this does not return a list of environment variables, make sure you have correctly sourced the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment script and updated all relevant path variables.&lt;br /&gt;
&lt;br /&gt;
Once the source code has been downloaded, a build directory should be created alongside the &amp;lt;code&amp;gt;src&amp;lt;/code&amp;gt; to hold the compiled &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; files before they are moved to their final installation location.&lt;br /&gt;
&lt;br /&gt;
On the UCL HEP Linux Cluster, the build directory should be created in &amp;lt;code&amp;gt;/unix/pbt/software/build&amp;lt;/code&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /unix/pbt/software/build&lt;br /&gt;
$ mkdir bdsim&lt;br /&gt;
$ cd bdsim&lt;br /&gt;
$ mkdir bdsim-0.9.9.2-build&lt;br /&gt;
$ cd bdsim-0.9.9.2-build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike other software installed on the UCL HEP Linux Cluster, there are a number of ways to configure the software before building. Using the &amp;lt;code&amp;gt;ccmake&amp;lt;/code&amp;gt; command, each configuration option can be set interactively:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cmake ../../../src/bdsim/bdsim-bitbucket/&lt;br /&gt;
&lt;br /&gt;
$ ccmake .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CMake opens an interactive configuration program. Set the options as required for your system e.g. on the UCL HEP Cluster:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CMAKE_INSTALL_PREFIX     /unix/pbt/software/dev/bdsim-0.9.9.2/&lt;br /&gt;
USE_AWAKE                ON&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;CMAKE_INSTALL_PREFIX=/unix/pbt/software/dev/bdsim-0.9.9.2&amp;lt;/code&amp;gt; flag specifies that the resulting &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; should be installed in the directory &amp;lt;code&amp;gt;/unix/pbt/software/dev/bdsim-0.9.9.2&amp;lt;/code&amp;gt; after compilation: this should be changed to suit the particular installation in question.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;c&#039;&#039; to configure.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;g&#039;&#039; to generate and exit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; can then be compiled and installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ make&lt;br /&gt;
$ make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Multiple examples are provided with the source code and can be found in the original build folder. A complete list of examples and tutorials for running them can be found at http://www.pp.rhul.ac.uk/bdsim/manual/examples/examples.html&lt;br /&gt;
&lt;br /&gt;
Here, the simpleMachine example will be demonstrated.&lt;br /&gt;
&lt;br /&gt;
First, navigate to the examples within build directory and find simpleMachine:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /unix/pbt/software/build/bdsim/bdsim-0.92-dev/bdsim-build-updated/examples&lt;br /&gt;
$ cd simpleMachine&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the simulation via the GUI use the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=sm.gmad&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An interface should load up and display the simpleMachine setup. It has a few drift beam pipes with a quadrupole, collimator and sector bend dipole magnet. To run the simulation once with any output exported to a file called &amp;lt;code&amp;gt;output.root&amp;lt;/code&amp;gt;, use the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=sm.gmad --outfile=output&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From within the GUI command line, type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/run/beamOn 1&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will execute a single run of the simulation with the output data exported to &amp;lt;code&amp;gt;output.root&amp;lt;/code&amp;gt;. This can then be analysed from within ROOT by following the tutorial at http://www.pp.rhul.ac.uk/bdsim/manual/output_analysis.html.&lt;br /&gt;
&lt;br /&gt;
To run this simulation in Batch mode, the following command can be used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=sm.gmad --outfile=output --batch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Batch mode has no interactive interface, but as a consequence is much faster and exits the program once it has finished. For simulations with large numbers of particles within the beam, this is the preferred method of use.&lt;br /&gt;
&lt;br /&gt;
== Basic AWAKE Spectrometer Simulation ==&lt;br /&gt;
&lt;br /&gt;
A simple model of the AWAKE spectrometer is available at &amp;lt;code&amp;gt;/unix/pdpwa/AWAKE_spectrometer/spectrometer&amp;lt;/code&amp;gt;. This model (&amp;lt;code&amp;gt;spectrometer.gmad&amp;lt;/code&amp;gt;) describes the first part of the spectrometer, downstream of the plasma cell, and includes the quadrupole magnets and drift sections up until the dipole magnet. Also included in this folder are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;options.gmad&amp;lt;/code&amp;gt; - includes definitions of constants used within the spectrometer model.&lt;br /&gt;
* &amp;lt;code&amp;gt;analysisConfig.txt&amp;lt;/code&amp;gt; - a simple &amp;lt;code&amp;gt;rebdsim&amp;lt;/code&amp;gt; script that is used to produce histograms describing the position and momentum distributions at different points along the beam line. More information can be found at http://www.pp.rhul.ac.uk/bdsim/manual/output_analysis.html .&lt;br /&gt;
* &amp;lt;code&amp;gt;plot_xy.C&amp;lt;/code&amp;gt; - a ROOT macro that plots histograms describing the position and momentum distributions at different points along the beam line.&lt;br /&gt;
*&amp;lt;code&amp;gt;vis.mac&amp;lt;/code&amp;gt; - settings for the interactive BDSIM GUI.&lt;br /&gt;
*&amp;lt;code&amp;gt;README&amp;lt;/code&amp;gt; - instructions on running the simulation.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
&lt;br /&gt;
First source the BDSIM environment as described [[#Running on the UCL HEP Linux Cluster| above]]. To run the simulation using the default supplied electron beam (E = 1.3+/-0.4 GeV), use the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=spectrometer.gmad --batch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output is then stored in a file called &amp;lt;code&amp;gt;output_event.root&amp;lt;/code&amp;gt;. There are two supplied scripts for analysis of this output: &amp;lt;code&amp;gt;analysisConfig.txt&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;plot_xy.C&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
==== REBDSIM ====&lt;br /&gt;
&lt;br /&gt;
The first analysis script uses &amp;lt;code&amp;gt;rebdsim&amp;lt;/code&amp;gt;, a set of analysis codes that are compiled into a library that is supplied with BDSIM. It can be used via:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rebdsim analysisConfig.txt output_event.root analysis.root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the third option, &amp;lt;code&amp;gt;analysis.root&amp;lt;/code&amp;gt;, is the desired name of the output file. This can then be opened in ROOT:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ root analysis.root&lt;br /&gt;
root &amp;gt; TBrowser a;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second command opens a &amp;lt;code&amp;gt;TBrowser&amp;lt;/code&amp;gt; session. &amp;lt;code&amp;gt;TBrowser&amp;lt;/code&amp;gt; is an interactive GUI provided by ROOT that can be used to visualise data. The histograms produced by the &amp;lt;code&amp;gt;rebdsim&amp;lt;/code&amp;gt; analysis can be found under &amp;lt;code&amp;gt;EventHistograms;1&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
==== ROOT Macro ====&lt;br /&gt;
&lt;br /&gt;
The second analysis script provided is a ROOT Macro that automatically plots the position and momentum distributions at different points within the beam line in two separate canvasses. It allows easy visualisation of the evolution of the beam. It can be used via:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ root&lt;br /&gt;
root &amp;gt; .x plot_xy.C&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should look similar to the following images:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Evolution:&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:position.png | 900px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Momentum Evolution:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:momentum.png | 900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--== References ==--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{cite web |url=https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim |title=BDSIM - Accelerator Beamline Simulation Tool |last=Nevay |first=Laurence |date=30 August 2017 |website=Royal Holloway Physics TWiki |access-date=17 October 2017}}--&amp;gt;&lt;/div&gt;</summary>
		<author><name>JamesChappell</name></author>
	</entry>
	<entry>
		<id>https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/BDSIM&amp;diff=1174</id>
		<title>Software/BDSIM</title>
		<link rel="alternate" type="text/html" href="https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/BDSIM&amp;diff=1174"/>
		<updated>2017-10-25T14:14:27Z</updated>

		<summary type="html">&lt;p&gt;JamesChappell: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== BDSIM ==&lt;br /&gt;
&lt;br /&gt;
BDSIM (Beam Delivery Simulation) is a program that uses a suite of high energy physics software including Geant4, CLHEP &amp;amp; ROOT to build a 3D model of an accelerator and simulate the passage of particles through both the vacuum and the material of the accelerator itself seamlessly.&lt;br /&gt;
&lt;br /&gt;
*Useful Links:&lt;br /&gt;
** [https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim RHUL BDSIM Webpage]&lt;br /&gt;
** [http://www.pp.rhul.ac.uk/bdsim/manual/index.html BDSIM Documentation]&lt;br /&gt;
** [https://bitbucket.org/jairhul/bdsim BDSIM Bitbucket Page]&lt;br /&gt;
** [http://www.pp.rhul.ac.uk/bdsim/manual/installation.html Official Installation Guide]&lt;br /&gt;
&lt;br /&gt;
This is a tutorial about installing and using BDSIM. BDSIM is installed on the HEP Linux cluster at UCL. You will need an account on that cluster to be able to use this software, run example tutorials and create your own simulations. &lt;br /&gt;
&lt;br /&gt;
== Running BDSIM Simulations ==&lt;br /&gt;
&lt;br /&gt;
In order to run BDSIM simulations, you will either need to download and install the software yourself or make use of the existing installation on the UCL HEP Linux cluster.&lt;br /&gt;
&lt;br /&gt;
In order to use the UCL HEP Linux cluster, you will need a HEP account: please contact Dr. Simon Jolly for more details. &lt;br /&gt;
&lt;br /&gt;
=== Running on the UCL HEP Linux Cluster ===&lt;br /&gt;
&lt;br /&gt;
In order to run &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; simulations on the UCL HEP Cluster, you must first source the development version of the PBT environment from a system within the cluster that is running Scientific Linux V6. This can be done using the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ source /unix/pbt/software/scripts/pbt.sh -vd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; the &#039;-d&#039; flag is essential as this sources the script that links the latest development software available on the PBT section of the cluster. &lt;br /&gt;
&lt;br /&gt;
Following this, a second script must be sourced in order to create the environment required to run &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ source /unix/pbt/software/scripts/bdsim_setup.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now your system is ready to use &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;. To check that it is working correctly, test the built-in help function: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should produce an output explaining all the possible options that can be used within &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Required Software ==&lt;br /&gt;
&lt;br /&gt;
BDSIM requires the following software to be installed:&lt;br /&gt;
&lt;br /&gt;
* Recent compiler with full C++11 support - proven compiler versions are GCC v4.9 or higher, or Clang 6 or higher.&lt;br /&gt;
* CMake v2.8.12 or higher&lt;br /&gt;
* CLHEP v2.1.3.1 or higher&lt;br /&gt;
* ROOT v6.x or higher&lt;br /&gt;
* Geant4 v4.10 or higher&lt;br /&gt;
* Flex v2.5.37 or higher&lt;br /&gt;
* Bison v2.3 or higher&lt;br /&gt;
&lt;br /&gt;
These are all installed on the UCL HEP cluster.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
&lt;br /&gt;
; Website: https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim&lt;br /&gt;
&lt;br /&gt;
; Latest Version: 0.9.9.2 (19th October 2017)&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
The installation process follows the general process described on the [[Software/Geant4/UCL HEP Cluster|UCL HEP Linux Cluster]] page.  &lt;br /&gt;
The basic method used is as follows:&lt;br /&gt;
&lt;br /&gt;
# Check that all the prerequisites for building &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; are installed (see above);&lt;br /&gt;
# Download the latest version of the source code;&lt;br /&gt;
# Create a build folder;&lt;br /&gt;
# Configure, build and install &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; from within the build folder.&lt;br /&gt;
&lt;br /&gt;
=== Download BDSIM from its central repository ===&lt;br /&gt;
&lt;br /&gt;
The BDSIM source code can be downloaded from its git repository using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; $ git clone --recursive &amp;lt;nowiki&amp;gt;https://bitbucket.org/jairhul/bdsim&amp;lt;/nowiki&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This creates a &amp;lt;code&amp;gt;/bdsim&amp;lt;/code&amp;gt; folder within your current folder. This folder contains all the code, examples, documentation and associated Python packages.&lt;br /&gt;
&lt;br /&gt;
=== Configure, build and install &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When installing &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;, all the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment variables must be available. This can be tested using the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; $ echo $G4 &amp;lt;tab&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment variables are available, you should see an output similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
$G4ABLADATA          $G4NEUTRONHPDATA      $G4REALSURFACEDATA &lt;br /&gt;
$G4ENSDFSTATEDATA    $G4NEUTRONXSDATA      $G4SAIDXSDATA &lt;br /&gt;
$G4LEDATA            $G4PIIDATA            $G4SHARE &lt;br /&gt;
$G4LEVELGAMMADATA    $G4RADIOACTIVEDATA    $G4VERSION &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This output corresponds to using the UCL PBT environment, but it will be dependent on the installed &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; modules. If this does not return a list of environment variables, make sure you have correctly sourced the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment script and updated all relevant path variables.&lt;br /&gt;
&lt;br /&gt;
Once the source code has been downloaded, a build directory should be created alongside the &amp;lt;code&amp;gt;src&amp;lt;/code&amp;gt; to hold the compiled &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; files before they are moved to their final installation location.&lt;br /&gt;
&lt;br /&gt;
On the UCL HEP Linux Cluster, the build directory should be created in &amp;lt;code&amp;gt;/unix/pbt/software/build&amp;lt;/code&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /unix/pbt/software/build&lt;br /&gt;
$ mkdir bdsim&lt;br /&gt;
$ cd bdsim&lt;br /&gt;
$ mkdir bdsim-0.9.9.2-build&lt;br /&gt;
$ cd bdsim-0.9.9.2-build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike other software installed on the UCL HEP Linux Cluster, there are a number of ways to configure the software before building. Using the &amp;lt;code&amp;gt;ccmake&amp;lt;/code&amp;gt; command, each configuration option can be set interactively:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cmake ../../../src/bdsim/bdsim-bitbucket/&lt;br /&gt;
&lt;br /&gt;
$ ccmake .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CMake opens an interactive configuration program. Set the options as required for your system e.g. on the UCL HEP Cluster:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CMAKE_INSTALL_PREFIX     /unix/pbt/software/dev/bdsim-0.9.9.2/&lt;br /&gt;
USE_AWAKE                ON&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;CMAKE_INSTALL_PREFIX=/unix/pbt/software/dev/bdsim-0.9.9.2&amp;lt;/code&amp;gt; flag specifies that the resulting &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; should be installed in the directory &amp;lt;code&amp;gt;/unix/pbt/software/dev/bdsim-0.9.9.2&amp;lt;/code&amp;gt; after compilation: this should be changed to suit the particular installation in question.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;c&#039;&#039; to configure.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;g&#039;&#039; to generate and exit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; can then be compiled and installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ make&lt;br /&gt;
$ make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Multiple examples are provided with the source code and can be found in the original build folder. A complete list of examples and tutorials for running them can be found at http://www.pp.rhul.ac.uk/bdsim/manual/examples/examples.html&lt;br /&gt;
&lt;br /&gt;
Here, the simpleMachine example will be demonstrated.&lt;br /&gt;
&lt;br /&gt;
First, navigate to the examples within build directory and find simpleMachine:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ cd /unix/pbt/software/build/bdsim/bdsim-0.92-dev/bdsim-build-updated/examples&lt;br /&gt;
$ cd simpleMachine&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the simulation via the GUI use the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=sm.gmad&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An interface should load up and display the simpleMachine setup. It has a few drift beam pipes with a quadrupole, collimator and sector bend dipole magnet. To run the simulation once with any output exported to a file called &amp;lt;code&amp;gt;output.root&amp;lt;/code&amp;gt;, use the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=sm.gmad --outfile=output&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From within the GUI command line, type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/run/beamOn 1&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will execute a single run of the simulation with the output data exported to &amp;lt;code&amp;gt;output.root&amp;lt;/code&amp;gt;. This can then be analysed from within ROOT by following the tutorial at http://www.pp.rhul.ac.uk/bdsim/manual/output_analysis.html.&lt;br /&gt;
&lt;br /&gt;
To run this simulation in Batch mode, the following command can be used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=sm.gmad --outfile=output --batch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Batch mode has no interactive interface, but as a consequence is much faster and exits the program once it has finished. For simulations with large numbers of particles within the beam, this is the preferred method of use.&lt;br /&gt;
&lt;br /&gt;
== Basic AWAKE Spectrometer Simulation ==&lt;br /&gt;
&lt;br /&gt;
A simple model of the AWAKE spectrometer is available at &amp;lt;code&amp;gt;/unix/pdpwa/AWAKE_spectrometer&amp;lt;/code&amp;gt;. This model (&amp;lt;code&amp;gt;spectrometer.gmad&amp;lt;/code&amp;gt;) describes the first part of the spectrometer, downstream of the plasma cell, and includes the quadrupole magnets and drift sections up until the dipole magnet. Also included in this folder are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;options.gmad&amp;lt;/code&amp;gt; - includes definitions of constants used within the spectrometer model.&lt;br /&gt;
* &amp;lt;code&amp;gt;analysisConfig.txt&amp;lt;/code&amp;gt; - a simple &amp;lt;code&amp;gt;rebdsim&amp;lt;/code&amp;gt; script that is used to produce histograms describing the position and momentum distributions at different points along the beam line. More information can be found at http://www.pp.rhul.ac.uk/bdsim/manual/output_analysis.html .&lt;br /&gt;
* &amp;lt;code&amp;gt;plot_xy.C&amp;lt;/code&amp;gt; - a ROOT macro that plots histograms describing the position and momentum distributions at different points along the beam line.&lt;br /&gt;
*&amp;lt;code&amp;gt;vis.mac&amp;lt;/code&amp;gt; - settings for the interactive BDSIM GUI.&lt;br /&gt;
*&amp;lt;code&amp;gt;README&amp;lt;/code&amp;gt; - instructions on running the simulation.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
&lt;br /&gt;
First source the BDSIM environment as described [[#Running on the UCL HEP Linux Cluster| above]]. To run the simulation using the default supplied electron beam (E = 1.3+/-0.4 GeV), use the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=spectrometer.gmad --batch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output is then stored in a file called &amp;lt;code&amp;gt;output_event.root&amp;lt;/code&amp;gt;. There are two supplied scripts for analysis of this output: &amp;lt;code&amp;gt;analysisConfig.txt&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;plot_xy.C&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
==== REBDSIM ====&lt;br /&gt;
&lt;br /&gt;
The first analysis script uses &amp;lt;code&amp;gt;rebdsim&amp;lt;/code&amp;gt;, a set of analysis codes that are compiled into a library that is supplied with BDSIM. It can be used via:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rebdsim analysisConfig.txt output_event.root analysis.root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the third option, &amp;lt;code&amp;gt;analysis.root&amp;lt;/code&amp;gt;, is the desired name of the output file. This can then be opened in ROOT:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ root analysis.root&lt;br /&gt;
root &amp;gt; TBrowser a;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second command opens a &amp;lt;code&amp;gt;TBrowser&amp;lt;/code&amp;gt; session. &amp;lt;code&amp;gt;TBrowser&amp;lt;/code&amp;gt; is an interactive GUI provided by ROOT that can be used to visualise data. The histograms produced by the &amp;lt;code&amp;gt;rebdsim&amp;lt;/code&amp;gt; analysis can be found under &amp;lt;code&amp;gt;EventHistograms;1&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
==== ROOT Macro ====&lt;br /&gt;
&lt;br /&gt;
The second analysis script provided is a ROOT Macro that automatically plots the position and momentum distributions at different points within the beam line in two separate canvasses. It allows easy visualisation of the evolution of the beam. It can be used via:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ root&lt;br /&gt;
root &amp;gt; .x plot_xy.C&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should look similar to the following images:&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Position Evolution:&#039;&#039;&#039;&lt;br /&gt;
 &lt;br /&gt;
[[File:position.png | 900px]]&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Momentum Evolution:&#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
[[File:momentum.png | 900px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--== References ==--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{cite web |url=https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim |title=BDSIM - Accelerator Beamline Simulation Tool |last=Nevay |first=Laurence |date=30 August 2017 |website=Royal Holloway Physics TWiki |access-date=17 October 2017}}--&amp;gt;&lt;/div&gt;</summary>
		<author><name>JamesChappell</name></author>
	</entry>
	<entry>
		<id>https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/BDSIM&amp;diff=1173</id>
		<title>Software/BDSIM</title>
		<link rel="alternate" type="text/html" href="https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/BDSIM&amp;diff=1173"/>
		<updated>2017-10-25T14:08:29Z</updated>

		<summary type="html">&lt;p&gt;JamesChappell: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== BDSIM ==&lt;br /&gt;
&lt;br /&gt;
BDSIM (Beam Delivery Simulation) is a program that uses a suite of high energy physics software including Geant4, CLHEP &amp;amp; ROOT to build a 3D model of an accelerator and simulate the passage of particles through both the vacuum and the material of the accelerator itself seamlessly.&lt;br /&gt;
&lt;br /&gt;
*Useful Links:&lt;br /&gt;
** [https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim RHUL BDSIM Webpage]&lt;br /&gt;
** [http://www.pp.rhul.ac.uk/bdsim/manual/index.html BDSIM Documentation]&lt;br /&gt;
** [https://bitbucket.org/jairhul/bdsim BDSIM Bitbucket Page]&lt;br /&gt;
** [http://www.pp.rhul.ac.uk/bdsim/manual/installation.html Official Installation Guide]&lt;br /&gt;
&lt;br /&gt;
This is a tutorial about installing and using BDSIM. BDSIM is installed on the HEP Linux cluster at UCL. You will need an account on that cluster to be able to use this software, run example tutorials and create your own simulations. &lt;br /&gt;
&lt;br /&gt;
== Running BDSIM Simulations ==&lt;br /&gt;
&lt;br /&gt;
In order to run BDSIM simulations, you will either need to download and install the software yourself or make use of the existing installation on the UCL HEP Linux cluster.&lt;br /&gt;
&lt;br /&gt;
In order to use the UCL HEP Linux cluster, you will need a HEP account: please contact Dr. Simon Jolly for more details. &lt;br /&gt;
&lt;br /&gt;
=== Running on the UCL HEP Linux Cluster ===&lt;br /&gt;
&lt;br /&gt;
In order to run &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; simulations on the UCL HEP Cluster, you must first source the development version of the PBT environment from a system within the cluster that is running Scientific Linux V6. This can be done using the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
source /unix/pbt/software/scripts/pbt.sh -vd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; the &#039;-d&#039; flag is essential as this sources the script that links the latest development software available on the PBT section of the cluster. &lt;br /&gt;
&lt;br /&gt;
Following this, a second script must be sourced in order to create the environment required to run &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
source /unix/pbt/software/scripts/bdsim_setup.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now your system is ready to use &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;. To check that it is working correctly, test the built-in help function: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bdsim --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should produce an output explaining all the possible options that can be used within &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Required Software ==&lt;br /&gt;
&lt;br /&gt;
BDSIM requires the following software to be installed:&lt;br /&gt;
&lt;br /&gt;
* Recent compiler with full C++11 support - proven compiler versions are GCC v4.9 or higher, or Clang 6 or higher.&lt;br /&gt;
* CMake v2.8.12 or higher&lt;br /&gt;
* CLHEP v2.1.3.1 or higher&lt;br /&gt;
* ROOT v6.x or higher&lt;br /&gt;
* Geant4 v4.10 or higher&lt;br /&gt;
* Flex v2.5.37 or higher&lt;br /&gt;
* Bison v2.3 or higher&lt;br /&gt;
&lt;br /&gt;
These are all installed on the UCL HEP cluster.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
&lt;br /&gt;
; Website: https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim&lt;br /&gt;
&lt;br /&gt;
; Latest Version: 0.9.9.2 (19th October 2017)&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
The installation process follows the general process described on the [[Software/Geant4/UCL HEP Cluster|UCL HEP Linux Cluster]] page.  &lt;br /&gt;
The basic method used is as follows:&lt;br /&gt;
&lt;br /&gt;
# Check that all the prerequisites for building &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; are installed (see above);&lt;br /&gt;
# Download the latest version of the source code;&lt;br /&gt;
# Create a build folder;&lt;br /&gt;
# Configure, build and install &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; from within the build folder.&lt;br /&gt;
&lt;br /&gt;
=== Download BDSIM from its central repository ===&lt;br /&gt;
&lt;br /&gt;
The BDSIM source code can be downloaded from its git repository using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; git clone --recursive &amp;lt;nowiki&amp;gt;https://bitbucket.org/jairhul/bdsim&amp;lt;/nowiki&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This creates a &amp;lt;code&amp;gt;/bdsim&amp;lt;/code&amp;gt; folder within your current folder. This folder contains all the code, examples, documentation and associated Python packages.&lt;br /&gt;
&lt;br /&gt;
=== Configure, build and install &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When installing &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;, all the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment variables must be available. This can be tested using the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; echo $G4 &amp;lt;tab&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment variables are available, you should see an output similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
$G4ABLADATA          $G4NEUTRONHPDATA      $G4REALSURFACEDATA &lt;br /&gt;
$G4ENSDFSTATEDATA    $G4NEUTRONXSDATA      $G4SAIDXSDATA &lt;br /&gt;
$G4LEDATA            $G4PIIDATA            $G4SHARE &lt;br /&gt;
$G4LEVELGAMMADATA    $G4RADIOACTIVEDATA    $G4VERSION &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This output corresponds to using the UCL PBT environment, but it will be dependent on the installed &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; modules. If this does not return a list of environment variables, make sure you have correctly sourced the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment script and updated all relevant path variables.&lt;br /&gt;
&lt;br /&gt;
Once the source code has been downloaded, a build directory should be created alongside the &amp;lt;code&amp;gt;src&amp;lt;/code&amp;gt; to hold the compiled &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; files before they are moved to their final installation location.&lt;br /&gt;
&lt;br /&gt;
On the UCL HEP Linux Cluster, the build directory should be created in &amp;lt;code&amp;gt;/unix/pbt/software/build&amp;lt;/code&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build&lt;br /&gt;
mkdir bdsim&lt;br /&gt;
cd bdsim&lt;br /&gt;
mkdir bdsim-0.9.9.2-build&lt;br /&gt;
cd bdsim-0.9.9.2-build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike other software installed on the UCL HEP Linux Cluster, there are a number of ways to configure the software before building. Using the &amp;lt;code&amp;gt;ccmake&amp;lt;/code&amp;gt; command, each configuration option can be set interactively:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cmake ../../../src/bdsim/bdsim-bitbucket/&lt;br /&gt;
&lt;br /&gt;
ccmake .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CMake opens an interactive configuration program. Set the options as required for your system e.g. on the UCL HEP Cluster:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CMAKE_INSTALL_PREFIX     /unix/pbt/software/dev/bdsim-0.9.9.2/&lt;br /&gt;
USE_AWAKE                ON&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;CMAKE_INSTALL_PREFIX=/unix/pbt/software/dev/bdsim-0.9.9.2&amp;lt;/code&amp;gt; flag specifies that the resulting &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; should be installed in the directory &amp;lt;code&amp;gt;/unix/pbt/software/dev/bdsim-0.9.9.2&amp;lt;/code&amp;gt; after compilation: this should be changed to suit the particular installation in question.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;c&#039;&#039; to configure.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;g&#039;&#039; to generate and exit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; can then be compiled and installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Multiple examples are provided with the source code and can be found in the original build folder. A complete list of examples and tutorials for running them can be found at http://www.pp.rhul.ac.uk/bdsim/manual/examples/examples.html&lt;br /&gt;
&lt;br /&gt;
Here, the simpleMachine example will be demonstrated.&lt;br /&gt;
&lt;br /&gt;
First, navigate to the examples within build directory and find simpleMachine:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build/bdsim/bdsim-0.92-dev/bdsim-build-updated/examples&lt;br /&gt;
cd simpleMachine&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the simulation via the GUI use the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bdsim --file=sm.gmad&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An interface should load up and display the simpleMachine setup. It has a few drift beam pipes with a quadrupole, collimator and sector bend dipole magnet. To run the simulation once with any output exported to a file called &amp;lt;code&amp;gt;output.root&amp;lt;/code&amp;gt;, use the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bdsim --file=sm.gmad --outfile=output&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From within the GUI command line, type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/run/beamOn 1&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will execute a single run of the simulation with the output data exported to &amp;lt;code&amp;gt;output.root&amp;lt;/code&amp;gt;. This can then be analysed from within ROOT by following the tutorial at http://www.pp.rhul.ac.uk/bdsim/manual/output_analysis.html.&lt;br /&gt;
&lt;br /&gt;
To run this simulation in Batch mode, the following command can be used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bdsim --file=sm.gmad --outfile=output --batch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Batch mode has no interactive interface, but as a consequence is much faster and exits the program once it has finished. For simulations with large numbers of particles within the beam, this is the preferred method of use.&lt;br /&gt;
&lt;br /&gt;
== Basic AWAKE Spectrometer Simulation ==&lt;br /&gt;
&lt;br /&gt;
A simple model of the AWAKE spectrometer is available at &amp;lt;code&amp;gt;/unix/pdpwa/AWAKE_spectrometer&amp;lt;/code&amp;gt;. This model (&amp;lt;code&amp;gt;spectrometer.gmad&amp;lt;/code&amp;gt;) describes the first part of the spectrometer, downstream of the plasma cell, and includes the quadrupole magnets and drift sections up until the dipole magnet. Also included in this folder are:&lt;br /&gt;
&lt;br /&gt;
* &amp;lt;code&amp;gt;options.gmad&amp;lt;/code&amp;gt; - includes definitions of constants used within the spectrometer model.&lt;br /&gt;
* &amp;lt;code&amp;gt;analysisConfig.txt&amp;lt;/code&amp;gt; - a simple &amp;lt;code&amp;gt;rebdsim&amp;lt;/code&amp;gt; script that is used to produce histograms describing the position and momentum distributions at different points along the beam line. More information can be found at http://www.pp.rhul.ac.uk/bdsim/manual/output_analysis.html .&lt;br /&gt;
* &amp;lt;code&amp;gt;plot_xy.C&amp;lt;/code&amp;gt; - a ROOT macro that plots histograms describing the position and momentum distributions at different points along the beam line.&lt;br /&gt;
*&amp;lt;code&amp;gt;vis.mac&amp;lt;/code&amp;gt; - settings for the interactive BDSIM GUI.&lt;br /&gt;
*&amp;lt;code&amp;gt;README&amp;lt;/code&amp;gt; - instructions on running the simulation.&lt;br /&gt;
&lt;br /&gt;
=== Running the Simulation ===&lt;br /&gt;
&lt;br /&gt;
First source the BDSIM environment as described [[#Running on the UCL HEP Linux Cluster| above]]. To run the simulation using the default supplied electron beam (E = 1.3+/-0.4 GeV), use the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ bdsim --file=spectrometer.gmad --batch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output is then stored in a file called &amp;lt;code&amp;gt;output_event.root&amp;lt;/code&amp;gt;. There are two supplied scripts for analysis of this output: &amp;lt;code&amp;gt;analysisConfig.txt&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;plot_xy.C&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
==== REBDSIM ====&lt;br /&gt;
&lt;br /&gt;
The first analysis script uses &amp;lt;code&amp;gt;rebdsim&amp;lt;/code&amp;gt;, a set of analysis codes that are compiled into a library that is supplied with BDSIM. It can be used via:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ rebdsim analysisConfig.txt output_event.root analysis.root&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
where the third option, &amp;lt;code&amp;gt;analysis.root&amp;lt;/code&amp;gt;, is the desired name of the output file. This can then be opened in ROOT:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ root analysis.root&lt;br /&gt;
root &amp;gt; TBrowser a;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The second command opens a &amp;lt;code&amp;gt;TBrowser&amp;lt;/code&amp;gt; session. &amp;lt;code&amp;gt;TBrowser&amp;lt;/code&amp;gt; is an interactive GUI provided by ROOT that can be used to visualise data. The histograms produced by the &amp;lt;code&amp;gt;rebdsim&amp;lt;/code&amp;gt; analysis can be found under &amp;lt;code&amp;gt;EventHistograms;1&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
==== ROOT Macro ====&lt;br /&gt;
&lt;br /&gt;
The second analysis script provided is a ROOT Macro that automatically plots the position and momentum distributions at different points within the beam line in two separate canvasses. It allows easy visualisation of the evolution of the beam. It can be used via:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
$ root&lt;br /&gt;
root &amp;gt; .x plot_xy.C&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The output should look similar to the following images:&lt;br /&gt;
 &lt;br /&gt;
{{multiple image&lt;br /&gt;
 | width = 80&lt;br /&gt;
 | footer = &lt;br /&gt;
 | image1 = position.png&lt;br /&gt;
 | alt1 = Position evolution&lt;br /&gt;
 | caption1 = Position&lt;br /&gt;
 | image2 = momentum.png&lt;br /&gt;
 | alt2 = Momentum evolution&lt;br /&gt;
 | caption2 = Momentum&lt;br /&gt;
 }}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--== References ==--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{cite web |url=https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim |title=BDSIM - Accelerator Beamline Simulation Tool |last=Nevay |first=Laurence |date=30 August 2017 |website=Royal Holloway Physics TWiki |access-date=17 October 2017}}--&amp;gt;&lt;/div&gt;</summary>
		<author><name>JamesChappell</name></author>
	</entry>
	<entry>
		<id>https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=File:Momentum.png&amp;diff=1172</id>
		<title>File:Momentum.png</title>
		<link rel="alternate" type="text/html" href="https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=File:Momentum.png&amp;diff=1172"/>
		<updated>2017-10-25T13:59:10Z</updated>

		<summary type="html">&lt;p&gt;JamesChappell: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>JamesChappell</name></author>
	</entry>
	<entry>
		<id>https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=File:Position.png&amp;diff=1171</id>
		<title>File:Position.png</title>
		<link rel="alternate" type="text/html" href="https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=File:Position.png&amp;diff=1171"/>
		<updated>2017-10-25T13:58:59Z</updated>

		<summary type="html">&lt;p&gt;JamesChappell: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>JamesChappell</name></author>
	</entry>
	<entry>
		<id>https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/Geant4/Installation/Xerces-C&amp;diff=1170</id>
		<title>Software/Geant4/Installation/Xerces-C</title>
		<link rel="alternate" type="text/html" href="https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/Geant4/Installation/Xerces-C&amp;diff=1170"/>
		<updated>2017-10-20T10:49:26Z</updated>

		<summary type="html">&lt;p&gt;JamesChappell: /* Installation from Central Repository */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Xerces-C++&amp;lt;/code&amp;gt; is a validating XML parser written in a portable subset of C++. Xerces-C++ makes it easy to give your application the ability to read and write XML data.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; requires the &amp;lt;code&amp;gt;Xerces-C++&amp;lt;/code&amp;gt; headers and libraries compiled against the C++11 standard in order to provide support for GDML geometry descriptions.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
&lt;br /&gt;
; Website : http://xerces.apache.org/xerces-c/&lt;br /&gt;
; Source URL : http://www.apache.org/dist/xerces/c/3/sources/&lt;br /&gt;
; Installed Production version : 3.1.3 (17 Feb 2016)&lt;br /&gt;
; Source code : &amp;lt;code&amp;gt;src/geant4-prerequisites/xerces-c/xerces-c-3.1.3.tar.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
; Installed Development version : 3.2.0 (20 October 2017)&lt;br /&gt;
; Central Repository : https://github.com/apache/xerces-c&lt;br /&gt;
&lt;br /&gt;
== Installation Notes ==&lt;br /&gt;
&lt;br /&gt;
The [http://xerces.apache.org/xerces-c/ Xerces-C++ website] provides some useful instructions on [http://xerces.apache.org/xerces-c/build-3.html Building and Installing Xerces-C++].&lt;br /&gt;
&lt;br /&gt;
For installation, &amp;lt;code&amp;gt;Xerces-C++&amp;lt;/code&amp;gt; does not support installation into a sandbox directory (i.e. there are no options &amp;lt;code&amp;gt;prefix&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;DESTDIR&amp;lt;/code&amp;gt; defined for command &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;) and must be given the installation directory with the &amp;lt;code&amp;gt;-prefix&amp;lt;/code&amp;gt; option.  &lt;br /&gt;
As such, to recompile &amp;lt;code&amp;gt;Xerces-C++&amp;lt;/code&amp;gt; for different target directories, the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script must be rerun with a modified &amp;lt;code&amp;gt;-prefix /path/to/dest&amp;lt;/code&amp;gt; option.  &lt;br /&gt;
This has to be managed manually as can be seen in the installation commands below.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
When downloading software, the downloaded tarball (or other &amp;lt;code&amp;gt;Zip&amp;lt;/code&amp;gt; archive) should be placed in an appropriately named directory in &amp;lt;code&amp;gt;/unix/pbt/software/src&amp;lt;/code&amp;gt;: the instructions below assume that the directory is &amp;lt;code&amp;gt;/unix/pbt/software/src/geant4-prerequisites/xerces-c&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The source code should then be extracted into a suitable subdirectory in &amp;lt;code&amp;gt;/unix/pbt/software/build&amp;lt;/code&amp;gt;.  &lt;br /&gt;
The extracted source code directory can only be deleted once the software has been built and installed.&lt;br /&gt;
&lt;br /&gt;
=== Installation from Central Repository ===&lt;br /&gt;
&lt;br /&gt;
After the latest version has been pulled from its [https://github.com/apache/xerces-c central repository] and placed within /unix/pbt/software/src/xerces-c, create a build directory within the PBT software directory from which you can compile the code: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build/&lt;br /&gt;
mkdir xerces-c&lt;br /&gt;
cd xerces-c&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CMake&amp;lt;/code&amp;gt; can then be used to configure and install &amp;lt;code&amp;gt;Xerces-C&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cmake ../../src/xerces-c&lt;br /&gt;
ccmake .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;code&amp;gt;ccmake .&amp;lt;/code&amp;gt; opens an interactive GUI that can be used to specify installation options. From within this you can define your installation directory and configure any other options as required. On the PBT cluster it is required that the software is installed to the development directory, and so the &amp;lt;code&amp;gt;CMAKE_INSTALL_PREFIX&amp;lt;/code&amp;gt; is defined as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CMAKE_INSTALL_PREFIX       /unix/pbt/software/dev/xerces-c-3.2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;c&#039;&#039; to configure&lt;br /&gt;
*&#039;&#039;g&#039;&#039; to generate and exit&lt;br /&gt;
&lt;br /&gt;
The software can then be installed using the usual commands: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make &lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installation from source code ===&lt;br /&gt;
&lt;br /&gt;
==== Source Code Extraction ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/src/geant4-prerequisites/xerces-c&lt;br /&gt;
tar -xvz -f xerces-c-3.1.3.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Build And Install ====&lt;br /&gt;
&lt;br /&gt;
It is possible to build for the &#039;&#039;&#039;Production&#039;&#039;&#039; environment without deleting the &amp;lt;code&amp;gt;Xerces-C build&amp;lt;/code&amp;gt; directory created for the &#039;&#039;&#039;Development&#039;&#039;&#039; installation, meaning that significant time is saved when running &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;.  &lt;br /&gt;
However, it isn&#039;t recommended to do so as the &#039;&#039;&#039;Production&#039;&#039;&#039; installation ends up referencing components within &amp;lt;code&amp;gt;/unix/pbt/software/dev&amp;lt;/code&amp;gt; which is not desirable as the two environments are no longer independent.  &lt;br /&gt;
As such, these instructions assume one is building from scratch for each environment: to do so, make sure that the &amp;lt;code&amp;gt;build/qt&amp;lt;/code&amp;gt; directory is deleted before recreating it for the subsequent build and install.&lt;br /&gt;
&lt;br /&gt;
Also, although it is possible to install straight to the &#039;&#039;&#039;Production&#039;&#039;&#039; environment, it is highly discouraged to do so without first compiling a &#039;&#039;&#039;Development&#039;&#039;&#039; version. &lt;br /&gt;
&lt;br /&gt;
===== Development Environment =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build&lt;br /&gt;
mkdir -pv xerces-c/xerces-c-3.1.3&lt;br /&gt;
cd xerces-c/xerces-c-3.1.3&lt;br /&gt;
../../../src/geant4-prerequisites/xerces-c/xerces-c/configure --prefix /unix/pbt/software/dev/xerces-c-3.1.3&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Production Environment =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build&lt;br /&gt;
mkdir -pv xerces-c/xerces-c-3.1.3&lt;br /&gt;
cd xerces-c/xerces-c-3.1.3&lt;br /&gt;
../../../src/geant4-prerequisites/xerces-c/xerces-c/configure --prefix /unix/pbt/software/prod-sl6&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>JamesChappell</name></author>
	</entry>
	<entry>
		<id>https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/Geant4/Installation&amp;diff=1169</id>
		<title>Software/Geant4/Installation</title>
		<link rel="alternate" type="text/html" href="https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/Geant4/Installation&amp;diff=1169"/>
		<updated>2017-10-20T10:48:14Z</updated>

		<summary type="html">&lt;p&gt;JamesChappell: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Installation Of Geant4 And Supporting Packages ==&lt;br /&gt;
&lt;br /&gt;
The [http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/InstallationGuide/html/index.html CERN Geant4 Installation Guide] provides extensive instructions on installing Geant4.  &lt;br /&gt;
This provides an overview of the installation procedure, as well as a list of prerequisites and additional software that need to be installed alongside Geant4.  &lt;br /&gt;
&lt;br /&gt;
In addition, information is given on the installation procedure for this additional software and the location the software is installed on the [[Software/Geant4/UCL HEP Cluster|UCL HEP Linux Cluster]].&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;environment&amp;lt;/code&amp;gt; described here is the combination of files, folders, settings and user interface that allow users to make use of &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; and related software packages for particle beam therapy simulations.&lt;br /&gt;
&lt;br /&gt;
Accessing the environment requires the following:&lt;br /&gt;
* Access to the filesystem and required folders.&lt;br /&gt;
* Terminal access to run simulations.&lt;br /&gt;
* A visualisation engine such as OpenGL on X (&#039;&#039;optional&#039;&#039;).&lt;br /&gt;
* Setting environment variables to point to installed software and scripts.&lt;br /&gt;
&lt;br /&gt;
The order of installation is important, as some packages depend on having the other packages first.&lt;br /&gt;
In some cases, installations will be successful if carried out in the wrong order, but some features will be disabled that should be enabled.&lt;br /&gt;
The order of packages described below is the order in which these packages were installed into the PBT environment.&lt;br /&gt;
&lt;br /&gt;
== Required Software ==&lt;br /&gt;
&lt;br /&gt;
The list of required software is split into 2 categories:&lt;br /&gt;
&lt;br /&gt;
* [[#Prerequisites|Prerequisites]] are those components that are required in order for some part of &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; or the resulting simulation visualisations to function correctly;&lt;br /&gt;
* [[#Add Ons|Add Ons]] are optional pieces of software &amp;amp;mdash; normally visualisation software &amp;amp;mdash; that are installed on the [[Software/Geant4/UCL HEP Cluster|UCL HEP Linux Cluster]].&lt;br /&gt;
&lt;br /&gt;
See the individually linked pages for information on building each of the components that do not ship by default.&lt;br /&gt;
&lt;br /&gt;
=== Prerequisites ===&lt;br /&gt;
&lt;br /&gt;
The [http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/InstallationGuide/html/index.html CERN Geant4 Installation Guide] provides extensive information on &lt;br /&gt;
[http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/InstallationGuide/html/ch01s02.html software that must be installed to compile Geant4 itself] and software required in order to &lt;br /&gt;
[http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/InstallationGuide/html/ch01s03.html compile optional components of Geant4].&lt;br /&gt;
&lt;br /&gt;
These are:&lt;br /&gt;
&lt;br /&gt;
* A C++11 compatible compiler: on Linux, this is [https://gcc.gnu.org &amp;lt;code&amp;gt;GCC&amp;lt;/code&amp;gt;: the GNU Compiler Collection] which is installed by default.&lt;br /&gt;
* [[/CMake|&amp;lt;code&amp;gt;CMake&amp;lt;/code&amp;gt;]] required for building the various &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; simulations through &amp;lt;code&amp;gt;cmake&amp;lt;/code&amp;gt; files.&lt;br /&gt;
* The [[/CLHEP|&amp;lt;code&amp;gt;CLHEP&amp;lt;/code&amp;gt; Class Library]] that provides a range of foundation and utility classes needed for &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; simulations.&lt;br /&gt;
&lt;br /&gt;
* [https://www.opengl.org &amp;lt;code&amp;gt;OpenGL&amp;lt;/code&amp;gt; headers and libraries] to provide support for &amp;lt;code&amp;gt;OpenGL&amp;lt;/code&amp;gt; graphics (graphics card specific; installed by default on most Operating Systems).&lt;br /&gt;
* [https://en.wikipedia.org/wiki/X_Window_System &amp;lt;code&amp;gt;X11&amp;lt;/code&amp;gt;] headers and libraries to provide support for the &amp;lt;code&amp;gt;X&amp;lt;/code&amp;gt;-Window system (installed by default on &amp;lt;nowiki&amp;gt;*&amp;lt;/nowiki&amp;gt;nix systems&lt;br /&gt;
* [[/Qt|&amp;lt;code&amp;gt;Qt4&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;Qt5&amp;lt;/code&amp;gt; headers and libraries]] to provide support for the Qt user interface and visualisation. &lt;br /&gt;
* [[/Xerces-C|&amp;lt;code&amp;gt;Xerces-C++&amp;lt;/code&amp;gt; headers and libraries]] compiled against the C++11 standard to provide support for GDML geometry descriptions.&lt;br /&gt;
* [http://www.opengroup.org/openmotif &amp;lt;code&amp;gt;Motif&amp;lt;/code&amp;gt;] and X11 headers and libraries to provide support for the Motif user interface and visualisation (installed by default on Linux)&lt;br /&gt;
* [[/Coin3D|&amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt;]] for Open Inventor visualisation (&amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt; is a free implementation of Open Inventor).  This requires the following libraries to be installed:&lt;br /&gt;
** The [[/Coin3D#simage|&amp;lt;code&amp;gt;simage&amp;lt;/code&amp;gt;]] library with image format loaders and front-ends to common import libraries.  &amp;lt;code&amp;gt;simage&amp;lt;/code&amp;gt; is meant for use with applications which read image files as textures.  &#039;&#039;&#039;&amp;lt;code&amp;gt;simage&amp;lt;/code&amp;gt; must be installed before &amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
** The [[/Coin3D#SoXt|&amp;lt;code&amp;gt;SoXt&amp;lt;/code&amp;gt;]] open source InventorXt library, which is a GUI binding for using Open Inventor with Xt/Motif. &amp;lt;code&amp;gt;SoXt&amp;lt;/code&amp;gt; must be installed after &amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt;.&lt;br /&gt;
** [[/Coin3D#SoQt|&amp;lt;code&amp;gt;SoQt&amp;lt;/code&amp;gt;]] open source &amp;lt;code&amp;gt;Qt&amp;lt;/code&amp;gt; GUI component toolkit library for &amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt;.  &amp;lt;code&amp;gt;SoQt&amp;lt;/code&amp;gt; must be installed after &amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
By default some of these will ship pre-installed with most modern Linux distributions: however the &amp;lt;code&amp;gt;expat&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;mesa&amp;lt;/code&amp;gt; generally need to be installed alongside the software listed above.&lt;br /&gt;
&lt;br /&gt;
=== Add Ons ===&lt;br /&gt;
&lt;br /&gt;
The [http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/InstallationGuide/html/index.html CERN Geant4 Installation Guide] provides a range of &lt;br /&gt;
[http://geant4.web.cern.ch/geant4/UserDocumentation/UsersGuides/InstallationGuide/html/ch01s04.html software suggested for use with &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt;].  &lt;br /&gt;
While none of these need to be installed for &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; to compile and run, they are useful for visualising the resulting simulations.&lt;br /&gt;
&lt;br /&gt;
The following subset is installed on the [[Software/Geant4/UCL HEP Cluster|UCL HEP Cluster]]:&lt;br /&gt;
&lt;br /&gt;
* The [[/DAWN|&amp;lt;code&amp;gt;DAWN&amp;lt;/code&amp;gt;]] postscript renderer to support the DAWN visualisation driver.&lt;br /&gt;
* The [[/HepRApp|&amp;lt;code&amp;gt;HepRApp&amp;lt;/code&amp;gt;]] Browser for use with the [http://www.slac.stanford.edu/~perl/heprep/ HepRep] visualisation driver.&lt;br /&gt;
* The [[/Java Analysis Studio|&amp;lt;code&amp;gt;Java Analysis Studio&amp;lt;/code&amp;gt;]] (&amp;lt;code&amp;gt;JAS3&amp;lt;/code&amp;gt;), along with the [[/Java Analysis Studio#WIRED4|&amp;lt;code&amp;gt;WIRED4 JAS Plug-IN&amp;lt;/code&amp;gt;]] for use with the [http://www.slac.stanford.edu/~perl/heprep/ HepRep] visualisation driver.&lt;br /&gt;
* The [[/gMocren|&amp;lt;code&amp;gt;gMocren&amp;lt;/code&amp;gt;]] volume visualiser for &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; medical simulations.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
&lt;br /&gt;
; Website : http://geant4.web.cern.ch/geant4/&lt;br /&gt;
; Source URL : http://geant4.web.cern.ch/geant4/support/download.shtml&lt;br /&gt;
; Latest Production version : 10.2.p01 (26 Feb 2016)&lt;br /&gt;
; Source tarball : &amp;lt;code&amp;gt;src/geant4/geant4.10.02.p01.tar.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
; Latest Development version : 10.3.02.p02 (20 October 2017)&lt;br /&gt;
; Central Repository : https://github.com/Geant4/geant4&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
The installation process follows the general process described on the [[Software/Geant4/UCL HEP Cluster|UCL HEP Linux Cluster]] page.  &lt;br /&gt;
The basic method used is as follows:&lt;br /&gt;
&lt;br /&gt;
# Check that all the prerequisites for building &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; are installed (see above);&lt;br /&gt;
# Download the latest version of the source code;&lt;br /&gt;
# Extract the source code from the downloaded tarball;&lt;br /&gt;
# Create a build folder;&lt;br /&gt;
# Configure, build and install &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; from within the build folder.&lt;br /&gt;
&lt;br /&gt;
=== Configure, Build and Install &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
==== Installation from Central Repository ====&lt;br /&gt;
&lt;br /&gt;
After the latest version has been pulled from its [https://github.com/Geant4/geant4 central repository] and placed within /unix/pbt/software/src/geant4, create a build directory within the PBT software directory from which you can compile the code: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build/&lt;br /&gt;
mkdir geant4&lt;br /&gt;
cd geant4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CMake can then be used to configure and install &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cmake ../../src/geant4/&lt;br /&gt;
ccmake .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;code&amp;gt;ccmake .&amp;lt;/code&amp;gt; opens an interactive GUI that can be used to specify installation options. From within this you can define your installation directory and configure any other options as required. On the PBT cluster it is required that the software is installed to the development directory and certain options are set, and so the configuration is defined as follows:  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CMAKE_INSTALL_PREFIX             /unix/pbt/dev/geant-4.10.3.p02&lt;br /&gt;
CMAKE_INSTALL_CONFIG_NAME        RelWithDebInfo&lt;br /&gt;
GEANT4_BUILD_MULTITHREADED       OFF&lt;br /&gt;
GEANT4_INSTALL_DATA              ON&lt;br /&gt;
GEANT4_BUILD_EXAMPLES            OFF&lt;br /&gt;
GEANT4_BUILD_TESTS               OFF&lt;br /&gt;
GEANT4_BUILD_STORE_TRAJECTORY    ON&lt;br /&gt;
GEANT4_BUILD_VERBOSE_CODE        ON&lt;br /&gt;
GEANT4_USE_G3TOG4                ON&lt;br /&gt;
GEANT4_USE_GDML                  ON&lt;br /&gt;
GEANT4_USE_INVENTOR              ON&lt;br /&gt;
GEANT4_USE_NETWORKDAWN           ON&lt;br /&gt;
GEANT4_USE_NETWORKVRML           ON&lt;br /&gt;
GEANT4_USE_OPENGL_X11            ON&lt;br /&gt;
GEANT4_USE_QT                    ON&lt;br /&gt;
GEANT4_USE_RAYTRACER_X11         ON&lt;br /&gt;
GEANT4_USE_SYSTEM_CLHEP          ON&lt;br /&gt;
GEANT4_USE_SYSTEM_EXPAT          ON&lt;br /&gt;
GEANT4_USE_SYSTEM_ZLIB           ON&lt;br /&gt;
GEANT4_USE_XM                    ON&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; The option &amp;lt;code&amp;gt;GEANT4_BUILD_MULTITHREADED&amp;lt;/code&amp;gt; is set to &amp;lt;code&amp;gt;OFF&amp;lt;/code&amp;gt; to allow compatibility with &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;. &lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;c&#039;&#039; to configure&lt;br /&gt;
&lt;br /&gt;
At this point, often the configuration is interrupted as the system cannot find all the necessary prerequisites. Enter any required base directories manually, e.g.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CLHEP_BASE_DIR                   /unix/pbt/software/dev/clhep-2.3.4.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;c&#039;&#039; to configure&lt;br /&gt;
*&#039;&#039;g&#039;&#039; to generate and exit&lt;br /&gt;
&lt;br /&gt;
The software can then be installed using the usual commands: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make &lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
==== Installation from source code ====&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; source code can be downloaded from the [http://geant4.web.cern.ch/geant4/support/download.shtml Geant4 Download Page] of the [http://geant4.web.cern.ch/geant4/ Geant4 website] given above.  &lt;br /&gt;
&lt;br /&gt;
Unless there is a &#039;&#039;&#039;very&#039;&#039;&#039; good reason for not doing so, it is always recommended to use the latest version: each version features incremental improvements and bug fixes over earlier version and normally also features superior physics modelling.  &lt;br /&gt;
&lt;br /&gt;
Alongside the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; download, there are also a number of data files available for modelling particular processes.  &lt;br /&gt;
These do not need to be downloaded separately as they can be added during &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; installation by setting the &amp;lt;code&amp;gt;-DGEANT4_INSTALL_DATA=ON&amp;lt;/code&amp;gt; compilation flag when running &amp;lt;code&amp;gt;cmake&amp;lt;/code&amp;gt; (see below).&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; source code is normally downloaded as a single gzipped &amp;lt;code&amp;gt;tar&amp;lt;/code&amp;gt;-file.  &lt;br /&gt;
This needs to be extracted with the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tar -xvz -f geant4.10.02.p01.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will extract the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; source code into a directory alongside the &amp;lt;code&amp;gt;tar&amp;lt;/code&amp;gt;-file.  &lt;br /&gt;
This directory can be renamed: it does not need to be kept the same for the installation described below to work, although the correct directory name should be substituted for the default name used below.&lt;br /&gt;
&lt;br /&gt;
Once the source code has been extracted, a &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; directory should be created alongside the &amp;lt;code&amp;gt;src&amp;lt;/code&amp;gt; to hold the compiled &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; files before they are moved to their final installation location.&lt;br /&gt;
&lt;br /&gt;
On the [[Software/Geant4/UCL HEP Cluster|UCL HEP Linux Cluster]], the &amp;lt;code&amp;gt;build&amp;lt;/code&amp;gt; directory should be created in &amp;lt;code&amp;gt;/unix/pbt/software/build&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build&lt;br /&gt;
mkdir geant4&lt;br /&gt;
cd geant4&lt;br /&gt;
mkdir geant4.10.02.p01-build&lt;br /&gt;
cd geant4.10.02.p01-build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike other software installed on the [[Software/Geant4/UCL HEP Cluster|UCL HEP Linux Cluster]], there are a number of ways to configure the software before building.  &lt;br /&gt;
Using the &amp;lt;code&amp;gt;ccmake&amp;lt;/code&amp;gt; command, each configuration option can be set interactively.  &lt;br /&gt;
Alternatively, the &amp;lt;code&amp;gt;cmake&amp;lt;/code&amp;gt; command below configures with the recommended options.  &lt;br /&gt;
&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;-DCMAKE_INSTALL_PREFIX=&amp;quot;/unix/pbt/software/prod-sl6&amp;quot;&amp;lt;/code&amp;gt; flag specifies that the resulting &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; should be installed in the directory &amp;lt;code&amp;gt;/unix/pbt/software/prod-sl6&amp;lt;/code&amp;gt; after compilation: this should be changed to suit the particular installation in question.&lt;br /&gt;
&lt;br /&gt;
Installation commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build/geant4/geant4.10.02.p01-prod-sl6&lt;br /&gt;
&lt;br /&gt;
cmake \&lt;br /&gt;
-DCMAKE_INSTALL_PREFIX=&amp;quot;/unix/pbt/software/prod-sl6&amp;quot; \&lt;br /&gt;
-DCMAKE_INSTALL_CONFIG_NAME=&amp;quot;ReleaseWithDebInfo&amp;quot; \&lt;br /&gt;
-DGEANT4_BUILD_MULTITHREADED=ON \&lt;br /&gt;
-DGEANT4_INSTALL_DATA=ON \&lt;br /&gt;
-DGEANT4_BUILD_EXAMPLES=OFF \&lt;br /&gt;
-DGEANT4_BUILD_TESTS=OFF \&lt;br /&gt;
-DGEANT4_ENABLE_TESTING=OFF \&lt;br /&gt;
-DGEANT4_BUILD_STORE_TRAJECTORY=ON \&lt;br /&gt;
-DGEANT4_BUILD_VERBOSE_CODE=ON \&lt;br /&gt;
-DGEANT4_USE_G3TOG4=ON \&lt;br /&gt;
-DGEANT4_USE_GDML=ON \&lt;br /&gt;
-DGEANT4_USE_INVENTOR=ON \&lt;br /&gt;
-DGEANT4_USE_NETWORKDAWN=ON \&lt;br /&gt;
-DGEANT4_USE_NETWORKVRML=ON \&lt;br /&gt;
-DGEANT4_USE_OPENGL_X11=ON \&lt;br /&gt;
-DGEANT4_USE_QT=ON \&lt;br /&gt;
-DGEANT4_USE_RAYTRACER_X11=ON \&lt;br /&gt;
-DGEANT4_USE_SYSTEM_CLHEP=ON \&lt;br /&gt;
-DGEANT4_USE_SYSTEM_EXPAT=ON \&lt;br /&gt;
-DGEANT4_USE_SYSTEM_ZLIB=ON \&lt;br /&gt;
-DGEANT4_USE_XM=ON \&lt;br /&gt;
/unix/pbt/software/src/geant4/geant4.10.02.p01-source&lt;br /&gt;
&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
=== Software package tests ===&lt;br /&gt;
&lt;br /&gt;
=== GEANT4 built-in tests ===&lt;br /&gt;
&lt;br /&gt;
The &amp;lt;code&amp;gt;GEANT4&amp;lt;/code&amp;gt; software includes some system tests, which can be included in the installation command via the options &amp;lt;code&amp;gt;-DGEANT4_BUILD_TESTS=ON -DGEANT4_ENABLE_TESTING=ON&amp;lt;/code&amp;gt;.&lt;br /&gt;
However, these tests are only used for testing of the system, and are not included in the distributed source tarballs, nor supported for use by end-users.&lt;br /&gt;
Therefore, these cannot easily be used for validation of the production system installation.&lt;br /&gt;
&lt;br /&gt;
=== GEANT4 examples ===&lt;br /&gt;
&lt;br /&gt;
One test of the &amp;lt;code&amp;gt;GEANT4&amp;lt;/code&amp;gt; software after installation is to make sure that all examples can be run and produce the expected results.&lt;br /&gt;
&lt;br /&gt;
Notes:&lt;br /&gt;
* The examples can be built at installation time using the command &amp;lt;code&amp;gt;-DGEANT4_BUILD_EXAMPLES=ON&amp;lt;/code&amp;gt;, but this throws up a number of problems because not all installation requirements are met. It is easier to build and run the examples after the installation is complete.&lt;br /&gt;
* Environment variable &amp;lt;code&amp;gt;G4SHARE&amp;lt;/code&amp;gt; is defined in the environment scripts &amp;lt;code&amp;gt;pbt.bashrc&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;pbt-dev.bashrc&amp;lt;/code&amp;gt;, along with the variable &amp;lt;code&amp;gt;G4VERSION&amp;lt;/code&amp;gt;. For the current installation, the location stored in this variable is &amp;lt;code&amp;gt;/unix/pbt/software/dev/share/Geant4-10.0.2&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The following errors and warnings were seen while configuring examples:&lt;br /&gt;
* Cannot find &amp;lt;code&amp;gt;AIDA&amp;lt;/code&amp;gt; package&lt;br /&gt;
* Cannot find &amp;lt;code&amp;gt;HBOOK&amp;lt;/code&amp;gt; package&lt;br /&gt;
* Cannot find &amp;lt;code&amp;gt;HepMC&amp;lt;/code&amp;gt; package&lt;br /&gt;
* Cannot find &amp;lt;code&amp;gt;Pythia6&amp;lt;/code&amp;gt; package&lt;br /&gt;
* Cannot find &amp;lt;code&amp;gt;GCCXML&amp;lt;/code&amp;gt; These packages are optional, but some of the examples are designed to demonstrate the connection with these packages. Note that some filetypes, such as &amp;lt;code&amp;gt;AIDA&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;HBOOK&amp;lt;/code&amp;gt;, do in fact have viewers installed in the PBT environments, but these are not available to the &amp;lt;code&amp;gt;GEANT4&amp;lt;/code&amp;gt; system. This what the errors are reporting.&lt;br /&gt;
&lt;br /&gt;
=== Basic examples ===&lt;br /&gt;
&lt;br /&gt;
==== B1 ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cp -r ${G4SHARE}/examples/basic/B1 . &lt;br /&gt;
&lt;br /&gt;
mkdir build &lt;br /&gt;
cd build &lt;br /&gt;
cmake ../B1 &lt;br /&gt;
make &lt;br /&gt;
./exampleB1 exampleB1.in | tee exampleB1.new.out &lt;br /&gt;
grep -B0 -A3 &amp;amp;quot;End of Global Run&amp;amp;quot; exampleB1.out &amp;amp;gt; exampleB1.old.results &lt;br /&gt;
grep -B0 -A3 &amp;amp;quot;End of Global Run&amp;amp;quot; exampleB1.new.out &amp;amp;gt; exampleB1.new.results &lt;br /&gt;
diff exampleB1.old.results exampleB1.new.results&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The newly generated simulation results contain similar but not identical values to those in the included &amp;lt;code&amp;gt;exampleB1.out&amp;lt;/code&amp;gt; file.&lt;br /&gt;
This is due to the fact that the results depend on the initial state of the random number generator. The random seed used to generate the example output is unknown.&lt;br /&gt;
&lt;br /&gt;
==== B1 visualisation ====&lt;br /&gt;
&lt;br /&gt;
The example, when run without arguments, opens in interactive mode using the visualisation driver selected in the file vis.mac:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
./exampleB1&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The various visualisation packages can be tested by editing vis.mac to select the appropriate package. Some drivers create an interactive view of the simulation geometry. Others write to a file which can be viewed using an external software package e.g. DAWN - see the [http://geant4.web.cern.ch/geant4/G4UsersDocuments/UsersGuides/ForApplicationDeveloper/html/Visualization/introduction.html geant manual] for details.&lt;br /&gt;
&lt;br /&gt;
Most packages are listed in the file in lines beginning &amp;lt;code&amp;gt;/vis/open&amp;lt;/code&amp;gt; and can be uncommented to select, e.g.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/vis/open OGL 600x600-0+0&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
&lt;br /&gt;
RayTracerX is not listed in the file but can be enabled by uncommenting the other /vis/open lines and adding the following line:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/vis/open RayTracerX&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>JamesChappell</name></author>
	</entry>
	<entry>
		<id>https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/Geant4/Installation/Coin3D&amp;diff=1168</id>
		<title>Software/Geant4/Installation/Coin3D</title>
		<link rel="alternate" type="text/html" href="https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/Geant4/Installation/Coin3D&amp;diff=1168"/>
		<updated>2017-10-20T10:28:55Z</updated>

		<summary type="html">&lt;p&gt;JamesChappell: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt; is a high-level, retained-mode toolkit for effective 3D graphics development. &lt;br /&gt;
It is API compatible with Open Inventor 2.1.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; requires the &amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt; headers and libraries in order to provide support for [https://en.wikipedia.org/wiki/Open_Inventor Open Inventor] visualisations.&lt;br /&gt;
&lt;br /&gt;
In order to function correctly, &amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt; requires the following additional components to be installed:&lt;br /&gt;
&lt;br /&gt;
* The [[#simage|&amp;lt;code&amp;gt;simage&amp;lt;/code&amp;gt;]] library with image format loaders and front-ends to common import libraries. &amp;lt;code&amp;gt;simage&amp;lt;/code&amp;gt; is meant for use with applications which read image files as textures.  &#039;&#039;&#039;&amp;lt;code&amp;gt;simage&amp;lt;/code&amp;gt; must be installed before &amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
* The [[#SoXt|&amp;lt;code&amp;gt;SoXt&amp;lt;/code&amp;gt;]] open source InventorXt library, which is a GUI binding for using Open Inventor with Xt/Motif. &amp;lt;code&amp;gt;SoXt&amp;lt;/code&amp;gt; has been developed for use with &amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt;.  &amp;lt;code&amp;gt;SoXt&amp;lt;/code&amp;gt; needs to be installed after &amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
* [[#SoQt|&amp;lt;code&amp;gt;SoXt&amp;lt;/code&amp;gt;]] open source &amp;lt;code&amp;gt;Qt&amp;lt;/code&amp;gt; GUI component toolkit library for &amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt;.  &amp;lt;code&amp;gt;SoQt&amp;lt;/code&amp;gt; needs to be installed after &amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt;&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
; Website : https://bitbucket.org/Coin3D/coin/&lt;br /&gt;
; Source URL : https://bitbucket.org/Coin3D/coin/downloads&lt;br /&gt;
; Installed version : 3.1.3 (13 February 2012)&lt;br /&gt;
; Source tarball : &amp;lt;code&amp;gt;src/geant4-prerequisites/coin3d/Coin3d-3.1.3.tar.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;simage&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
; Website : https://bitbucket.org/Coin3D/simage&lt;br /&gt;
; Source URL : https://bitbucket.org/Coin3D/coin/downloads/simage-1.7.0.tar.gz&lt;br /&gt;
; Installed Production version : 1.7.0 (13 February 2012)&lt;br /&gt;
; Source tarball : &amp;lt;code&amp;gt;src/geant4-prerequisites/coin3d/simage-1.7.0.tar.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
; Installed development version : 1.7.1a (20 October 2017)&lt;br /&gt;
; Central Repository : https://bitbucket.org/Coin3D/simage&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;SoXt&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
; Website : https://bitbucket.org/Coin3D/soxt&lt;br /&gt;
; Source URL : https://bitbucket.org/Coin3D/coin/downloads/SoXt-1.3.0.tar.gz&lt;br /&gt;
; Installed version : 1.3.0 (13 February 2012)&lt;br /&gt;
; Source tarball : &amp;lt;code&amp;gt;src/geant4-prerequisites/coin3d/SoXt-1.3.0.tar.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;code&amp;gt;SoQt&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
; Website : https://bitbucket.org/Coin3D/soqt&lt;br /&gt;
; Source URL : https://bitbucket.org/Coin3D/coin/downloads/SoQt-1.5.0.tar.gz&lt;br /&gt;
; Installed version : 1.5.0 (13 February 2012)&lt;br /&gt;
; Source tarball : &amp;lt;code&amp;gt;src/geant4-prerequisites/coin3d/SoXt-1.5.0.tar.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Installation Notes ==&lt;br /&gt;
&lt;br /&gt;
The [https://bitbucket.org/Coin3D/coin/wiki/How%20to%20build%20Coin3D%20and%20SIM%20Voleon &amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt; documentation] provides some useful instructions on building and installing &amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
For installation, &amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt; and the required libraries do not support installation into a sandbox directory (i.e. there are no options &amp;lt;code&amp;gt;prefix&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;DESTDIR&amp;lt;/code&amp;gt; defined for command &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;) and must be given the installation directory with the &amp;lt;code&amp;gt;--prefix&amp;lt;/code&amp;gt; option.  &lt;br /&gt;
As such, to recompile &amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt; for different target directories, the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script must be rerun with a modified &amp;lt;code&amp;gt;--prefix /path/to/dest&amp;lt;/code&amp;gt; option.  &lt;br /&gt;
This has to be managed manually as can be seen in the installation commands below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt; and each of the components contain a number of programming errors.  &lt;br /&gt;
Most can be ignored and skipped over by adding the compiler flag &amp;lt;code&amp;gt;-fpermissive&amp;lt;/code&amp;gt; at the configuration step.&lt;br /&gt;
&lt;br /&gt;
However, there is an error in the &amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt; source code that needs to be fixed before the code will compile: details on how to do so are given below.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;SoXt&amp;lt;/code&amp;gt; may require the following modifications to install correctly:&lt;br /&gt;
&lt;br /&gt;
* The configuration tool cannot find the libraries it needs unless the environment variable LD_RUN_PATH is manually set to include &amp;lt;code&amp;gt;/unix/pbt/software/prod-sl6/lib&amp;lt;/code&amp;gt; (set automatically by the environment scripts on the [[Software/Geant4/UCL HEP Cluster|UCL HEP Linux Cluster]]). &lt;br /&gt;
* For older versions of SoXt and SoQt, part of the code required for compilation was removed to a separate project called &amp;lt;code&amp;gt;SoGUI&amp;lt;/code&amp;gt;.  This GUI code needed to be incorporated into the library code before compilation.  The &amp;lt;code&amp;gt;SoGUI&amp;lt;/code&amp;gt; source code is available in a separate tarball, &amp;lt;code&amp;gt;src/geant4- prerequisites/coin3d/sogui-2011-12-03.tar.gz&amp;lt;/code&amp;gt;.  The more recent versions of the &amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt; components now incorporate this code by default.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
When downloading software, the downloaded tarball (or other &amp;lt;code&amp;gt;Zip&amp;lt;/code&amp;gt; archive) should be placed in an appropriately named directory in &amp;lt;code&amp;gt;/unix/pbt/software/src&amp;lt;/code&amp;gt;: the instructions below assume that the directory is &amp;lt;code&amp;gt;/unix/pbt/software/src/geant4-prerequisites/coin3d&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The source code should then be extracted into a suitable subdirectory in &amp;lt;code&amp;gt;/unix/pbt/software/build&amp;lt;/code&amp;gt;.  &lt;br /&gt;
The extracted source code directory can only be deleted once the software has been built and installed.&lt;br /&gt;
&lt;br /&gt;
Instructions are given for compiling each component of &amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt;: &#039;&#039;&#039;these must be followed in order&#039;&#039;&#039;.&lt;br /&gt;
&lt;br /&gt;
=== Source Code Extraction ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/src/geant4-prerequisites/coin3d&lt;br /&gt;
tar -xvz -f simage-1.7.0.tar.gz&lt;br /&gt;
tar -xvz -f Coin-3.1.3.tar.gz&lt;br /&gt;
tar -xvz -f SoXt-1.3.0.tar.gz&lt;br /&gt;
tar -xvz -f SoQt-1.5.0.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Fix Errors In &amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt; Code ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt; and each of the components contain a number of programming errors.  &lt;br /&gt;
Most can be ignored and skipped over by adding the compiler flag &amp;lt;code&amp;gt;-fpermissive&amp;lt;/code&amp;gt; at the configuration step.&lt;br /&gt;
&lt;br /&gt;
However, there is an error in the &amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt; source code that needs to be fixed before the code will compile:&lt;br /&gt;
&lt;br /&gt;
* In the &amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt; source directory, find the directory &amp;lt;code&amp;gt;src/fonts/&amp;lt;/code&amp;gt; and open the file &amp;lt;code&amp;gt;src/fonts/freetype.cpp&amp;lt;/code&amp;gt;.&lt;br /&gt;
* Insert the following two lines in &amp;lt;code&amp;gt;src/fonts/freetype.cpp&amp;lt;/code&amp;gt; before the line &amp;lt;code&amp;gt;#include fonts/freetype.h&amp;lt;/code&amp;gt;:&lt;br /&gt;
** &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;#include &amp;lt;cstdlib&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;&amp;lt;nowiki&amp;gt;#include &amp;lt;cmath&amp;gt;&amp;lt;/nowiki&amp;gt;&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The code should now compile successfully.&lt;br /&gt;
&lt;br /&gt;
=== Further modifications to enable compiling Geant4 with OpenInventor ===&lt;br /&gt;
&lt;br /&gt;
Geant4 compilation with OpenInventor enabled will fail unless an additional modification is made to the Coin3D source code.&lt;br /&gt;
&lt;br /&gt;
Open the file &amp;lt;code&amp;gt;/include/Inventor/SbBasic.h&amp;lt;/code&amp;gt; inside the Coin3D source, and add the following line below &amp;lt;code&amp;gt;#include &amp;lt;Inventor/C/basic.h&amp;gt;&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;lt;Inventor/C/errors/debugerror.h&amp;gt;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Build And Install ===&lt;br /&gt;
&lt;br /&gt;
It is possible to build for the &#039;&#039;&#039;Production&#039;&#039;&#039; environment without deleting the &amp;lt;code&amp;gt;Coin3D build&amp;lt;/code&amp;gt; directory created for the &#039;&#039;&#039;Development&#039;&#039;&#039; installation, meaning that significant time is saved when running &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;.  &lt;br /&gt;
However, it isn&#039;t recommended to do so as the &#039;&#039;&#039;Production&#039;&#039;&#039; installation ends up referencing components within &amp;lt;code&amp;gt;/unix/pbt/software/dev&amp;lt;/code&amp;gt; which is not desirable as the two environments are no longer independent.  &lt;br /&gt;
As such, these instructions assume one is building from scratch for each environment: to do so, make sure that the &amp;lt;code&amp;gt;build/coin3d&amp;lt;/code&amp;gt; directory is deleted before recreating it for the subsequent build and install.&lt;br /&gt;
&lt;br /&gt;
Also, although it is possible to install straight to the &#039;&#039;&#039;Production&#039;&#039;&#039; environment, it is highly discouraged to do so without first compiling a &#039;&#039;&#039;Development&#039;&#039;&#039; version. &lt;br /&gt;
&lt;br /&gt;
==== Installing &amp;lt;code&amp;gt;simage&amp;lt;/code&amp;gt; from its Central Repository ====&lt;br /&gt;
&lt;br /&gt;
After the latest version has been pulled from its [https://bitbucket.org/Coin3D/simage central repository] and placed within /unix/pbt/software/src/geant4-prerequisites/simage, create a build directory within the PBT software directory from which you can compile the code: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build/&lt;br /&gt;
mkdir simage-1.7.1a&lt;br /&gt;
cd simage-1.7.1a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;simage&amp;lt;/code&amp;gt; is then compiled using its /configure script with the following options. Note: Here, the software is to be installed into the development software directory using the command &amp;lt;code&amp;gt;--prefix=/unix/pbt/software/dev/simage-1.7.1a&amp;lt;/code&amp;gt;. Define this as appropriate for your system. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
../../../src/geant4-prerequisites/simage/configure \&lt;br /&gt;
   --prefix=/unix/pbt/software/dev/simage-1.7.1a&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;simage&amp;lt;/code&amp;gt; can then be compiled and installed using the usual commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make &lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Development Environment: &amp;lt;code&amp;gt;simage&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build&lt;br /&gt;
mkdir -pv coin3d/simage-1.7.0&lt;br /&gt;
cd coin3d/simage-1.7.0&lt;br /&gt;
../../../src/geant4-prerequisites/coin3d/simage-1.7.0/configure --prefix /unix/pbt/software/dev/simage-1.7.0 CXXFLAGS=-fpermissive&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Development Environment: &amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build&lt;br /&gt;
mkdir -pv coin3d/Coin-3.1.3&lt;br /&gt;
cd coin3d/Coin-3.1.3&lt;br /&gt;
../../../src/geant4-prerequisites/coin3d/Coin-3.1.3/configure --prefix /unix/pbt/software/dev/Coin-3.1.3 CXXFLAGS=-fpermissive&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Development Environment: &amp;lt;code&amp;gt;SoXt&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build&lt;br /&gt;
mkdir -pv coin3d/SoXt-1.3.0&lt;br /&gt;
cd coin3d/SoXt-1.3.0&lt;br /&gt;
../../../src/geant4-prerequisites/coin3d/SoXt-1.3.0/configure --prefix /unix/pbt/software/dev/SoXt-1.3.0 CXXFLAGS=-fpermissive&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Development Environment: &amp;lt;code&amp;gt;SoXt&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build&lt;br /&gt;
mkdir -pv coin3d/SoQt-1.5.0&lt;br /&gt;
cd coin3d/SoQt-1.5.0&lt;br /&gt;
../../../src/geant4-prerequisites/coin3d/SoQt-1.5.0/configure --prefix /unix/pbt/software/dev/SoQt-1.5.0 CXXFLAGS=-fpermissive&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Production Environment: &amp;lt;code&amp;gt;simage&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build&lt;br /&gt;
mkdir -pv coin3d/simage-1.7.0&lt;br /&gt;
cd coin3d/simage-1.7.0&lt;br /&gt;
../../../src/geant4-prerequisites/coin3d/simage-1.7.0/configure --prefix /unix/pbt/software/prod-sl6 CXXFLAGS=-fpermissive&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Production Environment: &amp;lt;code&amp;gt;Coin3D&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build&lt;br /&gt;
mkdir -pv coin3d/Coin-3.1.3&lt;br /&gt;
cd coin3d/Coin-3.1.3&lt;br /&gt;
../../../src/geant4-prerequisites/coin3d/Coin-3.1.3/configure --prefix /unix/pbt/software/prod-sl6 CXXFLAGS=-fpermissive&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Production Environment: &amp;lt;code&amp;gt;SoXt&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build&lt;br /&gt;
mkdir -pv coin3d/SoXt-1.3.0&lt;br /&gt;
cd coin3d/SoXt-1.3.0&lt;br /&gt;
../../../src/geant4-prerequisites/coin3d/SoXt-1.3.0/configure --prefix /unix/pbt/software/prod-sl6 CXXFLAGS=-fpermissive&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Production Environment: &amp;lt;code&amp;gt;SoQt&amp;lt;/code&amp;gt; ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build&lt;br /&gt;
mkdir -pv coin3d/SoQt-1.5.0&lt;br /&gt;
cd coin3d/SoQt-1.5.0&lt;br /&gt;
../../../src/geant4-prerequisites/coin3d/SoQt-1.5.0/configure --prefix /unix/pbt/software/prod-sl6 CXXFLAGS=-fpermissive&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>JamesChappell</name></author>
	</entry>
	<entry>
		<id>https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/Geant4/Installation/Xerces-C&amp;diff=1167</id>
		<title>Software/Geant4/Installation/Xerces-C</title>
		<link rel="alternate" type="text/html" href="https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/Geant4/Installation/Xerces-C&amp;diff=1167"/>
		<updated>2017-10-20T10:19:45Z</updated>

		<summary type="html">&lt;p&gt;JamesChappell: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Xerces-C++&amp;lt;/code&amp;gt; is a validating XML parser written in a portable subset of C++. Xerces-C++ makes it easy to give your application the ability to read and write XML data.  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; requires the &amp;lt;code&amp;gt;Xerces-C++&amp;lt;/code&amp;gt; headers and libraries compiled against the C++11 standard in order to provide support for GDML geometry descriptions.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
&lt;br /&gt;
; Website : http://xerces.apache.org/xerces-c/&lt;br /&gt;
; Source URL : http://www.apache.org/dist/xerces/c/3/sources/&lt;br /&gt;
; Installed Production version : 3.1.3 (17 Feb 2016)&lt;br /&gt;
; Source code : &amp;lt;code&amp;gt;src/geant4-prerequisites/xerces-c/xerces-c-3.1.3.tar.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
; Installed Development version : 3.2.0 (20 October 2017)&lt;br /&gt;
; Central Repository : https://github.com/apache/xerces-c&lt;br /&gt;
&lt;br /&gt;
== Installation Notes ==&lt;br /&gt;
&lt;br /&gt;
The [http://xerces.apache.org/xerces-c/ Xerces-C++ website] provides some useful instructions on [http://xerces.apache.org/xerces-c/build-3.html Building and Installing Xerces-C++].&lt;br /&gt;
&lt;br /&gt;
For installation, &amp;lt;code&amp;gt;Xerces-C++&amp;lt;/code&amp;gt; does not support installation into a sandbox directory (i.e. there are no options &amp;lt;code&amp;gt;prefix&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;DESTDIR&amp;lt;/code&amp;gt; defined for command &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;) and must be given the installation directory with the &amp;lt;code&amp;gt;-prefix&amp;lt;/code&amp;gt; option.  &lt;br /&gt;
As such, to recompile &amp;lt;code&amp;gt;Xerces-C++&amp;lt;/code&amp;gt; for different target directories, the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script must be rerun with a modified &amp;lt;code&amp;gt;-prefix /path/to/dest&amp;lt;/code&amp;gt; option.  &lt;br /&gt;
This has to be managed manually as can be seen in the installation commands below.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
When downloading software, the downloaded tarball (or other &amp;lt;code&amp;gt;Zip&amp;lt;/code&amp;gt; archive) should be placed in an appropriately named directory in &amp;lt;code&amp;gt;/unix/pbt/software/src&amp;lt;/code&amp;gt;: the instructions below assume that the directory is &amp;lt;code&amp;gt;/unix/pbt/software/src/geant4-prerequisites/xerces-c&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The source code should then be extracted into a suitable subdirectory in &amp;lt;code&amp;gt;/unix/pbt/software/build&amp;lt;/code&amp;gt;.  &lt;br /&gt;
The extracted source code directory can only be deleted once the software has been built and installed.&lt;br /&gt;
&lt;br /&gt;
=== Installation from Central Repository ===&lt;br /&gt;
&lt;br /&gt;
After the latest version has been pulled from its [https://github.com/apache/xerces-c central repository] and placed within /unix/pbt/software/src/xerces-c, create a build directory within the PBT software directory from which you can compile the code: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build/&lt;br /&gt;
mkdir xerces-c&lt;br /&gt;
cd xerces-c&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CMake&amp;lt;/code&amp;gt; can then be used to configure and install &amp;lt;code&amp;gt;Xerces-C&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cmake ../../src/xerces-c&lt;br /&gt;
ccmake .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command ccmake . opens an interactive GUI that can be used to specify installation options. From within this you can define your installation directory and configure any other options as required. On the PBT cluster it is required that the software is installed to the development directory, and so the CMAKE_INSTALL_PREFIX is defined as follows: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CMAKE_INSTALL_PREFIX       /unix/pbt/software/dev/xerces-c-3.2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;c&#039;&#039; to configure&lt;br /&gt;
*&#039;&#039;g&#039;&#039; to generate and exit&lt;br /&gt;
&lt;br /&gt;
The software can then be installed using the usual commands: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make &lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installation from source code ===&lt;br /&gt;
&lt;br /&gt;
==== Source Code Extraction ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/src/geant4-prerequisites/xerces-c&lt;br /&gt;
tar -xvz -f xerces-c-3.1.3.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Build And Install ====&lt;br /&gt;
&lt;br /&gt;
It is possible to build for the &#039;&#039;&#039;Production&#039;&#039;&#039; environment without deleting the &amp;lt;code&amp;gt;Xerces-C build&amp;lt;/code&amp;gt; directory created for the &#039;&#039;&#039;Development&#039;&#039;&#039; installation, meaning that significant time is saved when running &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;.  &lt;br /&gt;
However, it isn&#039;t recommended to do so as the &#039;&#039;&#039;Production&#039;&#039;&#039; installation ends up referencing components within &amp;lt;code&amp;gt;/unix/pbt/software/dev&amp;lt;/code&amp;gt; which is not desirable as the two environments are no longer independent.  &lt;br /&gt;
As such, these instructions assume one is building from scratch for each environment: to do so, make sure that the &amp;lt;code&amp;gt;build/qt&amp;lt;/code&amp;gt; directory is deleted before recreating it for the subsequent build and install.&lt;br /&gt;
&lt;br /&gt;
Also, although it is possible to install straight to the &#039;&#039;&#039;Production&#039;&#039;&#039; environment, it is highly discouraged to do so without first compiling a &#039;&#039;&#039;Development&#039;&#039;&#039; version. &lt;br /&gt;
&lt;br /&gt;
===== Development Environment =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build&lt;br /&gt;
mkdir -pv xerces-c/xerces-c-3.1.3&lt;br /&gt;
cd xerces-c/xerces-c-3.1.3&lt;br /&gt;
../../../src/geant4-prerequisites/xerces-c/xerces-c/configure --prefix /unix/pbt/software/dev/xerces-c-3.1.3&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Production Environment =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build&lt;br /&gt;
mkdir -pv xerces-c/xerces-c-3.1.3&lt;br /&gt;
cd xerces-c/xerces-c-3.1.3&lt;br /&gt;
../../../src/geant4-prerequisites/xerces-c/xerces-c/configure --prefix /unix/pbt/software/prod-sl6&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>JamesChappell</name></author>
	</entry>
	<entry>
		<id>https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/Geant4/Installation/Qt&amp;diff=1166</id>
		<title>Software/Geant4/Installation/Qt</title>
		<link rel="alternate" type="text/html" href="https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/Geant4/Installation/Qt&amp;diff=1166"/>
		<updated>2017-10-20T10:11:27Z</updated>

		<summary type="html">&lt;p&gt;JamesChappell: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Qt&amp;lt;/code&amp;gt; [https://en.wikipedia.org/wiki/Qt_(software) &amp;quot;is a cross-platform application framework that is widely used for developing application software that can be run on various software and hardware platforms with little or no change in the underlying codebase, while still being a native application with the capabilities and speed thereof&amp;quot;].&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt;, the &amp;lt;code&amp;gt;Qt&amp;lt;/code&amp;gt; headers and libraries are required in order to allow visualisation and interaction through the &amp;lt;code&amp;gt;Qt&amp;lt;/code&amp;gt; user interface.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
&lt;br /&gt;
; Website : http://qt-project.org&lt;br /&gt;
; Source URL : http://download.qt.io/official_releases/qt/5.6/5.6.0/submodules/&lt;br /&gt;
; Installed Production version : 5.6.0 (13 May 2016)&lt;br /&gt;
; Source code : &amp;lt;code&amp;gt;src/geant4-prerequisites/qt/qtbase-opensource-src-5.6.0.tar.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
; Installed Development version : 5.8.0 (20 October 2017)&lt;br /&gt;
; Central Repository : https://github.com/qt/qt5&lt;br /&gt;
&lt;br /&gt;
== Installation Notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; supports &amp;lt;code&amp;gt;Qt 4.6&amp;lt;/code&amp;gt; or higher (&amp;lt;code&amp;gt;Qt 4.8&amp;lt;/code&amp;gt; or higher on Mac).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Qt&amp;lt;/code&amp;gt; is available in a number of different versions and with a vast array of submodules.  Only the &amp;quot;qtbase&amp;quot; submodule is required to compile all the elements required for &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt;.  The various different installer and source code options can be found at: http://www.qt.io/download-open-source/&lt;br /&gt;
&lt;br /&gt;
For installation, &amp;lt;code&amp;gt;Qt&amp;lt;/code&amp;gt; does not support installation into a sandbox directory (i.e. there are no options &amp;lt;code&amp;gt;prefix&amp;lt;/code&amp;gt; or &amp;lt;code&amp;gt;DESTDIR&amp;lt;/code&amp;gt; defined for command &amp;lt;code&amp;gt;make install&amp;lt;/code&amp;gt;) and must be given the installation directory with the &amp;lt;code&amp;gt;-prefix&amp;lt;/code&amp;gt; option.  As such, to recompile &amp;lt;code&amp;gt;Qt&amp;lt;/code&amp;gt; for different target directories, the &amp;lt;code&amp;gt;configure&amp;lt;/code&amp;gt; script must be rerun with a modified &amp;lt;code&amp;gt;-prefix /path/to/dest&amp;lt;/code&amp;gt; option.  This has to be managed manually as can be seen in the installation commands below.&lt;br /&gt;
&lt;br /&gt;
The tarball extracts to a rather long folder name. To follow the installation commands below, rename this to &amp;lt;code&amp;gt;src/qt-5.6.0&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Some instructions on the correct package to download and the various compilation flags were provided by Ben Morgan at Warwick, along with this configuration script:&lt;br /&gt;
&lt;br /&gt;
https://github.com/SuperNEMO-DBD/homebrew-cadfael/blob/master/Formula/qt5-base.rb&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
When downloading software, the downloaded tarball (or other &amp;lt;code&amp;gt;Zip&amp;lt;/code&amp;gt; archive) should be placed in an appropriately named directory in &amp;lt;code&amp;gt;/unix/pbt/software/src&amp;lt;/code&amp;gt;: the instructions below assume that the directory is &amp;lt;code&amp;gt;/unix/pbt/software/src/qt&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The source code should then be extracted into a suitable subdirectory in &amp;lt;code&amp;gt;/unix/pbt/software/build&amp;lt;/code&amp;gt;.  The extracted source code directory can only be deleted once the software has been built and installed.&lt;br /&gt;
&lt;br /&gt;
=== Installation from Central Repository ===&lt;br /&gt;
&lt;br /&gt;
After the latest version has been pulled from its [https://github.com/qt/qt5 central repository] and placed within &amp;lt;code&amp;gt;/unix/pbt/software/src/qt&amp;lt;/code&amp;gt;, create a build directory within the PBT software directory from which you can compile the code:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build/&lt;br /&gt;
mkdir qt-5.8.0&lt;br /&gt;
cd qt-5.8.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Qt&amp;lt;/code&amp;gt; is then compiled using its &amp;lt;code&amp;gt;/configure&amp;lt;/code&amp;gt; script with the following options. &#039;&#039;&#039;Note:&#039;&#039;&#039; Here, the software is to be installed into the development software directory using the command &amp;lt;code&amp;gt;-prefix /unix/pbt/software/dev/qt-5.8.0&amp;lt;/code&amp;gt;. Define this as appropriate for your system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
../../src/qt/configure -prefix /unix/pbt/software/dev/qt-5.8.0 -verbose -release -opensource -confirm-license -system-zlib -qt-libpng -qt-libjpeg -qt-freetype -qt-pcre -nomake tests -nomake examples -pkg-config -c++std c++14 -qt-xcb -fontconfig -system-freetype&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; the installation options used here are specific to &amp;lt;code&amp;gt;Qt v5.8.0&amp;lt;/code&amp;gt; and are taken from Ben Morgan&#039;s [https://github.com/SuperNEMO-DBD/homebrew-cadfael/blob/master/Formula/qt5-base.rb script]. If installing a different version of &amp;lt;code&amp;gt;Qt&amp;lt;/code&amp;gt;, it is likely that the configuration options may need to be different for your system.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Qt&amp;lt;/code&amp;gt; can then be compiled and installed using the usual commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make &lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installation from source code ===&lt;br /&gt;
&lt;br /&gt;
==== Source Code Extraction ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/src/geant4-prerequisites/qt&lt;br /&gt;
tar -xvz -f qtbase-opensource-src-5.6.0.tar.gz&lt;br /&gt;
mv qtbase-opensource-src-5.6.0 qt-5.6.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Build And Install ====&lt;br /&gt;
&lt;br /&gt;
It is possible to build for the &#039;&#039;&#039;Production&#039;&#039;&#039; environment without deleting the &amp;lt;code&amp;gt;Qt build&amp;lt;/code&amp;gt; directory created for the &#039;&#039;&#039;Development&#039;&#039;&#039; installation, meaning that significant time is saved when running &amp;lt;code&amp;gt;make&amp;lt;/code&amp;gt;.  &lt;br /&gt;
However, it isn&#039;t recommended to do so as the &#039;&#039;&#039;Production&#039;&#039;&#039; installation ends up referencing components within &amp;lt;code&amp;gt;/unix/pbt/software/dev&amp;lt;/code&amp;gt; which is not desirable as the two environments are no longer independent.  &lt;br /&gt;
As such, these instructions assume one is building from scratch for each environment: to do so, make sure that the &amp;lt;code&amp;gt;build/qt&amp;lt;/code&amp;gt; directory is deleted before recreating it for the subsequent build and install.&lt;br /&gt;
&lt;br /&gt;
Also, although it is possible to install straight to the &#039;&#039;&#039;Production&#039;&#039;&#039; environment, it is highly discouraged to do so without first compiling a &#039;&#039;&#039;Development&#039;&#039;&#039; version. &lt;br /&gt;
&lt;br /&gt;
===== Development Environment =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build&lt;br /&gt;
mkdir -pv qt/qt-5.6.0&lt;br /&gt;
cd qt/qt-5.6.0&lt;br /&gt;
../../../src/geant4-prerequisites/qt/qt-5.6.0/configure -prefix /unix/pbt/software/dev/qt-5.6.0 -release -opensource -confirm-licence -nomake tests -nomake examples -optimized-qmake -opengl -qt-xcb&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Production Environment =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build&lt;br /&gt;
mkdir -pv qt/qt-5.6.0&lt;br /&gt;
cd qt/qt-5.6.0&lt;br /&gt;
../../../src/geant4-prerequisites/qt/qt-5.6.0/configure -prefix /unix/pbt/software/prod-sl6 -release -opensource -confirm-licence -nomake tests -nomake examples -optimized-qmake -opengl -qt-xcb&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>JamesChappell</name></author>
	</entry>
	<entry>
		<id>https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/Geant4/Installation/CLHEP&amp;diff=1165</id>
		<title>Software/Geant4/Installation/CLHEP</title>
		<link rel="alternate" type="text/html" href="https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/Geant4/Installation/CLHEP&amp;diff=1165"/>
		<updated>2017-10-20T09:56:15Z</updated>

		<summary type="html">&lt;p&gt;JamesChappell: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CLHEP&amp;lt;/code&amp;gt; is intended to be a set of HEP-specific foundation and utility classes such as random generators, physics vectors, geometry and linear algebra.  &lt;br /&gt;
&amp;lt;code&amp;gt;CLHEP&amp;lt;/code&amp;gt; is structured in a set of packages independent of any external package.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; requires the &amp;lt;code&amp;gt;CLHEP&amp;lt;/code&amp;gt; libraries in order to compile simulations.  &lt;br /&gt;
By default &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; distributes a minimal version of the &amp;lt;code&amp;gt;CLHEP&amp;lt;/code&amp;gt; library sources with the toolkit to help cross-platform usage.  &lt;br /&gt;
This internal version of the CLHEP library is built and used by default, so having an external install of CLHEP is no longer a prerequisite for Geant4.&lt;br /&gt;
&lt;br /&gt;
However, the [[Software/BDSIM|BDSIM]] accelerator simulation toolkit, which uses Geant4 for particle-matter interactions, requires a standalone version of &amp;lt;code&amp;gt;CLHEP&amp;lt;/code&amp;gt; to be compiled separately from &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt;.  &lt;br /&gt;
As such, the instructions below relate to the standalone version of &amp;lt;code&amp;gt;CLHEP&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
&lt;br /&gt;
; Website : http://proj-clhep.web.cern.ch/proj-clhep/&lt;br /&gt;
; Source URL : http://proj-clhep.web.cern.ch/proj-clhep/DISTRIBUTION/&lt;br /&gt;
; Installed Production version : 2.3.1.1 (15 Mar 2016)&lt;br /&gt;
; Source code : &amp;lt;code&amp;gt;src/geant4-prerequisites/clhep/2.3.1.1&amp;lt;/code&amp;gt;&lt;br /&gt;
; Installed Development version : 2.3.4.5 (20 October 2017)&lt;br /&gt;
; Central Repository : https://gitlab.cern.ch/CLHEP/CLHEP &lt;br /&gt;
&lt;br /&gt;
== Installation Notes ==&lt;br /&gt;
&lt;br /&gt;
The [http://proj-clhep.web.cern.ch/proj-clhep/ CLHEP website] provides some documentation on building and installing standalone &amp;lt;code&amp;gt;CLHEP&amp;lt;/code&amp;gt; libraries at http://proj-clhep.web.cern.ch/proj-clhep/INSTALLATION/clhep-2.0.html .&lt;br /&gt;
&lt;br /&gt;
According to the release notes, http://geant4.web.cern.ch/geant4/support/ReleaseNotes4.10.2.html, the supported version of CLHEP for &amp;lt;code&amp;gt;Geant4.10.2.p01&amp;lt;/code&amp;gt; is 2.3.1.1. Using other versions of &amp;lt;code&amp;gt;CLHEP&amp;lt;/code&amp;gt; may produce incorrect simulation results.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
When downloading software, the downloaded tarball (or other &amp;lt;code&amp;gt;Zip&amp;lt;/code&amp;gt; archive) should be placed in an appropriately named directory in &amp;lt;code&amp;gt;/unix/pbt/software/src&amp;lt;/code&amp;gt;: the instructions below assume that the directory is &amp;lt;code&amp;gt;/unix/pbt/software/src/clhep&amp;lt;/code&amp;gt;. The tarball should then be extracted into the same subdirectory.&lt;br /&gt;
&lt;br /&gt;
For CLHEP, the tarball is named &amp;lt;code&amp;gt;clhep-2.3.1.1.tgz&amp;lt;/code&amp;gt;. When extracted, this produces a directory called &amp;lt;code&amp;gt;2.3.1.1&amp;lt;/code&amp;gt;. Therefore, you will end up with a directory called &amp;lt;code&amp;gt;/unix/pbt/software/src/clhep/2.3.1.1&amp;lt;/code&amp;gt; containing the CLHEP source code.&lt;br /&gt;
&lt;br /&gt;
=== Installation from Central Repository ===&lt;br /&gt;
&lt;br /&gt;
Once the latest version of CLHEP has been pulled from its [https://gitlab.cern.ch/CLHEP/CLHEP central repository] and placed within &amp;lt;code&amp;gt;/unix/pbt/software/src/clhep/&amp;lt;/code&amp;gt;, create a build directory within the PBT Software directory from which you can compile &amp;lt;code&amp;gt;CLHEP&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build/&lt;br /&gt;
mkdir clhep-2.3.4.5&lt;br /&gt;
cd clhep-2.3.4.5&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CMake&amp;lt;/code&amp;gt; can then be used to compile &amp;lt;code&amp;gt;CLHEP&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cmake ../../src/clhep/&lt;br /&gt;
ccmake .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
The command &amp;lt;code&amp;gt;ccmake .&amp;lt;/code&amp;gt; opens an interactive GUI that can be used to specify installation options. From within this you can define your installation directory and configure any other options as required. On the PBT cluster it is required that the software is installed to the development directory, and so the &amp;lt;code&amp;gt;CMAKE_INSTALL_PREFIX&amp;lt;/code&amp;gt; is defined as follows:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CMAKE_INSTALL_PREFIX         /unix/pbt/software/dev/clhep-2.3.4.5/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
* &#039;&#039;c&#039;&#039; to configure&lt;br /&gt;
* &#039;&#039;g&#039;&#039; to generate and exit&lt;br /&gt;
&lt;br /&gt;
The software can then be installed using the usual commands:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installation from the Source Code ===&lt;br /&gt;
&lt;br /&gt;
==== Source Code Extraction ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/src/clhep&lt;br /&gt;
tar -xvzf clhep-2.3.1.1.tgz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Build And Install ====&lt;br /&gt;
&lt;br /&gt;
===== Development Environment =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build&lt;br /&gt;
mkdir -pv clhep/clhep-2.3.1.1&lt;br /&gt;
cd clhep/clhep-2.3.1.1&lt;br /&gt;
cmake -DCMAKE_INSTALL_PREFIX=/unix/pbt/software/dev/clhep-2.3.1.1 /unix/pbt/software/src/geant4-prerequisites/clhep/2.3.1.1/CLHEP&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Production Environment =====&lt;br /&gt;
&lt;br /&gt;
It may be possible to install in the production environment by running cmake again and changing the install prefix, then running make install:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build/clhep/clhep-2.3.1.1&lt;br /&gt;
cmake -DCMAKE_INSTALL_PREFIX=/unix/pbt/software/prod .&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will save having to compile the code again. If this does not work, the compilation steps for the development environment (above) will need to be repeated in another build directory:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build&lt;br /&gt;
mkdir -pv clhep/clhep-2.3.1.1-prod&lt;br /&gt;
cd clhep/clhep-2.3.1.1-prod&lt;br /&gt;
cmake -DCMAKE_INSTALL_PREFIX=/unix/pbt/software/prod /unix/pbt/software/src/clhep/2.3.1.1/CLHEP&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>JamesChappell</name></author>
	</entry>
	<entry>
		<id>https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/Geant4/Installation/CMake&amp;diff=1164</id>
		<title>Software/Geant4/Installation/CMake</title>
		<link rel="alternate" type="text/html" href="https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/Geant4/Installation/CMake&amp;diff=1164"/>
		<updated>2017-10-20T09:37:52Z</updated>

		<summary type="html">&lt;p&gt;JamesChappell: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Introduction ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;CMake&amp;lt;/code&amp;gt; is an open-source, cross-platform family of tools designed to build, test and package software. &lt;br /&gt;
&amp;lt;code&amp;gt;CMake&amp;lt;/code&amp;gt; is used to control the software compilation process using simple platform and compiler independent configuration files, and generate native makefiles and workspaces that can be used in the compiler environment of your choice..&lt;br /&gt;
&lt;br /&gt;
For &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt;, &amp;lt;code&amp;gt;CMake&amp;lt;/code&amp;gt; is used to control the installation process through the generation of &amp;lt;code&amp;gt;CMake&amp;lt;/code&amp;gt; &amp;lt;code&amp;gt;makefiles&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
&lt;br /&gt;
; Website : https://cmake.org/&lt;br /&gt;
; Source URL : https://cmake.org/files/v3.5/&lt;br /&gt;
; Installed Production version : 3.5.2 (16 April 2016)&lt;br /&gt;
; Source code : &amp;lt;code&amp;gt;src/geant4-prerequisites/cmake/cmake-3.5.2-Linux-x86_64.tar.gz&amp;lt;/code&amp;gt;&lt;br /&gt;
; Installed Development version : 3.9.4 (20 October 2017)&lt;br /&gt;
; Central Repository : https://gitlab.kitware.com/cmake/cmake&lt;br /&gt;
&lt;br /&gt;
== Installation Notes ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; requires &amp;lt;code&amp;gt;CMake&amp;lt;/code&amp;gt; 3.3 or higher.&lt;br /&gt;
&lt;br /&gt;
=== Installation from Central Repository ===&lt;br /&gt;
&lt;br /&gt;
The latest version of &amp;lt;code&amp;gt;CMake&amp;lt;/code&amp;gt; can be downloaded from its central repository, https://gitlab.kitware.com/cmake/cmake. Once downloaded, a simple bootstrap installation can be used to install the software as outlined below.&lt;br /&gt;
&lt;br /&gt;
=== Installation using precompiled binaries ===&lt;br /&gt;
&lt;br /&gt;
Unlike most of the other &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; prerequisites, &amp;lt;code&amp;gt;CMake&amp;lt;/code&amp;gt; comes as precompiled binaries downloaded directly from https://cmake.org/download/ .  &lt;br /&gt;
There are versions available for myriad operating systems, including 32-bit and 64-bit Linux.  &lt;br /&gt;
These instructions show the latter since the UCL HEP Cluster runs 64-bit Scientific Linux.&lt;br /&gt;
&lt;br /&gt;
There are a number of different &amp;lt;code&amp;gt;Zip&amp;lt;/code&amp;gt; archive formats available: any of these can be downloaded and extracted into the appropriate location in &amp;lt;code&amp;gt;/unix/pbt/software/src&amp;lt;/code&amp;gt; (see instructions below).  &lt;br /&gt;
&lt;br /&gt;
Once unpacked, the files need only be moved into the correct target directory.  &lt;br /&gt;
Although files can be moved by hand for the &#039;&#039;&#039;Production&#039;&#039;&#039; environment, it is recommended to use the &amp;lt;code&amp;gt;dev2prod.sh&amp;lt;/code&amp;gt; script as part of the automated copying process.  &lt;br /&gt;
Instructions for the former, however, are given below.&lt;br /&gt;
&lt;br /&gt;
== Installation ==&lt;br /&gt;
&lt;br /&gt;
When downloading software, the downloaded tarball (or other &amp;lt;code&amp;gt;Zip&amp;lt;/code&amp;gt; archive) should be placed in an appropriately named directory in &amp;lt;code&amp;gt;/unix/pbt/software/src&amp;lt;/code&amp;gt;: the instructions below assume that the directory is &amp;lt;code&amp;gt;/unix/pbt/software/src/cmake&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
=== Installation from central repository ===&lt;br /&gt;
&lt;br /&gt;
After the latest version (here v3.9.4) has been pulled from the central repository, create a directory within the build section of the PBT Software directory from which you can compile &amp;lt;code&amp;gt;CMake&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build/&lt;br /&gt;
mkdir cmake-3.9.4&lt;br /&gt;
cd cmake-3.9.4&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A simple bootstrap installation is then used to install &amp;lt;code&amp;gt;CMake&amp;lt;/code&amp;gt; within the development section of the PBT Software cluster. &#039;&#039;&#039;Note:&#039;&#039;&#039; The &amp;lt;code&amp;gt;--prefix&amp;lt;/code&amp;gt; option defines the installation prefix, i.e. where the software will be installed. In this case, the software is installed to &amp;lt;code&amp;gt;/unix/pbt/software/dev/cmake-3.9.4/&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
../../../src/cmake/bootstrap --prefix=/unix/pbt/software/dev/cmake-3.9.4/&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Installation from precompiled binaries ===&lt;br /&gt;
&lt;br /&gt;
==== Source Code Extraction ====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/src/geant4-prerequisites/cmake&lt;br /&gt;
tar -xvz -f cmake-3.5.2-Linux-x86_64.tar.gz&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Build And Install ====&lt;br /&gt;
&lt;br /&gt;
Although it is discouraged to copy the &amp;lt;code&amp;gt;CMake&amp;lt;/code&amp;gt; binaries from the &#039;&#039;&#039;Development&#039;&#039;&#039; to the &#039;&#039;&#039;Production&#039;&#039;&#039; directory &amp;amp;mdash; this should be handled by the &amp;lt;code&amp;gt;dev2prod.sh&amp;lt;/code&amp;gt; script &amp;amp;mdash; instructions for doing so are given below.&lt;br /&gt;
&lt;br /&gt;
===== Development Environment =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/src/geant4-prerequisites/cmake&lt;br /&gt;
mv -v cmake-3.5.2-Linux-x86_64 /unix/pbt/software/dev/cmake-3.5.2&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
===== Production Environment =====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/dev/&lt;br /&gt;
cp -av cmake-3.5.2/* /unix/pbt/software/prod/&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>JamesChappell</name></author>
	</entry>
	<entry>
		<id>https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/BDSIM&amp;diff=1163</id>
		<title>Software/BDSIM</title>
		<link rel="alternate" type="text/html" href="https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/BDSIM&amp;diff=1163"/>
		<updated>2017-10-19T16:16:15Z</updated>

		<summary type="html">&lt;p&gt;JamesChappell: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== BDSIM ==&lt;br /&gt;
&lt;br /&gt;
BDSIM (Beam Delivery Simulation) is a program that uses a suite of high energy physics software including Geant4, CLHEP &amp;amp; ROOT to build a 3D model of an accelerator and simulate the passage of particles through both the vacuum and the material of the accelerator itself seamlessly.&lt;br /&gt;
&lt;br /&gt;
*Useful Links:&lt;br /&gt;
** [https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim RHUL BDSIM Webpage]&lt;br /&gt;
** [http://www.pp.rhul.ac.uk/bdsim/manual/index.html BDSIM Documentation]&lt;br /&gt;
** [https://bitbucket.org/jairhul/bdsim BDSIM Bitbucket Page]&lt;br /&gt;
** [http://www.pp.rhul.ac.uk/bdsim/manual/installation.html Official Installation Guide]&lt;br /&gt;
&lt;br /&gt;
This is a tutorial about installing and using BDSIM. BDSIM is installed on the HEP Linux cluster at UCL. You will need an account on that cluster to be able to use this software, run example tutorials and create your own simulations. &lt;br /&gt;
&lt;br /&gt;
== Running BDSIM Simulations ==&lt;br /&gt;
&lt;br /&gt;
In order to run BDSIM simulations, you will either need to download and install the software yourself or make use of the existing installation on the UCL HEP Linux cluster.&lt;br /&gt;
&lt;br /&gt;
In order to use the UCL HEP Linux cluster, you will need a HEP account: please contact Dr. Simon Jolly for more details. &lt;br /&gt;
&lt;br /&gt;
=== Running on the UCL HEP Linux Cluster ===&lt;br /&gt;
&lt;br /&gt;
In order to run &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; simulations on the UCL HEP Cluster, you must first source the development version of the PBT environment from a system within the cluster that is running Scientific Linux V6. This can be done using the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
source /unix/pbt/software/scripts/pbt.sh -vd&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; the &#039;-d&#039; flag is essential as this sources the script that links the latest development software available on the PBT section of the cluster. &lt;br /&gt;
&lt;br /&gt;
Following this, a second script must be sourced in order to create the environment required to run &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
source /unix/pbt/software/scripts/bdsim_setup.sh&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now your system is ready to use &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;. To check that it is working correctly, test the built-in help function: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bdsim --help&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This should produce an output explaining all the possible options that can be used within &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
== Required Software ==&lt;br /&gt;
&lt;br /&gt;
BDSIM requires the following software to be installed:&lt;br /&gt;
&lt;br /&gt;
* Recent compiler with full C++11 support - proven compiler versions are GCC v4.9 or higher, or Clang 6 or higher.&lt;br /&gt;
* CMake v2.8.12 or higher&lt;br /&gt;
* CLHEP v2.1.3.1 or higher&lt;br /&gt;
* ROOT v6.x or higher&lt;br /&gt;
* Geant4 v4.10 or higher&lt;br /&gt;
* Flex v2.5.37 or higher&lt;br /&gt;
* Bison v2.3 or higher&lt;br /&gt;
&lt;br /&gt;
These are all installed on the UCL HEP cluster.&lt;br /&gt;
&lt;br /&gt;
== Details ==&lt;br /&gt;
&lt;br /&gt;
; Website: https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim&lt;br /&gt;
&lt;br /&gt;
; Latest Version: 0.9.9.2 (19th October 2017)&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
The installation process follows the general process described on the [[Software/Geant4/UCL HEP Cluster|UCL HEP Linux Cluster]] page.  &lt;br /&gt;
The basic method used is as follows:&lt;br /&gt;
&lt;br /&gt;
# Check that all the prerequisites for building &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; are installed (see above);&lt;br /&gt;
# Download the latest version of the source code;&lt;br /&gt;
# Create a build folder;&lt;br /&gt;
# Configure, build and install &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; from within the build folder.&lt;br /&gt;
&lt;br /&gt;
=== Download BDSIM from its central repository ===&lt;br /&gt;
&lt;br /&gt;
The BDSIM source code can be downloaded from its git repository using:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; git clone --recursive &amp;lt;nowiki&amp;gt;https://bitbucket.org/jairhul/bdsim&amp;lt;/nowiki&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This creates a &amp;lt;code&amp;gt;/bdsim&amp;lt;/code&amp;gt; folder within your current folder. This folder contains all the code, examples, documentation and associated Python packages.&lt;br /&gt;
&lt;br /&gt;
=== Configure, build and install &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; ===&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Note:&#039;&#039;&#039; When installing &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt;, all the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment variables must be available. This can be tested using the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; echo $G4 &amp;lt;tab&amp;gt; &amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment variables are available, you should see an output similar to:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt; &lt;br /&gt;
$G4ABLADATA          $G4NEUTRONHPDATA      $G4REALSURFACEDATA &lt;br /&gt;
$G4ENSDFSTATEDATA    $G4NEUTRONXSDATA      $G4SAIDXSDATA &lt;br /&gt;
$G4LEDATA            $G4PIIDATA            $G4SHARE &lt;br /&gt;
$G4LEVELGAMMADATA    $G4RADIOACTIVEDATA    $G4VERSION &lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This output corresponds to using the UCL PBT environment, but it will be dependent on the installed &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; modules. If this does not return a list of environment variables, make sure you have correctly sourced the &amp;lt;code&amp;gt;Geant4&amp;lt;/code&amp;gt; environment script and updated all relevant path variables.&lt;br /&gt;
&lt;br /&gt;
Once the source code has been downloaded, a build directory should be created alongside the &amp;lt;code&amp;gt;src&amp;lt;/code&amp;gt; to hold the compiled &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; files before they are moved to their final installation location.&lt;br /&gt;
&lt;br /&gt;
On the UCL HEP Linux Cluster, the build directory should be created in &amp;lt;code&amp;gt;/unix/pbt/software/build&amp;lt;/code&amp;gt;: &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build&lt;br /&gt;
mkdir bdsim&lt;br /&gt;
cd bdsim&lt;br /&gt;
mkdir bdsim-0.9.9.2-build&lt;br /&gt;
cd bdsim-0.9.9.2-build&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Unlike other software installed on the UCL HEP Linux Cluster, there are a number of ways to configure the software before building. Using the &amp;lt;code&amp;gt;ccmake&amp;lt;/code&amp;gt; command, each configuration option can be set interactively:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cmake ../../../src/bdsim/bdsim-bitbucket/&lt;br /&gt;
&lt;br /&gt;
ccmake .&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
CMake opens an interactive configuration program. Set the options as required for your system e.g. on the UCL HEP Cluster:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
CMAKE_INSTALL_PREFIX     /unix/pbt/software/dev/bdsim-0.9.9.2/&lt;br /&gt;
USE_AWAKE                ON&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note that the &amp;lt;code&amp;gt;CMAKE_INSTALL_PREFIX=/unix/pbt/software/dev/bdsim-0.9.9.2&amp;lt;/code&amp;gt; flag specifies that the resulting &amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; should be installed in the directory &amp;lt;code&amp;gt;/unix/pbt/software/dev/bdsim-0.9.9.2&amp;lt;/code&amp;gt; after compilation: this should be changed to suit the particular installation in question.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;c&#039;&#039; to configure.&lt;br /&gt;
&lt;br /&gt;
*&#039;&#039;g&#039;&#039; to generate and exit.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;BDSIM&amp;lt;/code&amp;gt; can then be compiled and installed by running:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
make&lt;br /&gt;
make install&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Testing ==&lt;br /&gt;
&lt;br /&gt;
Multiple examples are provided with the source code and can be found in the original build folder. A complete list of examples and tutorials for running them can be found at http://www.pp.rhul.ac.uk/bdsim/manual/examples/examples.html&lt;br /&gt;
&lt;br /&gt;
Here, the simpleMachine example will be demonstrated.&lt;br /&gt;
&lt;br /&gt;
First, navigate to the examples within build directory and find simpleMachine:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd /unix/pbt/software/build/bdsim/bdsim-0.92-dev/bdsim-build-updated/examples&lt;br /&gt;
cd simpleMachine&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To run the simulation via the GUI use the command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bdsim --file=sm.gmad&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
An interface should load up and display the simpleMachine setup. It has a few drift beam pipes with a quadrupole, collimator and sector bend dipole magnet. To run the simulation once with any output exported to a file called &amp;lt;code&amp;gt;output.root&amp;lt;/code&amp;gt;, use the following command:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bdsim --file=sm.gmad --outfile=output&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
From within the GUI command line, type:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/run/beamOn 1&lt;br /&gt;
exit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This will execute a single run of the simulation with the output data exported to &amp;lt;code&amp;gt;output.root&amp;lt;/code&amp;gt;. This can then be analysed from within ROOT by following the tutorial at http://www.pp.rhul.ac.uk/bdsim/manual/output_analysis.html.&lt;br /&gt;
&lt;br /&gt;
To run this simulation in Batch mode, the following command can be used:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
bdsim --file=sm.gmad --outfile=output --batch&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Batch mode has no interactive interface, but as a consequence is much faster and exits the program once it has finished. For simulations with large numbers of particles within the beam, this is the preferred method of use.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--== References ==--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{cite web |url=https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim |title=BDSIM - Accelerator Beamline Simulation Tool |last=Nevay |first=Laurence |date=30 August 2017 |website=Royal Holloway Physics TWiki |access-date=17 October 2017}}--&amp;gt;&lt;/div&gt;</summary>
		<author><name>JamesChappell</name></author>
	</entry>
	<entry>
		<id>https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/BDSIM&amp;diff=1158</id>
		<title>Software/BDSIM</title>
		<link rel="alternate" type="text/html" href="https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/BDSIM&amp;diff=1158"/>
		<updated>2017-10-17T13:51:14Z</updated>

		<summary type="html">&lt;p&gt;JamesChappell: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Work in progress (JChappell 17/10/17)&lt;br /&gt;
&lt;br /&gt;
== BDSIM ==&lt;br /&gt;
&lt;br /&gt;
BDSIM (Beam Delivery Simulation) is a program that uses a suite of high energy physics software including Geant4, CLHEP &amp;amp; ROOT to build a 3D model of an accelerator and simulate the passage of particles through both the vacuum and the material of the accelerator itself seamlessly.&lt;br /&gt;
&lt;br /&gt;
*Useful Links:&lt;br /&gt;
** [https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim RHUL BDSIM Webpage]&lt;br /&gt;
** [http://www.pp.rhul.ac.uk/bdsim/manual/index.html BDSIM Documentation]&lt;br /&gt;
** [https://bitbucket.org/jairhul/bdsim BDSIM Bitbucket Page]&lt;br /&gt;
&lt;br /&gt;
This is a tutorial about installing and using BDSIM. BDSIM is installed on the HEP Linux cluster at UCL. You will need an account on that cluster to be able to use this software, run example tutorials and create your own simulations. &lt;br /&gt;
&lt;br /&gt;
== Running BDSIM Simulations ==&lt;br /&gt;
&lt;br /&gt;
In order to run BDSIM simulations, you will either need to download and install the software yourself or make use of the existing installation on the UCL HEP Linux cluster.&lt;br /&gt;
&lt;br /&gt;
In order to use the UCL HEP Linux cluster, you will need a HEP account: please contact Dr. Simon Jolly for more details. &lt;br /&gt;
&lt;br /&gt;
== Required Software ==&lt;br /&gt;
&lt;br /&gt;
BDSIM requires the following software to be installed:&lt;br /&gt;
&lt;br /&gt;
* Recent compiler with full C++11 support - proven compiler versions are GCC v4.9 or higher, or Clang 6 or higher.&lt;br /&gt;
* CMake v2.8.12 or higher&lt;br /&gt;
* CLHEP v2.1.3.1 or higher&lt;br /&gt;
* ROOT v6.x or higher&lt;br /&gt;
* Geant4 v4.10 or higher&lt;br /&gt;
* Flex v2.5.37 or higher&lt;br /&gt;
* Bison v2.3 or higher&lt;br /&gt;
&lt;br /&gt;
These are all installed on the UCL HEP cluster.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--== References ==--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{cite web |url=https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim |title=BDSIM - Accelerator Beamline Simulation Tool |last=Nevay |first=Laurence |date=30 August 2017 |website=Royal Holloway Physics TWiki |access-date=17 October 2017}}--&amp;gt;&lt;/div&gt;</summary>
		<author><name>JamesChappell</name></author>
	</entry>
	<entry>
		<id>https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/BDSIM&amp;diff=1157</id>
		<title>Software/BDSIM</title>
		<link rel="alternate" type="text/html" href="https://www.hep.ucl.ac.uk/pbt/pbtWiki/index.php?title=Software/BDSIM&amp;diff=1157"/>
		<updated>2017-10-17T13:50:44Z</updated>

		<summary type="html">&lt;p&gt;JamesChappell: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== BDSIM ==&lt;br /&gt;
&lt;br /&gt;
BDSIM (Beam Delivery Simulation) is a program that uses a suite of high energy physics software including Geant4, CLHEP &amp;amp; ROOT to build a 3D model of an accelerator and simulate the passage of particles through both the vacuum and the material of the accelerator itself seamlessly.&lt;br /&gt;
&lt;br /&gt;
*Useful Links:&lt;br /&gt;
** [https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim RHUL BDSIM Webpage]&lt;br /&gt;
** [http://www.pp.rhul.ac.uk/bdsim/manual/index.html BDSIM Documentation]&lt;br /&gt;
** [https://bitbucket.org/jairhul/bdsim BDSIM Bitbucket Page]&lt;br /&gt;
&lt;br /&gt;
This is a tutorial about installing and using BDSIM. BDSIM is installed on the HEP Linux cluster at UCL. You will need an account on that cluster to be able to use this software, run example tutorials and create your own simulations. &lt;br /&gt;
&lt;br /&gt;
== Running BDSIM Simulations ==&lt;br /&gt;
&lt;br /&gt;
In order to run BDSIM simulations, you will either need to download and install the software yourself or make use of the existing installation on the UCL HEP Linux cluster.&lt;br /&gt;
&lt;br /&gt;
In order to use the UCL HEP Linux cluster, you will need a HEP account: please contact Dr. Simon Jolly for more details. &lt;br /&gt;
&lt;br /&gt;
== Required Software ==&lt;br /&gt;
&lt;br /&gt;
BDSIM requires the following software to be installed:&lt;br /&gt;
&lt;br /&gt;
* Recent compiler with full C++11 support - proven compiler versions are GCC v4.9 or higher, or Clang 6 or higher.&lt;br /&gt;
* CMake v2.8.12 or higher&lt;br /&gt;
* CLHEP v2.1.3.1 or higher&lt;br /&gt;
* ROOT v6.x or higher&lt;br /&gt;
* Geant4 v4.10 or higher&lt;br /&gt;
* Flex v2.5.37 or higher&lt;br /&gt;
* Bison v2.3 or higher&lt;br /&gt;
&lt;br /&gt;
These are all installed on the UCL HEP cluster.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--== References ==--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!--{{cite web |url=https://twiki.ph.rhul.ac.uk/twiki/bin/view/PP/JAI/BdSim |title=BDSIM - Accelerator Beamline Simulation Tool |last=Nevay |first=Laurence |date=30 August 2017 |website=Royal Holloway Physics TWiki |access-date=17 October 2017}}--&amp;gt;&lt;/div&gt;</summary>
		<author><name>JamesChappell</name></author>
	</entry>
</feed>