From 6d0150ad7adf0651faf487cd2b3939c6431913f8 Mon Sep 17 00:00:00 2001
From: Alexandru Bercuci <abercuci@niham.nipne.ro>
Date: Mon, 21 Feb 2022 12:29:17 +0200
Subject: [PATCH] add FASP mapping on GEO for mCBM 21, explicit printing of the
 mapping, and revert to old par hash to allow project build

---
 external/InstallParameter.cmake                        | 2 +-
 macro/run/run_unpack_online.C                          | 7 +++++++
 macro/run/run_unpack_tsa.C                             | 7 +++++++
 reco/detectors/trd/unpack/CbmTrdUnpackConfigFasp2D.cxx | 2 +-
 4 files changed, 16 insertions(+), 2 deletions(-)

diff --git a/external/InstallParameter.cmake b/external/InstallParameter.cmake
index 093fe60b04..97b566fb39 100644
--- a/external/InstallParameter.cmake
+++ b/external/InstallParameter.cmake
@@ -1,4 +1,4 @@
-set(PARAMETER_VERSION e4125bd3c05e40a1dc674567b43da85cc88d5639)
+set(PARAMETER_VERSION 849f5cf315a9c8ac40dc9e93fa90015b1535f6e4)
 
 set(PARAMETER_SRC_URL "https://git.cbm.gsi.de/CbmSoft/cbmroot_parameter.git")
 
diff --git a/macro/run/run_unpack_online.C b/macro/run/run_unpack_online.C
index 9e67428a17..6d067c9c65 100644
--- a/macro/run/run_unpack_online.C
+++ b/macro/run/run_unpack_online.C
@@ -210,6 +210,13 @@ void run_unpack_online(std::vector<std::string> publisher = {"tcp://localhost:55
     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");
+    if (runid <= 1588) {
+      uint8_t map[NFASPMOD],
+              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);
+    }
     std::string parfilesbasepathTrdfasp2d = Form("%s/parameters/trd", srcDir.Data());
     trdfasp2dconfig->SetParFilesBasePath(parfilesbasepathTrdfasp2d);
     trdfasp2dconfig->SetSystemTimeOffset(-1800);  // [ns] value to be updated
diff --git a/macro/run/run_unpack_tsa.C b/macro/run/run_unpack_tsa.C
index 4e48bc995c..9683988134 100644
--- a/macro/run/run_unpack_tsa.C
+++ b/macro/run/run_unpack_tsa.C
@@ -222,6 +222,13 @@ 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");
+    if (runid <= 1588) {
+      uint8_t map[NFASPMOD],
+              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);
+    }
     std::string parfilesbasepathTrdfasp2d = Form("%s/parameters/trd", srcDir.Data());
     trdfasp2dconfig->SetParFilesBasePath(parfilesbasepathTrdfasp2d);
     trdfasp2dconfig->SetSystemTimeOffset(-1800);  // [ns] value to be updated
diff --git a/reco/detectors/trd/unpack/CbmTrdUnpackConfigFasp2D.cxx b/reco/detectors/trd/unpack/CbmTrdUnpackConfigFasp2D.cxx
index 282b330538..51f00f1f19 100644
--- a/reco/detectors/trd/unpack/CbmTrdUnpackConfigFasp2D.cxx
+++ b/reco/detectors/trd/unpack/CbmTrdUnpackConfigFasp2D.cxx
@@ -35,7 +35,7 @@ void CbmTrdUnpackConfigFasp2D::InitAlgo()
 {
   if (fDoLog) LOG(info) << fName << "::InitAlgo - SetFaspMapping";
   fAlgo->SetAsicMapping(fFaspMap);
-  if (fDoLog) fAlgo->PrintAsicMapping();
+  /*if (fDoLog) */fAlgo->PrintAsicMapping();
 
   // Now we have all information required to initialise the algorithm
   fAlgo->Init();
-- 
GitLab