From b35460c7d2e634aeb7b7db16928d61ff0cc5f0d1 Mon Sep 17 00:00:00 2001 From: tlatorre Date: Mon, 17 Sep 2018 11:45:21 -0500 Subject: update muon kinetic energy calculation This commit updates the calculation of the muon kinetic energy as a function of distance along the track. Previously I was using an approximation from the PDG, but it doesn't seem to be very accurate and won't generalize to the case of electrons. The kinetic energy is now calculated using the tabulated values of dE/dx as a function of energy. --- src/muon.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/muon.h') diff --git a/src/muon.h b/src/muon.h index e95cb3c..253a9df 100644 --- a/src/muon.h +++ b/src/muon.h @@ -1,10 +1,20 @@ #ifndef MUON_H #define MUON_H +#include /* for size_t */ + #define EULER_CONSTANT 0.57721 +typedef struct muon_energy { + double *x; + double *T; + size_t n; +} muon_energy; + +muon_energy *muon_init_energy(double T0, double rho, size_t n); +double muon_get_energy(double x, muon_energy *m); +void muon_free_energy(muon_energy *m); double get_range(double T, double rho); -double get_T(double T0, double x, double rho); double get_dEdx(double T, double rho); double get_expected_charge(double x, double T, double T0, double *pos, double *dir, double *pmt_pos, double *pmt_normal, double r); -- cgit