ROOT e XRootD exercise

For the purpose of this exercise we will try to recreate a simple workflow which is very common in HEP (High Energy Physics) data analysis. The final goal will be to do some simple physics analysis on a set of data. The first part of the exercise is to set up a

inside a Docker

container. The XRootD project is a client-server framework used heavily in the HEP community for distributing and serving data.

XRootD container requirements[edit | edit source]

  • The base image for the container will be a Fedora 20 image.
  • The hostname of the container should be
  • The container will need to make the XRootD service available to the
 exterior on port 1094. Obs.: the XRootD server runs by
 default on port 1094.
  • The XRootD server will need to serve data from a volume mounted inside
 the container at /mnt/data. The data will reside on the
 Docker host machine in directory /tmp/xrd_data/.

In order to start an XRootD data server you will need to install the xrootd and xrootd-client packages. This you can do with the default package manager yum. By default, the XRootD server will export the data from /tmp/. We would like to change this so that is exports the data from /mnt/data. You can do this by updating the configuration script that the XRootD daemon reads at start-up, which is located at /etc/xrootd/xrootd-clustered.cfg (look for the all.export directive). Once the configuration changes are done, you can start the service using the following command service xrootd start.


  • The XRootD server runs under the user xrootd and it needs to
 own the directory from which it will serve the data i.e.
  • In order to test that the server works fine, one can do a test
 transfer: copy the /etc/passwd file to the server using the
 XRootD copy command:

Inspecting the contents of the /mnt/data/ directory should reveal the new file. At this point you have a running XRootD server which can store and deliver data to its clients. Don't forget to test that the XRootD server is also available from ouside the container by doing another transfer from the Docker host machine. Furthermore, verify that the data is actually present in /tmp/xrd_data on the Docker host machine.

In the second part of the exercise you are required to set up the

framework for data analysis

in a different Docker container. You can read more about the ROOT project on their web site, but just so that you know this is the most widely used tool for performing data analysis in the High Energy Physics community.

The container should meet the following requirements:

  • The base image for the container will be CentOS7.
  • The container's name should be root_application.
  • You will need to install the following packages that the ROOT
 framework depends on:

  • To get the ROOT binary release just download it from this
 into /mnt/.
  • Once the archive is downloaded, extract it and setup the environment
 by sourcing the file: source /mnt/root/bin/
  • At this point you should be able to launch ROOT in your
 container by typing the command: root -b
  • To exit the ROOT console, type: .q
  • Once you have everything installed, promote the new container to an
 image called

After completing the basic setup of the containers, you can move on the the following tasks:

  • Check that you can successfully transfer files from the
 root_application container to the XRootD server
 that you set up in the first part of the exercise.
  • Create a new file /mnt/hist.cpp in the running
 root_application container, with the following contents:

  • Compile and build the file using the following command:
 g++ -o run_hist hist.cpp $(root-config --cflags --glibs)
 which produces the run_hist executable. This program creates
 a histogram using a Gaussian distribution and saves the file in the
 same directory from where the executable was run.
  • Modify the program such that the histogram file is saved in the
 XRootD server that you set up in the first part of the
 exercise. Check that a new histo.root was successfully
 created in the directory used by the XRootD server to save
  • Automate the creation of the two containers using Dockerfiles
 and the docker build command.


In order to visualise the generated histogram, we need to be able to access the X11 server from inside the root_application container. There are several additional steps that you need to take in order to have this setup working:

  • Fist check on the Docker host machine that you have X
 forwarding enabled by executing the command: xclock. If
 everything works fine, you should see a clock displayed on your
  • You need to allow the processes that run inside the container to
 access the X server special directory. For this you need to execute,
 the usual by now:
 chcon -Rt svirt_sandbox_file_t /tmp/.X11-unix
  • When starting the root_application container you need to
 pass the --net=host option, so that the container and the
 host share the same UTS namespace - and can access the same socket to
 the X server.
  • One last thing you need to take care of, is forwarding the .Xauthority
 file inside the container in read-only mode by doing:
 -v /root/.Xauthority:/root/.Xauthority:ro.
  • Investigate how you can use the TBrowser() ROOT object to
 visualise the histograms - both the one locally saved and the one in
 the XRootD server.