From 127910ba425d62bf6f5738917b223408fca0701c Mon Sep 17 00:00:00 2001
From: "chad.hanna" <crh184@psu.edu>
Date: Mon, 28 Oct 2019 06:34:59 -0700
Subject: [PATCH] gstlal_ll_inspiral_pipe, inspiral_pipe.py: add activation
 counts file option to online DAG

---
 gstlal-inspiral/bin/gstlal_ll_inspiral_pipe | 1 +
 gstlal-inspiral/python/inspiral_pipe.py     | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/gstlal-inspiral/bin/gstlal_ll_inspiral_pipe b/gstlal-inspiral/bin/gstlal_ll_inspiral_pipe
index e80af79ded..2d68e9f9ee 100755
--- a/gstlal-inspiral/bin/gstlal_ll_inspiral_pipe
+++ b/gstlal-inspiral/bin/gstlal_ll_inspiral_pipe
@@ -133,6 +133,7 @@ def parse_command_line():
 	parser.add_option("--likelihood-cache", help = "set the cache containin likelihood files")
 	parser.add_option("--zerolag-likelihood-cache", help = "set the cache containin zerolag likelihood files")
 	parser.add_option("--marginalized-likelihood-file", help = "set the marginalized likelihood file, required")
+	parser.add_option("--activation-counts-file", metavar = "filename", help = "Set the name of the h5 file containing activation counts for multicomponent p-astro.")
 	parser.add_option("--compress-ranking-stat", action = "store_true", help = "Choose whether to compress the ranking stat upon start up. Only used when --ranking-stat-input is set.")
 	parser.add_option("--compress-ranking-stat-threshold", type = "float", default = 0.03, help = "Only keep horizon distance values that differ by this much, fractionally, from their neighbours (default = 0.03).")
 	parser.add_option("--control-peak-time", default = 4, metavar = "secs", help = "set the control peak time, default 4")
diff --git a/gstlal-inspiral/python/inspiral_pipe.py b/gstlal-inspiral/python/inspiral_pipe.py
index 4e36ceaba7..05d6bb3f11 100644
--- a/gstlal-inspiral/python/inspiral_pipe.py
+++ b/gstlal-inspiral/python/inspiral_pipe.py
@@ -150,6 +150,10 @@ def online_inspiral_layer(dag, jobs, options):
 		}
 		common_opts.update(datasource_opts)
 
+		# If providing an activation counts file provide it.
+		if options.activation_counts_file:
+			common_opts.update({"activation-counts-file": options.activation_counts_file})
+
 		# add ranking stat compression options, if requested
 		if options.compress_ranking_stat:
 			compress_opts = {
-- 
GitLab