From 3a4150107d12c8629232a6e57331fccdc849a9b9 Mon Sep 17 00:00:00 2001
From: "P.-A. Loizeau" <p.-a.loizeau@gsi.de>
Date: Thu, 7 Nov 2024 12:31:09 +0100
Subject: [PATCH] [mCBM 2022] Bring mTOF 21k geometry + rrelated/updated
 parameters + related fixes

- Update geometry and parameters hashes to most recent ones (bring tof 21k + also previously stacked mvd geo creation macros)
- Force the specific filename for run 2391 in the 2022 reco macros and the mTOF clusterizer initialization script (and higher runs in most 2022 macros)
- Remove switch to custom alignment file in 2022 mcbm_event_reco_l1 macro for TOF 21k
---
 external/InstallGeometry.cmake                |  2 +-
 external/InstallParameter.cmake               |  2 +-
 macro/beamtime/mcbm2022/ini_tof_clusterizer.C |  3 +-
 macro/beamtime/mcbm2022/mcbm_digievent_reco.C |  2 +-
 macro/beamtime/mcbm2022/mcbm_event_reco.C     |  3 +-
 macro/beamtime/mcbm2022/mcbm_event_reco_L1.C  | 34 ++++++++-----------
 macro/beamtime/mcbm2022/mcbm_reco.C           |  2 +-
 7 files changed, 22 insertions(+), 26 deletions(-)

diff --git a/external/InstallGeometry.cmake b/external/InstallGeometry.cmake
index 48248ee505..777bb170d3 100644
--- a/external/InstallGeometry.cmake
+++ b/external/InstallGeometry.cmake
@@ -1,4 +1,4 @@
-set(GEOMETRY_VERSION 978685b9e8fee29a7e69946bd6e32e933ff012ff)
+set(GEOMETRY_VERSION 362c8819841ac23c2726d435a655673ee392a20e)
 set(GEOMETRY_SRC_URL "https://git.cbm.gsi.de/CbmSoft/cbmroot_geometry.git")
 
 download_project_if_needed(PROJECT         Geometry_source
diff --git a/external/InstallParameter.cmake b/external/InstallParameter.cmake
index 4ebd34f2ec..e348b813b1 100644
--- a/external/InstallParameter.cmake
+++ b/external/InstallParameter.cmake
@@ -1,4 +1,4 @@
-set(PARAMETER_VERSION b0b7fa4a4319810263518b2f0c957b65e3454f64) # 2024-09-28
+set(PARAMETER_VERSION fce9835d7035ca6c5006cdd95de2f93fdf556aab) # 2024-11-07
 
 set(PARAMETER_SRC_URL "https://git.cbm.gsi.de/CbmSoft/cbmroot_parameter.git")
 
diff --git a/macro/beamtime/mcbm2022/ini_tof_clusterizer.C b/macro/beamtime/mcbm2022/ini_tof_clusterizer.C
index bb8e1feb1a..04957441fd 100644
--- a/macro/beamtime/mcbm2022/ini_tof_clusterizer.C
+++ b/macro/beamtime/mcbm2022/ini_tof_clusterizer.C
@@ -1,4 +1,4 @@
-/* Copyright (C) 2022 Physikalisches Institut, Universitaet Heidelberg, Heidelberg 
+/* Copyright (C) 2022 Physikalisches Institut, Universitaet Heidelberg, Heidelberg
    SPDX-License-Identifier: GPL-3.0-only
    Authors:  Norbert Herrmann [committer]*/
 
@@ -55,6 +55,7 @@ void ini_tof_clusterizer(Int_t calMode = 53, Int_t calSel = 0, Int_t calSm = 900
   if (cCalId != "XXX")
     cFname =
       Form("%s/%s_set%09d_%02d_%01dtofClust.hst.root", parPath.Data(), cCalId.Data(), iCalSet, calMode, calSelRead);
+  if (cCalId == "2391_1") cFname = Form("%s/%s_TofCal.hst.root", parPath.Data(), cCalId.Data());
   tofClust->SetCalParFileName(cFname);
 
   LOG(info) << "\n\n!!!!! Using TOF calibration " << cFname << " !!!!!\n\n";
diff --git a/macro/beamtime/mcbm2022/mcbm_digievent_reco.C b/macro/beamtime/mcbm2022/mcbm_digievent_reco.C
index 86dda771aa..d0d02b4a5a 100644
--- a/macro/beamtime/mcbm2022/mcbm_digievent_reco.C
+++ b/macro/beamtime/mcbm2022/mcbm_digievent_reco.C
@@ -121,7 +121,7 @@ Bool_t mcbm_digievent_reco(UInt_t uRunId               = 2365,
   if (uRunId >= 2389) cCalId = "2389.5.lxbk0598";
   if (uRunId >= 2390) cCalId = "2391.5.lxbk0598";
   if (uRunId >= 2393) cCalId = "2393.5.lxbk0598";
-  if (uRunId == 2391) cCalId = "2391.5.000";
+  if (uRunId == 2391) cCalId = "2391_1";
 
   Int_t iCalSet = 22002500;  // calibration settings
   if (uRunId >= 759) iCalSet = 10020500;
diff --git a/macro/beamtime/mcbm2022/mcbm_event_reco.C b/macro/beamtime/mcbm2022/mcbm_event_reco.C
index 459a190e1f..371cdf325a 100644
--- a/macro/beamtime/mcbm2022/mcbm_event_reco.C
+++ b/macro/beamtime/mcbm2022/mcbm_event_reco.C
@@ -101,7 +101,8 @@ Bool_t mcbm_event_reco(UInt_t uRunId                   = 2391,
   if (uRunId >= 1588) cCalId = "1588.50.6.0";
   if (uRunId >= 2160) cCalId = "2160.50.4.0";
   if (uRunId >= 2352) cCalId = "2365.5.lxbk0600";
-  if (uRunId >= 2391) cCalId = "2391.5.lxbk0598";
+  if (uRunId >= 2352) cCalId = "2391_1";
+
   Int_t iCalSet = 30040500;  // calibration settings
   if (uRunId >= 759) iCalSet = 10020500;
   if (uRunId >= 812) iCalSet = 10020500;
diff --git a/macro/beamtime/mcbm2022/mcbm_event_reco_L1.C b/macro/beamtime/mcbm2022/mcbm_event_reco_L1.C
index 73acba5736..b9bd63107f 100644
--- a/macro/beamtime/mcbm2022/mcbm_event_reco_L1.C
+++ b/macro/beamtime/mcbm2022/mcbm_event_reco_L1.C
@@ -55,20 +55,12 @@ Bool_t mcbm_event_reco_L1(UInt_t uRunId                   = 2570,
   /// Standardized RUN ID
   TString sRunId = TString::Format("%04u", uRunId);
 
-  /// Initial pattern
-  TString inFile  = sInpDir + sRunId + ".digi";
-  TString cFileId = sRunId + ".5.000";
-
   gSystem->Exec("mkdir " + sOutDir);
   gSystem->Exec("cp $VMCWORKDIR/macro/run/.rootrc .");
 
-  //TString parFileIn  = sInpDir + "/unp_mcbm_params_" + sRunId;
-  TString outFile = sOutDir + "/mcbm_test" + sRunId;
-
-  // Your folder with the Tof Calibration files;
-  TString TofFileFolder = "";
-  // TString TofFileFolder = "/lustre/cbm/users/nh/CBM/cbmroot/trunk/macro/beamtime/mcbm2021/";
-
+  /// Initial pattern
+  TString inFile  = sInpDir + sRunId + ".digi";
+  TString outFile = sOutDir + "/" + sRunId;
 
   /// Add index of splitting at unpacking level if needed
   if (0 <= iUnpFileIndex) {
@@ -78,18 +70,24 @@ Bool_t mcbm_event_reco_L1(UInt_t uRunId                   = 2570,
   }  // if ( 0 <= uUnpFileIndex )
   /// Add ROOT file suffix
   inFile += ".root";
-  //  parFileIn += ".root";
-
   TString parFileOut = outFile + ".par.root";
   TString geoFileOut = outFile + ".geo.root";
-
   outFile += ".rec.root";
 
-  if ("" != sInpFile) inFile = sInpFile;
+  if ("" != sInpFile) {
+    inFile  = sInpFile;
+    outFile = inFile;
+    outFile.ReplaceAll(".digi.root", "");
+    parFileOut = outFile + ".par.root";
+    geoFileOut = outFile + ".geo.root";
+    outFile += ".rec.root";
+  }
   // ---------------------------------------------
 
 
   // -----   TOF defaults ------------------------
+  TString cFileId       = sRunId + ".5.000";
+  TString TofFileFolder = "";
   // ===> PAL 2022/11/04: overwriten by block around l.510!
   Int_t calMode      = 93;
   Int_t calSel       = 1;
@@ -116,7 +114,7 @@ Bool_t mcbm_event_reco_L1(UInt_t uRunId                   = 2570,
   if (uRunId >= 812) cCalId = "831.100.4.0";
   if (uRunId >= 1588) cCalId = "1588.50.6.0";
   if (uRunId >= 2160) cCalId = "2160.50.4.0";
-  if (uRunId >= 2352) cCalId = "2391.5.000";
+  if (uRunId >= 2352) cCalId = "2391_1";
 
   Int_t iCalSet = 30040500;  // calibration settings
   if (uRunId >= 759) iCalSet = 10020500;
@@ -230,10 +228,6 @@ Bool_t mcbm_event_reco_L1(UInt_t uRunId                   = 2570,
 
     TString alignmentMatrixFileName = srcDir + "/parameters/mcbm/AlignmentMatrices_" + geoSetupTag + ".root";
 
-    if (geoTagTof.Contains("v21k_mcbm")) {
-      alignmentMatrixFileName = srcDir + "/parameters/mcbm/AlignmentMatrices_" + geoSetupTag + "_tof21k_AB.root";
-    }
-
     if (alignmentMatrixFileName.Length() != 0) {
 
       std::cout << "-I- " << myName << ": Applying alignment for file " << alignmentMatrixFileName << std::endl;
diff --git a/macro/beamtime/mcbm2022/mcbm_reco.C b/macro/beamtime/mcbm2022/mcbm_reco.C
index 4357665e4b..c68eee2670 100644
--- a/macro/beamtime/mcbm2022/mcbm_reco.C
+++ b/macro/beamtime/mcbm2022/mcbm_reco.C
@@ -113,7 +113,7 @@ Bool_t mcbm_reco(UInt_t uRunId                   = 2391,
   if (uRunId >= 812) cCalId = "831.100.4.0";
   if (uRunId >= 1588) cCalId = "1588.50.6.0";
   if (uRunId >= 2160) cCalId = "2160.50.4.0";
-  if (uRunId >= 2352) cCalId = "2391.5.000";
+  if (uRunId >= 2352) cCalId = "2391_1";
 
   Int_t iCalSet = 30040500;  // calibration settings
   if (uRunId >= 759) iCalSet = 10020500;
-- 
GitLab