From 7147c3e66259fe12a9777e30f3be39c76ebd0587 Mon Sep 17 00:00:00 2001
From: "s.zharko@gsi.de" <s.zharko@gsi.de>
Date: Mon, 23 Oct 2023 15:31:59 +0200
Subject: [PATCH] CA: flag to enable/disable time measurements in tracking

---
 reco/L1/CbmL1.cxx | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/reco/L1/CbmL1.cxx b/reco/L1/CbmL1.cxx
index 2d19512d19..b87f935910 100644
--- a/reco/L1/CbmL1.cxx
+++ b/reco/L1/CbmL1.cxx
@@ -495,6 +495,8 @@ InitStatus CbmL1::Init()
 
     std::vector<ca::StationInitializer> vStations;
     vStations.reserve(100);
+    bool bDisableTime =
+      (ca::Framework::TrackingMode::kMcbm == fTrackingMode) ? true : false;  /// TMP, move to parameters!
 
     // *** MVD stations info ***
     if (fUseMVD) {
@@ -502,7 +504,7 @@ InitStatus CbmL1::Init()
         auto stationInfo = ca::StationInitializer(ca::EDetectorID::kMvd, iSt);
         // TODO: SZh 15.08.2022: Replace station type with ca::EDetectorID
         stationInfo.SetStationType(1);  // MVD
-        stationInfo.SetTimeInfo(mvdInterface->IsTimeInfoProvided(iSt));
+        stationInfo.SetTimeInfo(!bDisableTime && mvdInterface->IsTimeInfoProvided(iSt));
         stationInfo.SetFieldStatus(fTrackingMode == ca::Framework::TrackingMode::kMcbm ? 0 : 1);
         stationInfo.SetZref(mvdInterface->GetZref(iSt));
         stationInfo.SetZmin(mvdInterface->GetZmin(iSt));
@@ -526,8 +528,7 @@ InitStatus CbmL1::Init()
         // TODO: SZh 15.08.2022: Replace station type with ca::EDetectorID
         stationInfo.SetStationType(0);  // STS
         stationInfo.SetTimeInfo(stsInterface->IsTimeInfoProvided(iSt));
-        stationInfo.SetTimeInfo(
-          ca::Framework::TrackingMode::kMcbm != fTrackingMode ? stsInterface->IsTimeInfoProvided(iSt) : false);
+        stationInfo.SetTimeInfo(!bDisableTime && stsInterface->IsTimeInfoProvided(iSt));
         stationInfo.SetFieldStatus(ca::Framework::TrackingMode::kMcbm == fTrackingMode ? 0 : 1);
         stationInfo.SetZref(stsInterface->GetZref(iSt));
         stationInfo.SetZmin(stsInterface->GetZmin(iSt));
@@ -551,9 +552,7 @@ InitStatus CbmL1::Init()
         auto stationInfo = ca::StationInitializer(ca::EDetectorID::kMuch, iSt);
         // TODO: SZh 15.08.2022: Replace station type with ca::EDetectorID
         stationInfo.SetStationType(2);  // MuCh
-        stationInfo.SetTimeInfo(muchInterface->IsTimeInfoProvided(iSt));
-        stationInfo.SetTimeInfo(
-          ca::Framework::TrackingMode::kMcbm != fTrackingMode ? stsInterface->IsTimeInfoProvided(iSt) : false);
+        stationInfo.SetTimeInfo(!bDisableTime && muchInterface->IsTimeInfoProvided(iSt));
         stationInfo.SetFieldStatus(0);
         stationInfo.SetZref(muchInterface->GetZref(iSt));
         stationInfo.SetZmin(muchInterface->GetZmin(iSt));
@@ -577,9 +576,7 @@ InitStatus CbmL1::Init()
         auto stationInfo = ca::StationInitializer(ca::EDetectorID::kTrd, iSt);
         // TODO: SZh 15.08.2022: Replace station type with ca::EDetectorID
         stationInfo.SetStationType((iSt == 1 || iSt == 3) ? 6 : 3);  // MuCh
-        stationInfo.SetTimeInfo(trdInterface->IsTimeInfoProvided(iSt));
-        stationInfo.SetTimeInfo(
-          ca::Framework::TrackingMode::kMcbm != fTrackingMode ? stsInterface->IsTimeInfoProvided(iSt) : false);
+        stationInfo.SetTimeInfo(!bDisableTime && trdInterface->IsTimeInfoProvided(iSt));
         stationInfo.SetFieldStatus(0);
         stationInfo.SetZref(trdInterface->GetZref(iSt));
         stationInfo.SetZmin(trdInterface->GetZmin(iSt));
@@ -604,9 +601,7 @@ InitStatus CbmL1::Init()
         auto stationInfo = ca::StationInitializer(ca::EDetectorID::kTof, iSt);
         // TODO: SZh 15.08.2022: Replace station type with ca::EDetectorID
         stationInfo.SetStationType(4);
-        stationInfo.SetTimeInfo(tofInterface->IsTimeInfoProvided(iSt));
-        stationInfo.SetTimeInfo(
-          ca::Framework::TrackingMode::kMcbm != fTrackingMode ? stsInterface->IsTimeInfoProvided(iSt) : false);
+        stationInfo.SetTimeInfo(!bDisableTime && tofInterface->IsTimeInfoProvided(iSt));
         stationInfo.SetFieldStatus(0);
         stationInfo.SetZref(tofInterface->GetZref(iSt));
         stationInfo.SetZmin(tofInterface->GetZmin(iSt));
-- 
GitLab