R3BROOT
R3B analysis software
|
Most of low/middle level data analysis relating to NeuLAND detector are done in the program R3BRoot, which requires many third-party libraries and tool-kits, such as FairSoft, FairRoot and UCESB etc. These software, on the other hand, requires newer versions of compilers and even operating systems. Therefore, to compile the R3BRoot oneself is an insurmountable task and may take quite lot of unnecessary times. To solve this problem and relief some burdens of high level data analysts, several containers containing the pre-built R3BRoot program are available. One only has to download the container and run the program with the data in your local machine or servers. Since containers doesn't care about your local operating system, you could use containers to run R3BRoot in Linux, MacOS and even Windows.
If you have access to GSI Linux server, there are some powerful server nodes, namely lustre.hpc.gsi.de
, with the data storage cluster mounted in /lustre
folder.
To login, simply do (you have to be inside GSI network first)
Go to your personal data folder under /lustre
. If you don't have it, please contact your colleagues to create one for you.
Download the Apptainer container in one of the folders, e.g. containers
Depending on the downloading speed, it may take several minutes. You may use other name instead of neuland
after the -F
flag.
Once downloaded, you could treat the download file neuland
as an executable, identical to neuland
CLI (see NeuLAND Command Line Interface):
or if you want to run a ROOT macro file, you could enter the shell environment of the container:
Here you don't need to source the config.sh
file as it's automatically done when entering the container.
Or as a high level data analyst, you most likely need to run jupyterlab in a conda environment (make sure you have conda environment already setup):
Further remarks:
dev
branch. If you need latest features, please open a new issue in the Github website.You could install the Apptainer software in your PC and do the same things as in GSI servers. But it's highly recommended to use Docker containers as they are more reliable and have more features. The following steps show how to run the R3BRoot program in docker container:
dnf
, apt
) according to this website. But if you are using Windows or MacOS, the best solution is to install Docker Desktop.If your operating system supports CLI (such as MacOS and Linux), pull the latest R3BRoot image from the dockerhub. To create the container, one way is to use docker run
:
If your computer is using x86_64 architecture (Most of Windows PCs), you could do:
If your computer is using ARM architecture (MacBook with Apple Silicon), you should use:
Further remarks about running a container:
exit
or press Ctrl-p
and Ctrl-q
. The former stops the container and the latter still keeps the container running. To go back to the running container, simply do docker attach r3b
. To start and run the stopped container, do docker start r3b
.-v
specifies the shared (mounted) folders between your local(host) machine and the container. The first path, e.g. current folder .
, is in your local machine. The second path is the folder in the container. The third option rw
represents read and write. You could use ro
for read-only.Run the program:
or
Developing the R3BRoot program can also be done inside the container. Again there are two containers for x86_64 and ARM machines, which include almost all compilers, software and third party libraries needed to compile R3BRoot.
Choose any GSI servers (e.g. lustre.hpc.gsi.de
) which have apptainer
available. Then create a Apptainer container with:
in a folder under /lustre
Then enter the shell environment with:
if you don't want to do run this command every time, you could put it in your .bashrc
file. If you would like to run the container as a sudo
, please refer to this gist.
To create the container, another easier way is to use docker compose
and ssh into the container. So instead of writing out a long command to specify mounting, binding and port forwarding, a single command would do the trick:
But before running this command, several things should be done first:
Create a docker-compose.yaml
file in any folder (the filename should not be changed) which contains:
Further remarks:
volumes
section.3100
can be changed to other port number larger than 1024. This number will be used for ssh login.command
and the volumes
section.Create the mounted local folders (if not existed):
Again you could use other folders as well.
docker compose up -d
in the folder that contains the docker-compose.yaml
file.SSH into the container with:
The initial password for the login is set in the docker-compose.yaml
file. You could change it by using the command chpasswd
after the login. But the best way is to send your local ssh key to the container such that password is not needed for the login. You could also login with root account with the password "root".
If you don't want to always remember the port number, add the following config in ~/.ssh/config
file (create it if not existed):
then just do
It's helpful to develop the program in a conda environment, where the python version is matched well with the ROOT version. To create such environment, in the container, clone this repository and source the bash file as: