Esempio n. 1
0
 def generate(self):
     """ Generate a raw data set for nd loaded scintillator."""
     gen_set = data_set.RawDataSet("Nd%d" % self._loading)
     # Scintillator backgrounds
     for isotope, fraction in self._scint_fractions.iteritems():
         energy_spectrum = generators.generators[isotope].generate(self._scint_mass * fraction)
         # Apply an internal radial dependence
         spectrum = spectrum_util.apply_radial_spectrum(energy_spectrum, 
                                                        spectrum_util.internal(self._radius))
         gen_set.add_background(spectrum)
     # Now Isotope backgrounds
     for isotope, fraction in self._nd_fractions.iteritems():
         energy_spectrum = generators.generators[isotope].generate(self._nd_mass * fraction)
         # Apply an internal radial dependence
         spectrum = spectrum_util.apply_radial_spectrum(energy_spectrum, 
                                                        spectrum_util.internal(self._radius))
         gen_set.add_background(spectrum)
     # Now Solar backgrounds
     for isotope in self._solar_backgrounds:
         energy_spectrum = generators.generators[isotope].generate(self._scint_mass)
         # Apply an internal radial dependence
         spectrum = spectrum_util.apply_radial_spectrum(energy_spectrum, 
                                                        spectrum_util.internal(self._radius))
         gen_set.add_background(spectrum)
     # Now the signal
     signal_energy_spectrum = generators.generators["150Nd0v"].generate(self._nd_mass * \
                                                                            self._signal_fraction)
     spectrum = spectrum_util.apply_radial_spectrum(signal_energy_spectrum, 
                                                    spectrum_util.internal(self._radius))
     gen_set.set_signal(spectrum)
     return gen_set
Esempio n. 2
0
    def generate(self):
        """ Generate a raw data set for Te loaded scintillator."""
        gen_set = data_set.RawDataSet("Te%d" % self._loading)

        # Scintillator backgrounds
        for isotope, fraction in self._scint_fractions.iteritems():
#this is if I want to use the g/g  
#            energy_spectrum = generators.generators[isotope].generate(self._scint_mass * fraction)
            energy_spectrum = generators.generators[isotope].generate(fraction)
            # Apply an internal radial dependence
            spectrum = spectrum_util.apply_radial_spectrum(energy_spectrum, 
                                                           spectrum_util.internal(self._radius))
            gen_set.add_background(spectrum)
        # AV backgrounds
        for isotope, fraction in self._av_fractions.iteritems():
            energy_spectrum = generators.generators[isotope].generate(fraction)
            # Apply an internal radial dependence
            spectrum = spectrum_util.apply_radial_spectrum(energy_spectrum, 
                                                           spectrum_util.internal(self._radius))
            gen_set.add_background(spectrum)
        # Now Solar backgrounds
        for isotope in self._solar_backgrounds:
            energy_spectrum = generators.generators[isotope].generate(self._scint_mass)
            # Apply an internal radial dependence
            spectrum = spectrum_util.apply_radial_spectrum(energy_spectrum, 
                                                           spectrum_util.internal(self._radius))
            gen_set.add_background(spectrum)
        # Now Isotope backgrounds
        for isotope, fraction in self._te_fractions.iteritems():
            energy_spectrum = generators.generators[isotope].generate(self._te_mass * fraction)
            # Apply an internal radial dependence
            spectrum = spectrum_util.apply_radial_spectrum(energy_spectrum, 
                                                           spectrum_util.internal(self._radius))
            gen_set.add_background(spectrum)

        # Now the signal

        signal_energy_spectrum = generators.generators["130Te0v"].generate(self._te_mass * \
                                                                               self._signal_fraction)
        spectrum = spectrum_util.apply_radial_spectrum(signal_energy_spectrum, 
                                                       spectrum_util.internal(self._radius))
        gen_set.set_signal(spectrum)
        return gen_set
Esempio n. 3
0
def spectra(bg1, bg2, bg3, activity, rejection):
    """ Return the pileup spectra of 1 + 2 + [3] with the activity specified given the rejection."""
    name = bg1.GetName() + "+" + bg2.GetName()
    spectra1 = spectrum_util.flattern(_new_spectra(bg1))
    spectra2 = spectrum_util.flattern(_new_spectra(bg2))
    convolved = _convolve_reject(spectra1, spectra2, rejection)
    if bg3 is not None:
        spectra3 = spectrum_util.flattern(_new_spectra(bg3))
        convolved = _convolve_reject(convolved, spectra3, rejection)
        name = name + "+" + bg3.GetName()
    convolved.Scale(activity / convolved.GetSumOfWeights())
    result = spectrum_util.apply_radial_spectrum(convolved, spectrum_util.internal(6000.0)) #Need to think about radial dependence
    result.SetName(name)
    return result
Esempio n. 4
0
def spectra(bg1, bg2, bg3, activity, rejection):
    """ Return the pileup spectra of 1 + 2 + [3] with the activity specified given the rejection."""
    name = bg1.GetName() + "+" + bg2.GetName()
    spectra1 = spectrum_util.flattern(_new_spectra(bg1))
    spectra2 = spectrum_util.flattern(_new_spectra(bg2))
    convolved = _convolve_reject(spectra1, spectra2, rejection)
    if bg3 is not None:
        spectra3 = spectrum_util.flattern(_new_spectra(bg3))
        convolved = _convolve_reject(convolved, spectra3, rejection)
        name = name + "+" + bg3.GetName()
    convolved.Scale(activity / convolved.GetSumOfWeights())
    result = spectrum_util.apply_radial_spectrum(
        convolved,
        spectrum_util.internal(6000.0))  #Need to think about radial dependence
    result.SetName(name)
    return result