Brown Delphes Analysis

Setting Up Environment

On LPC:

cmsrel CMSSW_8_0_4
cd CMSSW_8_0_4/src
cmsenv

Delphes Simulation Package

Delphes Website: https://cp3.irmp.ucl.ac.be/projects/delphes

Installing

Delphes Twiki: https://twiki.cern.ch/twiki/bin/view/CMS/DelphesUPG

git clone https://github.com/delphes/delphes 
cd delphes
git checkout tags/3.3.3pre11
./configure
make -j 4
cd ..

Might have to make at least 2 times.

Brown Delphes Analysis

Git Repository: https://github.com/agarabed/Delphes_Analysis

Checkout Code

git clone https://github.com/agarabed/Delphes_Analysis.git Delphes_Analysis

Selector

Relevant files:

Delphes_Analysis/interface/BrownDelphesSelector.h
Delphes_Analysis/interface/Selections.h
Delphes_Analysis/src/SelectorExample.C

Running the SelectorExample:

 root -l -q Delphes_Analysis/src/SelectorExample.C'("Delphes_Analysis/FileLists/tt-4p-0-600_200PU.txt", "out.root","Delphes","SnowMass")' 

input 1: location of input files. Can handle 1) path to single root file, 2) .txt file list of paths and file names for multiple root files, and 3) path to directory, will use all .root files in the directory.

input 2: path and name of output file

input 3: name of TTree in input root files

input 4 (optional): String to look up selection in Selections.h. If omitted or not a pre-existing selection, No Selection will be applied and a warning message will appear.

BrownDelphesSelector.h: Class which applies a selection stored in Selection.h. Can run over a single file, all the root files in a directory, or list of file paths found in a text file.

Example Usage (From: Delphes_Analysis/src/SelectorExample.C):

BrownDelphesSelector *Analysis = new BrownDelphesSelector; \\ creates class instance
Analysis->Init("path_to_input_file/input_file.root" , "path_to_output_file/output_file.root", "treeName", "SelectionString"); \\ Single File Mode. Initializes necessary variables and opens branches, loads selection cuts
\\Analysis->Init("path_to_input_file/input_file.txt" , "path_to_output_file/output_file.root", "treeName", "SelectionString"); \\ File List Mode
\\ Analysis->Init("path_to_input_files/ , "path_to_output_file/output_file.root", "treeName", "SelectionString"); \\ Directory Mode
Analysis->Loop(); \\ Loop over events, save events/objects that survive cuts

Currently uses "Electron", "MuonTight", "MissingET", and "Jet" branches for selection. To change this, edit the Loop() function in Delphes_Analysis/interface/BrownDelphesSelector.h.

Additional branches from selected events are copied over. To add/remove branches to copy, edit Fill() in Delphes_Analysis/interface/BrownDelphesSelector.h.

To add a selection, create unique name for the selection and add it to Delphes_Analysis/interface/Selections.h, then use the unique name as the "SelectionString" when running BrownDelphesSelector::Init().

Plotting Macro

Relevant Files:

Delphes_Analysis/interface/Sample.h \\Sample Class
Delphes_Analysis/interface/LoadSamples.h \\Stores info about samples and groups them by analysis
Delphes_Analysis/src/PlotExample.C \\Loops over selected output trees from samples found in LoadSamples, makes all requested plots

Running the PlotExample:

root -l -q Delphes_Analysis/src/PlotExample.C 

Currently can only run on one root file at a time. Stores final stacked histogram (THStack) as well as individual histograms (TH1F) from all samples in LoadSamples.

A "Sample" class has a name (ex: "tt_0_600", for the 0-600 HT bin of ttbar), a path to the input file, a type ("bkg","dat", or "sig"), fill color, cross section, generated events. "Samples" also keep track of the open files, trees, and branches. "Samples.h" stores how plots are filled (i.e. where things like getting the leading jet pT is coded)

To add a new set of samples for you analysis, edit LoadSamples.h. Create a new analysis string and add

else if(type == "MyNewType"){ 

to the LoadSamples function.

Add new plots to the top of PlotExample.C

\\Psuedo Code: PlotInfo.push_back( aPlot{plotName, BranchName, VariableName, X Axis Label} );
PlotInfo.push_back( aPlot{"Leading_Jet_pT", "Jet", "PT", "Leading Jet p_{T} [GeV]"} ); 

Out Of The Box Example

Set up environment:

cmsrel CMSSW_8_0_4
cd CMSSW_8_0_4/src
cmsenv

Check out, compile delphes:

git clone https://github.com/delphes/delphes
cd delphes
git checkout tags/3.3.3pre11
./configure
make -j 4
cd ..

Check out Delphis Analysis code:

git clone https://github.com/agarabed/Delphes_Analysis.git Delphes_Analysis

Apply basic selection to entire ttbar sample in 0-600 GeV Ht bin & 200 Pileup. Resulting events will be saved in "out.root":

root -l -q Delphes_Analysis/src/SelectorExample.C'("Delphes_Analysis/FileLists/tt-4p-0-600_200PU.txt", "out.root","Delphes","SnowMass")'

Make Plots using all 200PU ttbar samples (5 total). Plots contain in "plot.root":

root -l -q Delphes_Analysis/src/PlotExample.C

-- AlexGarabedian - 2016-06-07

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r4 - 2016-07-13 - AlexGarabedian
 
    • 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