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.
Samples
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.
Setup
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.
/afs/cern.ch/work/j/jlittle/public/TMVA/
/afs/cern.ch/work/j/jlittle/public/FirstAnalysisOutput/ntuples/
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.
Training
You can train on the data by running the TMVAClassification.C script. There are a few ways to do it.
Directly
You can execute the script directly with
ROOT:
root -l TMVAClassification.C
This can be useful if there is a problem with compiling.
Compiled
Compiling is probably a better way of doing things.
make
./TMVAClassification
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.
/afs/cern.ch/work/j/jlittle/public/TMVA/
Converting ROOT files for SciKit
I have setup code to convert files from .root to numpy arrays. It is located in:
/afs/cern.ch/work/j/jlittle/public/root2array
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.
HDF5
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.
/afs/cern.ch/work/j/jlittle/public/h5py
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
https://support.hdfgroup.org/HDF5/release/obtain518.html
http://www.h5py.org/
PythonandHDF5.pdf
--
JaredDavidLittle - 2018-06-18