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
|