From 8fa0a0ded6ef72b23b15fd950048884ed12d4d8f Mon Sep 17 00:00:00 2001
From: CHAD RICHARD HANNA <crh184@psu.edu>
Date: Tue, 2 Jul 2019 05:47:43 -0400
Subject: [PATCH] Revert "REVERT ME: inspiral_lr.py: hardcode constant trigger
 rate until scaling issues are sorted out"

This reverts commit cef97cbf9a710fb55005272f1d586b8dfd7466f2.
---
 gstlal-inspiral/python/stats/inspiral_lr.py | 9 ++-------
 1 file changed, 2 insertions(+), 7 deletions(-)

diff --git a/gstlal-inspiral/python/stats/inspiral_lr.py b/gstlal-inspiral/python/stats/inspiral_lr.py
index 3ff04dd312..7c91ea9485 100644
--- a/gstlal-inspiral/python/stats/inspiral_lr.py
+++ b/gstlal-inspiral/python/stats/inspiral_lr.py
@@ -728,10 +728,6 @@ class LnNoiseDensity(LnLRDensity):
 		if len(snrs) < self.min_instruments:
 			return NegInf
 
-		# FIXME for now the actual trigger rate estimation is disabled
-		# and assumed to be 0.5 until we understand some scaling issues
-		# The commented out code is left here to help put it back in
-		# place.
 		# FIXME:  the +/-3600 s window thing is a temporary hack to
 		# work around the problem of vetoes creating short segments
 		# that have no triggers in them but that can have
@@ -740,10 +736,9 @@ class LnNoiseDensity(LnLRDensity):
 		# around it.  you might might to make this bigger.
 		triggers_per_second_per_template = {}
 		for instrument, seg in segments.items():
-			triggers_per_second_per_template[instrument] = 0.5
-			#triggers_per_second_per_template[instrument] = (self.triggerrates[instrument] & trigger_rate.ratebinlist([trigger_rate.ratebin(seg[1] - 3600., seg[1] + 3600., count = 0)])).density / len(self.template_ids)
+			triggers_per_second_per_template[instrument] = (self.triggerrates[instrument] & trigger_rate.ratebinlist([trigger_rate.ratebin(seg[1] - 3600., seg[1] + 3600., count = 0)])).density / len(self.template_ids)
 		# sanity check rates
-		#assert all(triggers_per_second_per_template[instrument] for instrument in snrs), "impossible candidate in %s at %s when rates were %s triggers/s/template" % (", ".join(sorted(snrs)), ", ".join("%s s in %s" % (str(seg[1]), instrument) for instrument, seg in sorted(segments.items())), str(triggers_per_second_per_template))
+		assert all(triggers_per_second_per_template[instrument] for instrument in snrs), "impossible candidate in %s at %s when rates were %s triggers/s/template" % (", ".join(sorted(snrs)), ", ".join("%s s in %s" % (str(seg[1]), instrument) for instrument, seg in sorted(segments.items())), str(triggers_per_second_per_template))
 
 		# P(t | noise) = (candidates per unit time @ t) / total
 		# candidates.  by not normalizing by the total candidates
-- 
GitLab