These instructions should be reasonably complete as of 11/11/15. Please contact Corey Adams at corey.adams [at] yale.edu ASAP if there are issues.
The larlite event display is built on Qt4, PyQt4, and pyqtgraph. Qt4 and PyQt4 are a gui manager and python bindings, respectively, and don't have direct impact on the images created. However, pyqtgraph is a graphics rendering program built in python on PyQt4, and that is what makes the high quality images (in a timely manner). Read more about pyqtgraph at its website: http://www.pyqtgraph.org/
Larlite is a development and analysis framework built on root and python. Check out docdb 3183 for installation details (http://microboone-docdb.fnal.gov:8080/cgi-bin/ShowDocument?docid=3183). Here, I will just give a barebones set of instructions for installation.
There have been reports of problems when users use brew (on mac) to get some of the dependencies for this. I don't really recommend using brew, especially for root and PyQt4. No issues have been found yet using apt-get (on linux) or port (on mac), that I know of.
To run the larlite event display, you will need larlite, numpy and PyQt4. This page gives complete instructions for installing PyQt4. This page gives basic instructions for larlite. Larlite requires root with python (PyROOT), so make sure you have root installed and test pyroot by opening python and importing ROOT:
If "import ROOT" works, pyROOT is installed. If you are using ups to get root and larsoft, this should not be an issue for you. If you have root installed from source with a recent version, it should have included pyroot by default too. If you installed root from a package manager, it might not have pyroot.
Assuming you have root with pyROOT installed, install larlite first. It's recommended you encapsulate all of these installations if you are installing on your laptop so that you don't conflict with anything else. Don't use brew (if mac); there are reports that brew will cause issues if you also try to run larsoft. In this set of instructions, we assume that $INSTALL_DIR is the location of your top level installation area. Everything else will be inside of that, and I assume you've used the absolute path for $INSTALL_DIR and not a relative path.
I highly recommend you follow the official instructions for installing numpy (http://www.scipy.org/scipylib/download.html). However, if you want more detailed help contact me (corey.adams [at] yale.edu) for some tips. Make sure you get the header files too (they're needed for the c++ code of the display)
Move to the installation directory and check out the larlite repository from github:
git clone email@example.com:larlight/larlite.git
or, if you don't have ssh access to git hub, do a read only checkout:
git clone https://github.com/larlight/larlite.git
After the clone, you should have a folder named larlite inside of $INSTALL_DIR. cd into larlite and make sure you are on branch "trunk":
git checkout trunk
Next, run the larlite setup script and then build larlite:
If you want to use the larlite display for reconstructed products, you should run an auxiliary setup script:
Larlite will compile for some time. If there are compilation errors with larlite, please contact the maintainers of larlite. In the future it will be a ups product. For now, we will help you install.
Once larlite has built, you have to compile the extra tools for the display. This requires numpy so make sure that is installed first. Build it as:
PyQt4 is distributed from riverbank software, and requires both qt and sip to be installed on your computer. qt is fairly common. Test by looking for qmake, on my laptop for example:
cadams@cadams-UX303LN:DisplayTool$ which qmake
If there is no qmake, you will have to install qt4. There is not a good reason to install qt4 from scratch. You can use port (on mac) or apt-get install (linux) or whatever means you choose for installing qt.
With qt installed, install sip. We'll make a directory to install sip into, as well.
tar -zxvf sip-4.16.9.tar.gz
python configure.py -b $INSTALL_DIR/sip -d $INSTALL_DIR/sip -e $INSTALL_DIR/sip -v $INSTALL_DIR/sip
Check that sip is installed by doing this:
python -c "import sip"
If that worked (no error messages) sip is installed correctly.
We'll need to set up sip to build PyQt4. Later, this will be done with an install script but for now copy and paste:
With sip and qt installed, we can install pyqt4.
tar -zxvf PyQt-mac-gpl-4.11.4.tar.gz
tar -zxvf PyQt-x11-gpl-4.11.4.tar.gz
Then, for both mac and linux:
python configure.py -b $INSTALL_DIR/PyQt4 -d $INSTALL_DIR/PyQt4
Type yes to accept the license. This script takes awhile to generate the files for your PyQt4 build. When it's done:
For Ubuntu users, also do: sudo apt-get install python-qt4-gl
Setting up run after the first time¶
It's a good idea to set up a script to set all the environment variables you need for subsequent times you want to run the display. The commands below should be sufficient as long as you replace the directory appropriately. I recommend you copy them into a script that you can source each time you want to run.
#[Do whatever you need for numpy and qmake. If you used an installed, likely you don't need to do anything]
#Set up PyQt4
#Set up larlite:
#Set up the larlite display tool
Running the display has a few options. Use the command 'evd.py' for the larlite file viewer, and 'evd_larsoft.py' to use the larsoft file viewer. There is also a command 'ubdaq.py' which draws raw binaries for the control room, but that requires significantly more installation due to the extra overhead of reading in the binaries. In general, though, all the viewers can accept a file to draw on the command line OR you can run them without arguments and use the gui to select a file. For microboone, run the commands with the argument '-u' or '-U', and '-a' for argoneut and '-l' for lariat. That is,
Draw larlite file format:
evd.py -u [input_larlite_file.root]
Draw larsoft file format:
evd_larsoft.py -u [input_larsoft_file.root]