From af74331f4b28427ed0244f051afa502044653dc3 Mon Sep 17 00:00:00 2001
From: Wouter Deconinck <wdconinc@gmail.com>
Date: Mon, 28 Mar 2022 21:10:23 +0000
Subject: [PATCH] Reenable DIS analysis macros

---
 benchmarks/dis/analysis/dis_electrons.cxx | 26 +++++++++++++++++++++++
 benchmarks/dis/dis.sh                     | 11 +++++-----
 2 files changed, 31 insertions(+), 6 deletions(-)

diff --git a/benchmarks/dis/analysis/dis_electrons.cxx b/benchmarks/dis/analysis/dis_electrons.cxx
index fed2cafc..9ac81ce3 100644
--- a/benchmarks/dis/analysis/dis_electrons.cxx
+++ b/benchmarks/dis/analysis/dis_electrons.cxx
@@ -150,6 +150,32 @@ int dis_electrons(const std::string& config_name)
   TFitResultPtr f_x_esigma_res = h_x_esigma_res->Fit("gaus", "S");
   if (f_x_esigma_res == 0) f_x_esigma_res->Print("V");
 
+  // Print summary
+  fmt::print(fmt::emphasis::bold | fg(fmt::color::forest_green),
+             "Inclusive kinematics summary:\n");
+  fmt::print("Q2 resolution:\n");
+  fmt::print(" - electron: {} +/- {}\n",
+    f_Q2_el_res->Parameter(1), f_Q2_el_res->Error(1));
+  fmt::print(" - sigma:    {} +/- {}\n",
+    f_Q2_sigma_res->Parameter(1), f_Q2_sigma_res->Error(1));
+  fmt::print(" - esigma:   {} +/- {}\n",
+    f_Q2_esigma_res->Parameter(1), f_Q2_esigma_res->Error(1));
+  fmt::print(" - JB:       {} +/- {}\n",
+    f_Q2_jb_res->Parameter(1), f_Q2_jb_res->Error(1));
+  fmt::print(" - DA:       {} +/- {}\n",
+    f_Q2_da_res->Parameter(1), f_Q2_da_res->Error(1));
+  fmt::print("x resolution:\n");
+  fmt::print(" - electron: {} +/- {}\n",
+    f_x_el_res->Parameter(1), f_x_el_res->Error(1));
+  fmt::print(" - sigma:    {} +/- {}\n",
+    f_x_sigma_res->Parameter(1), f_x_sigma_res->Error(1));
+  fmt::print(" - esigma:   {} +/- {}\n",
+    f_x_esigma_res->Parameter(1), f_x_esigma_res->Error(1));
+  fmt::print(" - JB:       {} +/- {}\n",
+    f_x_jb_res->Parameter(1), f_x_jb_res->Error(1));
+  fmt::print(" - DA:       {} +/- {}\n",
+    f_x_da_res->Parameter(1), f_x_da_res->Error(1));
+
   // Plot our histograms.
   // TODO: to start I'm explicitly plotting the histograms, but want to
   // factorize out the plotting code moving forward.
diff --git a/benchmarks/dis/dis.sh b/benchmarks/dis/dis.sh
index f34e543c..27c347f3 100755
--- a/benchmarks/dis/dis.sh
+++ b/benchmarks/dis/dis.sh
@@ -114,12 +114,11 @@ cat << EOF > ${CONFIG}
 }
 EOF
 
-#FIXME DIS analysis disabled
-#root -b -q "benchmarks/dis/analysis/dis_electrons.cxx+(\"${CONFIG}\")"
-#if [[ "$?" -ne "0" ]] ; then
-#  echo "ERROR running dis_electron script"
-#  exit 1
-#fi
+root -b -q "benchmarks/dis/analysis/dis_electrons.cxx+(\"${CONFIG}\")"
+if [[ "$?" -ne "0" ]] ; then
+  echo "ERROR running dis_electron script"
+  exit 1
+fi
 
 CONFIG="${TMP_PATH}/${PLOT_TAG}.raw.json"
 cat << EOF > ${CONFIG}
-- 
GitLab