From a91ff5c149f93dd1fc2ae64bb0f4323b0e0bf0da Mon Sep 17 00:00:00 2001
From: "s.zharko@gsi.de" <s.zharko@gsi.de>
Date: Mon, 6 Jun 2022 23:20:10 +0200
Subject: [PATCH] L1: Changed L1Algo initialization logic, moved geometry
 parameters to L1Parameters

---
 reco/L1/CbmL1.cxx                        |  39 ++---
 reco/L1/CbmL1Performance.cxx             |  68 ++++-----
 reco/L1/CbmL1ReadEvent.cxx               |  58 ++++----
 reco/L1/L1Algo/L1Algo.cxx                |  57 ++-----
 reco/L1/L1Algo/L1Algo.h                  |  47 ++----
 reco/L1/L1Algo/L1CAMergeClones.cxx       |   8 +-
 reco/L1/L1Algo/L1CATrackFinder.cxx       |  88 ++++++-----
 reco/L1/L1Algo/L1Constants.h             |   5 +-
 reco/L1/L1Algo/L1Field.h                 |  13 ++
 reco/L1/L1Algo/L1InitManager.cxx         | 175 +++++++++-------------
 reco/L1/L1Algo/L1InitManager.h           |  62 ++------
 reco/L1/L1Algo/L1Parameters.cxx          | 129 +++++++++++++++-
 reco/L1/L1Algo/L1Parameters.h            | 181 +++++++++++++++++++----
 reco/L1/L1Algo/L1TrackExtender.cxx       |  18 +--
 reco/L1/L1Algo/L1TrackFitter.cxx         |  75 +++++-----
 reco/L1/L1Algo/L1TrackParFit.cxx         |   2 +-
 reco/L1/L1Algo/L1TrackParFit.h           |   2 +-
 reco/L1/L1Algo/utils/L1AlgoDraw.cxx      |   2 +-
 reco/L1/ParticleFinder/CbmL1PFFitter.cxx |  32 ++--
 19 files changed, 587 insertions(+), 474 deletions(-)

diff --git a/reco/L1/CbmL1.cxx b/reco/L1/CbmL1.cxx
index a613fa9c3b..fd5bb314f2 100644
--- a/reco/L1/CbmL1.cxx
+++ b/reco/L1/CbmL1.cxx
@@ -726,23 +726,6 @@ InitStatus CbmL1::Init()
     LOG(info) << "- TOF station " << iSt << " at z = " << stationInfo.GetZdouble();
   }
 
-  /*** Get numbers of active stations ***/
-
-  NMvdStations  = fpInitManager->GetNstationsActive(L1DetectorID::kMvd);
-  NStsStations  = fpInitManager->GetNstationsActive(L1DetectorID::kSts);
-  NTrdStations  = fpInitManager->GetNstationsActive(L1DetectorID::kTrd);
-  NMuchStations = fpInitManager->GetNstationsActive(L1DetectorID::kMuch);
-  NTOFStation   = fpInitManager->GetNstationsActive(L1DetectorID::kTof);
-  NStation      = fpInitManager->GetNstationsActive();
-
-  LOG(info) << "----- Numbers of stations active in tracking -----";
-  LOG(info) << "  MVD:    " << NMvdStations;
-  LOG(info) << "  STS:    " << NStsStations;
-  LOG(info) << "  MuCh:   " << NMuchStations;
-  LOG(info) << "  TRD:    " << NTrdStations;
-  LOG(info) << "  ToF:    " << NTOFStation;
-  LOG(info) << "  Total:  " << NStation;
-
   /****************************************
    **                                    **
    ** TRACKING ITERATIONS INITIALIZATION **
@@ -919,6 +902,24 @@ InitStatus CbmL1::Init()
   /**********************/
 
   algo->Init(fUseHitErrors, fTrackingMode, fMissingHits);
+  
+  /*** Get numbers of active stations ***/
+
+  NMvdStations  = fpInitManager->GetNstationsActive(L1DetectorID::kMvd);
+  NStsStations  = fpInitManager->GetNstationsActive(L1DetectorID::kSts);
+  NTrdStations  = fpInitManager->GetNstationsActive(L1DetectorID::kTrd);
+  NMuchStations = fpInitManager->GetNstationsActive(L1DetectorID::kMuch);
+  NTOFStation   = fpInitManager->GetNstationsActive(L1DetectorID::kTof);
+  NStation      = fpInitManager->GetNstationsActive();
+
+  LOG(info) << "----- Numbers of stations active in tracking -----";
+  LOG(info) << "  MVD:    " << NMvdStations;
+  LOG(info) << "  STS:    " << NStsStations;
+  LOG(info) << "  MuCh:   " << NMuchStations;
+  LOG(info) << "  TRD:    " << NTrdStations;
+  LOG(info) << "  ToF:    " << NTOFStation;
+  LOG(info) << "  Total:  " << NStation;
+
 
   return kSUCCESS;
 }
@@ -1043,7 +1044,7 @@ void CbmL1::Reconstruct(CbmEvent* event)
         h.n = mcp.event;
 #endif
         const int ista       = (*algo->fStripFlag)[h.f] / 4;
-        const L1Station& sta = algo->GetStations()[ista];
+        const L1Station& sta = algo->GetParameters()->GetStation(ista);
         if (std::find(strips.begin(), strips.end(), h.f) != strips.end()) {  // separate strips
 
           (*algo->fStripFlag).push_back((*algo->fStripFlag)[h.f]);
@@ -1118,7 +1119,7 @@ void CbmL1::Reconstruct(CbmEvent* event)
     //  algo->L1KFTrackFitter( fExtrapolateToTheEndOfSTS );
 
     {  // track fit
-      L1FieldValue b = algo->GetVtxFieldValue();
+      L1FieldValue b = algo->GetParameters()->GetVertexFieldValue();
 
       if ((fabs(b.x[0]) < 0.0000001) && (fabs(b.y[0]) < 0.0000001) && (fabs(b.z[0]) < 0.0000001)) {
         algo->KFTrackFitter_simple();
diff --git a/reco/L1/CbmL1Performance.cxx b/reco/L1/CbmL1Performance.cxx
index 8fe21a7b1c..e3f8b74ecd 100644
--- a/reco/L1/CbmL1Performance.cxx
+++ b/reco/L1/CbmL1Performance.cxx
@@ -800,8 +800,8 @@ void CbmL1::HistoPerformance()  // TODO: check if works correctly. Change vHitRe
       CbmL1HitStore& h2 = vHitStore[prtra->StsHits[1]];
       h_ghost_fstation->Fill(h1.iStation);
       h_ghost_r->Fill(sqrt(fabs(h1.x * h1.x + h1.y * h1.y)));
-      double z1 = algo->GetStations()[h1.iStation].z[0];
-      double z2 = algo->GetStations()[h2.iStation].z[0];
+      double z1 = algo->GetParameters()->GetStation(h1.iStation).z[0];
+      double z2 = algo->GetParameters()->GetStation(h2.iStation).z[0];
       if (fabs(z2 - z1) > 1.e-4) {
         h_ghost_tx->Fill((h2.x - h1.x) / (z2 - z1));
         h_ghost_ty->Fill((h2.y - h1.y) / (z2 - z1));
@@ -992,8 +992,8 @@ void CbmL1::HistoPerformance()  // TODO: check if works correctly. Change vHitRe
       //      CbmL1HitStore &ph21 = vHitStore[mtra.StsHits[0]];
       //      CbmL1HitStore &ph22 = vHitStore[mtra.StsHits[1]];
 
-      //      double z21 = algo->GetStations()[ph21.iStation].z[0];
-      //      double z22 = algo->GetStations()[ph22.iStation].z[0];
+      //      double z21 = algo->GetParameters()->GetStation(ph21.iStation).z[0];
+      //      double z22 = algo->GetParameters()->GetStation(ph22.iStation).z[0];
       //      if( fabs(z22-z21)>1.e-4 ){
       //        h_notfound_tx->Fill((ph22.x-ph21.x)/(z22-z21));
       //        h_notfound_ty->Fill((ph22.y-ph21.y)/(z22-z21));
@@ -1193,7 +1193,7 @@ void CbmL1::TrackFitPerformance()
       for (unsigned int iMCPoint = 0; iMCPoint < mc.Points.size(); iMCPoint++) {
         const int iMCP    = mc.Points[iMCPoint];
         CbmL1MCPoint& mcP = vMCPoints[iMCP];
-        const L1Station& st = algo->GetStations()[mcP.iStation];
+        const L1Station& st = algo->GetParameters()->GetStation(mcP.iStation);
         z[ih]             = st.z[0];
         if (ih > 0 && (z[ih] - z[ih - 1]) < 0.1) continue;
         st.fieldSlice.GetFieldValue(mcP.x, mcP.y, B[ih]);
@@ -1202,7 +1202,7 @@ void CbmL1::TrackFitPerformance()
       }
       if (ih < 3) continue;
       CbmL1MCPoint& mcP = vMCPoints[mc.Points[0]];
-      targB             = algo->GetVtxFieldValue();
+      targB             = algo->GetParameters()->GetVertexFieldValue();
       fld.Set(B[0], z[0], B[1], z[1], B[2], z[2]);
       L1Extrapolate(trPar, mcP.zIn, trPar.qp, fld);
 
@@ -1304,7 +1304,7 @@ void CbmL1::TrackFitPerformance()
       for (unsigned int iMCPoint = 0; iMCPoint < mc.Points.size(); iMCPoint++) {
         const int iMCP    = mc.Points[iMCPoint];
         CbmL1MCPoint& mcP = vMCPoints[iMCP];
-        const L1Station& st = algo->GetStations()[mcP.iStation];
+        const L1Station& st = algo->GetParameters()->GetStation(mcP.iStation);
         z[ih]             = st.z[0];
         if (ih > 0 && (z[ih] - z[ih - 1]) < 0.1) continue;
         st.fieldSlice.GetFieldValue(mcP.x, mcP.y, B[ih]);
@@ -1313,7 +1313,7 @@ void CbmL1::TrackFitPerformance()
       }
       if (ih < 3) continue;
       CbmL1MCPoint& mcP = vMCPoints[iMC];
-      targB             = algo->GetVtxFieldValue();
+      targB             = algo->GetParameters()->GetVertexFieldValue();
       fld.Set(B[0], z[0], B[1], z[1], B[2], z[2]);
       L1Extrapolate(trPar, mcP.zOut, trPar.qp, fld);
 
@@ -1375,7 +1375,7 @@ void CbmL1::TrackFitPerformance()
             if (ih >= mc.Points.size()) continue;  //If nofMCPoints in track < 3
             const int iMCP    = mc.Points[ih];
             CbmL1MCPoint& mcP = vMCPoints[iMCP];
-            const L1Station& st = algo->GetStations()[mcP.iStation];
+            const L1Station& st = algo->GetParameters()->GetStation(mcP.iStation);
             z[ih]             = st.z[0];
             st.fieldSlice.GetFieldValue(mcP.x, mcP.y, B[ih]);
           };
@@ -1384,12 +1384,12 @@ void CbmL1::TrackFitPerformance()
           L1Extrapolate(trPar, mc.z, trPar.qp, fld);
           // add material
           const int fSta = vHitStore[it->StsHits[0]].iStation;
-          const int dir  = int((mc.z - algo->GetStations()[fSta].z[0]) / fabs(mc.z - algo->GetStations()[fSta].z[0]));
-          //         if (abs(mc.z - algo->GetStations()[fSta].z[0]) > 10.) continue; // can't extrapolate on large distance
+          const int dir  = int((mc.z - algo->GetParameters()->GetStation(fSta).z[0]) / fabs(mc.z - algo->GetParameters()->GetStation(fSta).z[0]));
+          //         if (abs(mc.z - algo->GetParameters()->GetStation(fSta).z[0]) > 10.) continue; // can't extrapolate on large distance
           for (int iSta = fSta /*+dir*/;
-               (iSta >= 0) && (iSta < NStation) && (dir * (mc.z - algo->GetStations()[iSta].z[0]) > 0); iSta += dir) {
+               (iSta >= 0) && (iSta < NStation) && (dir * (mc.z - algo->GetParameters()->GetStation(iSta).z[0]) > 0); iSta += dir) {
             //           cout << iSta << " " << dir << endl;
-            fit.L1AddMaterial(trPar, algo->GetStations()[iSta].materialInfo, trPar.qp, 1);
+            fit.L1AddMaterial(trPar, algo->GetParameters()->GetStation(iSta).materialInfo, trPar.qp, 1);
             if (iSta + dir == NMvdStations - 1) fit.L1AddPipeMaterial(trPar, trPar.qp, 1);
           }
         }
@@ -1433,12 +1433,12 @@ void CbmL1::TrackFitPerformance()
           L1FieldValue B[3], targB _fvecalignment;
           float z[3];
 
-          targB = algo->GetVtxFieldValue();
+          targB = algo->GetParameters()->GetVertexFieldValue();
 
           int ih = 1;
           for (unsigned int iHit = 0; iHit < it->StsHits.size(); iHit++) {
             const int iStation = vHitStore[it->StsHits[iHit]].iStation;
-            const L1Station& st = algo->GetStations()[iStation];
+            const L1Station& st = algo->GetParameters()->GetStation(iStation);
             z[ih]              = st.z[0];
             st.fieldSlice.GetFieldValue(vHitStore[it->StsHits[iHit]].x, vHitStore[it->StsHits[iHit]].y, B[ih]);
             ih++;
@@ -1449,20 +1449,20 @@ void CbmL1::TrackFitPerformance()
           // add material
           const int fSta = vHitStore[it->StsHits[0]].iStation;
 
-          const int dir = (mc.z - algo->GetStations()[fSta].z[0]) / abs(mc.z - algo->GetStations()[fSta].z[0]);
-          //         if (abs(mc.z - algo->GetStations()[fSta].z[0]) > 10.) continue; // can't extrapolate on large distance
+          const int dir = (mc.z - algo->GetParameters()->GetStation(fSta).z[0]) / abs(mc.z - algo->GetParameters()->GetStation(fSta).z[0]);
+          //         if (abs(mc.z - algo->GetParameters()->GetStation(fSta].z[0]) > 10.) continue; // can't extrapolate on large distance
 
           for (int iSta = fSta + dir;
-               (iSta >= 0) && (iSta < NStation) && (dir * (mc.z - algo->GetStations()[iSta].z[0]) > 0); iSta += dir) {
+               (iSta >= 0) && (iSta < NStation) && (dir * (mc.z - algo->GetParameters()->GetStation(iSta).z[0]) > 0); iSta += dir) {
 
-            z[0]     = algo->GetStations()[iSta].z[0];
+            z[0]     = algo->GetParameters()->GetStation(iSta).z[0];
             float dz = z[1] - z[0];
-            algo->GetStations()[iSta].fieldSlice.GetFieldValue(trPar.x - trPar.tx * dz, trPar.y - trPar.ty * dz, B[0]);
+            algo->GetParameters()->GetStation(iSta).fieldSlice.GetFieldValue(trPar.x - trPar.tx * dz, trPar.y - trPar.ty * dz, B[0]);
             fld.Set(B[0], z[0], B[1], z[1], B[2], z[2]);
 
-            L1Extrapolate(trPar, algo->GetStations()[iSta].z[0], trPar.qp, fld);
-            fit.L1AddMaterial(trPar, algo->fRadThick[iSta].GetRadThick(trPar.x, trPar.y), trPar.qp, 1);
-            fit.EnergyLossCorrection(trPar, algo->fRadThick[iSta].GetRadThick(trPar.x, trPar.y), trPar.qp, fvec(1.f),
+            L1Extrapolate(trPar, algo->GetParameters()->GetStation(iSta).z[0], trPar.qp, fld);
+            fit.L1AddMaterial(trPar, algo->GetParameters()->GetMaterialThickness(iSta, trPar.x, trPar.y), trPar.qp, 1);
+            fit.EnergyLossCorrection(trPar, algo->GetParameters()->GetMaterialThickness(iSta, trPar.x, trPar.y), trPar.qp, fvec(1.f),
                                      fvec(1.f));
             if (iSta + dir == NMvdStations - 1) {
               fit.L1AddPipeMaterial(trPar, trPar.qp, 1);
@@ -1615,7 +1615,7 @@ void CbmL1::FieldApproxCheck()
 
     const int M   = 5;  // polinom order
     const int N   = (M + 1) * (M + 2) / 2;
-    const L1Station& st = algo->GetStations()[ist];
+    const L1Station& st = algo->GetParameters()->GetStation(ist);
     for (int i = 0; i < N; i++) {
       FSl.cx[i] = st.fieldSlice.cx[i][0];
       FSl.cy[i] = st.fieldSlice.cy[i][0];
@@ -1984,8 +1984,8 @@ void CbmL1::InputPerformance()
           pullTsts->Fill((sh->GetTime() - mcTime) / sh->GetTimeError());
         }
         else {  // errors used in TF
-          pullXsts->Fill((hitPos.X() - mcPos.X()) / sqrt(algo->GetStations()[NMvdStations].XYInfo.C00[0]));
-          pullYsts->Fill((hitPos.Y() - mcPos.Y()) / sqrt(algo->GetStations()[NMvdStations].XYInfo.C11[0]));
+          pullXsts->Fill((hitPos.X() - mcPos.X()) / sqrt(algo->GetParameters()->GetStation(NMvdStations).XYInfo.C00[0]));
+          pullYsts->Fill((hitPos.Y() - mcPos.Y()) / sqrt(algo->GetParameters()->GetStation(NMvdStations).XYInfo.C11[0]));
         }
 
         resXsts->Fill((hitPos.X() - mcPos.X()) * 10 * 1000);
@@ -2030,8 +2030,8 @@ void CbmL1::InputPerformance()
       //       if (hitErr.X() != 0) pullX->Fill( (hitPos.X() - mcPos.X()) / sh->GetDx() ); // qa errors
       //       if (hitErr.Y() != 0) pullY->Fill( (hitPos.Y() - mcPos.Y()) / sh->GetDy() );
       if (hitErr.X() != 0)
-        pullXmvd->Fill((hitPos.X() - mcPos.X()) / sqrt(algo->GetStations()[0].XYInfo.C00[0]));  // errors used in TF
-      if (hitErr.Y() != 0) pullYmvd->Fill((hitPos.Y() - mcPos.Y()) / sqrt(algo->GetStations()[0].XYInfo.C11[0]));
+        pullXmvd->Fill((hitPos.X() - mcPos.X()) / sqrt(algo->GetParameters()->GetStation(0).XYInfo.C00[0]));  // errors used in TF
+      if (hitErr.Y() != 0) pullYmvd->Fill((hitPos.Y() - mcPos.Y()) / sqrt(algo->GetParameters()->GetStation(0).XYInfo.C11[0]));
 
       resXmvd->Fill((hitPos.X() - mcPos.X()) * 10 * 1000);
       resYmvd->Fill((hitPos.Y() - mcPos.Y()) * 10 * 1000);
@@ -2097,8 +2097,8 @@ void CbmL1::InputPerformance()
         pullTmuch->Fill((h.t - mcTime) / sh->GetTimeError());
       }
       else {  // errors used in TF
-        pullXmuch->Fill((hitPos.X() - mcPos.X()) / sqrt(algo->GetStations()[NMvdStations].XYInfo.C00[0]));
-        pullYmuch->Fill((hitPos.Y() - mcPos.Y()) / sqrt(algo->GetStations()[NMvdStations].XYInfo.C11[0]));
+        pullXmuch->Fill((hitPos.X() - mcPos.X()) / sqrt(algo->GetParameters()->GetStation(NMvdStations).XYInfo.C00[0]));
+        pullYmuch->Fill((hitPos.Y() - mcPos.Y()) / sqrt(algo->GetParameters()->GetStation(NMvdStations).XYInfo.C11[0]));
       }
 
       resXmuch->Fill((h.x - mcPos.X()) * 10 * 1000);
@@ -2164,8 +2164,8 @@ void CbmL1::InputPerformance()
         pullTtrd->Fill((h.t - mcTime) / sh->GetTimeError());
       }
       else {  // errors used in TF
-        pullXtrd->Fill((hitPos.X() - mcPos.X()) / sqrt(algo->GetStations()[NMvdStations].XYInfo.C00[0]));
-        pullYtrd->Fill((hitPos.Y() - mcPos.Y()) / sqrt(algo->GetStations()[NMvdStations].XYInfo.C11[0]));
+        pullXtrd->Fill((hitPos.X() - mcPos.X()) / sqrt(algo->GetParameters()->GetStation(NMvdStations).XYInfo.C00[0]));
+        pullYtrd->Fill((hitPos.Y() - mcPos.Y()) / sqrt(algo->GetParameters()->GetStation(NMvdStations).XYInfo.C11[0]));
       }
 
       resXtrd->Fill((h.x - mcPos.X()) * 10 * 1000);
@@ -2232,8 +2232,8 @@ void CbmL1::InputPerformance()
         pullTtof->Fill((sh->GetTime() - mcTime) / sh->GetTimeError());
       }
       else {  // errors used in TF
-        pullXtof->Fill((hitPos.X() - mcPos.X()) / sqrt(algo->GetStations()[NMvdStations].XYInfo.C00[0]));
-        pullYtof->Fill((hitPos.Y() - mcPos.Y()) / sqrt(algo->GetStations()[NMvdStations].XYInfo.C11[0]));
+        pullXtof->Fill((hitPos.X() - mcPos.X()) / sqrt(algo->GetParameters()->GetStation(NMvdStations).XYInfo.C00[0]));
+        pullYtof->Fill((hitPos.Y() - mcPos.Y()) / sqrt(algo->GetParameters()->GetStation(NMvdStations).XYInfo.C11[0]));
       }
 
       resXtof->Fill((h.x - mcPos.X()) * 10 * 1000);
diff --git a/reco/L1/CbmL1ReadEvent.cxx b/reco/L1/CbmL1ReadEvent.cxx
index adb4636aca..de1b2bcbee 100644
--- a/reco/L1/CbmL1ReadEvent.cxx
+++ b/reco/L1/CbmL1ReadEvent.cxx
@@ -265,12 +265,12 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength,
           CbmL1MCPoint MC;
           if (!ReadMCPoint(&MC, iMC, iFile, iEvent, 1)) {
             MC.iStation     = -1;
-            const L1Station* sta = algo->GetStations().begin();
+            const L1Station* sta = algo->GetParameters()->GetStations().begin();
             double bestDist = 1.e20;
             for (Int_t iSt = 0; iSt < NMvdStationsGeom; iSt++) {
               // use z_in since z_out is sometimes very wrong
               // due to a problem in transport
-              int iStActive = fpInitManager->GetStationIndexActive(iSt, L1DetectorID::kMvd);
+              int iStActive = algo->GetParameters()->GetStationIndexActive(iSt, L1DetectorID::kMvd);
               if (iStActive == -1) { continue; }
               double d = (MC.zIn - sta[iStActive].z[0]);
               if (fabs(d) < fabs(bestDist)) {
@@ -304,10 +304,10 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength,
           CbmL1MCPoint MC;
           if (!ReadMCPoint(&MC, iMC, iFile, iEvent, 0)) {
             MC.iStation     = -1;
-            const L1Station* sta = algo->GetStations().begin();
+            const L1Station* sta = algo->GetParameters()->GetStations().begin();
             double bestDist = 1.e20;
             for (Int_t iSt = 0; iSt < NStsStationsGeom; iSt++) {
-              int iStActive = fpInitManager->GetStationIndexActive(iSt, L1DetectorID::kSts);
+              int iStActive = algo->GetParameters()->GetStationIndexActive(iSt, L1DetectorID::kSts);
               if (iStActive == -1) { continue; }
               // use z_in since z_out is sometimes very wrong
               // due to a problem in transport
@@ -342,9 +342,9 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength,
           CbmL1MCPoint MC;
           if (!ReadMCPoint(&MC, iMC, iFile, iEvent, 2)) {
             MC.iStation    = -1;
-            const L1Station* sta = algo->GetStations().begin();
+            const L1Station* sta = algo->GetParameters()->GetStations().begin();
             for (Int_t iSt = 0; iSt < NMuchStationsGeom; iSt++) {
-              int iStActive = fpInitManager->GetStationIndexActive(iSt, L1DetectorID::kMuch);
+              int iStActive = algo->GetParameters()->GetStationIndexActive(iSt, L1DetectorID::kMuch);
               if (iStActive == -1) { continue; }
               if (MC.z > sta[iStActive].z[0] - 2.5) { MC.iStation = iStActive; }
             }
@@ -370,9 +370,9 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength,
           CbmL1MCPoint MC;
           if (!ReadMCPoint(&MC, iMC, iFile, iEvent, 3)) {
             MC.iStation    = -1;
-            const L1Station* sta = algo->GetStations().begin();
+            const L1Station* sta = algo->GetParameters()->GetStations().begin();
             for (Int_t iSt = 0; iSt < NTrdStationsGeom; iSt++) {
-              int iStActive = fpInitManager->GetStationIndexActive(iSt, L1DetectorID::kTrd);
+              int iStActive = algo->GetParameters()->GetStationIndexActive(iSt, L1DetectorID::kTrd);
               if (iStActive == -1) { continue; }
               if (MC.z > sta[iStActive].z[0] - 4.0) { MC.iStation = iStActive; }
             }
@@ -422,9 +422,9 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength,
             Int_t IND_Track = trk_it->second;
 
             MC.iStation    = -1;
-            const L1Station* sta = algo->GetStations().begin();
+            const L1Station* sta = algo->GetParameters()->GetStations().begin();
             for (Int_t iSt = 0; iSt < NTOFStationGeom; iSt++) {
-              int iStActive = fpInitManager->GetStationIndexActive(iSt, L1DetectorID::kTof);
+              int iStActive = algo->GetParameters()->GetStationIndexActive(iSt, L1DetectorID::kTof);
               if (iStActive == -1) { continue; }
               MC.iStation = (MC.z > sta[iStActive].z[0] - 15) ? iStActive : MC.iStation;
             }
@@ -450,9 +450,9 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength,
             if (!ReadMCPoint(&MC, TofPointToTrack[iTofSta][iMC], iFile, iEvent, 4)) {
 
               MC.iStation    = -1;
-              const L1Station* sta = algo->GetStations().begin();
+              const L1Station* sta = algo->GetParameters()->GetStations().begin();
               for (Int_t iSt = 0; iSt < NTOFStation; iSt++) {
-                int iStActive = fpInitManager->GetStationIndexActive(iSt, L1DetectorID::kTof);
+                int iStActive = algo->GetParameters()->GetStationIndexActive(iSt, L1DetectorID::kTof);
                 if (iStActive == -1) { continue; }
                 MC.iStation = (MC.z > sta[iStActive].z[0] - 15) ? iStActive : MC.iStation;
               }
@@ -519,7 +519,7 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength,
         th.id         = tmpHits.size();
         th.iStation   = mh->GetStationNr();
 
-        int stIdx = algo->GetInitManager()->GetStationIndexActive(mh->GetStationNr(), L1DetectorID::kMvd);
+        int stIdx = algo->GetParameters()->GetStationIndexActive(mh->GetStationNr(), L1DetectorID::kMvd);
         if (stIdx == -1) continue;
         th.iStation = stIdx;  //mh->GetStationNr() - 1;
         th.iStripF  = firstDetStrip + j;
@@ -541,7 +541,7 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength,
         th.y = pos.Y();
         th.z = pos.Z();
 
-        const L1Station& st = algo->GetStations()[th.iStation];
+        const L1Station& st = algo->GetParameters()->GetStation(th.iStation);
         th.u_front    = th.x * st.frontInfo.cos_phi[0] + th.y * st.frontInfo.sin_phi[0];
         th.u_back     = th.x * st.backInfo.cos_phi[0] + th.y * st.backInfo.sin_phi[0];
       }
@@ -582,7 +582,7 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength,
       //            << p.time << " mc " << p.ID << " p " << p.p << endl;
       TmpHit th;
       int DetId = 1;
-      th.CreateHitFromPoint(p, DetId, tmpHits.size(), firstDetStrip, ip, NStrips, algo->GetStations()[p.iStation]);
+      th.CreateHitFromPoint(p, DetId, tmpHits.size(), firstDetStrip, ip, NStrips, algo->GetParameters()->GetStation(p.iStation));
       tmpHits.push_back(th);
       nStsHits++;
     }
@@ -615,7 +615,7 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength,
         CbmStsHit* mh = L1_DYNAMIC_CAST<CbmStsHit*>(listStsHits->At(hitIndexSort));
         th.ExtIndex   = hitIndexSort;
         th.Det        = 1;
-        int stIdx     = algo->GetInitManager()->GetStationIndexActive(
+        int stIdx     = algo->GetParameters()->GetStationIndexActive(
           CbmStsSetup::Instance()->GetStationNumber(mh->GetAddress()), L1DetectorID::kSts);
 
         if (stIdx == -1) continue;
@@ -659,7 +659,7 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength,
         th.du = mh->GetDu();
         th.dv = mh->GetDv();
 
-        const L1Station& st = algo->GetStations()[th.iStation];
+        const L1Station& st = algo->GetParameters()->GetStation(th.iStation);
         th.u_front    = th.x * st.frontInfo.cos_phi[0] + th.y * st.frontInfo.sin_phi[0];
         th.u_back     = th.x * st.backInfo.cos_phi[0] + th.y * st.backInfo.sin_phi[0];
       }
@@ -743,7 +743,7 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength,
 
       TmpHit th;
       int DetId = 2;
-      th.CreateHitFromPoint(p, DetId, tmpHits.size(), firstDetStrip, ip, NStrips, algo->GetStations()[p.iStation]);
+      th.CreateHitFromPoint(p, DetId, tmpHits.size(), firstDetStrip, ip, NStrips, algo->GetParameters()->GetStation(p.iStation));
 
       tmpHits.push_back(th);
       nMuchHits++;
@@ -772,7 +772,7 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength,
 
         int DetId = stationNumber * 3 + layerNumber;
 
-        int stIdx = algo->GetInitManager()->GetStationIndexActive(DetId, L1DetectorID::kMuch);
+        int stIdx = algo->GetParameters()->GetStationIndexActive(DetId, L1DetectorID::kMuch);
         if (stIdx == -1) continue;
         th.iStation = stIdx;  //mh->GetStationNr() - 1;
 
@@ -798,7 +798,7 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength,
         th.dv = mh->GetDy();
 
 
-        const L1Station& st = algo->GetStations()[th.iStation];
+        const L1Station& st = algo->GetParameters()->GetStation(th.iStation);
         th.u_front    = th.x * st.frontInfo.cos_phi[0] + th.y * st.frontInfo.sin_phi[0];
         th.u_back     = th.x * st.backInfo.cos_phi[0] + th.y * st.backInfo.sin_phi[0];
       }
@@ -824,7 +824,7 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength,
               if (trk_it == dFEI2vMCPoints.end()) continue;
               th.iMC = trk_it->second;
               if ((1 == fMuchUseMcHit) && (th.iMC > -1))
-                th.SetHitFromPoint(vMCPoints[th.iMC], algo->GetStations()[th.iStation]);
+                th.SetHitFromPoint(vMCPoints[th.iMC], algo->GetParameters()->GetStation(th.iStation));
             }
           }
         }
@@ -848,7 +848,7 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength,
 
       TmpHit th;
       int DetId = 3;
-      th.CreateHitFromPoint(p, DetId, tmpHits.size(), firstDetStrip, ip, NStrips, algo->GetStations()[p.iStation]);
+      th.CreateHitFromPoint(p, DetId, tmpHits.size(), firstDetStrip, ip, NStrips, algo->GetParameters()->GetStation(p.iStation));
       tmpHits.push_back(th);
       nTrdHits++;
     }
@@ -873,7 +873,7 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength,
 
       th.id = tmpHits.size();
 
-      int stIdx = algo->GetInitManager()->GetStationIndexActive(mh->GetPlaneId(), L1DetectorID::kTrd);
+      int stIdx = algo->GetParameters()->GetStationIndexActive(mh->GetPlaneId(), L1DetectorID::kTrd);
       if (stIdx == -1) continue;
 
       th.iStation = stIdx;
@@ -907,7 +907,7 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength,
       th.du = fabs(mh->GetDx());
       th.dv = fabs(mh->GetDy());
 
-      const L1Station& st = algo->GetStations()[th.iStation];
+      const L1Station& st = algo->GetParameters()->GetStation(th.iStation);
       th.u_front    = th.x * st.frontInfo.cos_phi[0] + th.y * st.frontInfo.sin_phi[0];
       th.u_back     = th.x * st.backInfo.cos_phi[0] + th.y * st.backInfo.sin_phi[0];
 
@@ -934,7 +934,7 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength,
               th.dy = 0.;
               th.dt = 0.;
             }
-            th.SetHitFromPoint(vMCPoints[th.iMC], algo->GetStations()[th.iStation]);
+            th.SetHitFromPoint(vMCPoints[th.iMC], algo->GetParameters()->GetStation(th.iStation));
             /*
               CbmTrdPoint* pt =
                 (CbmTrdPoint*) fTrdPoints->Get(trdHitMatch->GetLink(0).GetFile(), trdHitMatch->GetLink(0).GetEntry(),
@@ -990,7 +990,7 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength,
       TmpHit th;
 
       int DetId = 4;
-      th.CreateHitFromPoint(p, DetId, tmpHits.size(), firstDetStrip, ip, NStrips, algo->GetStations()[p.iStation]);
+      th.CreateHitFromPoint(p, DetId, tmpHits.size(), firstDetStrip, ip, NStrips, algo->GetParameters()->GetStation(p.iStation));
       tmpHits.push_back(th);
 
       nTofHits++;
@@ -1056,11 +1056,11 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength,
         if ((th.x > 20) && (th.z > 270) && (fTofDigiBdfPar->GetTrackingStation(mh) == 1)) sttof = 2;
       if (th.z > 400) continue;
 
-      int stIdx = algo->GetInitManager()->GetStationIndexActive(sttof, L1DetectorID::kTof);
+      int stIdx = algo->GetParameters()->GetStationIndexActive(sttof, L1DetectorID::kTof);
       if (stIdx == -1) continue;
       th.iStation = stIdx;
 
-      const L1Station& st = algo->GetStations()[th.iStation];
+      const L1Station& st = algo->GetParameters()->GetStation(th.iStation);
       th.u_front    = th.x * st.frontInfo.cos_phi[0] + th.y * st.frontInfo.sin_phi[0];
       th.u_back     = th.x * st.backInfo.cos_phi[0] + th.y * st.backInfo.sin_phi[0];
 
@@ -1085,7 +1085,7 @@ void CbmL1::ReadEvent(L1AlgoInputData* fData_, float& TsStart, float& TsLength,
           DFEI2I::iterator trk_it = dFEI2vMCPoints.find(dtrck);
           if (trk_it != dFEI2vMCPoints.end()) th.iMC = TofPointToTrack[sttof][trk_it->second];
           if ((1 == fTofUseMcHit) && (th.iMC > -1))
-            th.SetHitFromPoint(vMCPoints[th.iMC], algo->GetStations()[th.iStation]);
+            th.SetHitFromPoint(vMCPoints[th.iMC], algo->GetParameters()->GetStation(th.iStation));
         }
       }
 
diff --git a/reco/L1/L1Algo/L1Algo.cxx b/reco/L1/L1Algo/L1Algo.cxx
index 5508772a0a..d6dae01fa9 100644
--- a/reco/L1/L1Algo/L1Algo.cxx
+++ b/reco/L1/L1Algo/L1Algo.cxx
@@ -89,57 +89,24 @@ void L1Algo::Init(const bool UseHitErrors, const TrackingMode mode, const bool M
 
   // Final init checks (the function provides purity of fields initialization and turns on the last bit of
   // the L1ObjectInitController):
-  fInitManager.CheckInit();  // NOTE: after passing this frontier L1Algo is (will be) accounted as initialized
+  //fInitManager.CheckInit();  // NOTE: after passing this frontier L1Algo is (will be) accounted as initialized
 
   // Print out the bits of the init manager
-  LOG(info) << "InitManager " << fInitManager.GetInitController().ToString();
-
-  // Get real target position
-  fRealTargetX = fInitManager.GetTargetPosition()[0];
-  fRealTargetY = fInitManager.GetTargetPosition()[1];
-  fRealTargetZ = fInitManager.GetTargetPosition()[2];
-
+  //LOG(info) << "InitManager " << fInitManager.GetInitController().ToString();
+
+  LOG(info) << "\033[1;34m ------ Parameters (before) -------------------------------------------------------------------\033[0m";
+  LOG(info) << fParameters.ToString();
+  fInitManager.TransferParametersContainer(fParameters);
+  LOG(info) << "\033[1;34m ------ Parameters (after) --------------------------------------------------------------------\033[0m";
+  LOG(info) << fParameters.ToString();
+  
   // Get number of station
   fNstations = fInitManager.GetNstationsActive();
 
-  // Get field near target
-  fVtxFieldValue  = fInitManager.GetTargetFieldValue();
-  fVtxFieldRegion = fInitManager.GetTargetFieldRegion();
-
-  // Fill L1Station array
-  fInitManager.TransferL1StationArray(fStations);
-  fInitManager.TransferL1MaterialArray(fRadThick);
-
   fTrackingLevel    = fInitManager.GetTrackingLevel();
   fGhostSuppression = fInitManager.GetGhostSuppression();
   fMomentumCutOff   = fInitManager.GetMomentumCutOff();
 
-  LOG(info) << "  ***********************";
-  LOG(info) << "  *  L1Algo parameters  *";
-  LOG(info) << "  ***********************";
-  LOG(info) << "";
-
-  LOG(info) << "----- Nominal target position -----";
-  LOG(info) << "\t target X = " << fRealTargetX;
-  LOG(info) << "\t target Y = " << fRealTargetY;
-  LOG(info) << "\t target Z = " << fRealTargetZ;
-
-  LOG(info) << "----- Number of stations -----";
-  LOG(info) << "\tTotal stations:           " << fNstations;
-  LOG(info) << "\tStations before pipe:     " << fNstationsBeforePipe;
-  LOG(info) << "\tStations in field region: " << fNfieldStations;
-
-  LOG(info) << "----- Magnetic field near target -----";
-  LOG(info) << "\tField Value:  " << '\n' << fVtxFieldValue.ToString(/*indent = */ 1) << '\n';
-  LOG(info) << "\tField Region: " << '\n' << fVtxFieldRegion.ToString(/*indent = */ 1) << '\n';
-
-  LOG(info) << "----- L1 active stations list -----";
-  for (int iSt = 0; iSt < fNstations; ++iSt) {
-    LOG(info) << " #" << iSt << " " << fStations[iSt].ToString(/*verbosity = */ 0);
-  }
-
-  // Print L1Parameters
-  fParameters.Print(/*verbosity=*/0);
 }
 
 
@@ -208,11 +175,11 @@ void L1Algo::SetData(L1Vector<L1Hit>& StsHits_, int nStsStrips_, L1Vector<unsign
 
 void L1Algo::GetHitCoor(const L1Hit& _h, fscal& _x, fscal& _y, char iS)
 {
-  L1Station& sta = fStations[int(iS)];
+  const L1Station& sta = fParameters.GetStation(int(iS));
   fscal u        = _h.u;
   fscal v        = _h.v;
-  _x             = (sta.xInfo.sin_phi[0] * u + sta.xInfo.cos_phi[0] * v) / (_h.z - fRealTargetZ[0]);
-  _y             = (sta.yInfo.cos_phi[0] * u + sta.yInfo.sin_phi[0] * v) / (_h.z - fRealTargetZ[0]);
+  _x             = (sta.xInfo.sin_phi[0] * u + sta.xInfo.cos_phi[0] * v) / (_h.z - fParameters.GetTargetPositionZ()[0]);
+  _y             = (sta.yInfo.cos_phi[0] * u + sta.yInfo.sin_phi[0] * v) / (_h.z - fParameters.GetTargetPositionZ()[0]);
 }
 
 void L1Algo::GetHitCoor(const L1Hit& _h, fscal& _x, fscal& _y, fscal& _z, const L1Station& sta)
diff --git a/reco/L1/L1Algo/L1Algo.h b/reco/L1/L1Algo/L1Algo.h
index 39ee43de7e..5a789389a9 100644
--- a/reco/L1/L1Algo/L1Algo.h
+++ b/reco/L1/L1Algo/L1Algo.h
@@ -226,8 +226,8 @@ private:
   int fNstations {0};                          ///< number of all detector stations
   int fNstationsBeforePipe {0};                ///< number of stations before pipe (MVD stations in CBM)
   int fNfieldStations {0};                     ///< number of stations in the field region
-  alignas(16) L1StationsArray_t fStations {};  ///< array of L1Station objects
-  alignas(16) L1MaterialArray_t fRadThick {};  ///< material for each station
+  //alignas(16) L1StationsArray_t fStations {};  ///< array of L1Station objects
+  //alignas(16) L1MaterialArray_t fRadThick {};  ///< material for each station
 
 public:
   /// Gets total number of stations used in tracking
@@ -239,27 +239,6 @@ public:
   /// Gets number of stations situated in field region (MVD + STS in CBM)
   int GetNfieldStations() const { return fNfieldStations; }
 
-  /// Gets reference to the stations array
-  const L1StationsArray_t& GetStations() const { return fStations; }
-
-  /// Gets material thickness in units of radiation length in a point on the XY plane for a selected station
-  /// \param iStActive  Global index of an active station
-  /// \param xPos       Position of the point in X dimension [cm]
-  /// \param yPos       Position of the point in Y dimension [cm]
-  float GetMaterialThickness(int iStActive, float xPos, float yPos) const
-  {
-    return fRadThick[iStActive].GetRadThick(xPos, yPos);
-  }
-
-  /// Gets material thickness in units of radiation length in a point on the XY plane for a selected station
-  /// \param iStActive  Global index of an active station
-  /// \param xPos       Position of the point in X dimension [cm] (SIMDized vector)
-  /// \param yPos       Position of the point in Y dimension [cm] (SIMDized vector)
-  fvec GetMaterialThickness(int iStActive, fvec xPos, fvec yPos) const
-  {
-    return fRadThick[iStActive].GetRadThick(xPos, yPos);
-  }
-
 public:
 
   int NStsStrips {0};                             ///> number of strips
@@ -376,8 +355,6 @@ public:
 
   friend class CbmL1;
 
-  const L1FieldValue& GetVtxFieldValue() const { return fVtxFieldValue; }
-  const L1FieldRegion& GetVtxFieldRegion() const { return fVtxFieldRegion; }
   /// ----- Hit-point-strips conversion routines ------
 
   void GetHitCoor(const L1Hit& _h, fscal& _x, fscal& _y, fscal& _z, const L1Station& sta);
@@ -412,12 +389,11 @@ public:
   // TODO: remove it (S.Zharko)
 
   /// Gets a pointer to the L1Algo parameters object
-  L1Parameters* GetParameters() { return &fParameters; }
+  const L1Parameters* GetParameters() { return &fParameters; }
+
   /// Gets a pointer to the L1Algo initialization object
   L1InitManager* GetInitManager() { return &fInitManager; }
 
-  fvec GetTargetZ() const { return fRealTargetZ; }
-
 private:
   L1Parameters fParameters {};                ///< Object of L1Algo parameters class
   L1InitManager fInitManager {&fParameters};  ///< Object of L1Algo initialization manager class
@@ -521,7 +497,7 @@ private:
 
   /// Find the doublets. Reformat data in the portion of doublets.
   void f20(  // input
-    Tindex n1, L1Station& stal, L1Station& stam, L1HitPoint* vStsHits_m, L1TrackPar* T_1, L1HitIndex_t* hitsl_1,
+    Tindex n1, const L1Station& stal, const L1Station& stam, L1HitPoint* vStsHits_m, L1TrackPar* T_1, L1HitIndex_t* hitsl_1,
 
     // output
     Tindex& n2, L1Vector<L1HitIndex_t>& i1_2,
@@ -534,7 +510,7 @@ private:
   /// Add the middle hits to parameters estimation. Propagate to right station.
   /// Find the triplets (right hit). Reformat data in the portion of triplets.
   void f30(  // input
-    L1HitPoint* vStsHits_r, L1Station& stam, L1Station& star,
+    L1HitPoint* vStsHits_r, const L1Station& stam, const L1Station& star,
 
     int istam, int istar, L1HitPoint* vStsHits_m, L1TrackPar* T_1, L1FieldRegion* fld_1, L1HitIndex_t* hitsl_1,
 
@@ -552,7 +528,7 @@ private:
 
   /// Add the right hits to parameters estimation.
   void f31(  // input
-    Tindex n3_V, L1Station& star, nsL1::vector<fvec>::TSimd& u_front_3, nsL1::vector<fvec>::TSimd& u_back_3,
+    Tindex n3_V, const L1Station& star, nsL1::vector<fvec>::TSimd& u_front_3, nsL1::vector<fvec>::TSimd& u_back_3,
     nsL1::vector<fvec>::TSimd& z_Pos_3,
     //    nsL1::vector<fvec>::TSimd& dx_,
     //    nsL1::vector<fvec>::TSimd& dy_,
@@ -711,20 +687,15 @@ private:
   fvec fMaxInvMom {L1Utils::kNaN};       ///< max considered q/p for tracks
   fvec fMaxSlopePV {L1Utils::kNaN};      ///< max slope (tx\ty) in prim vertex
   float fMaxSlope {L1Utils::kNaN};       ///< max slope (tx\ty) in 3d hit position of a triplet
-  fvec fRealTargetX {L1Utils::kNaN};     ///< real target position x coordinate
-  fvec fRealTargetY {L1Utils::kNaN};     ///< real target position y coordinate
-  fvec fRealTargetZ {L1Utils::kNaN};     ///< real target position z coordinate
+  
   fvec fTargX {L1Utils::kNaN};           ///< target position x coordinate for the current iteration (modifiable)
   fvec fTargY {L1Utils::kNaN};           ///< target position y coordinate for the current iteration (modifiable)
   fvec fTargZ {L1Utils::kNaN};           ///< target position z coordinate for the current iteration (modifiable)
 
-  L1FieldValue fTargB _fvecalignment {};               // field in the target point
+  L1FieldValue fTargB _fvecalignment {};               // field in the target point (modifiable, do not touch!!)
   L1XYMeasurementInfo TargetXYInfo _fvecalignment {};  // target constraint  [cm]
 
 
-  L1FieldRegion fVtxFieldRegion _fvecalignment {};  // really doesn't used
-  L1FieldValue fVtxFieldValue _fvecalignment {};    // field at teh vertex position.
-
   //  int TripNumThread;
 
   int fTrackingLevel {2};       // currently not used
diff --git a/reco/L1/L1Algo/L1CAMergeClones.cxx b/reco/L1/L1Algo/L1CAMergeClones.cxx
index 1172e605d7..5df44eceff 100644
--- a/reco/L1/L1Algo/L1CAMergeClones.cxx
+++ b/reco/L1/L1Algo/L1CAMergeClones.cxx
@@ -347,8 +347,8 @@ void L1Algo::CAMergeClones()
       // if (fabs (Tf.time[0] - Tb.time[0]) > 500000) continue;
       unsigned short stam;
 
-      fStations[staf].fieldSlice.GetFieldValue(Tf.x, Tf.y, fBf);
-      fStations[stab].fieldSlice.GetFieldValue(Tb.x, Tb.y, fBb);
+      fParameters.GetStation(staf).fieldSlice.GetFieldValue(Tf.x, Tf.y, fBf);
+      fParameters.GetStation(stab).fieldSlice.GetFieldValue(Tb.x, Tb.y, fBb);
 
       unsigned short dist = firstStation[iTr] - lastStation[jTr];
 
@@ -356,10 +356,10 @@ void L1Algo::CAMergeClones()
       else
         stam = staf - 1;
 
-      fvec zm = fStations[stam].z;
+      fvec zm = fParameters.GetStation(stam).z;
       fvec xm = 0.5 * (Tf.x + Tf.tx * (zm - Tf.z) + Tb.x + Tb.tx * (zm - Tb.z));
       fvec ym = 0.5 * (Tf.y + Tf.ty * (zm - Tf.z) + Tb.y + Tb.ty * (zm - Tb.z));
-      fStations[stam].fieldSlice.GetFieldValue(xm, ym, fBm);
+      fParameters.GetStation(stam).fieldSlice.GetFieldValue(xm, ym, fBm);
       fld.Set(fBb, Tb.z, fBm, zm, fBf, Tf.z);
 
       fvec zMiddle = 0.5 * (Tb.z + Tf.z);
diff --git a/reco/L1/L1Algo/L1CATrackFinder.cxx b/reco/L1/L1Algo/L1CATrackFinder.cxx
index f2d7f8da96..6ab9234f03 100644
--- a/reco/L1/L1Algo/L1CATrackFinder.cxx
+++ b/reco/L1/L1Algo/L1CATrackFinder.cxx
@@ -128,19 +128,15 @@ inline void L1Algo::f11(  /// input 1st stage of singlet search
   // comment unused parameters, FU, 18.01.21
   fvec* /*d_x*/, fvec* /*d_y*/, fvec* /*d_xy*/, fvec* d_u, fvec* d_v)
 {
-  L1Station& stal = fStations[istal];
-  L1Station& stam = fStations[istam];
+  const L1Station& stal = fParameters.GetStation(istal);
+  const L1Station& stam = fParameters.GetStation(istam);
   fvec zstal      = stal.z;
   fvec zstam      = stam.z;
 
-  //L1Station& stal_CHECK = fStations[istal];
-  //std::cout << "\033[1;34m>>>>>>>>>>>>\033[0m " << istal << ' ' << &stal_CHECK << ' ' << fStations.begin() << ' ' << &stal_CHECK - fStations.begin() << '\n';
-
-
   int istal_global       = 5;  //TODO: SG: what are these stations? Should the numbers depend on the presence of mvd?
   int istam_global       = 6;
-  L1Station& stal_global = fStations[istal_global];
-  L1Station& stam_global = fStations[istam_global];
+  const L1Station& stal_global = fParameters.GetStation(istal_global);
+  const L1Station& stam_global = fParameters.GetStation(istam_global);
   fvec zstal_global      = stal_global.z;
   fvec zstam_global      = stam_global.z;
 
@@ -189,12 +185,12 @@ inline void L1Algo::f11(  /// input 1st stage of singlet search
     int istac = istal / 2;  // "center" station
     //     if (istal >= fNstationsBeforePipe) // to make it in the same way for both with and w\o mvd
     //       istac = (istal - fNstationsBeforePipe) / 2 + fNstationsBeforePipe;
-    L1Station& stac = fStations[istac];
+    const L1Station& stac = fParameters.GetStation(istac);
     fvec zstac      = stac.z;
 
     int istac_global = istal_global / 2;  // "center" station
 
-    L1Station& stac_global = fStations[istac_global];
+    const L1Station& stac_global = fParameters.GetStation(istac_global);
     fvec zstac_global      = stac.z;
 
     stac.fieldSlice.GetFieldValue(fTargX + tx * (zstac - fTargZ), fTargY + ty * (zstac - fTargZ), centB);
@@ -219,7 +215,7 @@ inline void L1Algo::f11(  /// input 1st stage of singlet search
       fld1.Set(m_B, zstam, l_B, zstal, fTargB, fTargZ);
 #else  // if USE_3HITS  // the best now
     L1FieldValue r_B _fvecalignment;
-    L1Station& star = fStations[istam + 1];
+    const L1Station& star = fParameters.GetStation(istam + 1);
     fvec zstar      = star.z;
     star.fieldSlice.GetFieldValue(fTargX + tx * (zstar - fTargZ), fTargY + ty * (zstar - fTargZ), r_B);
     fld1.Set(r_B, zstar, m_B, zstam, l_B, zstal);
@@ -325,10 +321,10 @@ inline void L1Algo::f11(  /// input 1st stage of singlet search
 
     for (int ista = 0; ista <= istal - 1; ista++) {
       if constexpr (L1Constants::control::kIfUseRadLengthTable) {
-        fit.L1AddMaterial(T, fRadThick[ista].GetRadThick(T.x, T.y), fMaxInvMom, 1);
+        fit.L1AddMaterial(T, fParameters.GetMaterialThickness(ista, T.x, T.y), fMaxInvMom, 1);
       }
       else {
-        fit.L1AddMaterial(T, fStations[ista].materialInfo, fMaxInvMom, 1);
+        fit.L1AddMaterial(T, fParameters.GetStation(ista).materialInfo, fMaxInvMom, 1);
       }
       if (ista == fNstationsBeforePipe - 1) fit.L1AddPipeMaterial(T, fMaxInvMom, 1);
     }
@@ -366,10 +362,10 @@ inline void L1Algo::f11(  /// input 1st stage of singlet search
 
     if constexpr (L1Constants::control::kIfUseRadLengthTable) {
       if (kGlobal == fTrackingMode || kMcbm == fTrackingMode) {
-        fit.L1AddThickMaterial(T, fRadThick[istal].GetRadThick(T.x, T.y), fMaxInvMom, 1, stal.materialInfo.thick, 1);
+        fit.L1AddThickMaterial(T, fParameters.GetMaterialThickness(istal, T.x, T.y), fMaxInvMom, 1, stal.materialInfo.thick, 1);
       }
       else {
-        fit.L1AddMaterial(T, fRadThick[istal].GetRadThick(T.x, T.y), fMaxInvMom, 1);
+        fit.L1AddMaterial(T, fParameters.GetMaterialThickness(istal, T.x, T.y), fMaxInvMom, 1);
       }
     }
     else {
@@ -399,7 +395,7 @@ inline void L1Algo::f11(  /// input 1st stage of singlet search
 /// Find the doublets. Reformat data in the portion of doublets.
 inline void L1Algo::f20(
   /// input
-  Tindex n1, L1Station& stal, L1Station& stam, L1HitPoint* vStsHits_m, L1TrackPar* T_1, L1HitIndex_t* hitsl_1,
+  Tindex n1, const L1Station& stal, const L1Station& stam, L1HitPoint* vStsHits_m, L1TrackPar* T_1, L1HitIndex_t* hitsl_1,
   /// output
   Tindex& n2, L1Vector<L1HitIndex_t>& i1_2,
 #ifdef DOUB_PERFORMANCE
@@ -422,12 +418,12 @@ inline void L1Algo::f20(
     // Pick_m22 is not used, search for mean squared, 2nd version
 
     // -- collect possible doublets --
-    const fscal iz         = 1.f / (T1.z[i1_4] - fRealTargetZ[0]);
+    const fscal iz         = 1.f / (T1.z[i1_4] - fParameters.GetTargetPositionZ()[0]);
     const float& timeError = T1.C55[i1_4];
     const float& time      = T1.t[i1_4];
 
 
-    L1HitAreaTime areaTime(vGridTime[&stam - fStations.begin()], T1.x[i1_4] * iz, T1.y[i1_4] * iz,
+    L1HitAreaTime areaTime(vGridTime[&stam - fParameters.GetStations().begin()], T1.x[i1_4] * iz, T1.y[i1_4] * iz,
                            (sqrt(Pick_m22 * (T1.C00 + stam.XYInfo.C00)) + fMaxDZ * fabs(T1.tx))[i1_4] * iz,
                            (sqrt(Pick_m22 * (T1.C11 + stam.XYInfo.C11)) + fMaxDZ * fabs(T1.ty))[i1_4] * iz, time,
                            sqrt(timeError) * 5);
@@ -439,7 +435,7 @@ inline void L1Algo::f20(
       if (kGlobal == fTrackingMode || kMcbm == fTrackingMode) {
         irm1++;
         if ((L1HitIndex_t) irm1
-            >= (StsHitsUnusedStopIndex[&stam - fStations.begin()] - StsHitsUnusedStartIndex[&stam - fStations.begin()]))
+            >= (StsHitsUnusedStopIndex[&stam - fParameters.GetStations().begin()] - StsHitsUnusedStartIndex[&stam - fParameters.GetStations().begin()]))
           break;
         imh = irm1;
       }
@@ -570,7 +566,7 @@ inline void L1Algo::f20(
 /// Add the middle hits to parameters estimation. Propagate to right station.
 /// Find the triplets(right hit). Reformat data in the portion of triplets.
 inline void L1Algo::f30(  // input
-  L1HitPoint* vStsHits_r, L1Station& stam, L1Station& star, int istam, int istar, L1HitPoint* vStsHits_m,
+  L1HitPoint* vStsHits_r, const L1Station& stam, const L1Station& star, int istam, int istar, L1HitPoint* vStsHits_m,
   L1TrackPar* T_1, L1FieldRegion* fld_1, L1HitIndex_t* hitsl_1, Tindex n2, L1Vector<L1HitIndex_t>& hitsm_2,
   L1Vector<L1HitIndex_t>& i1_2, const L1Vector<char>& /*mrDuplets*/,
   // output
@@ -693,11 +689,11 @@ inline void L1Algo::f30(  // input
       FilterTime(T2, timeM, timeMEr, stam.timeInfo);
       if constexpr (L1Constants::control::kIfUseRadLengthTable) {
         if (kGlobal == fTrackingMode || kMcbm == fTrackingMode) {
-          fit.L1AddThickMaterial(T2, fRadThick[istam].GetRadThick(T2.x, T2.y), fMaxInvMom, 1, stam.materialInfo.thick,
+          fit.L1AddThickMaterial(T2, fParameters.GetMaterialThickness(istam, T2.x, T2.y), fMaxInvMom, 1, stam.materialInfo.thick,
                                  1);
         }
         else {
-          fit.L1AddMaterial(T2, fRadThick[istam].GetRadThick(T2.x, T2.y), T2.qp, 1);
+          fit.L1AddMaterial(T2, fParameters.GetMaterialThickness(istam, T2.x, T2.y), T2.qp, 1);
         }
       }
       else {
@@ -740,8 +736,8 @@ inline void L1Algo::f30(  // input
 #ifdef DO_NOT_SELECT_TRIPLETS
         if (isec == TRACKS_FROM_TRIPLETS_ITERATION) Pick_r22 = Pick_r2 + 1;
 #endif  // DO_NOT_SELECT_TRIPLETS
-        const fscal iz = 1.f / (T2.z[i2_4] - fRealTargetZ[0]);
-        L1HitAreaTime area(vGridTime[&star - fStations.begin()], T2.x[i2_4] * iz, T2.y[i2_4] * iz,
+        const fscal iz = 1.f / (T2.z[i2_4] - fParameters.GetTargetPositionZ()[0]);
+        L1HitAreaTime area(vGridTime[&star - fParameters.GetStations().begin()], T2.x[i2_4] * iz, T2.y[i2_4] * iz,
                            (sqrt(Pick_r22 * (T2.C00 + stam.XYInfo.C00)) + fMaxDZ * fabs(T2.tx))[i2_4] * iz,
                            (sqrt(Pick_r22 * (T2.C11 + stam.XYInfo.C11)) + fMaxDZ * fabs(T2.ty))[i2_4] * iz, time,
                            sqrt(timeError) * 5);
@@ -916,7 +912,7 @@ inline void L1Algo::f30(  // input
 
 /// Add the right hits to parameters estimation.
 inline void L1Algo::f31(  // input
-  Tindex n3_V, L1Station& star, nsL1::vector<fvec>::TSimd& u_front_, nsL1::vector<fvec>::TSimd& u_back_,
+  Tindex n3_V, const L1Station& star, nsL1::vector<fvec>::TSimd& u_front_, nsL1::vector<fvec>::TSimd& u_back_,
   nsL1::vector<fvec>::TSimd& z_Pos,
   //  nsL1::vector<fvec>::TSimd& dx_,
   //  nsL1::vector<fvec>::TSimd& dy_,
@@ -939,7 +935,7 @@ inline void L1Algo::f31(  // input
     if (fUseHitErrors) info.sigma2 = du_[i3_V] * du_[i3_V];
 
     bool noField =
-      (kGlobal == fTrackingMode || kMcbm == fTrackingMode) && (&star - fStations.begin() >= fNfieldStations);
+      (kGlobal == fTrackingMode || kMcbm == fTrackingMode) && (&star - fParameters.GetStations().begin() >= fNfieldStations);
 
     if (noField) { L1FilterNoField(T_3[i3_V], info, u_front_[i3_V]); }
     else {
@@ -979,7 +975,7 @@ inline void L1Algo::f32(  // input // TODO not updated after gaps introduction
 
   L1Station sta[3];
   for (int is = 0; is < NHits; ++is) {
-    sta[is] = fStations[ista[is]];
+    sta[is] = fParameters.GetStation(ista[is]);
   };
 
   for (int i3 = 0; i3 < n3; ++i3) {
@@ -1044,7 +1040,7 @@ inline void L1Algo::f32(  // input // TODO not updated after gaps introduction
     for (int ih = 1; ih < NHits; ++ih) {
       L1Extrapolate(T, z[ih], T.qp, fld);
       if constexpr (L1Constants::control::kIfUseRadLengthTable) {
-        fit.L1AddMaterial(T, fRadThick[ista[ih]].GetRadThick(T.x, T.y), T.qp, 1);
+        fit.L1AddMaterial(T, fParameters.GetMaterialThickness(ista[ih], T.x, T.y), T.qp, 1);
       }
       else {
         fit.L1AddMaterial(T, sta[ih].materialInfo, T.qp, 1);
@@ -1080,7 +1076,7 @@ inline void L1Algo::f32(  // input // TODO not updated after gaps introduction
       for (ih = NHits - 2; ih >= 0; ih--) {
         L1Extrapolate(T, z[ih], T.qp, fld);
         if constexpr (L1Constants::control::kIfUseRadLengthTable) {
-          fit.L1AddMaterial(T, fRadThick[ista[ih]].GetRadThick(T.x, T.y), T.qp, 1);
+          fit.L1AddMaterial(T, fParameters.GetMaterialThickness(ista[ih], T.x, T.y), T.qp, 1);
         }
         else {
           fit.L1AddMaterial(T, sta[ih].materialInfo, T.qp, 1);
@@ -1112,7 +1108,7 @@ inline void L1Algo::f32(  // input // TODO not updated after gaps introduction
       for (ih = 1; ih < NHits; ++ih) {
         L1Extrapolate(T, z[ih], T.qp, fld);
         if constexpr (L1Constants::control::kIfUseRadLengthTable) {
-          fit.L1AddMaterial(T, fRadThick[ista[ih]].GetRadThick(T.x, T.y), T.qp, 1);
+          fit.L1AddMaterial(T, fParameters.GetMaterialThickness(ista[ih], T.x, T.y), T.qp, 1);
         }
         else {
           fit.L1AddMaterial(T, sta[ih].materialInfo, T.qp, 1);
@@ -1354,8 +1350,8 @@ inline void L1Algo::DupletsStaPort(
   ///   @&hitsm_2 - index of middle hit in hits array indexed by doublet index
 
   if (istam < fNstations) {
-    L1Station& stal = fStations[istal];
-    L1Station& stam = fStations[istam];
+    const L1Station& stal = fParameters.GetStation(istal);
+    const L1Station& stam = fParameters.GetStation(istam);
 
     // prepare data
     L1HitPoint* vStsHits_l = &((*vStsHitPointsUnused)[0]) + StsHitsUnusedStartIndex[istal];
@@ -1447,8 +1443,8 @@ L1Algo::TripletsStaPort(  /// creates triplets: input: @istal - start station nu
 {
   if (istar < fNstations) {
     // prepare data
-    L1Station& stam = fStations[istam];
-    L1Station& star = fStations[istar];
+    const L1Station& stam = fParameters.GetStation(istam);
+    const L1Station& star = fParameters.GetStation(istar);
 
     L1HitPoint* vStsHits_m = &((*vStsHitPointsUnused)[0]) + StsHitsUnusedStartIndex[istam];
 
@@ -1783,9 +1779,9 @@ void L1Algo::CATrackFinder()
 
 
   // ---- Loop over Track Finder iterations ----------------------------------------------------------------//
-  L1ASSERT(0, fNFindIterations == fParameters.CAIterationsContainer().size());
-  isec = 0;                                                            // TODO: temporary! (S.Zharko)
-  for (const auto& caIteration : fParameters.CAIterationsContainer())  // all finder
+  L1ASSERT(0, fNFindIterations == fParameters.GetCAIterations().size());
+  isec = 0;  // TODO: temporary! (S.Zharko)
+  for (const auto& caIteration : fParameters.GetCAIterations())  // all finder
   {
     std::cout << "CA Track Finder Iteration!!" << isec << '\n';
     //if (fTrackingMode == kMcbm) {
@@ -1895,17 +1891,17 @@ void L1Algo::CATrackFinder()
         //fMaxSlope = 2.748;  // corresponds to 70 grad
 
         // define the target
-        fTargX = fRealTargetX;
-        fTargY = fRealTargetY;
-        fTargZ = fRealTargetZ;
+        fTargX = fParameters.GetTargetPositionX();
+        fTargY = fParameters.GetTargetPositionY();
+        fTargZ = fParameters.GetTargetPositionZ();
 
         float SigmaTargetX = caIteration.GetTargetPosSigmaX();
         float SigmaTargetY = caIteration.GetTargetPosSigmaY();  // target constraint [cm]
 
         // Select magnetic field. For primary tracks - fVtxFieldValue, for secondary tracks - st.fieldSlice
-        if (caIteration.IsPrimary()) { fTargB = fVtxFieldValue; }
+        if (caIteration.IsPrimary()) { fTargB = fParameters.GetVertexFieldValue(); }
         else {
-          fStations[0].fieldSlice.GetFieldValue(0, 0, fTargB);
+          fParameters.GetStation(0).fieldSlice.GetFieldValue(0, 0, fTargB);
         }  // NOTE: calculates field fTargB in the center of 0th station
 
 
@@ -1919,9 +1915,9 @@ void L1Algo::CATrackFinder()
         //}
         //if ((isec == kAllSecIter) || (isec == kAllSecEIter)
         //    || (isec == kAllSecJumpIter)) {  //use outer radius of the 1st station as a constraint // ?
-        //  L1Station& st = fStations[0];
+        //  L1Station& st = fParameters.GetStation(0);
         //  SigmaTargetX = SigmaTargetY = 10;  //st.Rmax[0];
-        //  fTargZ                      = fRealTargetZ;  // fRealTargetZ-1.;
+        //  fTargZ                      = fParameters.GetTargetPositionZ();  // fParameters.GetTargetPositionZ()-1.;
         //  st.fieldSlice.GetFieldValue(0, 0, fTargB);
         //}
 
@@ -2414,9 +2410,9 @@ void L1Algo::CATrackFinder()
                 L1HitPoint tempPoint = CreateHitPoint(hit);  //TODO take number of station from hit
 
                 float xcoor, ycoor = 0;
-                L1Station stah = fStations[0];
+                L1Station stah = fParameters.GetStation(0); // TODO: Why is it a copy?
                 StripsToCoor(tempPoint.U(), tempPoint.V(), xcoor, ycoor, stah);
-                float zcoor = tempPoint.Z() - fRealTargetZ[0];
+                float zcoor = tempPoint.Z() - fParameters.GetTargetPositionZ()[0];
 
                 float timeFlight = sqrt(xcoor * xcoor + ycoor * ycoor + zcoor * zcoor) / 30.f;  // c = 30[cm/ns]
                 sumTime += (hit.t - timeFlight);
diff --git a/reco/L1/L1Algo/L1Constants.h b/reco/L1/L1Algo/L1Constants.h
index 92ac3e1c10..06734ae6ec 100644
--- a/reco/L1/L1Algo/L1Constants.h
+++ b/reco/L1/L1Algo/L1Constants.h
@@ -53,12 +53,13 @@ namespace L1Constants {
     /// Flag: debug mode for creating pools for triplets.
     /// NOTE: this feature will work only if the L1Parameters::kIfDebugTipletsPerformace is true!
     //constexpr bool kIfCreateTripletPulls {false};
-  }
+  } // end namespace control
   
   /// Miscellaneous constants
   namespace misc {
     constexpr int kAssertionLevel {0};  ///< Assertion level
-  } // end namespace control
+    constexpr int kAlignment {16};
+  } // end namespace misc
 } // end namespace L1Constants
 
 
diff --git a/reco/L1/L1Algo/L1Field.h b/reco/L1/L1Algo/L1Field.h
index 9557670838..b80cd4b7a7 100644
--- a/reco/L1/L1Algo/L1Field.h
+++ b/reco/L1/L1Algo/L1Field.h
@@ -20,8 +20,10 @@ public:
   /// \param B  other field value to combine with
   /// \param w  weight from 0 to 1 // TODO: Do we need any checks here? (S.Zharko)
   void Combine(L1FieldValue& B, fvec w);  // TODO: Shouldn't the B parameter be const? (S.Zharko)
+  
   /// Operator << overloading
   friend std::ostream& operator<<(std::ostream& out, const L1FieldValue& B);
+  
   /// String representation of class contents
   /// \param indentLevel      number of indent characters in the output
   std::string ToString(int indentLevel) const;
@@ -57,15 +59,18 @@ class L1FieldRegion {
 public:
   // NOTE: When a custom constructor is defined, default constructor also should be provided (S.Zharko)
   L1FieldRegion() = default;
+  
   L1FieldRegion(float reg[10]) noexcept;
 
   /// Gets the field vector at z
   // TODO: Probably we need a const specifier here, because the method does not change the fields
   L1FieldValue Get(const fvec z);
+ 
   /// Gets the field vector and writes it into B pointer
   /// \param z_  z-coordinate of the point to calculate the field
   /// \param B   pointer to the output fvec array of the magnetic field
   void Get(const fvec z_, fvec* B) const;
+  
   /// Interpolates the magnetic field by three nodal points and sets the result to this L1FieldRegion object
   /// The result is a quadratic interpolation of the field as a function of z
   /// \param b0   field value in the first nodal point
@@ -77,6 +82,7 @@ public:
   /// TODO: does the sequence of b0z, b1z and b2z matter? If yes, probalby we need an assertion (S.Zharko)
   void Set(const L1FieldValue& b0, const fvec b0z, const L1FieldValue& b1, const fvec b1z, const L1FieldValue& b2,
            const fvec b2z);
+  
   /// Interpolates the magnetic field by thwo nodal points and sets the result to this L1FieldRegion object.
   /// The result is a linear interpolation of the field as a function of z
   /// \param b0   field value in the first nodal point
@@ -85,20 +91,24 @@ public:
   /// \param b1z  z-coordinate of the second nodal point
   /// TODO: does the sequence of b0z and b1z matter? If yes, probalby we need an assertion (S.Zharko)
   void Set(const L1FieldValue& b0, const fvec b0z, const L1FieldValue& b1, const fvec b1z);
+  
   /// Shifts the coefficients to new central point
   /// \param z  z-coordinate of the new central point
   void Shift(fvec z);
+  
   /// Replaces the selected layer of the coefficients with one from another
   /// L1FieldRegion object
   /// \param i0    the index of the fvect layer in this L1FieldRegion object
   /// \param fl    the other L1FieldRegion object, which layer is going to be replaced
   /// \param i1    the index of the source fvect layer to copy
   void SetOneEntry(const int i0, const L1FieldRegion& f1, const int i1);
+  
   /// Replaces all the layers of the coefficients with one selected layer from another
   /// L1FieldRegion object
   /// \param fl    the other L1FieldRegion object, which layer is going to be replaced
   /// \param i1    the index of the source fvect layer to copy
   void SetOneEntry(const L1FieldRegion& f1, const int i1);
+  
   /// Saves the contents of the particular layer of the coefficients into an array of floats
   /// \param reg    output array of 10 floats
   /// \param iVec   index of the input
@@ -106,6 +116,7 @@ public:
   //       parameter of this function (S.Zharko)
   // TODO: Probably we need a const specifier here, because the method does not change the fields
   void GetOneEntry(float reg[10], const int iVec);
+  
   /// String representation of class contents
   /// \param indentLevel      number of indent characters in the output
   std::string ToString(int indentLevel = 0) const;
@@ -116,10 +127,12 @@ public:
   fvec cx0 {0.f};
   fvec cx1 {0.f};
   fvec cx2 {0.f};
+  
   // By(z) = cy0 + cy1*(z-z0) + cy2*(z-z0)^2
   fvec cy0 {0.f};
   fvec cy1 {0.f};
   fvec cy2 {0.f};
+  
   // Bz(z) = cz0 + cz1*(z-z0) + cz2*(z-z0)^2
   fvec cz0 {0.f};
   fvec cz1 {0.f};
diff --git a/reco/L1/L1Algo/L1InitManager.cxx b/reco/L1/L1Algo/L1InitManager.cxx
index 9df4a30def..b4ac3de902 100644
--- a/reco/L1/L1Algo/L1InitManager.cxx
+++ b/reco/L1/L1Algo/L1InitManager.cxx
@@ -17,7 +17,7 @@
 #include "L1Assert.h"
 //-----------------------------------------------------------------------------------------------------------------------
 //
-L1InitManager::L1InitManager(L1Parameters* pParameters) : fpParameters(pParameters) {}
+L1InitManager::L1InitManager(L1Parameters* pParameters) {}
 
 //-----------------------------------------------------------------------------------------------------------------------
 //
@@ -56,35 +56,31 @@ void L1InitManager::AddStation(const L1BaseStationInfo& inStation)
     }
 
     // Check station init
-    {
-      LOG(debug) << "L1InitManager::AddStation:(original) L1BaseStationInfo "
-                 << inStation.GetInitController().ToString();
-      LOG(debug) << "L1InitManager::AddStation:(copy)     L1BaseStationInfo "
-                 << inStation.GetInitController().ToString();
-      std::stringstream aStream;
-      aStream << "Attempt to add an incompletely initialized station info object (detectorID = "
-              << static_cast<int>(inStationCopy.GetDetectorID()) << ", stationID = " << inStationCopy.GetStationID()
-              << ")";
-      L1MASSERT(0, inStationCopy.GetInitController().IsFinalized(), aStream.str().c_str());
+    LOG(debug) << "L1InitManager::AddStation:(original) L1BaseStationInfo "
+               << inStation.GetInitController().ToString();
+    LOG(debug) << "L1InitManager::AddStation:(copy)     L1BaseStationInfo "
+               << inStation.GetInitController().ToString();
+    if (!inStationCopy.GetInitController().IsFinalized()) {
+      LOG(fatal) << "Attempt to add an incompletely initialized station info object (detectorID = "
+                 << static_cast<int>(inStationCopy.GetDetectorID()) << ", stationID = " << inStationCopy.GetStationID()
+                 << ")";
     }
     // insert the station in a set
     auto insertionResult = fStationsInfo.insert(std::move(inStationCopy));
-    // Check insertion
-    {
-      std::stringstream aStream;
-      aStream << "Attempt to add a dublicating station info object (detectorID = "
-              << static_cast<int>(inStationCopy.GetDetectorID()) << ", stationID = " << inStationCopy.GetStationID()
-              << ")";
-      L1MASSERT(0, insertionResult.second, aStream.str().c_str());
+    if (!insertionResult.second) {
+      LOG(fatal) << "Attempt to add a dublicating station info object (detectorID = "
+                 << static_cast<int>(inStationCopy.GetDetectorID()) << ", stationID = " << inStationCopy.GetStationID()
+                 << ")";
     }
+
     int index = fStationsInfo.size() - 1
                 + (fNstationsGeometry[fNstationsGeometry.size() - 1] - fNstationsActive[fNstationsActive.size() - 1]);
-    fActiveStationGlobalIDs[index] = fStationsInfo.size() - 1;
+    fParameters.fActiveStationGlobalIDs[index] = fStationsInfo.size() - 1;
   }
   else {
     int index = fStationsInfo.size()
                 + (fNstationsGeometry[fNstationsGeometry.size() - 1] - fNstationsActive[fNstationsActive.size() - 1]);
-    fActiveStationGlobalIDs[index] = -1;
+    fParameters.fActiveStationGlobalIDs[index] = -1;
     fNstationsActive[static_cast<L1DetectorID_t>(inStation.GetDetectorID())]--;
     fNstationsActive[fNstationsActive.size() - 1]--;
   }
@@ -101,6 +97,40 @@ void L1InitManager::CheckInit()
   this->CheckStationsInfoInit();
 }
 
+//-----------------------------------------------------------------------------------------------------------------------
+// NOTE: this function should be called once in the TransferParametersContainer
+void L1InitManager::FormParametersContainer()
+{
+  // Check initialization
+  this->CheckInit();
+   
+  if (!fInitController.IsFinalized()) {
+    LOG(fatal) << "Attempt to form parameters container before all necessary fields were initialized"
+               << fInitController.ToString();
+  }
+
+  // Copy station numbers
+  std::copy(fNstationsActive.begin(), fNstationsActive.end(), fParameters.fNstationsActive.begin());
+  std::copy(fNstationsGeometry.begin(), fNstationsGeometry.end(), fParameters.fNstationsGeometry.begin());
+
+  // Form array of stations
+  auto destinationArrayIterator = fParameters.fStations.begin();
+  for (const auto& item : fStationsInfo) {
+    *destinationArrayIterator = item.GetL1Station();
+    ++destinationArrayIterator;
+  }
+
+  // Form array of material map
+  auto thickMapIt = fParameters.fThickMap.begin();
+  for (auto it = fStationsInfo.begin(); it != fStationsInfo.end(); ++it) {
+    auto node                 = fStationsInfo.extract(it);
+    *thickMapIt = std::move(node.value().TakeMaterialMap());
+    fStationsInfo.insert(std::move(node));
+    ++thickMapIt;
+  }
+  //LOG(info) << "L1InitManager: L1Material vector was successfully transfered to L1Algo core";
+}
+
 //-----------------------------------------------------------------------------------------------------------------------
 //
 void L1InitManager::InitTargetField(double zStep)
@@ -123,7 +153,7 @@ void L1InitManager::InitTargetField(double zStep)
   constexpr int nDimensions {3};
   constexpr int nPointsNodal {3};
 
-  std::array<double, nPointsNodal> inputNodalZ {fTargetPos[2], fTargetPos[2] + zStep, fTargetPos[2] + 2. * zStep};
+  std::array<double, nPointsNodal> inputNodalZ {fTargetZ, fTargetZ + zStep, fTargetZ + 2. * zStep};
   std::array<L1FieldValue, nPointsNodal> B {};
   std::array<fvec, nPointsNodal> z {};
   // loop over nodal points
@@ -136,8 +166,8 @@ void L1InitManager::InitTargetField(double zStep)
     B[idx].y = field[1];
     B[idx].z = field[2];
   }  // loop over nodal points: end
-  fTargetFieldRegion.Set(B[0], z[0], B[1], z[1], B[2], z[2]);
-  fTargetFieldValue = B[0];
+  fParameters.fVertexFieldRegion.Set(B[0], z[0], B[1], z[1], B[2], z[2]);
+  fParameters.fVertexFieldValue = B[0];
 
   fInitController.SetFlag(EInitKey::kPrimaryVertexField);
 }
@@ -146,7 +176,7 @@ void L1InitManager::InitTargetField(double zStep)
 //
 void L1InitManager::PrintCAIterations(int verbosityLevel) const
 {
-  for (const auto& iteration : fpParameters->CAIterationsContainer()) {
+  for (const auto& iteration : fParameters.fCAIterations) {
     iteration.Print(verbosityLevel);
   }
 }
@@ -170,8 +200,7 @@ void L1InitManager::PushBackCAIteration(const L1CAIteration& iteration)
   L1MASSERT(0, control,  //fInitController.GetFlag(EInitKey::kCAIterationsNumberCrosscheck),
             "Attempt to push back a CA track finder iteration before the number of iterations was defined");
 
-  L1Vector<L1CAIteration>& iterationsContainer = fpParameters->CAIterationsContainer();
-  iterationsContainer.push_back(iteration);
+  fParameters.fCAIterations.push_back(iteration);
 }
 
 //-----------------------------------------------------------------------------------------------------------------------
@@ -188,7 +217,7 @@ void L1InitManager::SetActiveDetectorIDs(const L1DetectorIDSet_t& detectorIDs)
 void L1InitManager::SetCAIterationsNumberCrosscheck(int nIterations)
 {
   fCAIterationsNumberCrosscheck                = nIterations;
-  L1Vector<L1CAIteration>& iterationsContainer = fpParameters->CAIterationsContainer();
+  L1Vector<L1CAIteration>& iterationsContainer = fParameters.fCAIterations;
 
   // NOTE: should be called to prevent multiple copyings of objects between the memory realocations
   iterationsContainer.reserve(nIterations);
@@ -282,9 +311,12 @@ void L1InitManager::SetTargetPosition(double x, double y, double z)
     return;
   }
 
-  fTargetPos[0] = x;
-  fTargetPos[1] = y;
-  fTargetPos[2] = z;
+  /// Fill fvec target fields 
+  fParameters.fTargetPos[0] = x;
+  fParameters.fTargetPos[1] = y;
+  fParameters.fTargetPos[2] = z;
+  /// Set additional field for z component in double precision
+  fTargetZ = z; 
   fInitController.SetFlag(EInitKey::kTargetPos);
 }
 
@@ -302,71 +334,12 @@ void L1InitManager::SetTrackingLevel(int trackingLevel)
 
 //-----------------------------------------------------------------------------------------------------------------------
 //
-void L1InitManager::TransferL1StationArray(std::array<L1Station, L1Constants::size::kMaxNstations>& destinationArray)
-{
-  //
-  // 1) Check, if all fields of this were initialized
-  //
-  {
-    std::stringstream aStream;
-    aStream << "Attempt to pass L1Station array to L1Algo core before all necessary fields initialization\n"
-            << "L1InitManager " << fInitController.ToString();
-    L1MASSERT(0, fInitController.IsFinalized(), aStream.str().c_str());
-  }
-  //
-  // 2) Check, if destinationArraySize is enough for the transfer
-  //
-  {
-    int nStationsTotal = this->GetNstationsActive();
-    std::stringstream aStream;
-    aStream << "Destination array size (" << destinationArray.size()
-            << ") is smaller then the actual number of active tracking stations (" << nStationsTotal << ")";
-    L1MASSERT(0, nStationsTotal <= static_cast<int>(destinationArray.size()), aStream.str().c_str());
-  }
-
-  auto destinationArrayIterator = destinationArray.begin();
-  for (const auto& item : fStationsInfo) {
-    *destinationArrayIterator = item.GetL1Station();
-    ++destinationArrayIterator;
-  }
-  LOG(info) << "L1InitManager: L1Station vector was successfully transfered to L1Algo core";
-}
-
-//-----------------------------------------------------------------------------------------------------------------------
-//
-void L1InitManager::TransferL1MaterialArray(std::array<L1Material, L1Constants::size::kMaxNstations>& destinationArray)
-{
-  //
-  // 1) Check, if all fields of this were initialized
-  //
-  {
-    std::stringstream aStream;
-    aStream << "Attempt to pass L1Station array to L1Algo core before all necessary fields initialization\n"
-            << "L1InitManager " << fInitController.ToString();
-    L1MASSERT(0, fInitController.IsFinalized(), aStream.str().c_str());
-  }
-  //
-  // 2) Check, if destinationArraySize is enough for the transfer
-  //
-  {
-    int nStationsTotal = this->GetNstationsActive();
-    std::stringstream aStream;
-    aStream << "Destination array size (" << destinationArray.size()
-            << ") is smaller then the actual number of active tracking stations (" << nStationsTotal << ")";
-    L1MASSERT(0, nStationsTotal <= static_cast<int>(destinationArray.size()), aStream.str().c_str());
-  }
-
-  auto destinationArrayIterator = destinationArray.begin();
-  for (auto it = fStationsInfo.begin(); it != fStationsInfo.end(); ++it) {
-    auto node                 = fStationsInfo.extract(it);
-    *destinationArrayIterator = std::move(node.value().TakeMaterialMap());
-    fStationsInfo.insert(std::move(node));
-    ++destinationArrayIterator;
-  }
-  LOG(info) << "L1InitManager: L1Material vector was successfully transfered to L1Algo core";
+void L1InitManager::TransferParametersContainer(L1Parameters& destination) {
+  this->FormParametersContainer();
+  destination = std::move(fParameters);
+  LOG(info) << "Parameters object transfered to L1Algo core";
 }
 
-
 //
 // INIT CHECKERS
 //
@@ -380,7 +353,7 @@ void L1InitManager::CheckCAIterationsInit()
   //
   bool ifInitPassed = true;
   if (!fInitController.GetFlag(EInitKey::kCAIterations)) {
-    int nIterationsActual   = fpParameters->CAIterationsContainer().size();
+    int nIterationsActual   = fParameters.fCAIterations.size();
     int nIterationsExpected = fCAIterationsNumberCrosscheck;
     if (nIterationsActual != nIterationsExpected) {
       LOG(warn) << "L1InitManager::CheckCAIterations: incorrect number of iterations registered: " << nIterationsActual
@@ -421,16 +394,12 @@ void L1InitManager::CheckStationsInfoInit()
     //
     int nStationsTotal = fNstationsGeometry[fNstationsGeometry.size() - 1];
     if (nStationsTotal > L1Constants::size::kMaxNstations) {
-      std::stringstream aStream;
-      aStream << "Actual total number of registered stations in geometry (" << nStationsTotal
-              << ") is larger then possible (" << L1Constants::size::kMaxNstations
-              << "). Please, select another set of active tracking detectors or recompile the code with enlarged"
-              << " L1Constants::size::kMaxNstations value";
-      // TODO: We have to provide an instruction of how to increase the kMaxNstations
-      //       number keeping the code consistent (S.Zharko)
-      ifInitPassed = false;
-      L1MASSERT(0, false, aStream.str().c_str());
+      LOG(fatal) << "Actual total number of registered stations in geometry (" << nStationsTotal
+                 << ") is larger then possible (" << L1Constants::size::kMaxNstations
+                 << "). Please, select another set of active tracking detectors or recompile the code with enlarged"
+                 << " L1Constants::size::kMaxNstations value";
     }
   }
+
   fInitController.SetFlag(EInitKey::kStationsInfo, ifInitPassed);
 }
diff --git a/reco/L1/L1Algo/L1InitManager.h b/reco/L1/L1Algo/L1InitManager.h
index 80d523763c..f98a03d640 100644
--- a/reco/L1/L1Algo/L1InitManager.h
+++ b/reco/L1/L1Algo/L1InitManager.h
@@ -129,7 +129,7 @@ public:
   void CheckInit();
   // NOTE: This method calls checkers of large fields initializations like a station or an iteration. The method must be
   //       called in the L1Algo class. (S.Zharko)
-
+  
   /// Gets ghost suppression flag
   int GetGhostSuppression() const { return fGhostSuppression; }
 
@@ -140,7 +140,7 @@ public:
   const InitController_t& GetInitController() const { return fInitController; }
 
   /// Gets a pointer to L1Parameters instance with a posibility of its fields modification
-  const L1Parameters* GetParameters() const { return fpParameters; }
+  //const L1Parameters* GetParameters() const { return fpParameters; }
 
   /// Gets total number of active stations
   int GetNstationsActive() const { return fNstationsActive[fNstationsActive.size() - 1]; }
@@ -160,33 +160,6 @@ public:
     return fNstationsGeometry[static_cast<L1DetectorID_t>(detectorID)];
   }
 
-  /// Calculates global index of station among geometry (accounts for inactive stations)
-  /// \param localIndex  index of the detector subsystem module/station/layer provided by detector subsystem experts
-  /// \param detectorID  ID of the detector subsystem
-  __attribute__((always_inline)) int GetStationIndexGeometry(int localIndex, L1DetectorID detectorID) const
-  {
-    return localIndex
-           + std::accumulate(fNstationsGeometry.cbegin(), fNstationsGeometry.cbegin() + static_cast<int>(detectorID),
-                             0);
-  }
-
-  /// Calculates global index of station used by track finder
-  /// \param localIndex  index of the detector subsystem module/station/layer provided by detector subsystem experts
-  /// \param detectorID  ID of the detector subsystem
-  __attribute__((always_inline)) int GetStationIndexActive(int localIndex, L1DetectorID detectorID) const
-  {
-    return fActiveStationGlobalIDs[GetStationIndexGeometry(localIndex, detectorID)];
-  }
-
-  /// Gets L1FieldRegion object at primary vertex
-  const L1FieldRegion& GetTargetFieldRegion() const { return fTargetFieldRegion; }
-
-  /// Gets L1FieldValue object at primary vertex
-  const L1FieldValue& GetTargetFieldValue() const { return fTargetFieldValue; }
-
-  /// Gets a target position
-  const std::array<double, 3>& GetTargetPosition() const { return fTargetPos; }
-
   /// Gets tracking level
   int GetTrackingLevel() const { return fTrackingLevel; }
 
@@ -234,14 +207,8 @@ public:
   /// Sets target poisition
   void SetTargetPosition(double x, double y, double z);
 
-  /// Transfers an array of L1Stations formed inside a set of L1BaseStationInfo to a destination std::array
-  /// \param destinationArray  Reference to the destination array of L1Station objects in the L1Algo core
-  void TransferL1StationArray(std::array<L1Station, L1Constants::size::kMaxNstations>& destinationArray);
-
-  /// Transfers an array of L1Material tables formed inside a set of L1BaseStationInfo to a destination std::array
-  /// \param destinationArray  Reference to the destination array of L1Material objects in the L1Algo core
-  void TransferL1MaterialArray(std::array<L1Material, L1Constants::size::kMaxNstations>& destinationArray);
-
+  /// Transfers L1Parameters object to the destination
+  void TransferParametersContainer(L1Parameters& destination);
 
 private:
   /// Checker for L1CAIteration container initialization (sets EInitKey::kCAIterations)
@@ -251,6 +218,9 @@ private:
   /// Checker for L1BaseStationInfo set initialization (sets EInitKey::kStationsInfo)
   /// \return true If all L1BaseStationInfo objects were initialized properly. Similar effect can be achieved by
   void CheckStationsInfoInit();
+ 
+  /// Forms parameters container
+  void FormParametersContainer();
 
   /* Basic fields */
 
@@ -259,7 +229,7 @@ private:
 
   /* Target fields */
 
-  std::array<double, /*nDimensions=*/3> fTargetPos {};  ///< Nominal target position coordinates [cm]
+  double fTargetZ {0.};  ///< Target position z component in double precision
 
   /* Stations related fields */
 
@@ -273,29 +243,15 @@ private:
   /// L1DetectorID of the detector subystem. The last array element corresponds to the total number of stations.
   std::array<int, L1Constants::size::kMaxNdetectors + 1> fNstationsGeometry {};
 
-  /// Map of the actual detector indeces to the active detector indeces
-  /// The vector maps actual station index (which is defined by ) to the index of station in tracking. If the station is inactive,
-  /// its index is equal to -1. Example: let stations 1 and 4 be inactive. Then:
-  ///   actual index:  0  1  2  3  4  5  6  7  8  9  0  0  0  0
-  ///   active index:  0 -1  1  2 -1  3  4  5  6  7  0  0  0  0
-  std::array<int, L1Constants::size::kMaxNstations> fActiveStationGlobalIDs {};
-
   /// A function which returns magnetic field vector B in a radius-vector xyz
   L1FieldFunction_t fFieldFunction {[](const double (&)[3], double (&)[3]) {}};
   // NOTE: Stations of daetectors which will not be assigned as active, will not be included in the tracking!
 
-  /* Vertex related fields */
-
-  L1FieldValue fTargetFieldValue {};    ///< L1FieldValue object at target
-  L1FieldRegion fTargetFieldRegion {};  ///< L1FieldRegion object at target
-
   /* CA track finder iterations related */
 
   int fCAIterationsNumberCrosscheck {-1};  ///< Number of iterations to be passed (must be used for cross-checks)
 
-
-  L1Parameters* fpParameters {
-    nullptr};  ///< Pointer to L1Parameters object. NOTE: Owner of the object is L1Algo instance
+  L1Parameters fParameters {}; ///< L1Algo parameters object
 
   int fTrackingLevel {0};     ///< tracking level
   int fGhostSuppression {0};  ///< flag: if true, ghost tracks are suppressed
diff --git a/reco/L1/L1Algo/L1Parameters.cxx b/reco/L1/L1Algo/L1Parameters.cxx
index 888d069e59..d89191e183 100644
--- a/reco/L1/L1Algo/L1Parameters.cxx
+++ b/reco/L1/L1Algo/L1Parameters.cxx
@@ -6,20 +6,108 @@
  * @file L1Parameters.cxx
  * @brief Parameter container for the L1Algo library
  * @since 10.02.2022
+ * @author S.Zharko <s.zharko@gsi.de>
  ***********************************************************************************************************/
 #include "L1Parameters.h"
 
 #include <FairLogger.h>
 
+//------------------------------------------------------------------------------------------------------------------------------------
+//
+L1Parameters::L1Parameters() {}
+
+//------------------------------------------------------------------------------------------------------------------------------------
+//
+L1Parameters::~L1Parameters() noexcept {}
+
+//------------------------------------------------------------------------------------------------------------------------------------
+//
+L1Parameters::L1Parameters(const L1Parameters& other) noexcept
+: fMaxDoubletsPerSinglet(other.fMaxDoubletsPerSinglet),
+  fMaxTripletPerDoublets(other.fMaxTripletPerDoublets),
+  fCAIterations(other.fCAIterations),
+  fTargetPos(other.fTargetPos),
+  fVertexFieldValue(other.fVertexFieldValue),
+  fVertexFieldRegion(other.fVertexFieldRegion),
+  fStations(other.fStations),
+  fThickMap(other.fThickMap),
+  fNstationsActive(other.fNstationsActive),
+  fNstationsGeometry(other.fNstationsGeometry),
+  fActiveStationGlobalIDs(other.fActiveStationGlobalIDs)
+{}
+
+//------------------------------------------------------------------------------------------------------------------------------------
+//
+L1Parameters& L1Parameters::operator=(const L1Parameters& other) noexcept
+{
+  if (this != &other) { L1Parameters(other).Swap(*this); }
+  return *this;
+}
+
+//------------------------------------------------------------------------------------------------------------------------------------
+//
+L1Parameters::L1Parameters(L1Parameters&& other) noexcept
+{
+  this->Swap(other);
+}
+
+//------------------------------------------------------------------------------------------------------------------------------------
+//
+L1Parameters& L1Parameters::operator=(L1Parameters&& other) noexcept
+{
+  if (this != &other) {
+    L1Parameters tmp(std::move(other));
+    this->Swap(tmp);
+  }
+  return *this;
+}
+
+//------------------------------------------------------------------------------------------------------------------------------------
+//
+void L1Parameters::Swap(L1Parameters& other) noexcept
+{
+  std::swap(fMaxDoubletsPerSinglet, other.fMaxDoubletsPerSinglet);
+  std::swap(fMaxTripletPerDoublets, other.fMaxTripletPerDoublets);
+  std::swap(fCAIterations, other.fCAIterations);
+  std::swap(fTargetPos, other.fTargetPos);
+  std::swap(fVertexFieldValue, other.fVertexFieldValue);
+  std::swap(fVertexFieldRegion, other.fVertexFieldRegion);
+  std::swap(fStations, other.fStations);
+  std::swap(fThickMap, other.fThickMap);
+  std::swap(fNstationsActive, other.fNstationsActive);
+  std::swap(fNstationsGeometry, other.fNstationsGeometry);
+  std::swap(fActiveStationGlobalIDs, other.fActiveStationGlobalIDs);
+
+  //for (int i = 0; i < int(L1Constants::size::kMaxNstations); ++i) {
+  //  int tmp = fActiveStationGlobalIDs[i];
+  //  fActiveStationGlobalIDs[i] = other.fActiveStationGlobalIDs[i];
+  //  other.fActiveStationGlobalIDs[i] = tmp;
+  //}
+
+  //for (int i = 0; i < int(L1Constants::size::kMaxNdetectors + 1); ++i) {
+  //  int tmp = fNstationsGeometry[i];
+  //  fNstationsGeometry[i] = other.fNstationsGeometry[i];
+  //  other.fNstationsGeometry[i] = tmp;
+  //}
+
+  //for (int i = 0; i < int(L1Constants::size::kMaxNdetectors + 1); ++i) {
+  //  int tmp = fNstationsActive[i];
+  //  fNstationsActive[i] = other.fNstationsActive[i];
+  //  other.fNstationsActive[i] = tmp;
+  //}
+}
+
+//------------------------------------------------------------------------------------------------------------------------------------
+//
 void L1Parameters::Print(int /*verbosityLevel*/) const
 {
   LOG(info) << "--------------  L1Algo parameters ---------------";
   LOG(info) << ToString();
 }
 
-//----------------------------------------------------------------------------------------------------------------------
+//------------------------------------------------------------------------------------------------------------------------------------
 //
-std::string L1Parameters::ToString(int indentLevel) const
+std::string L1Parameters::ToString(int verbosity, int indentLevel) const
 {
   std::stringstream aStream {};
   constexpr char indentChar = '\t';
@@ -36,8 +124,41 @@ std::string L1Parameters::ToString(int indentLevel) const
   aStream << indent << indentChar << "Max number of doublets per singlet: " << fMaxDoubletsPerSinglet << '\n';
   aStream << indent << indentChar << "Max number of triplets per doublet: " << fMaxTripletPerDoublets << '\n';
   aStream << indent << "CA TRACK FINDER ITERATIONS:\n";
-  for (int idx = 0; idx < static_cast<int>(fCAIterationsContainer.size()); ++idx) {
-    aStream << idx << ") " << fCAIterationsContainer[idx].ToString(indentLevel + 1) << '\n';
+  for (int idx = 0; idx < static_cast<int>(fCAIterations.size()); ++idx) {
+    aStream << idx << ") " << fCAIterations[idx].ToString(indentLevel + 1) << '\n';
+  }
+  aStream << indent << "GEOMETRY:\n";
+  
+  aStream << indent << indentChar << "TARGET:\n";
+  aStream << indent << indentChar << indentChar << "Position (x [cm], y [cm], z[cm]): ";
+  for (int dim = 0; dim < 3 /*nDimensions*/; ++dim ) {
+    aStream << std::setw(12) << std::setfill(' ') << fTargetPos[dim][0] << ' ';
   }
+  aStream << '\n';
+  
+  aStream << indent << indentChar << "NUMBER OF STATIONS:\n";
+  aStream << indent << indentChar << indentChar << "Number of stations (Geometry): ";
+  for (int idx = 0; idx < int(fNstationsGeometry.size()); ++idx ) {
+    if (int(fNstationsGeometry.size() - 2) == idx) { aStream << " | total = "; }
+    aStream << std::setw(2) << std::setfill(' ') << fNstationsGeometry[idx] << ' ';
+  }
+  aStream << '\n';
+  aStream << indent << indentChar << indentChar << "Number of stations (Active): ";
+  for (int idx = 0; idx < int(fNstationsActive.size()); ++idx ) {
+    if (int(fNstationsActive.size() - 2) == idx) { aStream << " | total = "; }
+    aStream << std::setw(2) << std::setfill(' ') << fNstationsActive[idx] << ' ';
+  }
+  aStream << '\n';
+  aStream << indent << indentChar << indentChar << "Active station index: ";
+  for (int idx = 0; idx < *(fNstationsActive.end() - 1); ++idx ) {
+    aStream << std::setw(3) << std::setfill(' ') << fActiveStationGlobalIDs[idx] << ' ';
+  }
+  aStream << '\n';
+  
+  aStream << indent << indentChar << "STATIONS:\n ";
+  for (int idx = 0; idx < *(fNstationsActive.end() - 1); ++idx) {
+    aStream << indent << indentChar << indentChar << fStations[idx].ToString(verbosity) << '\n';
+  }
+
   return aStream.str();
 }
diff --git a/reco/L1/L1Algo/L1Parameters.h b/reco/L1/L1Algo/L1Parameters.h
index 1d53ba3c8b..5fc1873b66 100644
--- a/reco/L1/L1Algo/L1Parameters.h
+++ b/reco/L1/L1Algo/L1Parameters.h
@@ -6,85 +6,202 @@
  * @file L1Parameters.h
  * @brief Parameter container for the L1Algo library
  * @since 19.12.2021
- *
+ * @author S.Zharko <s.zharko@gsi.de>
  ***********************************************************************************************************/
 
 #ifndef L1Parameters_h
 #define L1Parameters_h 1
 
-
 #include "L1CAIteration.h"
 #include "L1Constants.h"
+#include "L1Station.h"
+#include "L1MaterialInfo.h"
+#include "L1Utils.h"
 #include "L1Vector.h"
 
-//#include "utils/L1AlgoFunctions.h"
+#include <type_traits>
+#include <numeric>
+
+class L1InitManager; 
+enum class L1DetectorID;
+
+/// Type definitions for used containers
+using L1IterationsContainer_t = L1Vector<L1CAIteration>;
+using L1StationsContainer_t = std::array<L1Station, L1Constants::size::kMaxNstations>;
+using L1MaterialContainer_t = std::array<L1Material, L1Constants::size::kMaxNstations>;
+  
 
 /// Class L1Parameters represents a container for all external parameters of the L1 tracking algorithm,
 /// including geometry parameters and physics cuts. The instance of the L1Parameters is constructed inside
 /// L1InitManager class and then moved to the L1Algo instance.
-class L1Parameters {
+///
+class alignas(L1Constants::misc::kAlignment) L1Parameters {
+  using L1DetectorID_t = std::underlying_type_t<L1DetectorID>;
 public:
-
   /// Default constructor
-  L1Parameters() = default;
+  L1Parameters();
   
   /// Destructor
-  ~L1Parameters() = default;
+  ~L1Parameters() noexcept;
   
   /// Copy constructor
-  L1Parameters(const L1Parameters& other) = default;
+  L1Parameters(const L1Parameters& other) noexcept;
   
   /// Copy assignment operator
-  L1Parameters& operator=(const L1Parameters& other) = default;
+  L1Parameters& operator=(const L1Parameters& other) noexcept;
   
   /// Move constructor
-  L1Parameters(L1Parameters&& other) = default;
+  L1Parameters(L1Parameters&& other) noexcept;
   
   /// Move assignment operator
-  L1Parameters& operator=(L1Parameters&& other) = default;
+  L1Parameters& operator=(L1Parameters&& other) noexcept;
 
-  //
-  // BASIC METHODS
-  //
+  /// Swap method
+  void Swap(L1Parameters& other) noexcept;
 
   /// Prints configuration
   void Print(int verbosityLevel = 0) const;
-  /// String representation of the class contents
-  std::string ToString(int indentLevel = 0) const;
 
-  // TODO: change constant names with actual (human) names
-
-  //-------------------------------------------------------------------------------------------------------//
-  //    Runtime constants                                                                                  //
-  //-------------------------------------------------------------------------------------------------------//
+  /// String representation of the class contents
+  std::string ToString(int verbosity = 0, int indentLevel = 0) const;
 
-  //
-  // SETTERS
-  //
   /// Sets upper-bound cut on max number of doublets per one singlet
   void SetMaxDoubletsPerSinglet(unsigned int value) { fMaxDoubletsPerSinglet = value; }
+  
   /// Sets upper-bound cut on max number of triplets per one doublet
   void SetMaxTripletPerDoublets(unsigned int value) { fMaxTripletPerDoublets = value; }
 
-  //
-  // GETTERS
-  //
   /// Gets upper-bound cut on max number of doublets per one singlet
   unsigned int GetMaxDoubletsPerSinglet() const { return fMaxDoubletsPerSinglet; }
+  
   /// Gets upper-bound cut on max number of triplets per one doublet
   unsigned int GetMaxTripletPerDoublets() const { return fMaxTripletPerDoublets; }
-
-  /// Provides access to L1CAIteration vector (modifiable)
-  L1Vector<L1CAIteration>& CAIterationsContainer() { return fCAIterationsContainer; }
+  
+  /// Gets total number of active stations
+  int GetNstationsActive() const { return fNstationsActive[fNstationsActive.size() - 1]; }
+
+  /// Gets number of active stations for given detector ID
+  int GetNstationsActive(L1DetectorID detectorID) const
+  {
+    return fNstationsActive[static_cast<L1DetectorID_t>(detectorID)];
+  }
+
+  /// Gets total number of stations, provided by setup geometry
+  int GetNstationsGeometry() const { return fNstationsGeometry[fNstationsGeometry.size() - 1]; }
+
+  /// Gets number of stations, provided by setup geometry for given detector ID
+  int GetNstationsGeometry(L1DetectorID detectorID) const
+  {
+    return fNstationsGeometry[static_cast<L1DetectorID_t>(detectorID)];
+  }
+
+  /// Calculates global index of station among geometry (accounts for inactive stations)
+  /// \param localIndex  index of the detector subsystem module/station/layer provided by detector subsystem experts
+  /// \param detectorID  ID of the detector subsystem
+  __attribute__((always_inline)) int GetStationIndexGeometry(int localIndex, L1DetectorID detectorID) const
+  {
+    return localIndex
+           + std::accumulate(fNstationsGeometry.cbegin(), fNstationsGeometry.cbegin() + static_cast<int>(detectorID), 0);
+  }
+
+  /// Calculates global index of station used by track finder
+  /// \param localIndex  index of the detector subsystem module/station/layer provided by detector subsystem experts
+  /// \param detectorID  ID of the detector subsystem
+  __attribute__((always_inline)) int GetStationIndexActive(int localIndex, L1DetectorID detectorID) const
+  {
+    return fActiveStationGlobalIDs[GetStationIndexGeometry(localIndex, detectorID)];
+  }
+  
   /// Provides access to L1CAIteration vector (const)
-  const L1Vector<L1CAIteration>& CAIterationsContainer() const { return fCAIterationsContainer; }
+  const L1IterationsContainer_t& GetCAIterations() const { return fCAIterations; }
+
+  /// Provides access to L1Stations container (const)
+  const L1StationsContainer_t& GetStations() const { return fStations; }
+  
+  /// Gets reference to the particular station
+  /// \param iStation  Index of station in the active stations container
+  const L1Station& GetStation(int iStation) const { return fStations[iStation]; }
+
+  /// Gets reference to the array of station thickness map
+  const L1MaterialContainer_t& GetThicknessMaps() const { return fThickMap; }
+  
+  /// Gets material thickness in units of radiation length in a point on the XY plane for a selected station
+  /// \param iStActive  Global index of an active station
+  /// \param xPos       Position of the point in X dimension [cm]
+  /// \param yPos       Position of the point in Y dimension [cm]
+  float GetMaterialThickness(int iStActive, float xPos, float yPos) const
+  {
+    return fThickMap[iStActive].GetRadThick(xPos, yPos);
+  }
+
+  /// Gets material thickness in units of radiation length in a point on the XY plane for a selected station
+  /// \param iStActive  Global index of an active station
+  /// \param xPos       Position of the point in X dimension [cm] (SIMDized vector)
+  /// \param yPos       Position of the point in Y dimension [cm] (SIMDized vector)
+  fvec GetMaterialThickness(int iStActive, fvec xPos, fvec yPos) const
+  {
+    return fThickMap[iStActive].GetRadThick(xPos, yPos);
+  }
+
+  /// Gets target position
+  /// \param iDimension  Component of target position: 0 - x, 1 - y, 2 - z
+  fvec GetTargetPositionX() const { return fTargetPos[0]; }
+  fvec GetTargetPositionY() const { return fTargetPos[1]; }
+  fvec GetTargetPositionZ() const { return fTargetPos[2]; }
+  
+  /// Gets L1FieldRegion object at primary vertex
+  const L1FieldRegion& GetVertexFieldRegion() const { return fVertexFieldRegion; }
+
+  /// Gets L1FieldValue object at primary vertex
+  const L1FieldValue& GetVertexFieldValue() const { return fVertexFieldValue; }
 
 
 private:
+  
   unsigned int fMaxDoubletsPerSinglet {150};  ///< Upper-bound cut on max number of doublets per one singlet
   unsigned int fMaxTripletPerDoublets {15};   ///< Upper-bound cut on max number of triplets per one doublet
 
-  L1Vector<L1CAIteration> fCAIterationsContainer {};  ///< L1 Track finder iterations vector
+  alignas(L1Constants::misc::kAlignment) L1IterationsContainer_t fCAIterations {};  ///< L1 Track finder iterations vector
+
+  /*************************
+   ** Geometry parameters **
+   *************************/
+  /// Target position
+  alignas(L1Constants::misc::kAlignment) std::array<fvec, /*nDimensions*/3> fTargetPos {L1Utils::kNaN, L1Utils::kNaN, L1Utils::kNaN};
+
+  /// Field value object at primary vertex (between target and the first station)
+  alignas(L1Constants::misc::kAlignment) L1FieldValue fVertexFieldValue {};
+  
+  /// Field value object at primary vertex (between target and the first station)
+  alignas(L1Constants::misc::kAlignment) L1FieldRegion fVertexFieldRegion {};
+
+  /// Array of stations 
+  alignas(L1Constants::misc::kAlignment) L1StationsContainer_t fStations {};
+
+  /// Array of station thickness map
+  alignas(L1Constants::misc::kAlignment) L1MaterialContainer_t fThickMap {};
+
+  /// Numbers of stations, which are active in tracking. Index of an array element (except the last one) corresponds to a given
+  /// L1DetectorID of the detector subystem. The last array element corresponds to the total number of stations.
+  alignas(L1Constants::misc::kAlignment) std::array<int, (L1Constants::size::kMaxNdetectors + 1)> fNstationsActive {};
+
+  /// Actual numbers of stations, provided by geometry. Index of an array element (except the last one) corresponds to a given
+  /// L1DetectorID of the detector subystem. The last array element corresponds to the total number of stations.
+  alignas(L1Constants::misc::kAlignment) std::array<int, (L1Constants::size::kMaxNdetectors + 1)> fNstationsGeometry {};
+
+  /// Map of the actual detector indeces to the active detector indeces
+  /// The vector maps actual station index (which is defined by ) to the index of station in tracking. If the station is inactive,
+  /// its index is equal to -1. Example: let stations 1 and 4 be inactive. Then:
+  ///   actual index:  0  1  2  3  4  5  6  7  8  9  0  0  0  0
+  ///   active index:  0 -1  1  2 -1  3  4  5  6  7  0  0  0  0
+  alignas(L1Constants::misc::kAlignment) std::array<int, L1Constants::size::kMaxNstations> fActiveStationGlobalIDs {};
+ 
+  /********************************
+   ** Friend classes declaration **
+   ********************************/
+
+  /// Note provide friend access to L1InitManager (TODO: L1Algo auch?)
+  friend class L1InitManager;
 };
 
 #endif  // L1Parameters_h
diff --git a/reco/L1/L1Algo/L1TrackExtender.cxx b/reco/L1/L1Algo/L1TrackExtender.cxx
index 1746a9e9bb..accccec020 100644
--- a/reco/L1/L1Algo/L1TrackExtender.cxx
+++ b/reco/L1/L1Algo/L1TrackExtender.cxx
@@ -48,9 +48,9 @@ void L1Algo::BranchFitterFast(const L1Branch& t, L1TrackPar& T, const bool dir,
   int ista1 = GetFStation((*fStripFlag)[hit1.f]);
   int ista2 = GetFStation((*fStripFlag)[hit2.f]);
 
-  L1Station& sta0 = fStations[ista0];
-  L1Station& sta1 = fStations[ista1];
-  L1Station& sta2 = fStations[ista2];
+  const L1Station& sta0 = fParameters.GetStation(ista0);
+  const L1Station& sta1 = fParameters.GetStation(ista1);
+  const L1Station& sta2 = fParameters.GetStation(ista2);
 
   fvec u0 = hit0.u;
   fvec v0 = hit0.v;
@@ -126,7 +126,7 @@ void L1Algo::BranchFitterFast(const L1Branch& t, L1TrackPar& T, const bool dir,
     ista_prev        = ista;
     ista             = GetFStation((*fStripFlag)[hit.f]);
 
-    L1Station& sta = fStations[ista];
+    const L1Station& sta = fParameters.GetStation(ista);
 
     float z_sta = hit.z;
 
@@ -213,9 +213,9 @@ void L1Algo::FindMoreHits(L1Branch& t, L1TrackPar& T, const bool dir,
   const int ista1 = GetFStation((*fStripFlag)[hit1.f]);
   const int ista2 = GetFStation((*fStripFlag)[hit2.f]);
 
-  const L1Station& sta0 = fStations[ista0];
-  const L1Station& sta1 = fStations[ista1];
-  const L1Station& sta2 = fStations[ista2];
+  const L1Station& sta0 = fParameters.GetStation(ista0);
+  const L1Station& sta1 = fParameters.GetStation(ista1);
+  const L1Station& sta2 = fParameters.GetStation(ista2);
 
   fvec u0 = hit0.u;
   fvec v0 = hit0.v;
@@ -252,7 +252,7 @@ void L1Algo::FindMoreHits(L1Branch& t, L1TrackPar& T, const bool dir,
 
   for (; (ista < fNstations) && (ista >= 0); ista += step) {  // CHECKME why ista2?
 
-    L1Station& sta = fStations[ista];
+    const L1Station& sta = fParameters.GetStation(ista);
 
     fvec dz = sta.z - T.z;
 
@@ -267,7 +267,7 @@ void L1Algo::FindMoreHits(L1Branch& t, L1TrackPar& T, const bool dir,
     fscal r2_best = 1e8;  // best distance to hit
     int iHit_best = -1;   // index of the best hit
 
-    const fscal iz = 1.f / (T.z[0] - fRealTargetZ[0]);
+    const fscal iz = 1.f / (T.z[0] - fParameters.GetTargetPositionZ()[0]);
 
 
     L1HitAreaTime area(vGridTime[ista], T.x[0] * iz, T.y[0] * iz,
diff --git a/reco/L1/L1Algo/L1TrackFitter.cxx b/reco/L1/L1Algo/L1TrackFitter.cxx
index e2573416c3..da954dee68 100644
--- a/reco/L1/L1Algo/L1TrackFitter.cxx
+++ b/reco/L1/L1Algo/L1TrackFitter.cxx
@@ -61,9 +61,9 @@ void L1Algo::KFTrackFitter_simple()  // TODO: Add pipe.
         int ista2 = (*fStripFlag)[hit2.f] / 4;
 
         //cout<<"back: ista012="<<ista0<<" "<<ista1<<" "<<ista2<<endl;
-        L1Station& sta0 = fStations[ista0];
-        L1Station& sta1 = fStations[ista1];
-        L1Station& sta2 = fStations[ista2];
+        const L1Station& sta0 = fParameters.GetStation(ista0);
+        const L1Station& sta1 = fParameters.GetStation(ista1);
+        const L1Station& sta2 = fParameters.GetStation(ista2);
 
         fvec u0 = hit0.u;
         fvec v0 = hit0.v;
@@ -129,14 +129,14 @@ void L1Algo::KFTrackFitter_simple()  // TODO: Add pipe.
           const L1Hit& hit = (*vStsHits)[hits[i]];
           ista             = (*fStripFlag)[hit.f] / 4;
 
-          L1Station& sta = fStations[ista];
+          const L1Station& sta = fParameters.GetStation(ista);
 
           //    L1Extrapolate( T, hit.z, qp0, fld );
           L1ExtrapolateLine(T, hit.z);
 //           T.L1Extrapolate( sta.z, qp0, fld );
 //         L1Extrapolate( T, hit.z, qp0, fld );
           if constexpr (L1Constants::control::kIfUseRadLengthTable) {
-            fit.L1AddMaterial(T, fRadThick[i].GetRadThick(T.x, T.y), qp0, ONE);
+            fit.L1AddMaterial(T, fParameters.GetMaterialThickness(i, T.x, T.y), qp0, ONE);
           }
           else {
             fit.L1AddMaterial(T, sta.materialInfo, qp0, ONE);
@@ -202,9 +202,9 @@ void L1Algo::KFTrackFitter_simple()  // TODO: Add pipe.
         int ista1 = GetFStation((*fStripFlag)[hit1.f]);
         int ista2 = GetFStation((*fStripFlag)[hit2.f]);
 
-        L1Station& sta0 = fStations[ista0];
-        L1Station& sta1 = fStations[ista1];
-        L1Station& sta2 = fStations[ista2];
+        const L1Station& sta0 = fParameters.GetStation(ista0);
+        const L1Station& sta1 = fParameters.GetStation(ista1);
+        const L1Station& sta2 = fParameters.GetStation(ista2);
 
         fvec u0 = hit0.u;
         fvec v0 = hit0.v;
@@ -264,7 +264,7 @@ void L1Algo::KFTrackFitter_simple()  // TODO: Add pipe.
         for (int i = 1; i < nHits; i++) {
           const L1Hit& hit = (*vStsHits)[hits[i]];
           ista             = (*fStripFlag)[hit.f] / 4;
-          L1Station& sta   = fStations[ista];
+          const L1Station& sta   = fParameters.GetStation(ista);
           fvec u           = hit.u;
           fvec v           = hit.v;
           fvec x, y;
@@ -275,7 +275,7 @@ void L1Algo::KFTrackFitter_simple()  // TODO: Add pipe.
 //           T.L1Extrapolate( sta.z, qp0, fld );
 //           L1Extrapolate( T, hit.z, qp0, fld );
           if constexpr (L1Constants::control::kIfUseRadLengthTable) {
-            fit.L1AddMaterial(T, fRadThick[i].GetRadThick(T.x, T.y), qp0, ONE);
+            fit.L1AddMaterial(T, fParameters.GetMaterialThickness(i, T.x, T.y), qp0, ONE);
           }
           else {
             fit.L1AddMaterial(T, sta.materialInfo, qp0, ONE);
@@ -352,7 +352,7 @@ void L1Algo::L1KFTrackFitter()
 
   L1Track* t[fvecLen];
 
-  L1Station* sta = fStations.begin();
+  const L1Station* sta = fParameters.GetStations().begin();
   L1Station staFirst, staLast;
   fvec x[L1Constants::size::kMaxNstations], u[L1Constants::size::kMaxNstations], v[L1Constants::size::kMaxNstations],
     y[L1Constants::size::kMaxNstations], time[L1Constants::size::kMaxNstations], timeEr[L1Constants::size::kMaxNstations],
@@ -445,7 +445,7 @@ void L1Algo::L1KFTrackFitter()
       fscal cursy = 0., curSy = 0.;
       for (i = nHitsTrack - 1; i >= 0; i--) {
         const int ista   = iSta[i];
-        L1Station& st    = fStations[ista];
+        const L1Station& st    = fParameters.GetStation(ista);
         const fscal curZ = z[ista][iVec];
         fscal dZ         = curZ - prevZ;
         fscal By         = st.fieldSlice.cy[0][0];
@@ -522,11 +522,11 @@ void L1Algo::L1KFTrackFitter()
           T1.EnergyLossCorrection(fit.PipeRadThick, qp01, fvec(1.f), wIn);
         }
         if constexpr (L1Constants::control::kIfUseRadLengthTable) {
-          fit.L1AddMaterial(T, fRadThick[i].GetRadThick(T.x, T.y), qp0, wIn);
-          fit.EnergyLossCorrection(T, fRadThick[i].GetRadThick(T.x, T.y), qp0, fvec(1.f), wIn);
+          fit.L1AddMaterial(T, fParameters.GetMaterialThickness(i, T.x, T.y), qp0, wIn);
+          fit.EnergyLossCorrection(T, fParameters.GetMaterialThickness(i, T.x, T.y), qp0, fvec(1.f), wIn);
 
-          T1.L1AddMaterial(fRadThick[i].GetRadThick(T1.fx, T1.fy), qp01, wIn);
-          T1.EnergyLossCorrection(fRadThick[i].GetRadThick(T1.fx, T1.fy), qp01, fvec(1.f), wIn);
+          T1.L1AddMaterial(fParameters.GetMaterialThickness(i, T1.fx, T1.fy), qp01, wIn);
+          T1.EnergyLossCorrection(fParameters.GetMaterialThickness(i, T1.fx, T1.fy), qp01, fvec(1.f), wIn);
         }
         else {
           fit.L1AddMaterial(T, sta[i].materialInfo, qp0, wIn);
@@ -682,11 +682,11 @@ void L1Algo::L1KFTrackFitter()
           T1.EnergyLossCorrection(fit.PipeRadThick, qp01, fvec(-1.f), wIn);
         }
         if constexpr (L1Constants::control::kIfUseRadLengthTable) {
-          fit.L1AddMaterial(T, fRadThick[i].GetRadThick(T.x, T.y), qp0, wIn);
-          fit.EnergyLossCorrection(T, fRadThick[i].GetRadThick(T.x, T.y), qp0, fvec(-1.f), wIn);
+          fit.L1AddMaterial(T, fParameters.GetMaterialThickness(i, T.x, T.y), qp0, wIn);
+          fit.EnergyLossCorrection(T, fParameters.GetMaterialThickness(i, T.x, T.y), qp0, fvec(-1.f), wIn);
 
-          T1.L1AddMaterial(fRadThick[i].GetRadThick(T1.fx, T1.fy), qp01, wIn);
-          T1.EnergyLossCorrection(fRadThick[i].GetRadThick(T1.fx, T1.fy), qp01, fvec(-1.f), wIn);
+          T1.L1AddMaterial(fParameters.GetMaterialThickness(i, T1.fx, T1.fy), qp01, wIn);
+          T1.EnergyLossCorrection(fParameters.GetMaterialThickness(i, T1.fx, T1.fy), qp01, fvec(-1.f), wIn);
         }
         else {
           fit.L1AddMaterial(T, sta[i].materialInfo, qp0, wIn);
@@ -778,7 +778,7 @@ void L1Algo::L1KFTrackFitterMuch()
 
   L1Track* t[fvecLen];
 
-  L1Station* sta = fStations.begin();
+  const L1Station* sta = fParameters.GetStations().begin();
   L1Station staFirst, staLast;
   fvec x[L1Constants::size::kMaxNstations], u[L1Constants::size::kMaxNstations], v[L1Constants::size::kMaxNstations],
     y[L1Constants::size::kMaxNstations], time[L1Constants::size::kMaxNstations], timeEr[L1Constants::size::kMaxNstations],
@@ -884,7 +884,7 @@ void L1Algo::L1KFTrackFitterMuch()
       //   for(i = nHitsTrack - 1; i >= 0; i-- ){
       for (i = 0; i < nHitsTrackSts; i++) {
         const int ista   = iSta[i];
-        L1Station& st    = fStations[ista];
+        const L1Station& st    = fParameters.GetStation(ista);
         const fscal curZ = z[ista][iVec];
         fscal dZ         = curZ - prevZ;
         fscal By         = st.fieldSlice.cy[0][0];
@@ -966,9 +966,9 @@ void L1Algo::L1KFTrackFitterMuch()
           fldZ1 = fldZ0;
 
           if constexpr (L1Constants::control::kIfUseRadLengthTable) {
-            T1.EnergyLossCorrection(fRadThick[i].GetRadThick(T1.fx, T1.fy), qp01, fvec(-1.f), wIn);
+            T1.EnergyLossCorrection(fParameters.GetMaterialThickness(i, T1.fx, T1.fy), qp01, fvec(-1.f), wIn);
 
-            T1.L1AddThickMaterial(fRadThick[i].GetRadThick(T1.fx, T1.fy), qp01, wIn, sta[i].materialInfo.thick, 1);
+            T1.L1AddThickMaterial(fParameters.GetMaterialThickness(i, T1.fx, T1.fy), qp01, wIn, sta[i].materialInfo.thick, 1);
           }
           else {
             //         L1AddMaterial( T, sta[i].materialInfo, qp0, wIn );
@@ -1039,18 +1039,19 @@ void L1Algo::L1KFTrackFitterMuch()
 
 //          T1.ExtrapolateLine( z_last, &w1);
 //          L1ExtrapolateLine( T, z_last);
+//          TODO: Unify energy loss corrections (S.Zharko)
             if constexpr (L1Constants::control::kIfUseRadLengthTable) {
               if (i == 11 || i == 14 || i == 17)
-                T1.EnergyLossCorrectionIron(fRadThick[i].GetRadThick(T1.fx, T1.fy) / (nofSteps + 1), qp01, fvec(-1.f),
+                T1.EnergyLossCorrectionIron(fParameters.GetMaterialThickness(i, T1.fx, T1.fy) / (nofSteps + 1), qp01, fvec(-1.f),
                                             wIn);
               if (i == 8)
-                T1.EnergyLossCorrectionCarbon(fRadThick[i].GetRadThick(T1.fx, T1.fy) / (nofSteps + 1), qp01, fvec(-1.f),
+                T1.EnergyLossCorrectionCarbon(fParameters.GetMaterialThickness(i, T1.fx, T1.fy) / (nofSteps + 1), qp01, fvec(-1.f),
                                               wIn);
               if (i == 9 || i == 10 || i == 12 || i == 13 || i == 15 || i == 16 || i == 18 || i == 19)
-                T1.EnergyLossCorrectionAl(fRadThick[i].GetRadThick(T1.fx, T1.fy) / (nofSteps + 1), qp01, fvec(-1.f),
+                T1.EnergyLossCorrectionAl(fParameters.GetMaterialThickness(i, T1.fx, T1.fy) / (nofSteps + 1), qp01, fvec(-1.f),
                                           wIn);
 
-              T1.L1AddThickMaterial(fRadThick[i].GetRadThick(T1.fx, T1.fy) / (nofSteps + fvec(1)), qp01, wIn,
+              T1.L1AddThickMaterial(fParameters.GetMaterialThickness(i, T1.fx, T1.fy) / (nofSteps + fvec(1)), qp01, wIn,
                                     sta[i].materialInfo.thick / (nofSteps + fvec(1)), 1);
 
               wIn = wIn & (one - mask1);
@@ -1130,9 +1131,9 @@ void L1Algo::L1KFTrackFitterMuch()
       //       fvec initialised = fvec(z[i] < z_end) & fvec(z_start <= z[i]);
       //       fvec wIn = (ONE  & (initialised));
 
-      //       T1.EnergyLossCorrectionAl( fRadThick[i].GetRadThick(T1.fx, T1.fy), qp01, fvec(1.f), wIn);
+      //       T1.EnergyLossCorrectionAl( fParameters.GetMaterialThickness(i, T1.fx, T1.fy), qp01, fvec(1.f), wIn);
       //
-      //       T1.L1AddThickMaterial(fRadThick[i].GetRadThick(T1.fx, T1.fy), qp01, ONE, sta[i].materialInfo.thick, 0);
+      //       T1.L1AddThickMaterial(fParameters.GetMaterialThickness(i, T1.fx, T1.fy), qp01, ONE, sta[i].materialInfo.thick, 0);
 
       for (--i; i >= 0; i--) {
 
@@ -1179,18 +1180,18 @@ void L1Algo::L1KFTrackFitterMuch()
 
             T1.ExtrapolateLine(z_cur, &w2);
             nofSteps1 = nofSteps1 + (one - mask1);
-
+            // TODO: Unify the selection of energy loss correction! (S.Zharko)
             if constexpr (L1Constants::control::kIfUseRadLengthTable) {
               if (i == 11 || i == 14 || i == 17)
-                T1.EnergyLossCorrectionIron(fRadThick[i].GetRadThick(T1.fx, T1.fy) / (nofSteps + 1), qp01, fvec(1.f),
+                T1.EnergyLossCorrectionIron(fParameters.GetMaterialThickness(i, T1.fx, T1.fy) / (nofSteps + 1), qp01, fvec(1.f),
                                             w2);
               if (i == 8)
-                T1.EnergyLossCorrectionCarbon(fRadThick[i].GetRadThick(T1.fx, T1.fy) / (nofSteps + 1), qp01, fvec(1.f),
+                T1.EnergyLossCorrectionCarbon(fParameters.GetMaterialThickness(i, T1.fx, T1.fy) / (nofSteps + 1), qp01, fvec(1.f),
                                               w2);
               if (i == 9 || i == 10 || i == 12 || i == 13 || i == 15 || i == 16 || i == 18)
-                T1.EnergyLossCorrectionAl(fRadThick[i].GetRadThick(T1.fx, T1.fy) / (nofSteps + 1), qp01, fvec(1.f), w2);
+                T1.EnergyLossCorrectionAl(fParameters.GetMaterialThickness(i, T1.fx, T1.fy) / (nofSteps + 1), qp01, fvec(1.f), w2);
 
-              T1.L1AddThickMaterial(fRadThick[i].GetRadThick(T1.fx, T1.fy) / (nofSteps + fvec(1)), qp01, w2,
+              T1.L1AddThickMaterial(fParameters.GetMaterialThickness(i, T1.fx, T1.fy) / (nofSteps + fvec(1)), qp01, w2,
                                     sta[i].materialInfo.thick / (nofSteps + fvec(1)), 0);
 
               w2 = w2 & (one - mask1);
@@ -1255,8 +1256,8 @@ void L1Algo::L1KFTrackFitterMuch()
 
 
           if constexpr (L1Constants::control::kIfUseRadLengthTable) {
-            T1.EnergyLossCorrection(fRadThick[i].GetRadThick(T1.fx, T1.fy), qp01, fvec(1.f), wIn);
-            T1.L1AddThickMaterial(fRadThick[i].GetRadThick(T1.fx, T1.fy), qp01, wIn, sta[i].materialInfo.thick, 0);
+            T1.EnergyLossCorrection(fParameters.GetMaterialThickness(i, T1.fx, T1.fy), qp01, fvec(1.f), wIn);
+            T1.L1AddThickMaterial(fParameters.GetMaterialThickness(i, T1.fx, T1.fy), qp01, wIn, sta[i].materialInfo.thick, 0);
           }
           else {
             fit.L1AddMaterial(T, sta[i].materialInfo, qp0, wIn);
diff --git a/reco/L1/L1Algo/L1TrackParFit.cxx b/reco/L1/L1Algo/L1TrackParFit.cxx
index 07f1efefd9..e11876b3e6 100644
--- a/reco/L1/L1Algo/L1TrackParFit.cxx
+++ b/reco/L1/L1Algo/L1TrackParFit.cxx
@@ -808,7 +808,7 @@ void L1TrackParFit::L1AddThickMaterial(fvec radThick, fvec qp0, fvec w, fvec thi
 }
 
 
-void L1TrackParFit::L1AddMaterial(L1MaterialInfo& info, fvec qp0, fvec w)
+void L1TrackParFit::L1AddMaterial(const L1MaterialInfo& info, fvec qp0, fvec w)
 {
   cnst ONE = 1.f;
 
diff --git a/reco/L1/L1Algo/L1TrackParFit.h b/reco/L1/L1Algo/L1TrackParFit.h
index d292523520..ce9e5634c9 100644
--- a/reco/L1/L1Algo/L1TrackParFit.h
+++ b/reco/L1/L1Algo/L1TrackParFit.h
@@ -113,7 +113,7 @@ public:
   void ExtrapolateLine1(fvec z_out, fvec* w = 0, fvec v = 0);
   void Compare(L1TrackPar& T);
   void EnergyLossCorrection(const fvec& radThick, fvec& qp0, fvec direction, fvec w);
-  void L1AddMaterial(L1MaterialInfo& info, fvec qp0, fvec w = 1);
+  void L1AddMaterial(const L1MaterialInfo& info, fvec qp0, fvec w = 1);
 
   void L1AddMaterial(fvec radThick, fvec qp0, fvec w = 1);
 
diff --git a/reco/L1/L1Algo/utils/L1AlgoDraw.cxx b/reco/L1/L1Algo/utils/L1AlgoDraw.cxx
index 6720dbb40b..a4f2fa8642 100644
--- a/reco/L1/L1Algo/utils/L1AlgoDraw.cxx
+++ b/reco/L1/L1Algo/utils/L1AlgoDraw.cxx
@@ -82,7 +82,7 @@ void L1AlgoDraw::InitL1Draw(L1Algo* algo_)
   for (int i = 0; i < NStations; i++) {
     StsHitsStartIndex[i] = algo->StsHitsStartIndex[i];
     StsHitsStopIndex[i]  = algo->StsHitsStopIndex[i];
-    vStations[i]         = algo->GetStations()[i];
+    vStations[i]         = algo->GetParameters()->GetStation(i);
   }
 }
 
diff --git a/reco/L1/ParticleFinder/CbmL1PFFitter.cxx b/reco/L1/ParticleFinder/CbmL1PFFitter.cxx
index 1e431d1713..1dc9c06b1b 100644
--- a/reco/L1/ParticleFinder/CbmL1PFFitter.cxx
+++ b/reco/L1/ParticleFinder/CbmL1PFFitter.cxx
@@ -107,7 +107,7 @@ void CbmL1PFFitter::Fit(vector<CbmStsTrack>& Tracks, vector<int>& pidHypo)
   CbmStsTrack* t[fvecLen];
 
   int ista;
-  const L1Station* sta = CbmL1::Instance()->algo->GetStations().begin();
+  const L1Station* sta = CbmL1::Instance()->algo->GetParameters()->GetStations().begin();
   L1Station staFirst, staLast;
   fvec* x = new fvec[nHits];
   fvec* u = new fvec[nHits];
@@ -187,7 +187,7 @@ void CbmL1PFFitter::Fit(vector<CbmStsTrack>& Tracks, vector<int>& pidHypo)
           posz = hit->GetZ();
           // ista = hit->GetStationNr();
           ista =
-            CbmL1::Instance()->algo->GetInitManager()->GetStationIndexActive(hit->GetStationNr(), L1DetectorID::kMvd);
+            CbmL1::Instance()->algo->GetParameters()->GetStationIndexActive(hit->GetStationNr(), L1DetectorID::kMvd);
           if (ista == -1) continue;
         }
         else {
@@ -200,7 +200,7 @@ void CbmL1PFFitter::Fit(vector<CbmStsTrack>& Tracks, vector<int>& pidHypo)
           posz = hit->GetZ();
           //  ista = CbmStsSetup::Instance()->GetStationNumber(hit->GetAddress())
           //       + NMvdStations;  //hit->GetStationNr() - 1 + NMvdStations;
-          ista = CbmL1::Instance()->algo->GetInitManager()->GetStationIndexActive(
+          ista = CbmL1::Instance()->algo->GetParameters()->GetStationIndexActive(
             CbmStsSetup::Instance()->GetStationNumber(hit->GetAddress()), L1DetectorID::kSts);
           if (ista == -1) continue;
         }
@@ -262,8 +262,8 @@ void CbmL1PFFitter::Fit(vector<CbmStsTrack>& Tracks, vector<int>& pidHypo)
         fit.EnergyLossCorrection(T, fit.PipeRadThick, qp0, fvec(-1.f), wIn);
       }
       if constexpr (L1Constants::control::kIfUseRadLengthTable) {
-        fit.L1AddMaterial(T, CbmL1::Instance()->algo->GetMaterialThickness(i, T.x, T.y), qp0, wIn);
-        fit.EnergyLossCorrection(T, CbmL1::Instance()->algo->GetMaterialThickness(i, T.x, T.y), qp0, -1, wIn);
+        fit.L1AddMaterial(T, CbmL1::Instance()->algo->GetParameters()->GetMaterialThickness(i, T.x, T.y), qp0, wIn);
+        fit.EnergyLossCorrection(T, CbmL1::Instance()->algo->GetParameters()->GetMaterialThickness(i, T.x, T.y), qp0, -1, wIn);
       }
       else {
         fit.L1AddMaterial(T, sta[i].materialInfo, qp0, wIn);
@@ -338,8 +338,8 @@ void CbmL1PFFitter::Fit(vector<CbmStsTrack>& Tracks, vector<int>& pidHypo)
         fit.EnergyLossCorrection(T, fit.PipeRadThick, qp0, fvec(1.f), wIn);
       }
       if constexpr (L1Constants::control::kIfUseRadLengthTable) {
-        fit.L1AddMaterial(T, CbmL1::Instance()->algo->GetMaterialThickness(i, T.x, T.y), qp0, wIn);
-        fit.EnergyLossCorrection(T, CbmL1::Instance()->algo->GetMaterialThickness(i, T.x, T.y), qp0, 1, wIn);
+        fit.L1AddMaterial(T, CbmL1::Instance()->algo->GetParameters()->GetMaterialThickness(i, T.x, T.y), qp0, wIn);
+        fit.EnergyLossCorrection(T, CbmL1::Instance()->algo->GetParameters()->GetMaterialThickness(i, T.x, T.y), qp0, 1, wIn);
       }
       else {
         fit.L1AddMaterial(T, sta[i].materialInfo, qp0, wIn);
@@ -406,7 +406,7 @@ void CbmL1PFFitter::GetChiToVertex(vector<CbmStsTrack>& Tracks, vector<L1FieldRe
 
   int nStations        = CbmL1::Instance()->algo->GetNstations();
   int NMvdStations     = CbmL1::Instance()->algo->GetNstationsBeforePipe();
-  const L1Station* sta = CbmL1::Instance()->algo->GetStations().begin();
+  const L1Station* sta = CbmL1::Instance()->algo->GetParameters()->GetStations().begin();
   fvec* zSta       = new fvec[nStations];
   for (int iSta = 0; iSta < nStations; iSta++)
     zSta[iSta] = sta[iSta].z;
@@ -488,8 +488,8 @@ void CbmL1PFFitter::GetChiToVertex(vector<CbmStsTrack>& Tracks, vector<L1FieldRe
       }
     }
 
-    fB[0]     = CbmL1::Instance()->algo->GetVtxFieldValue();
-    zField[0] = CbmL1::Instance()->algo->GetTargetZ();
+    fB[0]     = CbmL1::Instance()->algo->GetParameters()->GetVertexFieldValue();
+    zField[0] = CbmL1::Instance()->algo->GetParameters()->GetTargetPositionZ();
     fld.Set(fB[2], zField[2], fB[1], zField[1], fB[0], zField[0]);
     field.push_back(fld);
 
@@ -503,8 +503,8 @@ void CbmL1PFFitter::GetChiToVertex(vector<CbmStsTrack>& Tracks, vector<L1FieldRe
         fit.L1AddPipeMaterial(T, T.qp, w);
         fit.EnergyLossCorrection(T, fit.PipeRadThick, T.qp, fvec(1.f), w);
       }
-      fit.L1AddMaterial(T, CbmL1::Instance()->algo->GetMaterialThickness(iSt, T.x, T.y), T.qp, w);
-      fit.EnergyLossCorrection(T, CbmL1::Instance()->algo->GetMaterialThickness(iSt, T.x, T.y), T.qp, fvec(1.f), w);
+      fit.L1AddMaterial(T, CbmL1::Instance()->algo->GetParameters()->GetMaterialThickness(iSt, T.x, T.y), T.qp, w);
+      fit.EnergyLossCorrection(T, CbmL1::Instance()->algo->GetParameters()->GetMaterialThickness(iSt, T.x, T.y), T.qp, fvec(1.f), w);
     }
     if (NMvdStations <= 0) {
       fit.L1AddPipeMaterial(T, T.qp, ONE);
@@ -580,7 +580,7 @@ void CbmL1PFFitter::CalculateFieldRegion(vector<CbmStsTrack>& Tracks, vector<L1F
   CbmStsTrack* t[fvecLen];
 
   int ista;
-  const L1Station* sta = CbmL1::Instance()->algo->GetStations().begin();
+  const L1Station* sta = CbmL1::Instance()->algo->GetParameters()->GetStations().begin();
   L1FieldValue fB[3], fB_temp _fvecalignment;
   fvec zField[3];
 
@@ -627,8 +627,8 @@ void CbmL1PFFitter::CalculateFieldRegion(vector<CbmStsTrack>& Tracks, vector<L1F
       }
     }
 
-    fB[0]     = CbmL1::Instance()->algo->GetVtxFieldValue();
-    zField[0] = CbmL1::Instance()->algo->GetTargetZ();
+    fB[0]     = CbmL1::Instance()->algo->GetParameters()->GetVertexFieldValue();
+    zField[0] = CbmL1::Instance()->algo->GetParameters()->GetTargetPositionZ();
     fld.Set(fB[2], zField[2], fB[1], zField[1], fB[0], zField[0]);
     field.push_back(fld);
   }
@@ -652,7 +652,7 @@ void CbmL1PFFitter::CalculateFieldRegionAtLastPoint(vector<CbmStsTrack>& Tracks,
   CbmStsTrack* t[fvecLen];
 
   int ista;
-  const L1Station* sta = CbmL1::Instance()->algo->GetStations().begin();
+  const L1Station* sta = CbmL1::Instance()->algo->GetParameters()->GetStations().begin();
   L1FieldValue fB[3], fB_temp _fvecalignment;
   fvec zField[3];
 
-- 
GitLab