From d5e9bb561e068793bb73b9e1a73849fbcd03d5a1 Mon Sep 17 00:00:00 2001
From: Prathamesh Joshi <prathamesh.joshi@ldas-pcdev5.ligo.caltech.edu>
Date: Mon, 15 Jan 2024 01:49:08 -0800
Subject: [PATCH] OEM pdf health fix pt2

---
 gstlal-inspiral/python/far.py | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/gstlal-inspiral/python/far.py b/gstlal-inspiral/python/far.py
index de308bf1b7..00fc433380 100644
--- a/gstlal-inspiral/python/far.py
+++ b/gstlal-inspiral/python/far.py
@@ -571,6 +571,12 @@ class RankingStatPDF(object):
 			raise ValueError("cannot be initialized from a RankingStat that is not for a specific set of templates")
 		self.template_ids = rankingstat.template_ids
 
+		# the sum of noise counts may change due to first-round-extinction,
+		# so store the sum of counts before extinction in a different variable.
+		# This will be used for checking the health of the PDF
+		self.noise_counts_before_extinction = 0
+
+
 		#
 		# bailout used by codes that want all-zeros histograms
 		#
@@ -638,10 +644,6 @@ class RankingStatPDF(object):
 		self.noise_lr_lnpdf.normalize()
 		self.signal_lr_lnpdf.array *= rankingstat.numerator.candidate_count_model() / self.signal_lr_lnpdf.array.sum()
 		self.signal_lr_lnpdf.normalize()
-
-		# the sum of noise counts may change due to first-round-extinction,
-		# so store the sum of counts before extinction in a different variable.
-		# This will be used for checking the health of the PDF
 		self.noise_counts_before_extinction = self.noise_lr_lnpdf.array.sum()
 
 
-- 
GitLab