def apply(self, raw_data): """ Apply the Gaussian energy resolution to the raw_data.""" sigma_data = spectrum_util.default_raw(raw_data.GetName()) for bin_radius in range(1, raw_data.GetNbinsY() + 1): for bin_energy in range(1, raw_data.GetNbinsX() + 1): sigma_data.SetBinContent(bin_energy, bin_radius, self.get_sigma(raw_data.GetXaxis().GetBinCenter(bin_energy), # In MeV raw_data.GetYaxis().GetBinCenter(bin_radius))) result = spectrum_util.default_raw(raw_data.GetName()) ROOT.GaussianXConvolve(result, raw_data, sigma_data) return result
def apply(self, raw_data): """ Apply the Gaussian energy resolution to the raw_data.""" sigma_data = spectrum_util.default_raw(raw_data.GetName()) for bin_radius in range(1, raw_data.GetNbinsY() + 1): for bin_energy in range(1, raw_data.GetNbinsX() + 1): sigma_data.SetBinContent( bin_energy, bin_radius, self.get_sigma( raw_data.GetXaxis().GetBinCenter(bin_energy), # In MeV raw_data.GetYaxis().GetBinCenter(bin_radius))) result = spectrum_util.default_raw(raw_data.GetName()) ROOT.GaussianXConvolve(result, raw_data, sigma_data) return result
def apply(self, raw_data): """ Apply the fiducial rejection to the raw_data.""" result = spectrum_util.default_raw(raw_data.GetName()) for bin_radius in range(1, raw_data.GetNbinsY() + 1): for bin_energy in range(1, raw_data.GetNbinsX() + 1): net_count = raw_data.GetBinContent(bin_energy, bin_radius) survival_factor = self.get_survival_factor(raw_data.GetXaxis().GetBinCenter(bin_energy), raw_data.GetYaxis().GetBinCenter(bin_radius)) result.SetBinContent(bin_energy, bin_radius, net_count * survival_factor) return result
def apply(self, raw_data): """ Apply the fiducial rejection to the raw_data.""" result = spectrum_util.default_raw(raw_data.GetName()) for bin_radius in range(1, raw_data.GetNbinsY() + 1): for bin_energy in range(1, raw_data.GetNbinsX() + 1): net_count = raw_data.GetBinContent(bin_energy, bin_radius) survival_factor = self.get_survival_factor( raw_data.GetXaxis().GetBinCenter(bin_energy), raw_data.GetYaxis().GetBinCenter(bin_radius)) result.SetBinContent(bin_energy, bin_radius, net_count * survival_factor) return result
def _new_data(self, name): """ Reutrn an empty data type.""" return spectrum_util.default_raw(name)