diff options
-rw-r--r-- | muon.c | 28 | ||||
-rw-r--r-- | muon.h | 4 |
2 files changed, 26 insertions, 6 deletions
@@ -132,23 +132,43 @@ err: return -1; } -double get_range(double T) +double get_range(double T, double rho) { + /* Returns the approximate range a muon with kinetic energy `T` will travel + * in water before losing all of its energy. This range is interpolated + * based on data from the PDG which uses the continuous slowing down + * approximation. + * + * `T` should be in MeV, and `rho` should be in g/cm^3. + * + * Return value is in cm. + * + * See http://pdg.lbl.gov/2018/AtomicNuclearProperties/adndt.pdf. */ if (!initialized) { if (init()) { exit(1); } } - return gsl_spline_eval(spline_range, T, acc_range); + return gsl_spline_eval(spline_range, T, acc_range)/rho; } -double get_dEdx(double T) + +double get_dEdx(double T, double rho) { + /* Returns the approximate dE/dx for a muon in water with kinetic energy + * `T`. + * + * + * `T` should be in MeV and `rho` in g/cm^3. + * + * Return value is in MeV/cm. + * + * See http://pdg.lbl.gov/2018/AtomicNuclearProperties/adndt.pdf. */ if (!initialized) { if (init()) { exit(1); } } - return gsl_spline_eval(spline_dEdx, T, acc_dEdx); + return gsl_spline_eval(spline_dEdx, T, acc_dEdx)/rho; } @@ -1,7 +1,7 @@ #ifndef MUON_H #define MUON_H -double get_range(double T); -double get_dEdx(double T); +double get_range(double T, double rho); +double get_dEdx(double T, double rho); #endif |