ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/CMSSW/PhysicsTools/PythonAnalysis/test/MCTruth2.py
Revision: 1.2
Committed: Wed Nov 1 10:45:10 2006 UTC (18 years, 6 months ago) by hegner
Content type: text/x-python
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +0 -0 lines
State: FILE REMOVED
Log Message:
moved examples to examples directory

File Contents

# Content
1 from cmstools import *
2 from ROOT import *
3
4 # prepare the FWLite autoloading mechanism
5 gSystem.Load("libFWCoreFWLite.so")
6 AutoLibraryLoader.enable()
7
8 # load the file with the generator output
9 theFile = TFile("generatorOutput.root")
10
11 # access the event tree
12 events = EventTree(theFile.Get("Events"))
13
14 # access the products inside the tree
15 # aliases can be used directly
16 sourceBranch = events.branch("source")
17
18 # loop over the events
19 for event in events:
20 genEvent = sourceBranch().GetEvent()
21 print genEvent