CRXS  1.0
Comic Ray Cross Section Tools
 All Classes Namespaces Functions Variables Pages
Documentation of the CRXS Tools


This software package is developed to easily calculate cross sections (XS) for the production of antiprotons and antideuteron as required in cosmic-ray (CR) physics. The package is based on c++ and builds all functions into a library. Furthermore, it provides an interface to python.

This software package provides:


Step 1: Prerequisits

If you install the python package make sure your python version contains the following packages:

Step 2: Get Software

The software is available as git repository on gitHub. To download it into the folder <MySoftwareDirectory> type:

$ git clone <MySoftwareDirectory>

Step 3: Build software

The c++ library is build with cmake and the python interface is created by swig. All commands to build the software are summarised in the Makefile. If you want to build everything, simply use

$ make

The c++ library is build shared. You should add "<MySoftwareDirectory>/cpp/lib" to your LD_LIBRARY_PATH (Mac: DYLD_LIBRARY_PATH) library path.

$ export LD_LIBRARY_PATH=<MySoftwareDirectory>cpp/lib:$LD_LIBRARY_PATH

To permanently add the library to the LD_LIBRARY path add this line in your ~/.bashrc (Mac: ~/.profile).

Further options:

  1. build, to build only the c++ library
  2. example, to build the example.cpp which links to the CRXS library
  3. debug, to build the c++ library with debug symbols

If you want to build only the python 2 or 3 use:

$ make build
$ make python


$ make build
$ make python_three

To uninstall everything use

$ make clean

If you want to link the python package to your site path use the script

$ ./

and follow the instruction. You have to specify your site path manuelly. To find out your path you may need the command (python -m site).

If you do not want to link the package to your python version you have to create a symbolic link of the py2 or py3 directory in the directory where you want to use the package.

$ ln -s PATH_TO_CRXS/py2 CRXS

To include the package use

import CRXS.XS_wrapper
import CRXS.XS_tools

Step 4: Build project (optional)

On a Mac with Xcode you may build a project by

  1. creating a folder in the directory cpp (e.g. xcode) and change into this new directory. Then type
  2. $ cmake -G Xcode ..

Now you are ready to start!


This package has been developed during the preparation of three papers. Please cite those papers if you use the results of this package.

More details are given in the LICENSE file.


The are stored in the folder examples

There are some examples which show how the software and access to individual fuctions works. Note that some functions are available in as well as in XS_wrapper. The difference is that the functions in XS_wrapper are completly based on c++ and interfaced at the very end. This results in the best performance. The functions of XS_tools are partly written in python, which allows easy modification but has a worse performance.