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 |