Grid tools on UF HiPerGator

Recently I moved my codes to the UF HiPerGator machines (also referred to as the HPC machines) which are running RHEL 7. Info about HiPerGator can be found on:

One issue that I ran into was that the grid tools used by CMS, e.g. voms-proxy-*, uberftp, gfal-copy, globus-url-copy, etc, are not automatically set up. To get them working, I got the following instructions from Bockjoo Kim:

source /cvmfs/
export X509_CERT_DIR=/cvmfs/
export X509_VOMS_DIR=/cvmfs/
export VOMS_USERCONF=/cvmfs/

Jupyter notebook code indentation

The Jupyter notebook code indentation is 4 spaces by default. It can be configured as documented here. Basically, to change it to 2 spaces, look for the file ~/.jupyter/nbconfig/notebook.json. If the directory or the file doesn’t exist, create them. Then edit the file to add the following:

  "CodeCell": {
    "cm_config": {
      "indentUnit": 2

(Tested on Jupyter 4.4.0.)

Running CMSSW with Docker

Trying to install CMSSW in an OS that is not officially supported (e.g. Mac OS, Arch Linux, etc) can be very difficult. It’s possible to run a virtual machine with Scientific Linux or CentOS as the guest OS instead. But there is also a more lightweight solution, which is to use a Docker container.

The official Docker images provided by ‘cmssw’ are huge (5-10 GB). Apparently there is a different Docker image that you can use, which is provided by ‘hepsw’, and is smaller (~200 MB). You can find the Dockerfiles used to build the images at (for ‘cmssw’) and at (for ‘hepsw’).

The following instructions should provide a functional CMSSW environment using the hepsw/cvmfs-cms image (tested on Linux Mint 18 as the host OS). Note that the image is based on slc-6.

# Install Docker from the repository
sudo apt install

# Load the Docker image
# '--privileged' option is required because of FUSE
sudo systemctl start docker
sudo docker run -h dev --privileged -i -t hepsw/cvmfs-cms

Once the image is loaded, you should be in the interactive session in the guest OS. To setup CMSSW:

yum install -y glibc glibc-headers glibc-devel.x86_64

export SCRAM_ARCH=slc6_amd64_gcc700
scramv1 project CMSSW CMSSW_10_4_0
cd CMSSW_10_4_0/src
eval `scramv1 runtime -sh`
scram b

To disable the annoying fastestmirror plugin for yum, open the file /etc/yum/pluginconf.d/fastestmirror.conf, and change enabled=1 to enabled=0.

Muon pT resolution

The muon $p_{\mathrm{T}}$ is measured from the curvature of its trajectory in the magnetic field. The curvature is proportional to $1/p_{\mathrm{T}}$. So, the error in the curvature measurement is related to the $p_{\mathrm{T}}$ resolution:

\[\begin{align} \Delta\left(\frac{1}{p}\right) &= -\frac{\Delta p}{p^2} \\ \frac{\Delta p}{p} &= -\left[\Delta\left(\frac{1}{p}\right)\right] \cdot p \\ &= k(p) \cdot p \end{align}\]

If the error in the curvature measurement is independent of $p_{\mathrm{T}}$, i.e. $k(p) = k$, then we find that the fractional $p_{\mathrm{T}}$ resolution is proportional to $p_{\mathrm{T}}$:

\[\frac{\Delta p}{p} \propto p\]