xboa
_fit_smoothing.py
Go to the documentation of this file.
1 import copy
2 import ROOT
3 
4 class FitSmoothing(object):
5  def __init__(self, fit_function):
6  self.fit = fit_function
7 
8  def smooth(self, data):
9  graph = ROOT.TGraph(len(data))
10  for i, data_y in enumerate(data):
11  graph.SetPoint(i, i, data_y)
12  graph.Fit(self.fit)
13  data_out = [self.fit.Eval(i) for i in range(len(data))]
14  return data_out
15