3.5.4 FWLite.Python (using PyROOT)

Detailed Review status

Goals of this page:

In this section you will learn how to use FWLite.Python.


This document assumes that you already know python (although you may be able to learn a fair bit just following the examples). Please see references for some links for learning Python.

Why Python? CMS already uses it for its configuration files. It is a powerful language that many consider both much easier to read and easier to write than C++.

Simple Example

This tutorial assumes that the user has setup their area as described in WorkBookFWLiteExamples35X.

An example of accessing data in python is shown here.

To use this example, simply do

python PhysicsTools/PatExamples/bin/PatBasicFWLiteAnalyzer.py

This will loop over the muons in the event ("cleanPatMuons") and plot the kinematic information.


Python introductions:

-- SalvatoreRoccoRappoccio - 08-Mar-2010 -- CharlesPlager - 13-Jan-2010 -- PetarMaksimovic - 08 Jul 2009

This topic: CMSPublic > CMSCommunicationsGroup > CMSCommunicationsProjects > WebHome > SWGuide > WorkBook > WorkBookFWLitePython35X
Topic revision: r1 - 2010-03-08 - SalvatoreRRappoccio
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback