Hello guys!
First of all, sorry if the question is very obvious, I am a newbie using PyROOT.
I am trying to make a histogram with data stored in a branch (see code)
Turns out it doesn’t read the values. Read the number of entries ok, but the value is always the same.
What could it be? Do you know another way to do it?
If you can help me, I would be grateful. Thank you very much in advance.
Best, Dayron.
Code
histFile = ROOT.TFile.Open( histFileName ,“READ”)
tree = histFile.Get(“charge_gap;1”) ##get tree
branch = tree.GetBranch(“KINETIC_ENERGY”) ##get branch named “KINETIC_ENERGY”
histo8 = ROOT.TH1F(“charged_distro_gap”,“charged part distro on gap” ,512 ,0 ,150)
nEntries = branch.GetEntries()
for i in range (0,nEntries):
data = branch.GetEntry(i)
histo8.Fill(data)