chrisfinlay / DaSciX

Data Science Experiment - a virtual, minimal high-energy physics experiment for teaching

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

About

DaSciX (Data Science Experiment) is a virtual high-energy physics experiment for the PHY5007Z course “Data Science for Particle Physics” at the University of Cape Town.

The goal is to build a minimal, but complete virtual experiment that can simulate collisions (with Pythia 8), trace the produced particles through a detector geometry (with GEANT 4) and reconstruct the events with code that is still to be written.

Installation

This software package uses ROOT as the overall glue, Pythia 8 as an event generator and GEANT 4 for the detector simulation. This section gives short instructions how to install these components.

Prerequisites

ROOT, Pythia and Geant depend on a number of other software packages, like compilers, libraries, build tools etc. This section attempts to give an overview how to install all required (and recommended) dependencies for various platforms. The main issue are the dependencies for ROOT, which are listed in the ROOT build documentation.

Ubuntu 16.04 / 17.04

sudo apt-get install git dpkg-dev cmake g++ gcc binutils \
   libx11-dev libxpm-dev libxft-dev libxext-dev \
   gfortran libssl-dev libpcre3-dev \
   xlibmesa-glu-dev libglew1.5-dev libftgl-dev \
   libmysqlclient-dev libfftw3-dev libcfitsio-dev \
   graphviz-dev libavahi-compat-libdnssd-dev \
   libldap2-dev python-dev libxml2-dev libkrb5-dev \
   libgsl0-dev libqt4-dev

Scientific Linux 6

This distribution is quite dated, and you will only support Root 5 and Pythia 8.1 out of the box. It was tested with Root 5.34.30 and Pythia 8.186.

Mac OS X

You will need Xcode (from the App Store) and the Xcode Command Line Utilities, following for example these installation instructions.

Environment Settings

You will have to configure your environment to successfully compile and run ROOT with Pythia and Geant support. You can do some of the setup before you start compiling, but you will have to repeat some steps every time you log in, so you should consider to put these steps into your .bashrc or .bash_profile.

Pythia 8

The Pythia 8 homepage provides downloads and further documentation for this event generator. Note in particular the instructions to use Pythia 8 as a module within ROOT. In the following, we will give you minimal instructions how to compile Pythia.

You first have to decide where to install Pythia, and set the directories. This has to be repeated whenever you login, and should be added to your bash startup files. In this example, we install everything under Root in your home directory, but you can easily change this if you prefer another location.

export PYTHIA8=~/Root/pythia8226
export PYTHIA8DATA=$PYTHIA8/share/Pythia8/xmldoc

Once the environment variables are set, you can use these commands to install Pythia 8 in the chosen location.

cd ~ && mkdir Root
mkdir -p $PYTHIA8
cd $PYTHIA8/..
curl -O http://home.thep.lu.se/~torbjorn/pythia8/$(basename $PYTHIA8).tgz
tar -xvzf $(basename $PYTHIA8).tgz
cd $PYTHIA8
./configure --enable-shared
make

ROOT

The ROOT homepage provides comprehensive documentation, source code and precompiled binaries for ROOT. However, precompiled binaries - including the ones you would usually find with your package managers such as homebrew, apt or yum - usually do not include the interfaces for Pythia or Geant and should therefore be avoided.

You should download the sources and compile ROOT yourself. Minimal instructions are:

cd ~/Root
ROOT_VERSION=6.08.06
curl -O https://root.cern.ch/download/root_v$ROOT_VERSION.source.tar.gz
tar -xvzf root_v$ROOT_VERSION.source.tar.gz
mkdir root-build && cd root-build
cmake  -Dpythia8=ON \
       -DPYTHIA8_LIBRARY=$PYTHIA8/lib/libpythia8.so \
       -DPYTHIA8_INCLUDE_DIR=$PYTHIA8/include \
       ../root-$ROOT_VERSION
make
. bin/thisroot.sh

GEANT 4

The Geant 4 installation page may be useful for extra help.

mkdir ~/Geant4 && cd ~/Geant4
wget http://cern.ch/geant4/support/source/geant4.10.03.p01.tar.gz
tar -xvf geant4.10.03.p01.tar.gz
mkdir geant4-build && mkdir geant4-install
cd geant4-build
cmake -DCMAKE_INSTALL_PREFIX=$HOME/Geant4/geant4-install \
      -DGEANT4_INSTALL_DATA=ON \
      -DGEANT4_USE_OPENGL_X11=ON \
      -DGEANT4_BUILD_MULTITHREADED=ON \
      -DGEANT4_BUILD_TLS_MODEL=global-dynamic \
      ../geant4.10.03.p01
make
make install
. ../geant4-install/bin/geant4.sh

VGM - Virtual Geometry Model

This is needed to run Geant4 from within ROOT using virtual monte-carlo (vmc). For extra help check out the VGM README at vgm/doc/INSTALL in the unzipped directory.

cd ~/Geant4
mkdir vgm-build && mkdir install
wget http://ivana.home.cern.ch/ivana/vgm.4.4.tar.gz
tar -xvf vgm.4.4.tar.gz
cd vgm-build
cmake -DCMAKE_INSTALL_PREFIX=$HOME/Geant4/install \
      ../vgm.4.4
make
make install

Geant4 VMC - Virtual Monte-Carlo

This is needed to run Geant4 from within ROOT. It depends on VGM so you will first need to set an environmet variable.

If you require further installation instructions check out the Geant 4 VMC installation page.

export VGM_DIR=~/Geant4/install/lib/VGM-4.4.0/
cd ~/Geant4
mkdir vmc-build
wget https://root.cern.ch/download/vmc/geant4_vmc.3.4.tar.gz
tar -xvf geant4_vmc.3.4.tar.gz
cd vmc-build
cmake -DCMAKE_INSTALL_PREFIX=$HOME/Geant4/install \
      -DGeant4VMC_USE_VGM=ON \
      ../geant4_vmc.3.4
make
make install

For info on things related MULTITHREADED processing visit the ROOT site.

Compilation

The Geant4 detector model must be compiled:

cd ~/DaSciX
. env.sh
mkdir Detector/build
cd Detector/build
cmake ../src/
make

Running Macros

Once your environment has been set up and the detector has been compiled you can run macros to perform the simulation.

cd $DASCIX_DIR/macros
root GeneratePrimariesPythia8.C

Now you have simulated the initial collision we can let Geant 4 take over the rest of the simulation. We will run these next few macros from within ROOT. You should get a list of all the hits with details on each.

.x loadlibs.C
.x run_g4.C
.x read_geant.C

About

Data Science Experiment - a virtual, minimal high-energy physics experiment for teaching


Languages

Language:C++ 76.9%Language:C 16.9%Language:CMake 5.3%Language:Shell 0.9%