From 2231e1367057bf8d070fbe8e0e889a1a1d10fab1 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?GIRARD=20ALCINDOR=20Val=C3=A9rian?=
 <girard-alcindor@ijclab.in2p3.fr>
Date: Wed, 17 Jan 2024 10:16:02 +0100
Subject: [PATCH] Updating MUST2 physics to fix error with large range

---
 NPLib/Detectors/MUST2/TMust2Physics.cxx | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/NPLib/Detectors/MUST2/TMust2Physics.cxx b/NPLib/Detectors/MUST2/TMust2Physics.cxx
index b82b7d03f..e03492f3b 100644
--- a/NPLib/Detectors/MUST2/TMust2Physics.cxx
+++ b/NPLib/Detectors/MUST2/TMust2Physics.cxx
@@ -1232,11 +1232,12 @@ void TMust2Physics::AddParameterToCalibrationManager() {
   vector<double> standardCsI;
   for (int i = 0; i < m_NumberOfTelescope; ++i) {
 
-    if (m_CsIOffset[i] == 1) {
+    if (m_CsIOffset[i+1] == 1) {
       standardCsI = {0, 500. / 16384.};
     }
-    else
+    else{
       standardCsI = {-250, 250. / 8192.};
+    }
 
     for (int j = 0; j < 128; ++j) {
       Cal->AddParameter("MUST2", "T" + NPL::itoa(i + 1) + "_Si_X" + NPL::itoa(j + 1) + "_E",
-- 
GitLab