1. Getting started

Installation

nrCascadeSim is designed to run in a Unix-based system and is tested via Travis-CI using the Xenial (Ubuntu 16.04), Bionic (Ubuntu 18.04), and Focal (Ubuntu 20.04) distributions, all on x86_64 archetecture. It is also tested on Mac OSX Mojave (10.14), Catalina (10.15), and Big Sur (11.5) via Travis-CI.

Because of a combination of the operating systems tested and the versions of ROOT (see below) the Travis-CI tests three C++ compiler standards: c++11 (Xenial, Mojave, Catalina, Big Sur); c++14 (Bionic); and c++17 (Focal).

Dependencies

1. ROOT

Travis-CI tests two versions of ROOT: 6.24.06 and 6.20.00. It is assumed (though not explicitly tested) that the versions in between those two versions will also work.

To install ROOT please follow the instructions on the CERN website.

It is intended that nrCascadeSim is compatible with all versions; known compatibility with version 6.

On Linux machines, you can also install ROOT via a pre-packaged binary run:

wget https://root.cern/download/root_v6.24.02.Linux-ubuntu20-x86_64-gcc9.3.tar.gz
tar -xzvf root_v6.24.02.Linux-ubuntu20-x86_64-gcc9.3.tar.gz
source root/bin/thisroot.sh # also available: thisroot.{csh,fish,bat}

Note: You will need to find the appropriate ROOT link for your Linux distribution. The one provided above is used for Focal. Bionic uses root_v6.24.06.Linux-ubuntu18-x86_64-gcc7.5.tar.gz and Xenial uses root_v6.24.06.Linux-ubuntu20-x86_64-gcc9.3.tar.gz.

If you are using WSL, you will need to install the conda package (recommended) or build ROOT from source. Using a pre-compiled binary or installing from most package managers will not work for WSL users.

2. gcc

You almost certainly have a version of gcc already and nrCascadeSim is compatible with version 4.4.7 or newer.

On Linux machines, you can build gcc via the apt-get manager:

sudo apt-get install gcc

If, for some reason, you need to use a C++ standard older than 11, please use nrCascadeSim v1.2.2 or older.

Download & Build

The nrCascadeSim source code can be downloaded by cloning this git repository:

git clone https://github.com/villano-lab/nrCascadeSim.git
cd nrCascadeSim

The code is compiled and the executable and library is built by Make. To build run the following commands from the repository’s root folder.:

make
sudo make install

If everything worked well, the executable and library file are created as:

bin/realizeCascades
bin/lib/libncap.so

To clean the installation use:

make clean

or:

sudo make clean

if after a sudo make install.

Using nrCascadeSim command-line tools

nrCascadeSim contains pre-built executables built on the library functions that can be used as command-line tools. See Section 2 for list of the executables and inputs and outputs.

Using nrCascadeSim as a library

If we want to use nrCascadeSim functions in an external code, we can do so and import it as a library. We recommend to do this inside your Make build, where the nrCascadeSim libraries can be linked with the -fPIC and -lncap flags.

Use the following headers when including the library functions:

//library commands
#include "cascadeProd.h"
#include "lindhard.h"
#include "weisskopf.h"
#include "isotope_info.h"
#include "MersenneTwister.h"

//ROOT stuff
#include "rootUtil.h"

Using the ROOT utilities will also require having ROOT installed and adding root-config –cflags –glibs to the compilation line in your Make file.