aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2018-11-04 14:17:52 -0600
committertlatorre <tlatorre@uchicago.edu>2018-11-04 14:17:52 -0600
commita0876ec4863d22d6d20b2507e173071a58c4b342 (patch)
treea4451ca51a189821401619af09b50dea411c43d2 /src
parent12f40b02dc4c091eefa6042e1a8ba52c8b14e0ca (diff)
downloadsddm-a0876ec4863d22d6d20b2507e173071a58c4b342.tar.gz
sddm-a0876ec4863d22d6d20b2507e173071a58c4b342.tar.bz2
sddm-a0876ec4863d22d6d20b2507e173071a58c4b342.zip
delete solid_angle_fast since it wasn't working
Diffstat (limited to 'src')
-rw-r--r--src/likelihood.c2
-rw-r--r--src/solid_angle.c18
-rw-r--r--src/solid_angle.h1
-rw-r--r--src/test.c26
4 files changed, 1 insertions, 46 deletions
diff --git a/src/likelihood.c b/src/likelihood.c
index ed07826..2340fb1 100644
--- a/src/likelihood.c
+++ b/src/likelihood.c
@@ -424,7 +424,7 @@ static double get_total_charge_approx(double T0, double *pos, double *dir, parti
sin_theta = sqrt(1-pow(cos_theta,2));
/* Get the solid angle of the PMT at the position `s` along the track. */
- omega = get_solid_angle_fast(tmp,pmts[i].pos,pmts[i].normal,PMT_RADIUS);
+ omega = get_solid_angle_approx(tmp,pmts[i].pos,pmts[i].normal,PMT_RADIUS);
theta0 = fmax(theta0*sqrt(s),MIN_THETA0);
diff --git a/src/solid_angle.c b/src/solid_angle.c
index dbac045..7201533 100644
--- a/src/solid_angle.c
+++ b/src/solid_angle.c
@@ -24,24 +24,6 @@ static double lookupTable[13][11] = {
{1.0041,1.0051,1.0061,1.0070,1.0078,1.0106,1.0120,1.0122,1.0116,1.0097,1.0084}
};
-double get_solid_angle_fast(double *pos, double *pmt, double *n, double r)
-{
- /* Returns a *very* fast approximation of the solid angle subtended by a
- * circular disk of radius r at a position `pmt` with a normal vector `n` from
- * a position `pos`. */
- double dir[3];
- double R, cos_theta_pmt;
-
- SUB(dir,pos,pmt);
-
- /* Distance to the PMT. */
- R = NORM(dir);
-
- cos_theta_pmt = fabs(DOT(dir,n)/R);
-
- return pow(r,2)*cos_theta_pmt/pow(R,2);
-}
-
static double A(double u, double a, double h)
{
return atan(((a*a-h*h)*u - 2*a*a*h*h)/(2*a*h*sqrt((u-h*h)*(u+a*a))));
diff --git a/src/solid_angle.h b/src/solid_angle.h
index 654f605..aacb692 100644
--- a/src/solid_angle.h
+++ b/src/solid_angle.h
@@ -3,7 +3,6 @@
#include <math.h>
-double get_solid_angle_fast(double *pos, double *pmt, double *n, double r);
double get_solid_angle_approx(double *pos, double *pmt, double *n, double r);
double get_solid_angle(double *pos, double *pmt, double *n, double r);
diff --git a/src/test.c b/src/test.c
index 16756ad..f8cedb9 100644
--- a/src/test.c
+++ b/src/test.c
@@ -970,31 +970,6 @@ err:
return 1;
}
-int test_solid_angle_fast(char *err)
-{
- /* Tests the get_solid_angle_fast() function. */
- int i;
- double pmt[3] = {0,0,0};
- double pos[3] = {0,0,1};
- double n[3] = {0,0,-1};
- double r = 1.0;
- double solid_angle;
-
- for (i = 0; i < sizeof(solid_angle_results)/sizeof(struct solid_angle_results); i++) {
- pos[0] = solid_angle_results[i].r0*r;
- pos[2] = solid_angle_results[i].L*r;
-
- solid_angle = get_solid_angle_approx(pos,pmt,n,r);
-
- if (!isclose(solid_angle, solid_angle_results[i].omega, 1e-2, 0)) {
- sprintf(err, "solid angle = %.5f, but expected %.5f", solid_angle, solid_angle_results[i].omega);
- return 1;
- }
- }
-
- return 0;
-}
-
struct tests {
testFunction *test;
char *name;
@@ -1024,7 +999,6 @@ struct tests {
{test_log_norm, "test_log_norm"},
{test_trapz, "test_trapz"},
{test_interp2d, "test_interp2d"},
- {test_solid_angle_fast, "test_solid_angle_fast"},
};
int main(int argc, char **argv)