diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/fit.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -5240,6 +5240,7 @@ double get_expected_photons(int id, double T0, double distance, double cos_theta break; default: fprintf(stderr, "unknown particle id %i\n", id); + particle_free(p); exit(1); } @@ -5255,6 +5256,8 @@ double get_expected_photons(int id, double T0, double distance, double cos_theta nphotons += p->delta_ray_photons*distance/p->range*(1-interp1d(cos_theta,p->cos_theta,p->cdf_delta,p->n)); } + particle_free(p); + /* Finally we multiply by the average quantum efficiency and divide by 2 to * account for the PMT coverage. */ return nphotons*get_weighted_quantum_efficiency()/2.0; |