ROOT Version: ROOT/6.06.08/x86_64-slc6-gcc49-opt
Hello,
I’m having a problem filling some histograms in ROOT, more specifically I have a histogram say h1 that I load from a root file, I now want to fill a new histogram with the old multiplied by some factor onto each bin. I do this in python, but the new histogram is empty except for one bin. I have tried t by doing it in a loop:
hnew = ROOT.TH1D(“hnew”,"",100,-1,1)
for i in range(h1.GetXaxis().GetNbins()):
temp = k * h1.GetBinContent(i)
hnew.Fill(temp)
I also found the multiply function, however I’m not quite sure how to use it via python.
- Thanks!