Category Archives: Computing

Subcommands in optparse

I recently wrote a command line interface for the new version of LHAPDF which will allow users to easily find and download the latest PDF sets. I wanted something that had nice subcommands like Homebrew, pip or apt-get. But I also wanted something simple that could run on SL5 (Python 2.4) without external dependencies (so using optparse).

Continue reading


Installing HEP packages on Mac OS

A couple of months ago, I created a Mac OS X package manager for High Energy Physics programs. It’s called Homebrew-hep and is just an extension of the excellent Homebrew package manager. The homepage is

This should make it easier to install packages which usually come with documentation pages dedicated to ‘Mac Installation issues’. A couple of great things about the package manager are:

  • it will keep track of dependencies on other packages, e.g. if you install Herwig++ it will install HepMC and ThePEG too!
  • it also keeps things in /usr/local/ so you often don’t need to worry about setting environment variables.
  • it can tell you if you need to update to the latest versions.

I wanted to wait until after a bit of testing before announcing it, but everything seems to work well. I invite you to use it and let me know your experiences. Also, let me know if there are any packages you’d like included, and I’ll try my best.

Continue reading

Drawing an error band graph in PyROOT

I just spent a long time trying to work out how to draw an error band graph in ROOT without things looking completely ridiculous. Often ROOT will mess things up with Draw(“l3”) if you have data points that lie outside the range being plotted. To save others the major hassle involved, I’ve put my custom function here.

Continue reading