1 | import ROOT
|
---|
2 | #import math
|
---|
3 | #import array
|
---|
4 | #import numpy
|
---|
5 |
|
---|
6 |
|
---|
7 | ROOT.gInterpreter.Declare('#include "MG5_aMC_v2_6_0/Delphes/classes/DelphesClasses.h"')
|
---|
8 | ROOT.gInterpreter.Declare('#include "MG5_aMC_v2_6_0/Delphes/external/ExRootAnalysis/ExRootTreeReader.h"')
|
---|
9 |
|
---|
10 | #Load Delphes library
|
---|
11 | ROOT.gSystem.Load("libDelphes.so")
|
---|
12 |
|
---|
13 | #Load the TFile and branch
|
---|
14 | f = ROOT.TFile("signal.root")
|
---|
15 | t = f.Get("Delphes;1")
|
---|
16 |
|
---|
17 | #Loop over events in the branch
|
---|
18 | t.SetAlias("ParticlePID","Particle.PID")
|
---|
19 | for event in t:
|
---|
20 | print(event.ParticlePID[0])
|
---|