From 6507ef3a0b9c95f8587207af90f7fccfe246bed0 Mon Sep 17 00:00:00 2001
From: ChiWai Chan <chiwai.chan@ligo.org>
Date: Wed, 9 Jun 2021 21:26:55 -0700
Subject: [PATCH] streamthinca.py: create a new background collector for
 background estimation.

---
 gstlal-inspiral/python/streamthinca.py | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/gstlal-inspiral/python/streamthinca.py b/gstlal-inspiral/python/streamthinca.py
index f9dfce65a9..76d505ae9e 100644
--- a/gstlal-inspiral/python/streamthinca.py
+++ b/gstlal-inspiral/python/streamthinca.py
@@ -221,6 +221,19 @@ class backgroundcollector(object):
 		return [event for event in map(index.__getitem__, background_ids) if event.snr >= snr_min]
 
 
+class timereversebackgroundcollector(object):
+	def __init__(self):
+		self.events = set()
+
+	def push(self, event_ids, offset_vector):
+		# input parameters are just for compatibility
+		self.events.update(event_ids)
+
+	def pull(self, snr_min, two_or_more_instruments, flushed_events):
+		# input parameters are just for compatibility
+		return [event for event in flushed_events if event.snr >= snr_min]
+
+
 class StreamThinca(object):
 	def __init__(self, xmldoc, process_id, delta_t, min_instruments = 2, sngls_snr_threshold = None):
 		self.ln_lr_from_triggers = None
-- 
GitLab