No description, website, or topics provided.
Python C
Switch branches/tags
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

CMS Outreach Exercise 2010

Some intro text here. This repo contains two examples:

a) the TwoLeptons analysis: Z -> ll

b) the FourLeptons analysis: ZZ -> llll

Both examples exercises running on 2010 data, but not directly in the AOD format.

The exercise runs over tuples created following the Physics Analysis Toolkit (pattuples) from the 2010 AOD data. More details on the pattuples generation are in the pattuple repository:

From now on it is assumed that you will work on a VM properly contextualized for CMS.

Creating the Working Area

This step is only needed the first time.

source /cvmfs/
cmsrel CMSSW_4_2_8
cd CMSSW_4_2_8/src
git init
git remote add origin 
git fetch origin
git checkout master
scram b 

Sourcing the environment

This step is needed each time you want to run the exercise.

source /cvmfs/
cd CMSSW_4_2_8/src

Running the Exercise

The path to the pattuples is giving in the file:


To run the code you have to move to the directory:


You must specify in your code from the path above which analysis you want to run:

# Import the Analyzer you want to run:
# FourLeptonAnalyzer or TwoLeptonAnalyzer
# by uncommenting the appropiate line below. 

#from OutreachExercise2010.DecaysToLeptons.FourLeptonAnalyzer import FourLeptonAnalyzer as MyAnalyzer
from OutreachExercise2010.DecaysToLeptons.TwoLeptonAnalyzer import TwoLeptonAnalyzer as MyAnalyzer

The number of events to be analyzed can be modified in the file.

for sample in sources:
    # maxEv defines the maximum number of events to analyze
    # set it to -1 to analyze all available events; 
    analyzer.processSample(sample, maxEv=100)

To get enough events in the plots, you would need to run over all available samples. That takes time. If you just want to see whether you can get this running, run over at least 100000 events to get some entries in the plot for the two lepton example, and more for the four lepton example: you get a clear signal with 1000000 events in the plot for the two lepton example, it takes 15 min.

Then, just run your analysis in a interactive mode:


or in a non-interactive mode:


At the beginning you will get a message like:

Processing Files
['root://', 'root://', 'root://', 'root://', 'root://', 'root://', 'root://', 'root://', 'root://', 'root://', 'root://', 'root://']
1 events processed in 28.4234111309 seconds
100 events processed in 49.6256351471 seconds
In [1]: 

By default all the histrograms defined in your analyzer will be plotted and saved in png format (with the name of the histogram). In the interactive mode, you can also plot them typing (depending on the analysis your are running):




You can exit the ipython session by typing exit() or ctrl+d.

Events selection can be modified in the and codes: