Skip to content

Usage and Application

Raj Handique edited this page Jun 25, 2025 · 2 revisions

The CMS-OpenData-Pipeline is developed by the Experimental High Energy Physics group at IISER-Pune. The pipeline is capable of making custom Ntuples called FunAODs consisting of high-level physics objects (for e.g: electrons, muons, jets) from Run 1 AODs and Run 2 miniAODs.

Setting up and the pipeline in the Docker container

To set up the CMS-OpenData-Pipeline in the docker container, clone the GitHub repository onto the Docker container. The repository should be cloned into the /code/CMSSW_5_3_32/src/ directory in the Docker container. The following command shall clone the repository:

git clone https://github.com/phazarik/CMS-OpenData-analysis.git

Making a FunAOD:

Let us see how can we make a simple FunAOD:

  1. Navigate to the CMS-OpenData-Pipeline’s AOD2FunAOD directory. The directory path is given as: /code/CMSSW_5_3_32/src/CMS-OpenData-analysis/AOD2FunAOD/Test.

  2. In this directory you’ll find a python file named testntuple.py, which we will be using for our test problem. There shall also be a C++ source file named testntuplemaker.cc that will be used by the python file in the ../src/ directory. You can access these files and make changes later.

  3. Now, let us produce a FunAOD that will contain high-level muons. For that we’ll have to compile the source code before we can exeute it. To compile the files, one has to run the following command:

scram b -j 8
  1. After successful compilation, the FunAOD can be made using the following command:
cmsRun testntuple.py nEvents=5000 isData=False

This will run the python file and produce an FunAOD named testoutput.root. This file can be accessed through TBrowser in ROOT.

Note: To run over all events, set nEvents=-1

Congratulations, we’ve now successfully created the first FunAOD containing muon information of 5000 events from a DYJetsToLL simulated sample. Now, let’s take this FunAOD out of the docker container to the local machine. (ROOT doesn’t really work in the docker container, so it’s better to have in the local machine).

Example - Plotting the $\mu^{+}\mu^{-}$ invariant mass

Now that we have created a FunAOD, let us make a dummy analysis using analysis files that can be found in the AnalysisCodes directory. A directory named test_dimuon_mass shall contain the a dummy analysis file. To run those files using ROOT in your local machine, do the following:

  1. Change directory to test_dimuon_mass.
cd AnalysisCodes/test_dimuon_mass/
  1. Initialise the ROOT terminal using:
root --web=off
  1. Compile the code from the ROOT terminal:
.L cmsAna.C+
  1. Execute the driver file using:
.x driver.C
  1. You can plot the $\mu^{+}\mu^{-}$ invariant mass by running the plotting script:
.x graphing.C
  1. You shall get a plot like shown below once you run the script.

dimuon

Figure: Invariant mass distribution of dimuon events.

That’s it, we’ve now plotted the $\mu^{+}\mu^{-}$ mass using the CMS-OpenData-Pipeline. Fun, isn’t it? One can thus do even more complex analyses using the CMS-OpenData-Pipeline.