Dear,
In the following piece of code, I’m converting Gaussians (TF1’s) to histograms (TH1D) in order to add them up in an eventloop. Adding up TF1’s failed since there is a limit on the number of iteration. With histograms, it works, however on the edges peaks are appearing that should be there, so I guess that out-of-range events are being added there. Is there a way to avoid that?
Gaus_tot = ROOT.TF1(“Gaus_tot”,“gaus”,100, 200)
Hist_tot = Gaus_tot.GetHistogram()
Gaus_i = ROOT.TF1(“Gaus_i”,“gaus”,100, 200)
for iev in chain1:
Gaus_i.Clear()
Gaus_i = ROOT.TF1(“Gaus_i”,“gaus”,100, 200)
Gaus_i.SetParameters(1., iev.mean, iev.sigma)
Hist_i = Gaus_i.GetHistogram()
Hist_tot.Add(Hist_i, iev.weight)