diff --git a/reco/L1/CbmL1.cxx b/reco/L1/CbmL1.cxx
index 00a477e7c73dd56d25225b9d0af6b560d40b225a..b97fe990f168f884c6cda47f74294cf1adb388c3 100644
--- a/reco/L1/CbmL1.cxx
+++ b/reco/L1/CbmL1.cxx
@@ -1654,12 +1654,12 @@ void CbmL1::WriteSTAPAlgoData()  // must be called after ReadEvent
     // write StsHitsStartIndex and StsHitsStopIndex
     n = 20;
     for (int i = 0; i < n; i++) {
-      if (int(algo->MaxNStations) + 1 > i) fadata << algo->StsHitsStartIndex[i] << endl;
+      if (int(algo->fkMaxNstations) + 1 > i) fadata << algo->StsHitsStartIndex[i] << endl;
       else
         fadata << 0 << endl;
     };
     for (int i = 0; i < n; i++) {
-      if (int(algo->MaxNStations) + 1 > i) fadata << algo->StsHitsStopIndex[i] << endl;
+      if (int(algo->fkMaxNstations) + 1 > i) fadata << algo->StsHitsStopIndex[i] << endl;
       else
         fadata << 0 << endl;
     };
@@ -1914,12 +1914,12 @@ void CbmL1::ReadSTAPAlgoData()
     for (int i = 0; i < n; i++) {
       int tmp;
       fadata >> tmp;
-      if (int(algo->MaxNStations) + 1 > i) (const_cast<unsigned int&>(algo->StsHitsStartIndex[i]) = tmp);
+      if (int(algo->fkMaxNstations) + 1 > i) (const_cast<unsigned int&>(algo->StsHitsStartIndex[i]) = tmp);
     }
     for (int i = 0; i < n; i++) {
       int tmp;
       fadata >> tmp;
-      if (int(algo->MaxNStations) + 1 > i) (const_cast<unsigned int&>(algo->StsHitsStopIndex[i]) = tmp);
+      if (int(algo->fkMaxNstations) + 1 > i) (const_cast<unsigned int&>(algo->StsHitsStopIndex[i]) = tmp);
     }
 
     cout << "-I- CbmL1: CATrackFinder data for event " << nEvent << " has been read from file " << fadata_name
diff --git a/reco/L1/L1Algo/L1Algo.cxx b/reco/L1/L1Algo/L1Algo.cxx
index 4e893a1596642a4df94e3d1bed1055ada8085152..323a5bff730a4f9a36fedfca2324e1d0fed4335f 100644
--- a/reco/L1/L1Algo/L1Algo.cxx
+++ b/reco/L1/L1Algo/L1Algo.cxx
@@ -7,18 +7,18 @@
 #include "L1Grid.h"
 #include "L1HitPoint.h"
 
-L1Algo::L1Algo(int nThreads)
+L1Algo::L1Algo(unsigned int nThreads)
 {
   SetNThreads(nThreads);
-  for (int i = 0; i < MaxNStations; i++) {
+  for (unsigned int i = 0; i < fkMaxNstations; i++) {
     vGridTime[i].AllocateMemory(fNThreads);
   }
 }
 
-void L1Algo::SetNThreads(int n)
+void L1Algo::SetNThreads(unsigned int n)
 {
-  if (n > kMaxNthreads) {
-    LOG(FATAL) << "L1Algo: n threads " << n << " is greater than the maximum " << kMaxNthreads << std::endl;
+  if (n > fkMaxNthreads) {
+    LOG(FATAL) << "L1Algo: n threads " << n << " is greater than the maximum " << fkMaxNthreads << std::endl;
   }
   fNThreads = n;
 
@@ -51,7 +51,7 @@ void L1Algo::SetNThreads(int n)
     du[i].reserve(MaxPortionTriplets / fvecLen);
     dv[i].reserve(MaxPortionTriplets / fvecLen);
 
-    for (int j = 0; j < MaxNStations; j++) {
+    for (unsigned int j = 0; j < fkMaxNstations; j++) {
       fTriplets[j][i].SetName(std::stringstream() << "L1Algo::fTriplets[" << i << "][" << j << "]");
     }
   }
@@ -278,7 +278,7 @@ void L1Algo::SetData(L1Vector<L1Hit>& StsHits_, int nStsStrips_, L1Vector<unsign
     fRecoHits_local[i].reserve(nHits);
     fTrackCandidates[i].clear();
     fTrackCandidates[i].reserve(nHits / 10);
-    for (int j = 0; j < MaxNStations; j++) {
+    for (unsigned int j = 0; j < fkMaxNstations; j++) {
       fTriplets[j][i].clear();
       fTriplets[j][i].reserve(2 * nHits);
     }
diff --git a/reco/L1/L1Algo/L1Algo.h b/reco/L1/L1Algo/L1Algo.h
index 0e69fbd160fa906ba1fa0df1a65896a86948ea88..d0040438359855541cae434f37b31e4ddf63e9db 100644
--- a/reco/L1/L1Algo/L1Algo.h
+++ b/reco/L1/L1Algo/L1Algo.h
@@ -78,7 +78,7 @@ typedef int Tindex;
 
 class L1Algo {
 public:
-  L1Algo(int nThreads = 1);
+  L1Algo(unsigned int nThreads = 1);
 
   L1Algo(const L1Algo&) = delete;
   L1Algo operator=(const L1Algo&) = delete;
@@ -94,18 +94,60 @@ public:
   /// get default particle mass squared
   float GetDefaultParticleMass2() const { return fDefaultMass * fDefaultMass; }
 
-  static const int kMaxNthreads = 1;
-  static const int nSta         = 25;
-
   float fDefaultMass = 0.10565800;  // muon mass
 
-  L1Vector<L1Triplet> fTriplets[nSta][kMaxNthreads] {{"L1Algo::fTriplets"}};  // created triplets at station + thread
+  static constexpr unsigned int fkStationBits = 6;
+  static constexpr unsigned int fkThreadBits  = 6;
+  static constexpr unsigned int fkTripletBits = 32 - fkStationBits - fkThreadBits;
+
+  static constexpr unsigned int fkMaxNstations = (1 << fkStationBits);  // 2^6 =64
+  static constexpr unsigned int fkMaxNthreads  = (1 << fkThreadBits);   // 2^6 = 64
+  static constexpr unsigned int fkMaxNtriplets = (1 << fkTripletBits);  // 2^20 = 262,144
+
+  /// pack station, thread and triplet indices to an unique triplet ID
+  static unsigned int PackTripletId(unsigned int Station, unsigned int Thread, unsigned int Triplet)
+  {
+#ifndef FAST_CODE
+    assert(Station < fkMaxNstations);
+    assert(Thread < fkMaxNthreads);
+    assert(Triplet < fkMaxNtriplets);
+#endif
+    constexpr unsigned int kMoveThread  = fkTripletBits;
+    constexpr unsigned int kMoveStation = fkTripletBits + fkThreadBits;
+    return (Station << kMoveStation) + (Thread << kMoveThread) + Triplet;
+  }
+
+  /// unpack the triplet ID to its station index
+  static unsigned int TripletId2Station(unsigned int ID)
+  {
+    constexpr unsigned int kMoveStation = fkTripletBits + fkThreadBits;
+    return ID >> kMoveStation;
+  }
+
+  /// unpack the triplet ID to its thread index
+  static unsigned int TripletId2Thread(unsigned int ID)
+  {
+    constexpr unsigned int kMoveThread = fkTripletBits;
+    constexpr unsigned int kThreadMask = (1 << fkThreadBits) - 1;
+    return (ID >> kMoveThread) & kThreadMask;
+  }
+
+  /// unpack the triplet ID to its triplet index
+  static unsigned int TripletId2Triplet(unsigned int ID)
+  {
+    constexpr unsigned int kTripletMask = (1 << fkTripletBits) - 1;
+    return ID & kTripletMask;
+  }
+
+
+  L1Vector<L1Triplet> fTriplets[fkMaxNstations][fkMaxNthreads] {
+    {"L1Algo::fTriplets"}};  // created triplets at station + thread
 
   // Track candidates created out of adjacent triplets before the final track selection.
   // The candidates may share any amount of hits.
-  L1Vector<L1Branch> fTrackCandidates[kMaxNthreads] {"L1Algo::fTrackCandidates"};
+  L1Vector<L1Branch> fTrackCandidates[fkMaxNthreads] {"L1Algo::fTrackCandidates"};
 
-  Tindex fDupletPortionStopIndex[nSta] {0};                            // end of the duplet portions for the station
+  Tindex fDupletPortionStopIndex[fkMaxNstations] {0};                  // end of the duplet portions for the station
   L1Vector<Tindex> fDupletPortionSize {"L1Algo::fDupletPortionSize"};  // N duplets in a portion
 
   //
@@ -154,25 +196,20 @@ public:
   /// ----- Input data -----
   // filled in CbmL1::ReadEvent();
 
-  void SetNThreads(int n);
-
-  enum
-  {
-    MaxNStations = 25
-  };
+  void SetNThreads(unsigned int n);
 
   int NStations {0};     // number of all detector stations
   int NMvdStations {0};  // number of mvd stations
   int NStsStations {0};  // number of sts stations
   int NFStations {0};    // ?
 
-  L1Station vStations[MaxNStations] _fvecalignment;  // station info
+  L1Station vStations[fkMaxNstations] _fvecalignment;  // station info
   L1Vector<L1Material> fRadThick {"fRadThick"};      // material for each station
 
   int NStsStrips {0};                   // number of strips
   L1Vector<L1Hit>* vStsHits {nullptr};  // hits as a combination of front-, backstrips and z-position
-  L1Grid vGrid[MaxNStations];           // hits as a combination of front-, backstrips and z-position
-  L1Grid vGridTime[MaxNStations];
+  L1Grid vGrid[fkMaxNstations];         // hits as a combination of front-, backstrips and z-position
+  L1Grid vGridTime[fkMaxNstations];
 
   L1Vector<unsigned char>* fStripFlag {nullptr};  // information of hits station & using hits in tracks;
 
@@ -194,8 +231,8 @@ public:
   L1Vector<L1HitPoint> vStsDontUsedHitsxy_A {"L1Algo::vStsDontUsedHitsxy_A"};
   L1Vector<L1HitPoint> vStsDontUsedHitsxy_buf {"L1Algo::vStsDontUsedHitsxy_buf"};
   L1Vector<L1HitPoint> vStsDontUsedHitsxy_B {"L1Algo::vStsDontUsedHitsxy_B"};
-  L1Vector<L1Track> fTracks_local[kMaxNthreads] {"L1Algo::fTracks_local"};
-  L1Vector<THitI> fRecoHits_local[kMaxNthreads] {"L1Algo::fRecoHits_local"};
+  L1Vector<L1Track> fTracks_local[fkMaxNthreads] {"L1Algo::fTracks_local"};
+  L1Vector<THitI> fRecoHits_local[fkMaxNthreads] {"L1Algo::fRecoHits_local"};
 
   L1Vector<THitI> RealIHit_v {"L1Algo::RealIHit_v"};
   L1Vector<THitI> RealIHit_v_buf {"L1Algo::RealIHit_v_buf"};
@@ -214,8 +251,8 @@ public:
   bool fmCBMmode {0};
   bool fGlobal {0};
 
-  fvec EventTime[kMaxNthreads][kMaxNthreads] {{0}};
-  fvec Err[kMaxNthreads][kMaxNthreads] {{0}};
+  fvec EventTime[fkMaxNthreads][fkMaxNthreads] {{0}};
+  fvec Err[fkMaxNthreads][fkMaxNthreads] {{0}};
 
 
   /// standard sizes of the arrays
@@ -233,8 +270,9 @@ public:
     MaxNPortion        = 40 * coeff / multiCoeff,
 
 
-    MaxArrSize = MaxNPortion * MaxPortionDoublets
-                 / MaxNStations  //200000,  // standart size of big arrays  // mas be 40000 for normal work in cbmroot!
+    MaxArrSize =
+      MaxNPortion * MaxPortionDoublets
+      / fkMaxNstations  //200000,  // standart size of big arrays  // mas be 40000 for normal work in cbmroot!
   };
 
 
@@ -247,10 +285,10 @@ public:
   L1Vector<L1HitPoint>* vStsHitPointsUnused {nullptr};
   THitI* RealIHit {nullptr};  // index in vStsHits indexed by index in vStsHitsUnused
 
-  THitI StsHitsUnusedStartIndex[MaxNStations + 1] {0};
-  THitI StsHitsUnusedStopIndex[MaxNStations + 1] {0};
-  THitI StsHitsUnusedStartIndexEnd[MaxNStations + 1] {0};
-  THitI StsHitsUnusedStopIndexEnd[MaxNStations + 1] {0};
+  THitI StsHitsUnusedStartIndex[fkMaxNstations + 1] {0};
+  THitI StsHitsUnusedStopIndex[fkMaxNstations + 1] {0};
+  THitI StsHitsUnusedStartIndexEnd[fkMaxNstations + 1] {0};
+  THitI StsHitsUnusedStopIndexEnd[fkMaxNstations + 1] {0};
 
 
   L1Vector<int> TripForHit[2] {"L1Algo::TripForHit"};
@@ -260,25 +298,25 @@ public:
   //  fvec zPos[Portion/fvecLen];
   //  fvec fHitTime[Portion/fvecLen];
 
-  nsL1::vector<L1TrackPar>::TSimd fT_3[kMaxNthreads];
+  nsL1::vector<L1TrackPar>::TSimd fT_3[fkMaxNthreads];
 
-  L1Vector<THitI> fhitsl_3[kMaxNthreads] {"L1Algo::fhitsl_3"};
-  L1Vector<THitI> fhitsm_3[kMaxNthreads] {"L1Algo::fhitsm_3"};
-  L1Vector<THitI> fhitsr_3[kMaxNthreads] {"L1Algo::fhitsr_3"};
+  L1Vector<THitI> fhitsl_3[fkMaxNthreads] {"L1Algo::fhitsl_3"};
+  L1Vector<THitI> fhitsm_3[fkMaxNthreads] {"L1Algo::fhitsm_3"};
+  L1Vector<THitI> fhitsr_3[fkMaxNthreads] {"L1Algo::fhitsr_3"};
 
-  nsL1::vector<fvec>::TSimd fu_front3[kMaxNthreads];
-  nsL1::vector<fvec>::TSimd fu_back3[kMaxNthreads];
-  nsL1::vector<fvec>::TSimd fz_pos3[kMaxNthreads];
-  nsL1::vector<fvec>::TSimd fTimeR[kMaxNthreads];
-  nsL1::vector<fvec>::TSimd fTimeER[kMaxNthreads];
-  nsL1::vector<fvec>::TSimd dx[kMaxNthreads];
-  nsL1::vector<fvec>::TSimd dy[kMaxNthreads];
-  nsL1::vector<fvec>::TSimd du[kMaxNthreads];
-  nsL1::vector<fvec>::TSimd dv[kMaxNthreads];
+  nsL1::vector<fvec>::TSimd fu_front3[fkMaxNthreads];
+  nsL1::vector<fvec>::TSimd fu_back3[fkMaxNthreads];
+  nsL1::vector<fvec>::TSimd fz_pos3[fkMaxNthreads];
+  nsL1::vector<fvec>::TSimd fTimeR[fkMaxNthreads];
+  nsL1::vector<fvec>::TSimd fTimeER[fkMaxNthreads];
+  nsL1::vector<fvec>::TSimd dx[fkMaxNthreads];
+  nsL1::vector<fvec>::TSimd dy[fkMaxNthreads];
+  nsL1::vector<fvec>::TSimd du[fkMaxNthreads];
+  nsL1::vector<fvec>::TSimd dv[fkMaxNthreads];
 
 
-  //   Tindex NHits_l[MaxNStations];
-  //   Tindex NHits_l_P[MaxNStations];
+  //   Tindex NHits_l[fkMaxNstations];
+  //   Tindex NHits_l_P[fkMaxNstations];
   /// ----- Output data -----
 
   friend class CbmL1;
diff --git a/reco/L1/L1Algo/L1CATrackFinder.cxx b/reco/L1/L1Algo/L1CATrackFinder.cxx
index 20104356d924b67a5622f8daacaa17d923a94bd7..81d85355488dd7ad518c63474659ea9138454470 100644
--- a/reco/L1/L1Algo/L1CATrackFinder.cxx
+++ b/reco/L1/L1Algo/L1CATrackFinder.cxx
@@ -1110,7 +1110,7 @@ inline void L1Algo::f4(  // input
     L1_ASSERT(ihitm < StsHitsUnusedStopIndex[istam], ihitm << " < " << StsHitsUnusedStopIndex[istam]);
     L1_ASSERT(ihitr < StsHitsUnusedStopIndex[istar], ihitr << " < " << StsHitsUnusedStopIndex[istar]);
 
-    unsigned int Location = L1Triplet::PackTripletID(istal, Thread, fTriplets[istal][Thread].size());
+    unsigned int Location = PackTripletId(istal, Thread, fTriplets[istal][Thread].size());
 
     if (ihitl_priv == 0 || ihitl_priv != hitsl_3[i3]) {
       TripForHit[0][ihitl] = Location;
@@ -1162,10 +1162,9 @@ inline void L1Algo::f4(  // input
     unsigned int nNeighbours = TripForHit[1][ihitm] - TripForHit[0][ihitm];
 
     unsigned int neighLocation = TripForHit[0][ihitm];
-    unsigned int neighStation;
-    unsigned int neighThread;
-    unsigned int neighTriplet;
-    L1Triplet::UnpackTripletID(neighLocation, neighStation, neighThread, neighTriplet);
+    unsigned int neighStation  = TripletId2Station(neighLocation);
+    unsigned int neighThread   = TripletId2Thread(neighLocation);
+    unsigned int neighTriplet  = TripletId2Triplet(neighLocation);
 
     if (nNeighbours > 0) { assert((int) neighStation == istal + 1 || (int) neighStation == istal + 2); }
     unsigned char level = 0;
@@ -1240,10 +1239,9 @@ inline void L1Algo::f5(  // input
             unsigned int nNeighbours = TripForHit[1][ihitm] - TripForHit[0][ihitm];
 
             unsigned int neighLocation = TripForHit[0][ihitm];
-            unsigned int neighStation;
-            unsigned int neighThread;
-            unsigned int neighTriplet;
-            L1Triplet::UnpackTripletID(neighLocation, neighStation, neighThread, neighTriplet);
+            unsigned int neighStation  = TripletId2Station(neighLocation);
+            unsigned int neighThread   = TripletId2Thread(neighLocation);
+            unsigned int neighTriplet  = TripletId2Triplet(neighLocation);
 
             for (unsigned int iN = 0; iN < nNeighbours; ++iN, ++neighTriplet, ++neighLocation) {
               //    for (iN = first_triplet; iN <= last_triplet; ++iN){
@@ -1260,19 +1258,15 @@ inline void L1Algo::f5(  // input
               if (level == jlevel + 1) neighCands.push_back(neighLocation);
             }
 
-            //  trip->neighbours.resize(0);
-
-            //           for (unsigned int in = 0; in < neighCands.size(); in++)
-            //           {
-            //             int Location = neighCands[in];
-            //
-            //             int Station = Location/100000000;
-            //             int Thread = (Location -Station*100000000)/1000000;
-            //             int Triplet = (Location- Station*100000000-Thread*1000000);
-
-            //  const int nLevel = fTriplets[Station][Thread][Triplet].GetLevel();
+            // trip->neighbours.resize(0);
+            // for (unsigned int in = 0; in < neighCands.size(); in++) {
+            //   int ID           = neighCands[in];
+            //   unsigned int Station     = TripletId2Station(ID);
+            //   unsigned int Thread      = TripletId2Thread(ID);
+            //   unsigned int Triplet     = TripletId2Triplet(ID);
+            //   const int nLevel = fTriplets[Station][Thread][Triplet].GetLevel();
             //   if (level == nLevel + 1) trip->neighbours.push_back(Location);
-            //           }
+            // }
             nlevel[level]++;
           }  // vTriplets
         }
@@ -1622,7 +1616,7 @@ void L1Algo::CATrackFinder()
   //  static Tindex stat_nDoublets[fNFindIterations] = {0};
   static Tindex stat_nTriplets[fNFindIterations] = {0};
 
-  static Tindex stat_nLevels[MaxNStations - 2][fNFindIterations] = {{0}};
+  static Tindex stat_nLevels[fkMaxNstations - 2][fNFindIterations] = {{0}};
   static Tindex stat_nCalls[fNFindIterations]                    = {0};  // n calls of CAFindTrack
   static Tindex stat_nTrCandidates[fNFindIterations]             = {0};
 #endif
@@ -1867,7 +1861,7 @@ void L1Algo::CATrackFinder()
             || (isec == kAllSecEIter) || (isec == kAllSecJumpIter))
           MaxDZ = 0.1;
 
-        if (NStations > MaxNStations) cout << " CATrackFinder: Error: Too many Stations" << endl;
+        if (NStations > (int) fkMaxNstations) cout << " CATrackFinder: Error: Too many Stations" << endl;
       }
 
 #ifndef L1_NO_ASSERT
@@ -1951,9 +1945,9 @@ void L1Algo::CATrackFinder()
     L1Vector<THitI> hitsmG_2("L1CATrackFinder::hitsmG_2");  /// middle hits indexed by number of doublets in portion(i2)
     L1Vector<THitI> i1G_2(
       "L1CATrackFinder::i1G_2");  /// index in portion of singlets(i1) indexed by index in portion of doublets(i2)
-    L1Vector<char> lmDuplets[MaxNStations] {
+    L1Vector<char> lmDuplets[fkMaxNstations] {
       "L1CATrackFinder::lmDuplets"};  // is exist a doublet started from indexed by left hit
-    L1Vector<char> lmDupletsG[MaxNStations] {
+    L1Vector<char> lmDupletsG[fkMaxNstations] {
       "L1CATrackFinder::lmDupletsG"};  // is exist a doublet started from indexed by left hit
 
     for (int i = 0; i < NStations; i++) {
@@ -2035,7 +2029,7 @@ void L1Algo::CATrackFinder()
       }  //
     }
 
-    //     int nlevels[MaxNStations];  // number of triplets with some number of neighbours.
+    //     int nlevels[fkMaxNstations];  // number of triplets with some number of neighbours.
     //     for (int il = 0; il < NStations; ++il) nlevels[il] = 0;
     //
     //      f5(   // input
@@ -2076,7 +2070,7 @@ void L1Algo::CATrackFinder()
 
 
     L1Branch curr_tr;
-    L1Branch new_tr[MaxNStations];
+    L1Branch new_tr[fkMaxNstations];
     L1Branch best_tr;
     fscal curr_chi2 = 0;
 
@@ -2625,24 +2619,20 @@ inline void L1Algo::CAFindTrack(int ista, L1Branch& best_tr, unsigned char& best
   }
   else  //MEANS level ! = 0
   {
-    unsigned int Station  = 0;
-    unsigned int Thread   = 0;
-    unsigned int Triplet  = 0;
-    unsigned int Location = 0;
-    int N_neighbour       = (curr_trip->GetNNeighbours());
-
+    int N_neighbour = (curr_trip->GetNNeighbours());
 
     for (Tindex in = 0; in < N_neighbour; in++) {
-      Location = curr_trip->GetFNeighbour() + in;
 
-      //    Location = curr_trip->neighbours[in];
+      unsigned int ID = curr_trip->GetFNeighbour() + in;
+
+      //    ID = curr_trip->neighbours[in];
       //    const fscal &qp2 = curr_trip->GetQp();
       //    fscal &Cqp2 = curr_trip->Cqp;
       //    if (( fabs(qp - qp2) > PickNeighbour * (Cqp + Cqp2) ) )  continue;
 
-      Station = Location / 100000000;
-      Thread  = (Location - Station * 100000000) / 1000000;
-      Triplet = (Location - Station * 100000000 - Thread * 1000000);
+      unsigned int Station = TripletId2Station(ID);
+      unsigned int Thread  = TripletId2Thread(ID);
+      unsigned int Triplet = TripletId2Triplet(ID);
 
       const L1Triplet& new_trip = fTriplets[Station][Thread][Triplet];
       if ((new_trip.GetMHit() != curr_trip->GetRHit())) continue;
diff --git a/reco/L1/L1Algo/L1TrackFitter.cxx b/reco/L1/L1Algo/L1TrackFitter.cxx
index bfbfd7358354f002220494a2f3e68add58e00f6f..799d4de8bf809db30ee0b831482d11cd45126ef9 100644
--- a/reco/L1/L1Algo/L1TrackFitter.cxx
+++ b/reco/L1/L1Algo/L1TrackFitter.cxx
@@ -352,17 +352,17 @@ void L1Algo::L1KFTrackFitter()
 
   L1Station* sta = vStations;
   L1Station staFirst, staLast;
-  fvec x[MaxNStations], u[MaxNStations], v[MaxNStations], y[MaxNStations], time[MaxNStations], timeEr[MaxNStations],
-    z[MaxNStations];
-  fvec d_x[MaxNStations], d_y[MaxNStations], d_xy[MaxNStations], d_u[MaxNStations], d_v[MaxNStations];
+  fvec x[fkMaxNstations], u[fkMaxNstations], v[fkMaxNstations], y[fkMaxNstations], time[fkMaxNstations],
+    timeEr[fkMaxNstations], z[fkMaxNstations];
+  fvec d_x[fkMaxNstations], d_y[fkMaxNstations], d_xy[fkMaxNstations], d_u[fkMaxNstations], d_v[fkMaxNstations];
   fvec x_first, y_first, time_first, x_last, y_last, time_last, time_er_first, time_er_last, d_x_fst, d_y_fst, d_xy_fst,
     time_er_lst, d_x_lst, d_y_lst, d_xy_lst;
-  fvec Sy[MaxNStations], w[MaxNStations], w_time[MaxNStations];
+  fvec Sy[fkMaxNstations], w[fkMaxNstations], w_time[fkMaxNstations];
   fvec y_temp, x_temp;
   fvec fz0, fz1, fz2, z_start, z_end;
-  L1FieldValue fB[MaxNStations], fB_temp _fvecalignment;
+  L1FieldValue fB[fkMaxNstations], fB_temp _fvecalignment;
 
-  fvec ZSta[MaxNStations];
+  fvec ZSta[fkMaxNstations];
   for (int iHit = 0; iHit < nHits; iHit++) {
     ZSta[iHit] = sta[iHit].z;
   }
@@ -384,7 +384,7 @@ void L1Algo::L1KFTrackFitter()
 
     for (iVec = 0; iVec < nTracks_SIMD; iVec++) {
       int nHitsTrack = t[iVec]->NHits;
-      int iSta[MaxNStations];
+      int iSta[fkMaxNstations];
       for (i = 0; i < nHitsTrack; i++) {
         const L1Hit& hit = (*vStsHits)[fRecoHits[start_hit++]];
         const int ista   = (*fStripFlag)[hit.f] / 4;
@@ -774,18 +774,18 @@ void L1Algo::L1KFTrackFitterMuch()
 
   L1Station* sta = vStations;
   L1Station staFirst, staLast;
-  fvec x[MaxNStations], u[MaxNStations], v[MaxNStations], y[MaxNStations], time[MaxNStations], timeEr[MaxNStations],
-    z[MaxNStations];
-  fvec d_x[MaxNStations], d_y[MaxNStations], d_xy[MaxNStations], d_u[MaxNStations], d_v[MaxNStations];
+  fvec x[fkMaxNstations], u[fkMaxNstations], v[fkMaxNstations], y[fkMaxNstations], time[fkMaxNstations],
+    timeEr[fkMaxNstations], z[fkMaxNstations];
+  fvec d_x[fkMaxNstations], d_y[fkMaxNstations], d_xy[fkMaxNstations], d_u[fkMaxNstations], d_v[fkMaxNstations];
   fvec x_first, y_first, time_first, x_last, y_last, time_last, time_er_fst, d_x_fst, d_y_fst, d_xy_fst, time_er_lst,
     d_x_lst, d_y_lst, d_xy_lst, dz;
-  int iSta[MaxNStations];
-  fvec Sy[MaxNStations], w[MaxNStations];
+  int iSta[fkMaxNstations];
+  fvec Sy[fkMaxNstations], w[fkMaxNstations];
   fvec y_temp, x_temp;
   fvec fz0, fz1, fz2, z_start, z_end;
-  L1FieldValue fB[MaxNStations], fB_temp _fvecalignment;
+  L1FieldValue fB[fkMaxNstations], fB_temp _fvecalignment;
 
-  fvec ZSta[MaxNStations];
+  fvec ZSta[fkMaxNstations];
   for (int iHit = 0; iHit < nHits; iHit++) {
     ZSta[iHit] = sta[iHit].z;
   }
diff --git a/reco/L1/L1Algo/L1Triplet.h b/reco/L1/L1Algo/L1Triplet.h
index 8da915c2a0ca89ea3aa5593ccdc1f000d3c9224e..a97b47f3649e05c28391a240867440e3b914b0cf 100644
--- a/reco/L1/L1Algo/L1Triplet.h
+++ b/reco/L1/L1Algo/L1Triplet.h
@@ -70,20 +70,6 @@ public:
   fscal GetTy() const { return fTy; }
   fscal GetCty() const { return fCty; }
 
-  /// pack station, thread and triplet indices to an unique triplet ID
-  static unsigned int PackTripletID(unsigned int Station, unsigned int Thread, unsigned int Triplet)
-  {
-    return Station * 100000000 + Thread * 1000000 + Triplet;
-  }
-
-  /// unpack the triplet ID to its station, thread, triplet index
-  static void UnpackTripletID(unsigned int ID, unsigned int& Station, unsigned int& Thread, unsigned int& Triplet)
-  {
-    Station = ID / 100000000;
-    Thread  = (ID - Station * 100000000) / 1000000;
-    Triplet = (ID - Station * 100000000 - Thread * 1000000);
-  }
-
   /// print the tracklet parameters
   void Print();
 
diff --git a/reco/L1/L1Algo/utils/L1AlgoDraw.h b/reco/L1/L1Algo/utils/L1AlgoDraw.h
index ea9d7e03f6e9e1454808f1abd1c2c2184ae35520..bd678b94c4b996c9535d7377f5c9a0c04e2635cf 100644
--- a/reco/L1/L1Algo/utils/L1AlgoDraw.h
+++ b/reco/L1/L1Algo/utils/L1AlgoDraw.h
@@ -31,8 +31,8 @@ public:
   void DrawMCTracks();
   void DrawRecoTracks();
 
-  void DrawTriplets(vector<L1Triplet>& triplets, const THitI* realIHit);
-  void DrawDoublets(vector<THitI>* Duplets_hits, map<THitI, THitI>* Duplets_start, const int MaxArrSize,
+  void DrawTriplets(std::vector<L1Triplet>& triplets, const THitI* realIHit);
+  void DrawDoublets(std::vector<THitI>* Duplets_hits, std::map<THitI, THitI>* Duplets_start, const int MaxArrSize,
                     THitI* StsHitsStartIndex, unsigned int* realIHit);
   void DrawDoubletsOnSta(int iSta, THitI* Duplets_hits, THitI* Duplets_start, const int MaxArrSize,
                          THitI* StsRestHitsStartIndex, unsigned int* realIHit);
@@ -58,7 +58,7 @@ private:
 
   L1Algo* algo {nullptr};
 
-  vector<L1Hit> vStsHits {};
+  std::vector<L1Hit> vStsHits {};
   int StsHitsStartIndex[20] {0};
   int StsHitsStopIndex[20] {0};