SVN at CERN or Glasgow


First install the package as shown at the previous page: AdrianBuzatuJERSVN. Below is how you run it.


Since we are going to oscillate between working on my Mac and on the Glasgow linux machine (and want to make the code generic for people on other machines, such as CERN or their local institutions), let's have a naming convention. We call "$jer" the location of the code you are running, "$jerroot" the location of the event trees and train trees that we will be creating out of the original files, the "$initialroot" the initial input files which are large such as D3PDs, flat ntuples produced by Paul, or by someone else, in the future xAOD files, so on the Mac we keep only one for testing and at Glasgow we keep all of them. Also there are the common variables about SVN: "$SVNUSR" the shortcut that will allow you to check out the code and the "$SVN_EDITOR" to allow you to make comments in the SVN commits. I keep these lines in my .profile file on the Mac and the .bashrc on the Glasgow Linux machine.

On Mac:

export SVNUSR=svn+ssh://
export SVN_EDITOR="emacs -nw"
export jer="/Users/abuzatu/Work/ATLAS/Analyses/JER/ResolutionNN/trunk"
export jerroot="/Users/abuzatu/Work/ATLAS/Analyses/JER/root_output"
export initialroot="/Users/abuzatu/Work/ATLAS/root/MC12"

On Linux at Glasgow:

export SVNUSR="svn+ssh://"
export SVN_EDITOR="emacs -nw"
export jer="/afs/"
export jerroot="/afs/"
export initialroot="/nfs/atlas/vhbb01/MC12"

Then go to the working directory

cd $jer

Then you need to setup ROOT and the "LD_LIBRARY_PATH". For Mac there is nothing to do, but for Linux you need to do

source setup/

Compile the code


The packages are of two types: those compiled as shared objects, if they contain code like classes and functions that is used in one or more executables (for ex: Event, Jet, Sample); and those compiled as executables, which can include code from one or more shared objects (ex: readPaul, readTree). The advantage of the Makefile structure I wrote here is that it can compile both shared objects and executables, both on Linux and on Mac. The only difference is in the Makefile of a particular folder.

Example of a shared object: the "Event" folder: notice how it includes other shared objects, such as Object and Jet); notice how setting "DO_ROOTCINT=1" instead of "DO_ROOTCINT=0" is enough to compile the object in such a way as to save an Event object to a ROOT Tree; the part in Makefile that is specific to this class

OutSuf=$(DllSuf) #.dylib for Mac or .so for Linux
LIBS_MINE=$(SOFLAGS) -L$(PATH_LIB_MINE) -lObject -lJet #to use the shared library JetRaw and to create a new shared library in Mac

Example of an executable: the "readPaul" folder: the part in Makefile that is specific to this folder

LIBS_MINE=-L$(PATH_LIB_MINE) -lMath -lObject -lJet -lEvent -lEventRaw

For each shared object you need a symbolic link to the folder in the include folder. By doing "ls include" we see

lrwxr-xr-x 1 abuzatu staff 9B 29 Apr 19:44 Sample -> ../Sample
lrwxr-xr-x 1 abuzatu staff 9B 29 Apr 19:44 Object -> ../Object
lrwxr-xr-x 1 abuzatu staff 10B 29 Apr 19:44 NN_Pt_2 -> ../NN_Pt_2
lrwxr-xr-x 1 abuzatu staff 8B 29 Apr 19:44 NN_Pt -> ../NN_Pt
lrwxr-xr-x 1 abuzatu staff 10B 29 Apr 19:44 NNUsage -> ../NNUsage
lrwxr-xr-x 1 abuzatu staff 5B 29 Apr 19:44 NN -> ../NN
lrwxr-xr-x 1 abuzatu staff 7B 29 Apr 19:44 Math -> ../Math
lrwxr-xr-x 1 abuzatu staff 6B 29 Apr 19:44 Jet -> ../Jet
lrwxr-xr-x 1 abuzatu staff 13B 29 Apr 19:44 Histograms -> ../Histograms
lrwxr-xr-x 1 abuzatu staff 11B 29 Apr 19:44 EventRaw -> ../EventRaw
lrwxr-xr-x 1 abuzatu staff 8B 29 Apr 19:44 Event -> ../Event

So now you know how to create your own shared object, your own executable that uses your own shared object.

Copy an input file

Let's copy an intial file for testing. It is signal WH125 with low statistics (about 10k events)

cd $initialroot
mkdir Paul
cd Paul
scp .

Create event trees

This step is specific to the data file read. All the steps above will be identical. The data files read are for now flat ntuples produced for us by Paul Mullen. But they could also be ATLAS D3PDs, future ATLAS xAODs files, or other files produced by other analyses or even other experiments.


That shows you the options. You can run on a small number of events to test (100) or on all events (-1). Let's test on 100 events.

./bin/readPaul.exe ${initialroot}/Paul/WH125.root WlvH125 1 100 ${jerroot}/event_trees_WH125.root 

To run on all events, you do

./bin/readPaul.exe ${initialroot}/Paul/WH125.root WlvH125 1 -1 ${jerroot}/event_trees_WH125.root 

This produces the file, which we can open in ROOT and check the number of events. We can not do more than that as objects of the type Event as saved in the tree. The "Event" is the class defined by our code. So there this is not a flat tree that contains numbers that are simple to read.

root.exe ${jerroot}/event_trees_WH125.root 

Create training trees

We now produce a training file from the file produced at the previous step.


That shows you the options. We typically run here on all events produced at the previous stage (using 0 for all events; notice, it was -1 before). We also apply an event selection at this stage. "2TBTag" means "two tight b-tags" in addition of the 45 GeV cut on the leading jet (j1) and 20 GeV cut on the subleading jet (j2). To have the other b-tagging requirements do "2MBTag" for the "medium" b-tags on both jets and "2LBTag" for the "loose" b-tags on both jets. For just one jet to be b-tagged do "1BTag". These cuts are defined in "Sample/Sample.cxx". You can add your own event selections here. If you want no jet to be b-tagged, choose "0BTag".

./bin/readTree.exe ${jerroot}/event_trees_WH125.root 2TBTag 0 ${jerroot}/train_trees_2TBTag_0_WH125_0.root

As a result, a file is produced which has 42 events saved (out of the intial 100) due to the 2TBTag. If you do all the b-tagging, you should get back the initial 100 events. Let's check that.

root.exe ${jerroot}/train_trees_2TBTag_0_WH125_0.root

2TBTag has 42 events. 2MBTag has 38 events. 2LBTag has 20 events. 1BTag has 0 events. 0BTag has 0 events. So it means that Paul saves only the 2-tag events.

To run on run on many files and on large files, we have scripts starting from Python in the PyRoot folder. But what we wanted to make sure here is a new user is able to check out the package, compile it, run it for one file, and knows how to add her own folders, either shared objects or executables.

cd $jer/PyRoot

Back to the main framework page: AdrianBuzatuJER.

-- AdrianBuzatu - 29 Apr 2014

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2014-08-04 - AdrianBuzatu
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback