From 02fecf0e409983c25dfec88ace8ad7d7d34b57c1 Mon Sep 17 00:00:00 2001
From: Alexandru Bercuci <abercuci@niham.nipne.ro>
Date: Fri, 4 Mar 2022 14:58:47 +0200
Subject: [PATCH] add default mapping for FASP on module 5

---
 macro/run/run_unpack_tsa.C | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/macro/run/run_unpack_tsa.C b/macro/run/run_unpack_tsa.C
index 42730679a9..d22c2533ac 100644
--- a/macro/run/run_unpack_tsa.C
+++ b/macro/run/run_unpack_tsa.C
@@ -222,13 +222,16 @@ void run_unpack_tsa(std::vector<std::string> infile = {"test.tsa"}, UInt_t runid
     trdfasp2dconfig->SetDoWriteOutput();
     // Activate the line below to write Trd1D digis to a separate "TrdFaspDigi" branch. Can be used to separate between Fasp and Spadic digis
     // trdfasp2dconfig->SetOutputBranchName("TrdFaspDigi");
+    uint8_t map[NFASPMOD];
     if (runid <= 1588) {
-      uint8_t map[NFASPMOD], map21[] = {9, 2, 3, 11, 10, 7, 8, 0, 1, 4, 6, 5};
-
+      uint8_t map21[] = {9, 2, 3, 11, 10, 7, 8, 0, 1, 4, 6, 5};
       for (int i(0); i < NFASPMOD; i++)
         map[i] = (i < 12 ? map21[i] : i);
-      trdfasp2dconfig->SetFaspMapping(5, map);
     }
+    else
+      for (int i(0); i < NFASPMOD; i++)
+        map[i] = i;
+    trdfasp2dconfig->SetFaspMapping(5, map);
     std::string parfilesbasepathTrdfasp2d = Form("%s/parameters/trd", srcDir.Data());
     trdfasp2dconfig->SetParFilesBasePath(parfilesbasepathTrdfasp2d);
     trdfasp2dconfig->SetSystemTimeOffset(-1800);  // [ns] value to be updated
-- 
GitLab