Skip to content
Paola Ferrario edited this page Sep 4, 2020 · 7 revisions

Welcome to the nexus wiki!

Description

NEXUS is the Geant4-based simulation framework for the NEXT experiment. This framework provides a set of common tools — such as basic geometries, physics lists, a materials database or a data persistency mechanism — and ensures data consistency via well-defined interfaces. It can be easily extended to include new geometries and configurations writing only a concrete number of classes, while still using the same verified core.

Getting the source

Nexus source can be downloaded from the git repository:

git clone https://github.com/nextsw/nexus.git

This command will create a folder names nexus. To get a particular tag, just enter the nexus folder and type:

git checkout name_of_tag

External dependencies

NEXUS depends on the following third-party libraries:

  • SCons
  • Geant4
  • ROOT
  • gsl
  • hdf5

SCons

NEXUS uses SCons as a building system. Detailed information on SCons can be found here. To install SCons on your computer:

  1. Since SCons is written in Python, you must have Python installed on your system. SCons works with any version of Python 1 and 2 >1.5.2 (>2.5 is recommended). Recently, SCons started supporting Pyhton 3, too.
  2. Download the latest stable version of SCons and uncompress the file.
  3. Move to the resulting folder and type (you may need super-user privileges for this to work): python setup.py install

Geant4

NEXUS is based on Geant4. To install it, see the Geant4 page. The recommended version is geant4.10.05.p01. A tag >= v5_04_00 is needed to run with this geant4 release. A summary of the installation instructions can be found [here].

Once Geant4 is installed, make sure to have:

  1. G4INSTALL environment variable pointing to the top-level Geant4 directory.
  2. G4INSTALL/bin path added to the PATH variable.
  3. G4INSTALL/lib path added to the LD_LIBRARY_PATH (or DYLD_LIBRARY_PATH) variable.

Also, download the following data files from the Geant4 web page: PhotonEvaporation, G4EMLOW, RadioactiveDecay, G4ENSDFSTATE, G4SAIDDATA, G4NEUTRONXS and G4NDL and make sure to have:

G4LEVELGAMMADATA environment variable pointing to the directory of the data file PhotonEvaporationv1.

G4LEDATA environment variable pointing to the directory of the data file G4EMLOWv2.

G4RADIOACTIVEDATA environment variable pointing to the directory of the data file RadioactiveDecayv3.

G4ENSDFSTATEDATA environment variable pointing to the directory of the data file G4ENSDFSTATEv4.

G4SAIDXSDATA environment variable pointing to the directory of the data file G4SAIDDATAv5.

G4PARTICLEXSDATA environment variable pointing to the directory of the data file G4PARTICLEXSv6.

G4NEUTRONHPDATA environment variable pointing to the directory of the data file G4NDLv7.

where v1, v2, ... must be replaced with the specific version number of each data file.

ROOT

NEXUS depends on ROOT for I/O and histogramming. You can download ROOT from [here] (http://root.cern.ch). You should install ROOT version >= 5.14. Once ROOT is installed, make sure to have:

  1. ROOTSYS environment variable pointing to the ROOT top-level directory.
  2. ROOTSYS/bin in your PATH variable.
  3. ROOTSYS/lib in your LD_LIBRARY_PATH (or DYLD_LIBRARY_PATH) variable.

gsl

Since the v5_00_11 tag, NEXUS depends on the GNU Scientific Library for the simulation of double beta decay events. See the [GNU page] (http://www.gnu.org/software/gsl/) for the download and installation of gsl. Once you have gsl installed, make sure you have:

  1. gsl bin directory in your PATH variable.
  2. gsl lib directory in your LD_LIBRARY_PATH (or DYLD_LIBRARY_PATH) variable.

hdf5

NEXUS has the ability of writing hdf5 output files, therefore depends on the hdf5 library. You can download it from [here] (https://www.hdfgroup.org/downloads/hdf5/). After the installation, you need to have the following environment variables defined:

  1. hdf5 lib directory in your HDF5_LIB variable.
  2. hdf5 include directory in your HDF5_INC variable.
  3. hdf5 lib directory added to the LD_LIBRARY_PATH (or DYLD_LIBRARY_PATH) variable.

Installation

To build NEXUS, just type: scons inside the top-level directory. The building script (SConstruct) tries to locate the headers and libraries of all dependencies using pkg-config scripts or examining common system-paths (/usr/local, for instance).

It is also possible to build NEXUS with the CMake cross-platform build-generator tool. CMake does not build the project, it generates the files needed by your build tool (GNU make, Ninja, Visual Studio, etc.) for building NEXUS. The following are the basic building instructions for UNIX systems. We use here the command-line, non-interactive CMake interface.

  • Download and unpack the NEXUS's sources from the download area or using directly the Git repository.
  • Create a directory for containing the build. It is not supported to build NEXUS on the source directory. Go to this directory:

mkdir <builddir>

cd <builddir>

  • Be sure you have the ROOT and GEANT4-related environment variables set as explained above.
  • Execute the cmake command on the shell replacing the various path/to/source with the paths to the top of your source trees:

cmake -DGSL_ROOT_DIR=/path/to/gsl/installation -DHDF5_ROOT=/path/to/hdf5/installation -DCMAKE_INSTALL_PREFIX=path/to/nexus/source path/to/nexus/source

CMake will detect your development environment, perform a series of test and generate the files required for building NEXUS.

  • After CMake has finished running, type from the build directory: cmake --build . --target install. The --build option tells cmake to invoke the underlying build tool (make, ninja, xcodebuild, msbuild, etc). The underlying build tool can also be invoked directly of course, but the cmake --build command is more portable. On unix systems (with make or ninja) you can speedup the build with cmake --build . -- -jN where N is the number of available cores.

Running nexus

In order to run nexus, be sure to execute the setup script in the scripts folder:

source /path/to/scripts/nexus_setup.sh

It will set the NEXUSDIR variable to the top level directory of the installation.