35 lines
1.2 KiB
C++
Executable File
35 lines
1.2 KiB
C++
Executable File
#include "simulation/tritium_spectrum.h"
|
|
|
|
#include "constants/T2_beta_decay.h"
|
|
#include "constants/physical_constants.h"
|
|
#include "simulation/errors.h"
|
|
#include "simulation/kinematic.h"
|
|
|
|
std::function<double(double)> tritiumDecayEnergySpectrum(double prefactor) {
|
|
if (prefactor <= 0.) {
|
|
ERROR("Prefactor must be positive");
|
|
}
|
|
|
|
return [=](double energy_eV) {
|
|
if (energy_eV < 0.) {
|
|
ERROR("Beta decay spectrum not defined for negative energies.");
|
|
}
|
|
|
|
else if ((energy_eV == 0.) || (energy_eV > T2BetaDecay::E0_T)) {
|
|
return 0.;
|
|
}
|
|
|
|
const double Z = 2.0;
|
|
const double beta = kinematic::relativisticBeta(energy_eV, HEPunits::me);
|
|
const double p = kinematic::relativisticMomentum(energy_eV, HEPunits::me);
|
|
const double eta = 2.0 * M_PI * Z / (137.0 * beta);
|
|
const double fermi_function = eta / (1. - std::exp(-eta));
|
|
|
|
// return T2BetaDecay::spectrum_prefactor * fermi_function *
|
|
// (energy_eV + HEPunits::me) * p *
|
|
// std::pow(T2BetaDecay::E0_T - energy_eV, 2) * prefactor;
|
|
return T2BetaDecay::spectrum_prefactor * fermi_function *
|
|
(energy_eV + HEPunits::me) * p *
|
|
(T2BetaDecay::E0_T - energy_eV)*(T2BetaDecay::E0_T - energy_eV) * prefactor;
|
|
};
|
|
} |