From 4178680c74627d6490b44ae6b59b4332700d952f Mon Sep 17 00:00:00 2001 From: tlatorre Date: Tue, 16 Jul 2019 11:18:09 -0500 Subject: use QLX if QHS is railed --- src/fit.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/fit.c') diff --git a/src/fit.c b/src/fit.c index 5e6a572..c0b9858 100644 --- a/src/fit.c +++ b/src/fit.c @@ -5155,9 +5155,9 @@ double guess_t0(event *ev, double *pos) /* Add the charge weighted time difference between the PMT hit time and * the time it would take a photon to hit the PMT from `pos`. */ - t0 += ev->pmt_hits[i].qhs*(ev->pmt_hits[i].t - distance*n/SPEED_OF_LIGHT); + t0 += ev->pmt_hits[i].q*(ev->pmt_hits[i].t - distance*n/SPEED_OF_LIGHT); - qhs_sum += ev->pmt_hits[i].qhs; + qhs_sum += ev->pmt_hits[i].q; } /* Divide by the total QHS sum. */ @@ -5195,7 +5195,7 @@ void guess_direction(event *ev, double *pos, double *theta, double *phi) normalize(pmt_dir); /* Multiply the vector by the QHS charge in the PMT. */ - MUL(pmt_dir,ev->pmt_hits[i].qhs); + MUL(pmt_dir,ev->pmt_hits[i].q); /* Add this to the estimated direction. */ ADD(dir,dir,pmt_dir); @@ -5229,7 +5229,7 @@ double guess_energy(event *ev, double *pos, double *dir) SUB(pmt_dir,pmts[i].pos,pos); normalize(pmt_dir); if (DOT(pmt_dir,dir) > 1/n_d2o) - qhs_sum += ev->pmt_hits[i].qhs; + qhs_sum += ev->pmt_hits[i].q; } return qhs_sum/6.0; @@ -5571,7 +5571,7 @@ int fit_event(event *ev, double *xopt, double *fmin, int id, double maxtime) qhs_sum = 0.0; for (i = 0; i < MAX_PMTS; i++) { if (ev->pmt_hits[i].flags || pmts[i].pmt_type != PMT_NORMAL || !ev->pmt_hits[i].hit) continue; - qhs_sum += ev->pmt_hits[i].qhs; + qhs_sum += ev->pmt_hits[i].q; } T0 = qhs_sum/6.0; -- cgit