Running the VH analyses

Getting prepared

Here is how to use the software package Adrian wrote and put in svn as "HiggsAnalysis" in order to do the VH analyses with the help of the GlaNp package. We plan to check out the HiggsAnalysis package.

First you have to checkout and build the latest versions of the GlaNtp and HiggsAnalysis packages.

GlaNtp: AdrianBuzatuZHFrameworkGlasgowGlaNtpCheckout

HiggsAnalysis: AdrianBuzatuZHFrameworkGlasgowGlaNtpHiggsAnalysisCheckout

Then we define the variables in a new exterm.

ssh -Y

Then open an xterm terminal.


Go to the HiggsAnalysis package

Do you want to run a tagged version of HiggsAnalysis? Typically users that are not developers of HiggsAnalysis want that. Go the tagged version you already have installed.

cd $HOME/public_ppe/HiggsAnalysis/HiggsAnalysis-00-00-03

Do you want to run the trunk (head) version of HiggsAnalysis? Typically developers of HiggsAnalysis want that (Adrian was the creator of this package and always uses this, so the tagged will not be the latest version, but the latest stable version).

cd $HOME/public_ppe/HiggsAnalysis/trunk

Setup GlaNtp and others (short practical version)

Do you want to setup a tagged version of GlaNtp? Typically users that are not developers of GlaNtp want that. Set up the tagged version you already have installed. The tag version is hard coded in the file.


Do you want to set up the trunk (head) version of GlaNtp? Typically developers of GlaNtp want that (Adrian was has added some executables in the RootUtil/test folder of GlaNtp, so Adrian uses this).


Be careful to always source and never execute these scripts. If you execute them, then the setup is done only during running and the new environment variables do not exist afterwards. To check that they do, show the directory where GlaNtp is taken from, check for example that ROOT is now defined and one command from GlaNtp is accessible to you.

which root
which CheckEntriesrv5

Setup GlaNtp and others (long fancy useless version)

Skip this section if you did the section above with setting GlaNtp in the quick way.

Define the environment values we will use:

export WORKING_AREA=$HOME/public_ppe
export PACKAGE_GN=GlaNtpPackage
export PACKAGE_GN_TAG="00-00-66"
export PACKAGE_GN_TAG="h"

Set up the already checked out version of GlaNtp:

source $HOME/public_ppe/scripts/ -v $PACKAGE_GN_TAG

Check is to see if you can access one of the commands in GlaNtp

which CheckEntriesrv5

Now that we are done with setting up GlaNtp, we define the environment variables for the package HiggsAnalysis.

export PACKAGE_HA=HiggsAnalysis
export PACKAGE_HA_TAG="00-00-03"
export PACKAGE_HA_TAG="h" (not used anywhere, but for consistency with GlaNtp)

Now we are ready to do the analyses, so we go to the appropriate HiggsAnalysis folder, from where we run.


To check that we are indeed here


Thin flatuples independently of other scripts

First produce a new flattuple that keeps the physics and global trees but only for the events that pass the selections described in the file .txt.

cd $HOME/public_ppe/HiggsAnalysis/trunk
ThinFlattuplerv5   /afs/ /afs/ steerFiles/Sample_lvbb.txt 0 0

Then read the number of entries in that file.

GetEntriesrv5 /afs/ physics

Run on flattuples

Once Mike gives us flattuples from the grid using AtlasHbb, there are several stages to run, but all use the same script "runOnFlattuples" that takes as a command-line argument the action that we want to do.

cd $HOME/public_ppe/HiggsAnalysis/trunk

First, we need to correct the global tree information, which for data is setting all values to 1, and for MC is setting NGen to the total of all the files produced for that process.

./ WenuHbb  MCtest    0      0     0            0                 /afs/ 1 6 globalfix

Then if you want to update the global tree for example by changing your selection for a certain region (cutmask and invertword values from the globaldata tree) you should run the following command. But bear in mind that what you change too is hard coded in GlaNtp. You have to change there, then recompile GlaNtp, then you can run. This is dirty, but I did not have time to code more. However, it is flexible enough to allow us to change the selection criteria quickly, recompile and then run again.

cd $HOME/public_ppe/GlaNtpPackage/GlaNtpSVNh/trunk/RootUtil/test
look for "if(false)" statements, make changes inside and set them to true, save the file

Now recompile and the new executable is accesible for us to use in the HiggsAnalysis side.

(cd .. ; make) 

Now we can run the command.

./ WenuHbb  MCtest    0      0     0            0                 /afs/ 1 6 globalupdate

Then open the .root file and look at the globaldata and it will have different cut mask and invert word.

root.exe /afs/

Now we want to thin the flattuples according to the selection that we desire. This will mean that the globaldata tree will be kept unchanged, but the physics tree will contain only the events that pass the event selection, and for each such event all the branches and leaves of the initial tree will be kept. For this we run

./ WenuHbb  MCtest    0      0     0            0                 /afs/ 1 6 thinselection

Implementation in progress ...

Run templates

Edit the file to run the test files for data and MC and run.


You should see the log files in the folder "logs" and the output .root template files in the folder "templates". The input files are the thinned flattuples stored by Adrian. The path is in this script.

I will add here the rest of the commands: we can manipulate the flattuples in different ways, we can make the stacked plots after the flattuples.

Back to mother page: AdrianBuzatuZHFrameworkGlasgowGlaNtp.

-- AdrianBuzatu - 11-Jul-2012

Edit | Attach | Watch | Print version | History: r8 < r7 < r6 < r5 < r4 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r8 - 2012-09-15 - 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-2023 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