UTA Stop2L

Here I would like to collect anything important for efforts to keep up with the Stop2L group. I will try to keep this updated as much as possible.


I have space in EOS to store all of our MC samples. I do my best to keep this folder updated and organized, but please help and let me know if you see something wrong!

/eos/atlas/user/j/jlittle/v50/ for Signal Samples
/eos/atlas/user/j/jlittle/v51/ for Background Samples

I also try to keep the background separated into their respective regions, but again, please help with this as you see fit.


LoopSUSYCore is a common RootCore package to help with branch address settings for the common ntuples from MelAnalysis. LoopSUSYCore also helps with the computation of kinematic variables such as mCT and MT2.

This package can be found at https://svnweb.cern.ch/trac/atlasinst/browser/Institutes/Bern/SusyAnalysis/LoopSUSYCore/trunk. Generally this will be set up to read the most recent common ntuple.


To use LoopSUSYCore you need to first set up your environment and Analysis Release:

It is common to setup ATLAS software by adding some lines to .bashrc as follows:

export ATLAS_LOCAL_ROOT_BASE=/cvmfs/atlas.cern.ch/repo/ATLASLocalRootBase
alias setupATLAS='source ${ATLAS_LOCAL_ROOT_BASE}/user/atlasLocalSetup.sh'

This way anytime you open a terminal you can simply setup with the command $setupATLAS. If you are on lxplus, you can simply run setupATLAS.

Once the ATLAS Software is setup, we need to run.

rcSetup Base,2.4.29

This will set up the analysis release, it contains SampleHandler, EventLoop and SUSYTools among other things. Now, check out the package:

rc checkout_pkg atlasinst/Institutes/Bern/SusyAnalysis/LoopSUSYCore/trunk 
rc find_packages
rc compile

Don't forget to re-compile if you make changes!

Analysis Code

I have set up a Git Repository for my code so we can all work on the same code here https://gitlab.cern.ch/jlittle/FirstAnalysis. To get started using GitLab go to https://cern.service-now.com/service-portal/article.do?n=KB0003137

First Analysis

Our analysis will inherit from LoopSUSYCore to make histograms or ntuples from the common ntuples.

To check out this project, navigate to where your rcSetup script is located.

git clone https://:@gitlab.cern.ch:8443/jlittle/FirstAnalysis.git
rc find_packages
rc compile

The code should be setup to run right out of the box. If you navigate to the "scripts" directory, there is a python script that will point to the files and execute the code. It is by default set to run over the files in EOS, which I will try to keep up to date. You just have to pass the name of the folder you want to run over as the "submitDir" option. You can run this code over any of the background regions or all of the signals using the following commands:

python Run_2LSS.py --submitDir ttbar
python Run_2LSS.py --submitDir ttV
python Run_2LSS.py --submitDir zjets
python Run_2LSS.py --submitDir VV_llll
python Run_2LSS.py --submitDir VV_lllv
python Run_2LSS.py --submitDir VV_llvv
python Run_2LSS.py --submitDir Wt
python Run_2LSS.py --submitDir VVV
python Run_2LSS.py --submitDir other
python Run_2LSS.py --submitDir signal

This will automatically find the folder containing the corresponding MC stored in EOS.


I also have TMVA setup in a public space along with samples already skimmed by our FirstAnalysis code.


If you navigate to the TMVA folder and source the setup.sh script, you can run TMVAClassification and it will run over the samples in the TMVA_Samples/ folder.

Choose Classification Technique

You can easily choose which technique to train with. Simply open TMVAClassification.C and find the binaries that select the classifier you want. If it's '1', then it will train with that method.

For example you can train a BDT with Adaptive Boosting as follows:

 Use["BDT"]            = 1; // uses Adaptive Boost

You can select multiple methods in one run.


You can train on the data by running the TMVAClassification.C script. There are a few ways to do it.


You can execute the script directly with ROOT:

root -l TMVAClassification.C

This can be useful if there is a problem with compiling.


Compiling is probably a better way of doing things.


Don't forget to run make again if you make any changes.

Viewing Results with TMVA GUI

When finished the TMVA GUI will automatically launch. However, you can launch the files manually in a root session with TMVA::TMVAGui("file.root"). I left root files you can open and view right away in the TMVA folder.


Converting ROOT files for SciKit

NumPy Arrays

I have setup code to convert files from .root to numpy arrays. It is located in:


First source the setup script. This will setup all of the software needed, including root_numpy. Then you can execute root2array.py and pass the file to convert as an argument.


I also have setup a space for .h5 files. HDF5 is a great mechanism for storing large numerical arrays of a homogeneous type, for data models that can be organized hierarchically and benefit from tagging of the datasets with arbitrary metadata.


To convert the root files to .h5, simply navigate here and source the setup file. Then you can convert any ttree like this:

$ ttree2hdf5 --in-file foo.root -o foo.h5 --tree-name TREE

Some HDF5/H5Py Sources




-- JaredDavidLittle - 2018-06-18

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2018-06-18 - JaredDavidLittle
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2021 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