This is what I have:
When I try to do this, it shows me an error: IndexError: list index out of range
Could someone help?
with open(os.path.join(path, file.replace(".root", ".txt")), 'r') as f:
lines = f.readlines()
htemp = TH1D(name, name, nBins, eMin, eMax)
for i in range(len(lines)):
htemp.SetBinContent(i + 1, float(lines[i]))
entries = int(lines[-1])
return prepareHisto(htemp, xLabel, yLabel), entries