LightJetAnalysis: a lightweight framework to analyse flat root ntuples

We setup a lightweight framework to analyse flat root ntuples. These ntuples can (but don't need to) be derived from ATLAS D3PDs. The purpose of this framework is to make it easy for (undergraduate) students to analyse events, without having to deal with the complication (and potential overhead) of using ProofAna.  

Getting Started & Compile

(1) Install FastJet (only if you're not running this at SLAC but on your laptop!) 

Follow instructions here:


(2) Check out the code from GitHub

git clone

If you run this on your local machine (and not on atlint) you need to adjust the file to point to your local installation of fastjet and root.

  • Note: if you have the C++ boost library installed, you can set it up in the file. This allows you set arguments in the command line. 




(3) Copy input test file:

scp <userid> .

(1 GB in size)

A larger sample is available at:


Running the code

run the executable:


if you compiled the code against the boost library, you can use

$./runLightJetAnalysis.exe --h

to see the available run options / arguments. 

Changing the MakeClass

The files LightJetAnalysisBase.C and LightJetAnalysisBase.h are generated using the MakeClass() method of a TTree.

If the branches of the TTree of the input file is changed, these two files need to be regenerated. For this, do the following:

$root -l myfile.root

root [1] myTree->MakeClass("LightJetAnalysisBase");

The file LightJetAnalysisBase.h now contains the declaration of the branches of the TTree myTree .

One annoying feature of MakeClass is that the arraw size is taken from the first entry of the tree. For instance, you may find lines like this:

Float_t Jpt[17]; //[NJetsFilled]

which needs to be changed into

Float_t Jpt[NJetsFilled];






  • No labels