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 and build 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 r3broot after the -F flag.
Once downloaded, you could treat the download file r3broot as an executable, similar to neuland CLI (see NeuLAND Command Line Interface):
or if you want to run a ROOT macro file, you could use macro option:
or enter the shell environment of the container:
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:
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:
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:
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, use the --fakeroot option a-case-sensitive-src-folder-for-mac-programmers-176cc82a3830
The fakeroot option allows a user to install any package from the system package manager, like apt or dnf. But be aware the fakeroot option makes the container slow. For more details, 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:
Create the mounted local folders (if not existed):
Again you could use other folders as well.
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. The r3broot image already contains some convenient command for this situation.
To initialize the conda environment and download all the packages, do
This command will install mini-conda folder ~/miniconda3 in your home folder and create an conda environment named r3bdev. This step need to be done only once.
Next, to open a jupyter lab server, simply do: