From f2002d2715d164e81a99758f025e209a676af52e Mon Sep 17 00:00:00 2001
From: Brad Sawatzky <brads@jlab.org>
Date: Tue, 12 Dec 2017 22:35:28 -0500
Subject: [PATCH] Add true prescale factors to report file output

- Requires hcana commit af83fe852ef592053dd38ac5f9ced5c3cf571710
  (Tue Dec 12 22:24:52 2017)
---
 .../HMS/PRODUCTION/hstackana_production.template   | 12 ++++++------
 TEMPLATES/HMS/SCALERS/hscalers.template            | 14 +++++++-------
 .../SHMS/PRODUCTION/pstackana_production.template  | 12 ++++++------
 TEMPLATES/SHMS/SCALERS/pscalers.template           | 12 ++++++------
 4 files changed, 25 insertions(+), 25 deletions(-)

diff --git a/TEMPLATES/HMS/PRODUCTION/hstackana_production.template b/TEMPLATES/HMS/PRODUCTION/hstackana_production.template
index 0534c29f..72f32278 100644
--- a/TEMPLATES/HMS/PRODUCTION/hstackana_production.template
+++ b/TEMPLATES/HMS/PRODUCTION/hstackana_production.template
@@ -43,12 +43,12 @@ Ps4_value = {ghconfig_ti_ps[3]}
 Ps5_value = {ghconfig_ti_ps[4]}
 Ps6_value = {ghconfig_ti_ps[5]}
 
-Ps1_factor = {floor(2**(ghconfig_ti_ps[0] - 1) + 1):%d}
-Ps2_factor = {floor(2**(ghconfig_ti_ps[1] - 1) + 1):%d}
-Ps3_factor = {floor(2**(ghconfig_ti_ps[2] - 1) + 1):%d}
-Ps4_factor = {floor(2**(ghconfig_ti_ps[3] - 1) + 1):%d}
-Ps5_factor = {floor(2**(ghconfig_ti_ps[4] - 1) + 1):%d}
-Ps6_factor = {floor(2**(ghconfig_ti_ps[5] - 1) + 1):%d}
+Ps1_factor = {ghconfig_ti_ps_factors[0]}
+Ps2_factor = {ghconfig_ti_ps_factors[1]}
+Ps3_factor = {ghconfig_ti_ps_factors[2]}
+Ps4_factor = {ghconfig_ti_ps_factors[3]}
+Ps5_factor = {ghconfig_ti_ps_factors[4]}
+Ps6_factor = {ghconfig_ti_ps_factors[5]}
 
 ***************
 * 3/4 Triggers
diff --git a/TEMPLATES/HMS/SCALERS/hscalers.template b/TEMPLATES/HMS/SCALERS/hscalers.template
index 84691f97..a429f834 100644
--- a/TEMPLATES/HMS/SCALERS/hscalers.template
+++ b/TEMPLATES/HMS/SCALERS/hscalers.template
@@ -35,12 +35,12 @@ Ps4_value = {ghconfig_ti_ps[3]}
 Ps5_value = {ghconfig_ti_ps[4]}
 Ps6_value = {ghconfig_ti_ps[5]}
 
-Ps1_factor = {floor(2**(ghconfig_ti_ps[0] - 1) + 1):%d}
-Ps2_factor = {floor(2**(ghconfig_ti_ps[1] - 1) + 1):%d}
-Ps3_factor = {floor(2**(ghconfig_ti_ps[2] - 1) + 1):%d}
-Ps4_factor = {floor(2**(ghconfig_ti_ps[3] - 1) + 1):%d}
-Ps5_factor = {floor(2**(ghconfig_ti_ps[4] - 1) + 1):%d}
-Ps6_factor = {floor(2**(ghconfig_ti_ps[5] - 1) + 1):%d}
+Ps1_factor = {ghconfig_ti_ps_factors[0]}
+Ps2_factor = {ghconfig_ti_ps_factors[1]}
+Ps3_factor = {ghconfig_ti_ps_factors[2]}
+Ps4_factor = {ghconfig_ti_ps_factors[3]}
+Ps5_factor = {ghconfig_ti_ps_factors[4]}
+Ps6_factor = {ghconfig_ti_ps_factors[5]}
 
 ***********
 * Triggers
@@ -200,4 +200,4 @@ H2X: {H.S2X.scaler} [ {H.S2X.scalerRate/1000.:%.3f} kHz ] AND between + and - si
 H2Y: {H.S2Y.scaler} [ {H.S2Y.scalerRate/1000.:%.3f} kHz ] AND between + and - sides of H2Y
 
 H1XH1Y: {H.S1XS1Y.scaler} [{H.S1XS1Y.scalerRate/1000.:%.3f}] AND between H1X and H1Y planes 
-H2XH2Y: {H.S2XS2Y.scaler} [{H.S2XS2Y.scalerRate/1000.:%.3f}] OR between H2X and H2Y planes (just for kpp, will be AND)
\ No newline at end of file
+H2XH2Y: {H.S2XS2Y.scaler} [{H.S2XS2Y.scalerRate/1000.:%.3f}] OR between H2X and H2Y planes (just for kpp, will be AND)
diff --git a/TEMPLATES/SHMS/PRODUCTION/pstackana_production.template b/TEMPLATES/SHMS/PRODUCTION/pstackana_production.template
index 0746b93a..75cedccc 100644
--- a/TEMPLATES/SHMS/PRODUCTION/pstackana_production.template
+++ b/TEMPLATES/SHMS/PRODUCTION/pstackana_production.template
@@ -32,12 +32,12 @@ Ps4_value = {gpconfig_ti_ps[3]}
 Ps5_value = {gpconfig_ti_ps[4]}
 Ps6_value = {gpconfig_ti_ps[5]}
 
-Ps1_factor = {floor(2**(gpconfig_ti_ps[0] - 1) + 1):%d}
-Ps2_factor = {floor(2**(gpconfig_ti_ps[1] - 1) + 1):%d}
-Ps3_factor = {floor(2**(gpconfig_ti_ps[2] - 1) + 1):%d}
-Ps4_factor = {floor(2**(gpconfig_ti_ps[3] - 1) + 1):%d}
-Ps5_factor = {floor(2**(gpconfig_ti_ps[4] - 1) + 1):%d}
-Ps6_factor = {floor(2**(gpconfig_ti_ps[5] - 1) + 1):%d}
+Ps1_factor = {ghconfig_ti_ps_factors[0]}
+Ps2_factor = {ghconfig_ti_ps_factors[1]}
+Ps3_factor = {ghconfig_ti_ps_factors[2]}
+Ps4_factor = {ghconfig_ti_ps_factors[3]}
+Ps5_factor = {ghconfig_ti_ps_factors[4]}
+Ps6_factor = {ghconfig_ti_ps_factors[5]}
 
 ***************	
 * 3/4 Triggers 
diff --git a/TEMPLATES/SHMS/SCALERS/pscalers.template b/TEMPLATES/SHMS/SCALERS/pscalers.template
index 4c0d0833..97bf1665 100644
--- a/TEMPLATES/SHMS/SCALERS/pscalers.template
+++ b/TEMPLATES/SHMS/SCALERS/pscalers.template
@@ -36,12 +36,12 @@ Ps4_value = {gpconfig_ti_ps[3]}
 Ps5_value = {gpconfig_ti_ps[4]}
 Ps6_value = {gpconfig_ti_ps[5]}
 
-Ps1_factor = {floor(2**(gpconfig_ti_ps[0] - 1) + 1):%d}
-Ps2_factor = {floor(2**(gpconfig_ti_ps[1] - 1) + 1):%d}
-Ps3_factor = {floor(2**(gpconfig_ti_ps[2] - 1) + 1):%d}
-Ps4_factor = {floor(2**(gpconfig_ti_ps[3] - 1) + 1):%d}
-Ps5_factor = {floor(2**(gpconfig_ti_ps[4] - 1) + 1):%d}
-Ps6_factor = {floor(2**(gpconfig_ti_ps[5] - 1) + 1):%d}
+Ps1_factor = {ghconfig_ti_ps_factors[0]}
+Ps2_factor = {ghconfig_ti_ps_factors[1]}
+Ps3_factor = {ghconfig_ti_ps_factors[2]}
+Ps4_factor = {ghconfig_ti_ps_factors[3]}
+Ps5_factor = {ghconfig_ti_ps_factors[4]}
+Ps6_factor = {ghconfig_ti_ps_factors[5]}
 
 ***********	
 * 3/4 Triggers
-- 
GitLab