コード例 #1
0
ファイル: energy_resolution.py プロジェクト: pgjones/snopy
 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
コード例 #2
0
ファイル: energy_resolution.py プロジェクト: arushanova/snopy
 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
コード例 #3
0
ファイル: fiducial_rejection.py プロジェクト: pgjones/snopy
 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
コード例 #4
0
 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
コード例 #5
0
ファイル: data_set.py プロジェクト: arushanova/snopy
 def _new_data(self, name):
     """ Reutrn an empty data type."""
     return spectrum_util.default_raw(name)