diff options
author | tlatorre <tlatorre@uchicago.edu> | 2018-11-14 10:49:03 -0600 |
---|---|---|
committer | tlatorre <tlatorre@uchicago.edu> | 2018-11-14 10:49:03 -0600 |
commit | 95f95be5f87f0fa4f5e9f7c8568dbb23a843cff6 (patch) | |
tree | 6256d75273fc8d247131146996ee020e1353ac9b /src/likelihood.c | |
parent | 0ae23efdbba0168b6c32300c2f9881d2eddf8697 (diff) | |
download | sddm-95f95be5f87f0fa4f5e9f7c8568dbb23a843cff6.tar.gz sddm-95f95be5f87f0fa4f5e9f7c8568dbb23a843cff6.tar.bz2 sddm-95f95be5f87f0fa4f5e9f7c8568dbb23a843cff6.zip |
speed things up again
This commit speeds up the likelihood calculation by returning zero early if the
angle between the PMT and the track is far from the Cerenkov angle.
Specifically we check to see that the angle is 5 "standard deviations" away.
Where the standard deviation is taken to be the RMS width of the angular
distribution.
Diffstat (limited to 'src/likelihood.c')
-rw-r--r-- | src/likelihood.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/likelihood.c b/src/likelihood.c index 0855d08..ca0b2b6 100644 --- a/src/likelihood.c +++ b/src/likelihood.c @@ -217,15 +217,17 @@ static double get_expected_charge(double x, double beta, double theta0, double * normalize(pmt_dir); - cos_theta_pmt = DOT(pmt_dir,pmt_normal); - - *reflected = 0.0; - if (cos_theta_pmt > 0) return 0.0; - /* Calculate the cosine of the angle between the track direction and the * vector to the PMT. */ cos_theta = DOT(dir,pmt_dir); + *reflected = 0.0; + if (fabs(cos_theta-1.0/(n_d2o*beta))/theta0 > 5) return 0.0; + + cos_theta_pmt = DOT(pmt_dir,pmt_normal); + + if (cos_theta_pmt > 0) return 0.0; + omega = get_solid_angle_fast(pos,pmt_pos,pmt_normal,r); R = NORM(pos); |