00001 from PhysicsTools.PythonAnalysis import *
00002 from ROOT import *
00003
00004 gSystem.Load("libFWCoreFWLite.so")
00005 AutoLibraryLoader.enable()
00006
00007
00008 theFile = TFile("generatorOutput.root")
00009
00010 events = theFile.Get("Events")
00011
00012
00013 events.GetEntry()
00014
00015
00016
00017
00018
00019
00020 source = edm.HepMCProduct()
00021 sourceBranch = events.GetBranch(events.GetAlias("source"))
00022 sourceBranch.SetAddress(source)
00023
00024
00025 for index in all(events):
00026
00027
00028
00029 sourceBranch.GetEntry(index)
00030 events.GetEntry(index,0)
00031
00032
00033 genEvent = source.GetEvent();
00034 print genEvent.event_number()