Download the files
First, download the required files using the following link or by cloning the git repository:
https://github.com/hsf-training/hsf-training-cms-analysis/archive/refs/heads/master.zip
For cloning the repository via the terminal:
git clone https://github.com/hsf-training/hsf-training-cms-analysis.git
Next, please select one of the following solutions to get the required software.
Set up the software
The analysis needs ROOT above release 6.16, a recent C++ compiler supporting at least C++14 and Python. To set up the software, choose one of the following options.
Docker
On a machine running docker (see docker setup instructions for MacOS, CentOS and Ubuntu), cd into the top level of your analysis repo:
cd /path/to/analysis/repo
start up a container from the rootproject/root
docker image as follows:
docker run -it --rm -v $PWD:/analysis -w /analysis rootproject/root:6.26.10-conda /bin/bash
# If you run into a permission error, use "sudo docker run ..." as a quick fix.
# To fix this for the future, see https://docs.docker.com/install/linux/linux-postinstall/
Thanks the volume mount set up with the -v
command, any output saved under your working directory (/analysis
) will automatically appear on your local machine in the location from which you started the container.
When you’re finished working in the container type exit
to get out of it.
Note: The --rm
option causes the container to be deleted once you’re finished working with it. If you want the container to persist on your machine after you exit, remove the --rm
option from the startup command.
conda
If you are running on a Linux distribution or MacOS, you can use the conda package manager to install ROOT in under five minutes. Follow the steps shown in the first slides in this presentation to set up your system.
lxplus/CVMFS
You can use the CERN lxplus service to log into a machine at CERN with CVMFS. Alternatively, you can use any system with a CVMFS installation. Use the following command to connect to lxplus with X forwarding.
ssh -Y your_username@lxplus.cern.ch
When logged in, just source the software stack with the following command.
source /cvmfs/sft.cern.ch/lcg/views/LCG_95/x86_64-centos7-gcc8-opt/setup.sh
Note that you may have to replace x86_64-centos7-gcc8-opt
with a platform matching your system.
Now, you should have all required software available. You can check with which root
, e.g., which ROOT executable you have sourced.
SWAN
You can run the analysis in the browser using the SWAN service at CERN. Go to swan.cern.ch and select the software stack 96 to start your session. Please note that you have to visit CERNBox once before you can use SWAN (go once to cernbox.cern.ch).
Download the files, upload them and in the top menu you can open a terminal. To view any output, either you can download the result again or view them directly in the browser.