snowmass2013:analyse_d3
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
snowmass2013:analyse_d3 [2013/05/30 18:53] – external edit 127.0.0.1 | snowmass2013:analyse_d3 [2014/04/24 01:51] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
[[snowmass2013: | [[snowmass2013: | ||
- | === How to analyze | + | ==== How to analyze |
- | This example shows how to run a program over all files in a certain directory, fill histograms (pT and jet mass) and | + | This example shows how to run a C+= program over all Delphes ROOT files located |
- | save histograms | + | |
Look at the workbook of Delphes3 [[https:// | Look at the workbook of Delphes3 [[https:// | ||
Line 17: | Line 16: | ||
- | === Advanced | + | ==== Advanced |
This assumes that Delphes3 is already installed. You have the directory " | This assumes that Delphes3 is already installed. You have the directory " | ||
Line 23: | Line 22: | ||
Get the analysis file: {{: | Get the analysis file: {{: | ||
- | < | + | < |
tar -zvxf antup.tgz | tar -zvxf antup.tgz | ||
cd antup | cd antup | ||
Line 29: | Line 28: | ||
So you will see 2 directories: | So you will see 2 directories: | ||
- | < | + | < |
delphes3 | delphes3 | ||
antup | antup | ||
Line 37: | Line 36: | ||
Now go to the directory " | Now go to the directory " | ||
- | < | + | < |
ln -s ../ | ln -s ../ | ||
</ | </ | ||
Line 43: | Line 42: | ||
In my case, it will look as: | In my case, it will look as: | ||
- | < | + | < |
analysis.h | analysis.h | ||
A_RUN_TEST | A_RUN_TEST | ||
Line 55: | Line 54: | ||
Check that you see the shared Delphes3 file | Check that you see the shared Delphes3 file | ||
- | < | + | < |
ls -l delphes/*so | ls -l delphes/*so | ||
</ | </ | ||
Line 66: | Line 65: | ||
To run the code, run " | To run the code, run " | ||
But before you do this, you will need to set " | But before you do this, you will need to set " | ||
+ | |||
+ | ==== How to analyze in PyROOT ==== | ||
+ | |||
+ | If ROOT was compiled using " | ||
+ | [[https:// | ||
+ | |||
+ | <code python test.py> | ||
+ | # | ||
+ | # Based on P.Onyisi example | ||
+ | import sys, | ||
+ | if len(sys.argv)< | ||
+ | print " | ||
+ | print " | ||
+ | sys.exit() | ||
+ | from ROOT import * | ||
+ | TH1D.SetDefaultSumw2() | ||
+ | gSystem.Load(' | ||
+ | |||
+ | f=TFile(sys.argv[1]) | ||
+ | t=f.Delphes # extract the tree | ||
+ | h=TH1D(' | ||
+ | c1=TCanvas() # build a canvas | ||
+ | |||
+ | n=0 | ||
+ | for e in t: # loop over all events | ||
+ | if n%100==0: print " | ||
+ | n=n+1 | ||
+ | for electron in e.Electron: # loop over all electrons | ||
+ | | ||
+ | h.Draw() | ||
+ | c1.Print(' | ||
+ | if (raw_input(" | ||
+ | c1.Close(); sys.exit(1); | ||
+ | </ | ||
+ | |||
+ | Run this code as: | ||
+ | < | ||
+ | python test.py file.root | ||
+ | </ | ||
+ | |||
+ | You will see this image: | ||
+ | {{: | ||
+ | |||
+ | ====How to analyze in Java==== | ||
+ | |||
+ | MC truth information and most of ROOT files with Delphes outputs | ||
+ | are stored in the PROMC file format which can be analyzed on any platform. | ||
+ | Read this [[snowmass2013: | ||
--- // | --- // | ||
snowmass2013/analyse_d3.1369940005.txt.gz · Last modified: 2013/06/01 02:47 (external edit)