From 39c18e55fc9c57d75ebfb568b79ed777b11557a6 Mon Sep 17 00:00:00 2001
From: Jack Christopher Hutchinson Rolph <jack.rolph@desy.de>
Date: Mon, 22 Nov 2021 14:18:05 +0100
Subject: [PATCH] Update PeakOTron.py

---
 PeakOTron.py | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/PeakOTron.py b/PeakOTron.py
index 886a24c..bbe20ff 100644
--- a/PeakOTron.py
+++ b/PeakOTron.py
@@ -279,7 +279,7 @@ class PeakOTron:
                 "r_fast":None,
                 "tgate":None,
                 "pedestal":None,
-                "truncate":False,
+                "truncate":True,
                 "n_bootstrap": 1000,
                 "n_bootstrap_kde":100,
                 "bw":None,
@@ -904,11 +904,12 @@ class PeakOTron:
                           lw=2.5,
                           linestyle="--")
 
-
-            ax.axvline(x=[self._GD_data["limit_s"]],
-                       color = "purple",
-                       lw=5,
-                       label="Pedestal Threshold ($PH_{{0}} - \\frac{G_{est}}{2}$)")
+        
+            if(self._GD_data["truncated"]):
+                ax.axvline(x=[self._GD_data["limit_s"]],
+                           color = "purple",
+                           lw=5,
+                           label="Pedestal Threshold ($PH_{{0}} - \\frac{G_{est}}{2}$)")
 
             box = ax.get_position()
             ax.set_position([box.x0, box.y0, box.width * 0.8, box.height])
@@ -1553,6 +1554,7 @@ class PeakOTron:
         self._GD_data["fit_x_0_err"] = self._peak_data["x_width_s"][0]
         self._GD_data["scaler"] = self.scaler
         self._GD_data["limit_s"] = limit_s
+        self._GD_data["truncated"] = truncate
         
         
         
-- 
GitLab