diff options
Diffstat (limited to 'src/muon.c')
-rw-r--r-- | src/muon.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -227,11 +227,14 @@ double get_dEdx(double T, double rho) double get_expected_charge(double x, double T, double theta0, double *pos, double *dir, double *pmt_pos, double *pmt_normal, double r) { - double pmt_dir[3], cos_theta, n, wavelength0, omega, E, p, beta, z, R, f, cos_theta_pmt; + double pmt_dir[3], cos_theta, n, wavelength0, omega, E, p, beta, z, R, f, cos_theta_pmt, absorption_length, distance; z = 1.0; SUB(pmt_dir,pmt_pos,pos); + + distance = NORM(pmt_dir); + normalize(pmt_dir); cos_theta_pmt = DOT(pmt_dir,pmt_normal); @@ -264,6 +267,8 @@ double get_expected_charge(double x, double T, double theta0, double *pos, doubl f = get_weighted_pmt_response(acos(-cos_theta_pmt)); + absorption_length = get_absorption_length_snoman_d2o(wavelength0); + /* FIXME: add angular response and scattering/absorption. */ - return f*omega*FINE_STRUCTURE_CONSTANT*z*z*(1-(1/(beta*beta*n*n)))*get_probability(beta, cos_theta, theta0); + return f*exp(-distance/absorption_length)*omega*FINE_STRUCTURE_CONSTANT*z*z*(1-(1/(beta*beta*n*n)))*get_probability(beta, cos_theta, theta0); } |