Analysis Release and the xAOD EDM

This is the wiki page for the AnalysisRelease + xAOD EDM session of the ATLAS LBL Software Tutorial. The material on this page comes mostly from the standard SoftwareTutorialxAODEDM Twiki.

Setting up the Analysis Release

In this session you will be familiarized with the Analysis Release, which is a lightweight collection of analysis software RootCore tags. I assume you have already run setupATLAS (see here if not).

To begin, create a fresh new work directory:

 mkdir XAODTutorialEDM
 cd XAODTutorialEDM

The basic command used to setup the analysis release is rcSetup. The syntax is similar to asetup, which you used to setup an athena release. To see which flavors and release numbers are available, run rcSetup -r. You should see an output like this:

> rcSetup -r
Available releases are:
relType = 1.X.0 (at /afs/cern.ch/atlas/software/ASG/nightlies/1.X.0):
 Top: 	rel_2 rel_3 rel_4 rel_5 rel_6 rel_0 rel_1
 Base: 	rel_5 rel_6 rel_0 rel_1 rel_2 rel_3 rel_4
relType = 2.0.X (at /afs/cern.ch/atlas/software/ASG/nightlies/2.0.X):
 Base: 	rel_0 rel_1 rel_2 rel_3 rel_4 rel_5 rel_6
relType = dev (at /afs/cern.ch/atlas/software/ASG/nightlies/dev):
 SUSY: 	rel_0 rel_1 rel_2 rel_3 rel_4 rel_5 rel_6
 Top: 	rel_0 rel_1 rel_2 rel_3 rel_4 rel_5 rel_6
 Base: 	rel_0 rel_1 rel_2 rel_3 rel_4 rel_5 rel_6
cvmfs-stable (at /cvmfs/atlas.cern.ch/repo/sw/ASG):
 SUSY: 	1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6
 Top: 	1.0.0 1.1.0 1.2.0 1.3.0 1.4.0 1.5.0 1.6.0
 Base: 	1.0.0 1.0.1 1.1.0 1.2.0 1.3.0 2.0.0 1.4.0 1.5.0 1.5.1 2.0.1 1.5.2 2.0.2 1.5.3 2.0.3 1.5.4 2.0.4 1.5.5 2.0.5

You see there are three flavors of analysis release: Base, Top, and SUSY. We will use Base release 2.0.2 for this session.

Set up the release now by running rcSetup Base,2.0.2. This will automatically set up ROOT and create a directory called RootCoreBin where RootCore will store compiled binaries, links to headers, package scripts, shared library files, etc.

Playing with RootCore

Now, you will try out some sample RootCore commands to get you used to using the AnalysisRelease with RootCore.

First, run rc find_packages and rc compile to tell RootCore to search for compatible packages in your work directory as well as in the release area, and compile things as necessary. At the moment you don't have any packages checked out, so this isn't very interesting!

Let's try checking out a package and compiling, just for fun! Run

 rc checkout_pkg EventLoop
 rc find_packages
 rc compile

To see which tags you are getting from the release, run rc version. You may want to grep for the package you are interested in; e.g., rc version | grep xAODMuon

For more detailed information about using RootCore, see the official twiki page here: https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/RootCore

xAOD EDM software

For the moment the best way to understand what variables you can access for each object is to look at the code.

The EDM code can be found in the SVN browser at atlasoff/Event/xAOD. In most cases, it should be clear which package in the structure to look at. For example, if you are interested in taus you would look at the xAODTau package. For each xAOD EDM package you can either choose a particular tag of that package (corresponding to the version in your Athena or Analysis Release versions), or you can look in the trunk version to see the latest version.

Browsing the xAOD with a TBrowser

Now let's open the xAOD in ROOT, and open a TBrowser for browsing:

 root /afs/cern.ch/atlas/project/PAT/xAODs/r5534/valid2.117050.PowhegPythia_P2011C_ttbar.digit.AOD.e2657_s1933_s1964_r5534/AOD.01482225._000107.pool.root.1
 root[0] TBrowser b;

Adjust the above file path as necessary for your filesystem. If you are on PDSF or the SLAC machines, take a look at the site specific setup instructions.

You will get lots and lots of warnings about dictionaries not available, don't worry about those for now. The TTree containing the variables is called CollectionTree. Feel free to open that TTree and play with the items inside.

Can you find and understand the variables discussed in the lectures? Can you see how the variables are organized? Try to draw some variables from the browser.

Look and compare containers with and without Aux, representing the Auxillary store. When looking at the xAOD in the TBrowser we need to be aware of this, but when working with interactive sessions or compiled C++ code we will interact with the xAOD objects through an interface and don't need to explicitly worry about this Auxillary store business.

Interactive ROOT with the xAOD

Let's use interactive ROOT to look at the xAOD and make a simple plot:

 root [0] gROOT->Macro( "$ROOTCOREDIR/scripts/load_packages.C" );
 root [1] xAOD::Init();
 root [2] f = TFile::Open( "/afs/cern.ch/atlas/project/PAT/xAODs/r5534/valid2.117050.PowhegPythia_P2011C_ttbar.digit.AOD.e2657_s1933_s1964_r5534/AOD.01482225._000107.pool.root.1", "READ" );
 root [3] t = xAOD::MakeTransientTree( f )
 root [4] t->Draw( "ElectronCollection.pt() - ElectronCollection.trackParticle().pt()" );

Again, remember to replace the file path with one appropriate for your local filesystem.