From e697098845ed30cdb1aa4db66696ac4975372d28 Mon Sep 17 00:00:00 2001
From: "s.zharko@gsi.de" <szharko@lxi099.gsi.de>
Date: Thu, 13 Jan 2022 18:24:37 +0100
Subject: [PATCH] modifications before clang-format

---
 macro/run/run_reco.C    |  4 ----
 reco/L1/CbmL1.cxx       | 10 +---------
 reco/L1/CbmL1.h         | 11 ++++++++---
 reco/L1/L1Algo/L1Algo.h | 18 +-----------------
 4 files changed, 10 insertions(+), 33 deletions(-)

diff --git a/macro/run/run_reco.C b/macro/run/run_reco.C
index 2b309f2139..af3e5e3df0 100644
--- a/macro/run/run_reco.C
+++ b/macro/run/run_reco.C
@@ -391,10 +391,6 @@ void run_reco(TString input = "", Int_t nTimeSlices = -1, Int_t firstTimeSlice =
       l1->SetStsMaterialBudgetFileName(parFile.Data());
     }
 
-    // ---- L1Algo runtime constants selection interface example ------
-    l1->GetL1Parameters()->SetMaxDoubletsPerSinglet(149);
-    // ----------------------------------------------------------------
-
     run->AddTask(l1);
     std::cout << "-I- " << myName << ": Added task " << l1->GetName() << std::endl;
 
diff --git a/reco/L1/CbmL1.cxx b/reco/L1/CbmL1.cxx
index 8c6f16537c..36af489e59 100644
--- a/reco/L1/CbmL1.cxx
+++ b/reco/L1/CbmL1.cxx
@@ -752,15 +752,7 @@ InitStatus CbmL1::Init()
       LOG(error) << "-E- CbmL1: Read geometry from file " << fSTAPDataDir + "geo_algo.txt was NOT successful.";
   }
 
-  if (fL1ParametersPtr) {
-    algo->SetL1Parameters(*fL1ParametersPtr);
-    delete fL1ParametersPtr;
-  }
-  else {
-    LOG(error) << "-E- CbmL1: L1Parameters object was not transfered to the L1Algo core. Default parameters "
-               << "will be used.";
-  }
-
+  algo->SetL1Parameters(fL1Parameters);
   algo->Init(geo, fUseHitErrors, fTrackingMode, fMissingHits);
   geo.clear();
 
diff --git a/reco/L1/CbmL1.h b/reco/L1/CbmL1.h
index 6ce48fc37c..c8dea94ed0 100644
--- a/reco/L1/CbmL1.h
+++ b/reco/L1/CbmL1.h
@@ -81,7 +81,12 @@ public:
   int Det;
 };
 
-
+// TODO: insert documentation!
+//  
+/// L1Algo runtime constants modification can be performed in run_reco.C. Example:
+///   
+///   l1->GetL1Parameters()->SetMaxDoubletsPerSinglet(149);
+///
 class CbmL1 : public FairTask {
 private:
   CbmL1(const CbmL1&);
@@ -118,7 +123,7 @@ public:
 
   ~CbmL1(/*if (targetFieldSlice) delete;*/);
 
-  L1Parameters* GetL1Parameters() { return fL1ParametersPtr; }
+  L1Parameters* GetL1Parameters() { return &fL1Parameters; }
 
   void SetStsMaterialBudgetFileName(TString fileName) { fStsMatBudgetFileName = fileName; }
   void SetMvdMaterialBudgetFileName(TString fileName) { fMvdMatBudgetFileName = fileName; }
@@ -217,7 +222,7 @@ public:
 
 private:
   static CbmL1* fInstance;
-  L1Parameters* fL1ParametersPtr {new L1Parameters()};  ///< pointer to L1Algo parameters class instance
+  L1Parameters fL1Parameters;
 
   L1AlgoInputData* fData {nullptr};
 
diff --git a/reco/L1/L1Algo/L1Algo.h b/reco/L1/L1Algo/L1Algo.h
index 78c91cca3d..b445714872 100644
--- a/reco/L1/L1Algo/L1Algo.h
+++ b/reco/L1/L1Algo/L1Algo.h
@@ -95,23 +95,7 @@ public:
   float GetDefaultParticleMass2() const { return fDefaultMass * fDefaultMass; }
 
   float fDefaultMass = 0.10565800;  // muon mass
-                                    // NOTE: technically it is a default value, so it can be modified
-                                    // with a setter. But on other hand it is a phys constant, so we must
-                                    // think again whether to handle the numerical literal as constexpr or not
-  //float fDefaultMass = L1Parameters::kMuonMass;  // muon mass
-
-  /////--> moved to L1Parameters
-  /////static constexpr unsigned int fkStationBits = 6;
-  /////static constexpr unsigned int fkThreadBits  = 6;
-  /////static constexpr unsigned int fkTripletBits = 32 - fkStationBits - fkThreadBits;
-
-  /////static constexpr unsigned int fkMaxNstations = (1 << fkStationBits);  // 2^6 =64
-  /////static constexpr unsigned int fkMaxNthreads  = (1 << fkThreadBits);   // 2^6 = 64
-  /////static constexpr unsigned int fkMaxNtriplets = (1 << fkTripletBits);  // 2^20 = 262,144
-
-  /////--> moved to L1Parameters
-  /////unsigned int fMaxDoubletsPerSinglet = 150;
-  /////unsigned int fMaxTripletPerDoublets = 15;
+  // TODO: make fDefaultMass a private member
 
   /// pack station, thread and triplet indices to an unique triplet ID
   static unsigned int PackTripletId(unsigned int Station, unsigned int Thread, unsigned int Triplet)
-- 
GitLab