ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/CMSSW/PhysicsTools/PythonAnalysis/examples/MCTruth2.py
(Generate patch)

Comparing CMSSW/PhysicsTools/PythonAnalysis/examples/MCTruth2.py (file contents):
Revision 1.1 by hegner, Wed Nov 1 10:47:55 2006 UTC vs.
Revision 1.2 by hegner, Sat Mar 3 03:49:59 2007 UTC

# Line 1 | Line 1
1 < from cmstools import *
1 > from PhysicsTools.PythonAnalysis.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
8   # access the event tree
9 < events = EventTree(theFile.Get("Events"))
13 <
14 < # access the products inside the tree
15 < # aliases can be used directly
16 < sourceBranch = events.branch("source")
9 > events = EventTree("generatorOutput.root")
10  
11 < # loop over the events
11 > # event loop
12   for event in events:
13 <    genEvent = sourceBranch().GetEvent()
13 >    genEvent = event.VtxSmeared.GetEvent()
14      print genEvent

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines