Project

General

Profile

Python Analysis Code

The DAQ code is mainly C++. We also have some basic python analysis modules. These are in src/analysis. This
uses pyROOT. This requires that your ROOTSYS/lib has the libPyROOT.so ie that your ROOT install was built with python enabled. You then need to setup python related environment variables e.g.

export PYTHONPATH=$ROOTSYS/lib:/usr/local/lib/python2.7/site-packages:/Users/markl/python
export PYTHONDIR=/usr/local/Cellar/python/2.7.7_2/Frameworks/Python.framework/Versions/2.7/
export LD_LIBRARY_PATH=$ROOTSYS/lib/:$PYTHONDIR/lib

The code is using Python 2.6 NOT Python 3.

In addition to PyRoot the code uses some third party Python libraries : numpy and scipy. The installation of these depends on your machine. For a MAC the simplest method is via brew and then "easy_install/pip" e.g.

brew install python
brew install cmake
easy_install pip
pip install numpy
pip install matplotlib
pip install scipy

The file src/analysis/straws_raw.py reads a ROOT file with the raw TDC data and makes a plot of the bits set in the hit times.
src/analysis/mwpc_plots.py reads a ROOT file with the raw MWPC data and makes some plots into an output ROOT file.

Location of the data / ROOT files

The ROOT files of the raw testbeam data are on the FNAL gm2gpvm0x cluster in the directory /gm2/data/t1042-straws/
For example the raw ROOT file with the straw TDC data for Run 1300 is in: /gm2/data/t1042-straws/apr-2014/data/root/Run-1300-BIG.root
and the MWPC data for that run is in: /gm2/data/t1042-straws/apr-2014/data/root/Run-1300-straws-0-scint-0-mwpc-30-protons-0.root