Bare ROOT Analysis

Complete: 3


CMS data can be inspected with ROOT without need of any CMSSW code installation. This can even be done locally on a laptop.

We assume you have a data file with name aod.root under your local working area. You can find more details on how to locate data samples in the Workbook introduction to data management.

Quick Data Inspection with TBrowser

  • Start ROOT prompt:
> root.exe
  • Open the aod.root file from ROOT prompt.
[] TFile f("aod.root");
You will find a number of warning messages due to missing dictionaries in the file. This is expected.
  • Open a browser where you can explore the file content:
[] new TBrowser
select by double-clicking the folder icon "ROOT files", then double-click the opened file aod.root, then select the tree called Events:


  • Look at the available branches. Scroll down the window, then select the branch beginning with recoTracks_ctfWithMaterialTracks_:


  • Select the branch ending by .obj. You will have a list of data members of objects of type reco::Track:


  • double-click on one of the leaves, for instance, the one ending by ndof_. You will see a new window with the plot of the number of degrees of freedom of the stored tracks:


Interactive Plots from ROOT Prompt

You can obtain the same plot as above typing the following command from ROOT prompt:

[] Events.Draw("ctfWithMaterialTracks.ndof_")

From ROOT prompt you can also plot combination of data members. For instance:

[] Events.Draw("ctfWithMaterialTracks.chi2_/ctfWithMaterialTracks.ndof_", "ctfWithMaterialTracks.chi2_<100")

This will display the plot below:


Limits of Bare ROOT Analysis

You can't invoke object member functions in bare ROOT more. You can do this if you load dynamic libraries containing the object definition. This is possible accessing data in FWLite interactive mode.

Review Status

Reviewer/Editor and Date (copy from screen) Comments
LucaLista - 01 Nov 2006 page content last edited
JennyWilliams - 07 Feb 2007 editing to include in SWGuide

Responsible: LucaLista
Last reviewed by: Reviewer

Edit | Attach | Watch | Print version | History: r9 < r8 < r7 < r6 < r5 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r9 - 2007-07-02 - JennyWilliams

    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CMSPublic All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2021 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