From 9aa8d39989f7eea11159a03eddfdc45f0cc51157 Mon Sep 17 00:00:00 2001
From: "se.gorbunov" <se.gorbunov@gsi.de>
Date: Fri, 13 Oct 2023 01:30:07 +0000
Subject: [PATCH] Ca: cleanup CaHit class

---
 algo/ca/core/data/CaGrid.cxx            |  28 ++--
 algo/ca/core/data/CaGridEntry.h         |  15 +--
 algo/ca/core/data/CaHit.h               | 172 ++++++++++++++++++------
 reco/L1/CbmCaTimeSliceReader.cxx        |  33 +++--
 reco/L1/CbmL1.cxx                       |   2 +-
 reco/L1/CbmL1Performance.cxx            |   6 +-
 reco/L1/CbmL1ReadEvent.cxx              |  34 ++---
 reco/L1/L1Algo/L1BranchExtender.cxx     |  74 +++++-----
 reco/L1/L1Algo/L1CaTrackFinder.cxx      |  26 ++--
 reco/L1/L1Algo/L1CaTrackFinderSlice.cxx |  47 +++----
 reco/L1/L1Algo/L1CloneMerger.cxx        |   4 +-
 reco/L1/L1Algo/L1Fit.cxx                |  10 +-
 reco/L1/L1Algo/L1TrackFitter.cxx        |  18 +--
 reco/L1/L1Algo/L1TripletConstructor.cxx |  22 +--
 reco/L1/L1Algo/utils/L1AlgoDraw.cxx     |  22 +--
 15 files changed, 301 insertions(+), 212 deletions(-)

diff --git a/algo/ca/core/data/CaGrid.cxx b/algo/ca/core/data/CaGrid.cxx
index 4f06c5ee6d..d9eeded1f5 100644
--- a/algo/ca/core/data/CaGrid.cxx
+++ b/algo/ca/core/data/CaGrid.cxx
@@ -61,8 +61,8 @@ void Grid::StoreHits(const Vector<ca::Hit>& hits, ca::HitIndex_t hitStartIndex,
   int nEntries = 0;
   for (ca::HitIndex_t ih = 0; ih < nHits; ih++) {
     const ca::Hit& hit = hits[hitStartIndex + ih];
-    if (!(hitKeyFlags[hit.f] || hitKeyFlags[hit.b])) {
-      fNofBinEntries[GetBin(hit.x, hit.y)]++;
+    if (!(hitKeyFlags[hit.FrontKey()] || hitKeyFlags[hit.BackKey()])) {
+      fNofBinEntries[GetBin(hit.X(), hit.Y())]++;
       nEntries++;
     }
   }
@@ -81,13 +81,13 @@ void Grid::StoreHits(const Vector<ca::Hit>& hits, ca::HitIndex_t hitStartIndex,
 
   for (ca::HitIndex_t ih = 0; ih < nHits; ih++) {
     const ca::Hit& hit = hits[hitStartIndex + ih];
-    if (!(hitKeyFlags[hit.f] || hitKeyFlags[hit.b])) {
-      int bin = GetBin(hit.x, hit.y);
+    if (!(hitKeyFlags[hit.FrontKey()] || hitKeyFlags[hit.BackKey()])) {
+      int bin = GetBin(hit.X(), hit.Y());
       fEntries[fFirstBinEntryIndex[bin] + fNofBinEntries[bin]].Set(hit, hitStartIndex + ih);
       fNofBinEntries[bin]++;
-      fMaxRangeX = std::max(fMaxRangeX, hit.rangeX);
-      fMaxRangeY = std::max(fMaxRangeY, hit.rangeY);
-      fMaxRangeT = std::max(fMaxRangeT, hit.rangeT);
+      fMaxRangeX = std::max(fMaxRangeX, hit.RangeX());
+      fMaxRangeY = std::max(fMaxRangeY, hit.RangeY());
+      fMaxRangeT = std::max(fMaxRangeT, hit.RangeT());
     }
   }
 }
@@ -104,14 +104,16 @@ void Grid::RemoveUsedHits(const Vector<ca::Hit>& hits, const Vector<unsigned cha
     fFirstBinEntryIndex[bin]     = nEntries;
     fNofBinEntries[bin]          = 0;
     for (ca::HitIndex_t i = firstEntryOld; i < fFirstBinEntryIndex[bin + 1]; i++) {
-      const ca::Hit& hit = hits[fEntries[i].GetObjectId()];
-      if (!(hitKeyFlags[hit.f] || hitKeyFlags[hit.b])) {
-        fEntries[nEntries] = fEntries[i];
+      auto entry         = fEntries[i];
+      const ca::Hit& hit = hits[entry.GetObjectId()];
+
+      if (!(hitKeyFlags[hit.FrontKey()] || hitKeyFlags[hit.BackKey()])) {
+        fEntries[nEntries] = entry;
         nEntries++;
         fNofBinEntries[bin]++;
-        fMaxRangeX = std::max(fMaxRangeX, hit.rangeX);
-        fMaxRangeY = std::max(fMaxRangeY, hit.rangeY);
-        fMaxRangeT = std::max(fMaxRangeT, hit.rangeT);
+        fMaxRangeX = std::max(fMaxRangeX, entry.RangeX());
+        fMaxRangeY = std::max(fMaxRangeY, entry.RangeY());
+        fMaxRangeT = std::max(fMaxRangeT, entry.RangeT());
       }
     }
   }
diff --git a/algo/ca/core/data/CaGridEntry.h b/algo/ca/core/data/CaGridEntry.h
index 67502b1c6c..66d4ab00d5 100644
--- a/algo/ca/core/data/CaGridEntry.h
+++ b/algo/ca/core/data/CaGridEntry.h
@@ -22,13 +22,13 @@ namespace cbm::algo::ca
     void Set(const ca::Hit& hit, ca::HitIndex_t id)
     {
       fObjectId = id;
-      x         = hit.x;
-      y         = hit.y;
-      z         = hit.z;
-      t         = hit.t;
-      rangeX    = hit.rangeX;
-      rangeY    = hit.rangeY;
-      rangeT    = hit.rangeT;
+      x         = hit.X();
+      y         = hit.Y();
+      z         = hit.Z();
+      t         = hit.T();
+      rangeX    = hit.RangeX();
+      rangeY    = hit.RangeY();
+      rangeT    = hit.RangeT();
     }
 
     ca::HitIndex_t GetObjectId() const { return fObjectId; }
@@ -56,4 +56,3 @@ namespace cbm::algo::ca
   };
 
 }  // namespace cbm::algo::ca
-
diff --git a/algo/ca/core/data/CaHit.h b/algo/ca/core/data/CaHit.h
index 6273d38a0d..5bb4b35153 100644
--- a/algo/ca/core/data/CaHit.h
+++ b/algo/ca/core/data/CaHit.h
@@ -23,64 +23,152 @@ namespace cbm::algo::ca
     friend class boost::serialization::access;
 
   public:
+    /// Default constructor
     Hit() = default;
 
-    fscal X() const { return x; }
-    fscal Y() const { return y; }
-    fscal Z() const { return z; }
-    fscal T() const { return t; }
-    fscal dX2() const { return dx2; }
-    fscal dY2() const { return dy2; }
-    fscal dXY() const { return dxy; }
-    fscal dT2() const { return dt2; }
-    fscal RangeX() const { return rangeX; }
-    fscal RangeY() const { return rangeY; }
-    fscal RangeT() const { return rangeT; }
+    ///-----------------------------------------------------------------------------
+    /// setters
+
+    /// Set the front key index
+    void SetFrontKey(HitKeyIndex_t key) { fFrontKey = key; }
+
+    /// Set the back key index
+    void SetBackKey(HitKeyIndex_t key) { fBackKey = key; }
+
+    /// Set the X coordinate
+    void SetX(fscal x) { fX = x; }
+
+    /// Set the Y coordinate
+    void SetY(fscal y) { fY = y; }
+
+    /// Set the Z coordinate
+    void SetZ(fscal z) { fZ = z; }
+
+    /// Set the time
+    void SetT(fscal t) { fT = t; }
+
+    /// Set the uncertainty of X coordinate
+    void SetDx2(fscal dx2) { fDx2 = dx2; }
+
+    /// Set the uncertainty of Y coordinate
+    void SetDy2(fscal dy2) { fDy2 = dy2; }
+
+    /// Set the X/Y covariance
+    void SetDxy(fscal dxy) { fDxy = dxy; }
+
+    /// Set the uncertainty of time
+    void SetDt2(fscal dt2) { fDt2 = dt2; }
+
+    /// Set the +/- range of uncertainty of X coordinate
+    void SetRangeX(fscal rangeX) { fRangeX = rangeX; }
+
+    /// Set the +/- range of uncertainty of Y coordinate
+    void SetRangeY(fscal rangeY) { fRangeY = rangeY; }
+
+    /// Set the +/- range of uncertainty of time
+    void SetRangeT(fscal rangeT) { fRangeT = rangeT; }
+
+    /// Set the hit id
+    void SetId(HitIndex_t id) { fId = id; }
+
+    /// Set the station index
+    void SetStation(int station) { fStation = station; }
+
+    ///-----------------------------------------------------------------------------
+    /// getters
+
+    /// Get the front key index
+    HitKeyIndex_t FrontKey() const { return fFrontKey; }
+
+    /// Get the back key index
+    HitKeyIndex_t BackKey() const { return fBackKey; }
+
+    /// Get the X coordinate
+    fscal X() const { return fX; }
+
+    /// Get the Y coordinate
+    fscal Y() const { return fY; }
+
+    /// Get the Z coordinate
+    fscal Z() const { return fZ; }
+
+    /// Get the time
+    fscal T() const { return fT; }
+
+    /// Get the uncertainty of X coordinate
+    fscal dX2() const { return fDx2; }
+
+    /// Get the uncertainty of Y coordinate
+    fscal dY2() const { return fDy2; }
+
+    /// Get the X/Y covariance
+    fscal dXY() const { return fDxy; }
+
+    /// Get the uncertainty of time
+    fscal dT2() const { return fDt2; }
+
+    /// Get the +/- range of uncertainty of X coordinate
+    fscal RangeX() const { return fRangeX; }
+
+    /// Get the +/- range of uncertainty of Y coordinate
+    fscal RangeY() const { return fRangeY; }
+
+    /// Get the +/- range of uncertainty of time
+    fscal RangeT() const { return fRangeT; }
+
+    /// Get the hit id
     HitIndex_t Id() const { return fId; }
-    int Ist() const { return iSt; }
 
-  public:
+    /// Get the station index
+    int Station() const { return fStation; }
+
+
+  private:
+    ///-----------------------------------------------------------------------------
+    /// data members
+
+
     /// NOTE: For STS f and b correspond to the indexes of the front and back clusters of the hit in a dataset. For other
     ///       tracking detectors (MVD, MuCh, TRD, TOF) f == b and corresponds to the index of the hit. Indexes f and b
     ///       do not intersect between different detector stations.
-    HitKeyIndex_t f {0};  ///< front hit key index
-    HitKeyIndex_t b {0};  ///< back hit key index
-
-    fscal x {0.};       ///< measured X coordinate [cm]
-    fscal y {0.};       ///< measured Y coordinate [cm]
-    fscal z {0.};       ///< fixed Z coordinate [cm]
-    fscal t {0.};       ///< measured time [ns]
-    fscal dx2 {0.};     ///< rms^2 of uncertainty of X coordinate [cm]
-    fscal dy2 {0.};     ///< rms^2 of uncertainty of Y coordinate [cm]
-    fscal dxy {0.};     ///< X/Y covariance [cm2]
-    fscal dt2 {0.};     ///< measured uncertainty of time [ns]
-    fscal rangeX {0.};  ///< +/- range of uncertainty of X coordinate [cm]
-    fscal rangeY {0.};  ///< +/- range of uncertainty of Y coordinate [cm]
-    fscal rangeT {0.};  ///< +/- range of uncertainty of time [ns]
+    HitKeyIndex_t fFrontKey {0};  ///< front hit key index
+    HitKeyIndex_t fBackKey {0};   ///< back hit key index
+
+    fscal fX {0.};       ///< measured X coordinate [cm]
+    fscal fY {0.};       ///< measured Y coordinate [cm]
+    fscal fZ {0.};       ///< fixed Z coordinate [cm]
+    fscal fT {0.};       ///< measured time [ns]
+    fscal fDx2 {0.};     ///< rms^2 of uncertainty of X coordinate [cm]
+    fscal fDy2 {0.};     ///< rms^2 of uncertainty of Y coordinate [cm]
+    fscal fDxy {0.};     ///< X/Y covariance [cm2]
+    fscal fDt2 {0.};     ///< measured uncertainty of time [ns]
+    fscal fRangeX {0.};  ///< +/- range of uncertainty of X coordinate [cm]
+    fscal fRangeY {0.};  ///< +/- range of uncertainty of Y coordinate [cm]
+    fscal fRangeT {0.};  ///< +/- range of uncertainty of time [ns]
 
     HitIndex_t fId {0};  ///< id of the hit
-    int iSt {-1};       ///< index of station in the active stations array
+    int fStation {-1};   ///< index of station in the active stations array
 
   private:
     /// Serialization method, used to save ca::Hit objects into binary or text file in a defined order
     template<class Archive>
     void serialize(Archive& ar, const unsigned int /*version*/)
     {
-      ar& f;
-      ar& b;
-      ar& x;
-      ar& y;
-      ar& z;
-      ar& t;
-      ar& dx2;
-      ar& dxy;
-      ar& dy2;
-      ar& dt2;
-      ar& rangeX;
-      ar& rangeY;
-      ar& rangeT;
+      ar& fFrontKey;
+      ar& fBackKey;
+      ar& fX;
+      ar& fY;
+      ar& fZ;
+      ar& fT;
+      ar& fDx2;
+      ar& fDy2;
+      ar& fDxy;
+      ar& fDt2;
+      ar& fRangeX;
+      ar& fRangeY;
+      ar& fRangeT;
       ar& fId;
-      ar& iSt;
+      ar& fStation;
     }
   };
 
diff --git a/reco/L1/CbmCaTimeSliceReader.cxx b/reco/L1/CbmCaTimeSliceReader.cxx
index 6d12d01060..87c39afdc0 100644
--- a/reco/L1/CbmCaTimeSliceReader.cxx
+++ b/reco/L1/CbmCaTimeSliceReader.cxx
@@ -402,23 +402,22 @@ void TimeSliceReader::StoreHitRecord(const HitRecord& hitRecord)
   // Save the algo hit
   if (fpIODataManager.get()) {
     ca::Hit aHit;
-    aHit.f   = hitRecord.fStripF;
-    aHit.b   = hitRecord.fStripB;
-    aHit.x   = hitRecord.fX;
-    aHit.y   = hitRecord.fY;
-    aHit.z   = hitRecord.fZ;
-    aHit.t   = hitRecord.fT;
-    aHit.dx2 = hitRecord.fDx2;
-    aHit.dxy = hitRecord.fDxy;
-    aHit.dy2 = hitRecord.fDy2;
-    aHit.dt2 = hitRecord.fDt2;
-
-    aHit.rangeX = hitRecord.fRangeX;
-    aHit.rangeY = hitRecord.fRangeY;
-    aHit.rangeT = hitRecord.fRangeT;
-
-    aHit.fId = static_cast<int>(fpIODataManager->GetNofHits());
-    aHit.iSt = hitRecord.fStaId;
+    aHit.SetFrontKey(hitRecord.fStripF);
+    aHit.SetBackKey(hitRecord.fStripB);
+    aHit.SetX(hitRecord.fX);
+    aHit.SetY(hitRecord.fY);
+    aHit.SetZ(hitRecord.fZ);
+    aHit.SetT(hitRecord.fT);
+    aHit.SetDx2(hitRecord.fDx2);
+    aHit.SetDy2(hitRecord.fDy2);
+    aHit.SetDxy(hitRecord.fDxy);
+    aHit.SetDt2(hitRecord.fDt2);
+    aHit.SetRangeX(hitRecord.fRangeX);
+    aHit.SetRangeY(hitRecord.fRangeY);
+    aHit.SetRangeT(hitRecord.fRangeT);
+    aHit.SetId(static_cast<int>(fpIODataManager->GetNofHits()));
+    aHit.SetStation(hitRecord.fStaId);
+
     fpIODataManager->PushBackHit(aHit, hitRecord.fDataStream);
   }
 
diff --git a/reco/L1/CbmL1.cxx b/reco/L1/CbmL1.cxx
index d72aafdb59..568c19efb8 100644
--- a/reco/L1/CbmL1.cxx
+++ b/reco/L1/CbmL1.cxx
@@ -758,7 +758,7 @@ void CbmL1::Reconstruct(CbmEvent* event)
   {
     for (ca::HitIndex_t i = 0; i < fpAlgo->GetInputData().GetNhits(); i++) {
       const ca::Hit& h = fpAlgo->GetInputData().GetHit(i);
-      fMaterialMonitor[h.iSt].MarkActiveBin(h.x, h.y);
+      fMaterialMonitor[h.Station()].MarkActiveBin(h.X(), h.Y());
     }
   }
   //
diff --git a/reco/L1/CbmL1Performance.cxx b/reco/L1/CbmL1Performance.cxx
index 52618e8061..720909cca5 100644
--- a/reco/L1/CbmL1Performance.cxx
+++ b/reco/L1/CbmL1Performance.cxx
@@ -338,9 +338,9 @@ void CbmL1::EfficienciesPerformance()
       for (unsigned int i = 0; i < rtraIt->Hits.size(); i++) {
         const ca::Hit& h           = fpAlgo->fInputData.GetHit(rtraIt->Hits[i]);
         const CbmL1HitDebugInfo& s = fvHitDebugInfo[rtraIt->Hits[i]];
-        cout << " x y z t " << s.x << " " << s.y << " " << h.z << " dx " << s.dx << " dy " << s.dy << std::endl;
-        cbm::ca::tools::Debugger::Instance().FillNtuple("ghost", statNghost, i, fabs(1. / tr.GetQp()[0]), s.x, s.y, h.z,
-                                                        h.t, s.dx, s.dy);
+        cout << " x y z t " << s.x << " " << s.y << " " << h.Z() << " dx " << s.dx << " dy " << s.dy << std::endl;
+        cbm::ca::tools::Debugger::Instance().FillNtuple("ghost", statNghost, i, fabs(1. / tr.GetQp()[0]), s.x, s.y,
+                                                        h.Z(), h.T(), s.dx, s.dy);
       }
       std::cout << tr.ToString(0);
       statNghost++;
diff --git a/reco/L1/CbmL1ReadEvent.cxx b/reco/L1/CbmL1ReadEvent.cxx
index 92f0eff196..618ccfbe3a 100644
--- a/reco/L1/CbmL1ReadEvent.cxx
+++ b/reco/L1/CbmL1ReadEvent.cxx
@@ -748,23 +748,23 @@ void CbmL1::ReadEvent(CbmEvent* event)
 
     ca::Hit h;
 
-    h.f   = th.iStripF;
-    h.b   = th.iStripB;
-    h.x   = th.x;
-    h.y   = th.y;
-    h.z   = th.z;
-    h.t   = th.time;
-    h.dx2 = th.dx2;
-    h.dy2 = th.dy2;
-    h.dxy = th.dxy;
-    h.dt2 = th.dt2;
-
-    h.rangeX = th.rangeX;
-    h.rangeY = th.rangeY;
-    h.rangeT = th.rangeT;
-
-    h.fId = iHit;
-    h.iSt = th.iStation;
+    h.SetFrontKey(th.iStripF);
+    h.SetBackKey(th.iStripB);
+    h.SetX(th.x);
+    h.SetY(th.y);
+    h.SetZ(th.z);
+    h.SetT(th.time);
+    h.SetDx2(th.dx2);
+    h.SetDy2(th.dy2);
+    h.SetDxy(th.dxy);
+    h.SetDt2(th.dt2);
+
+    h.SetRangeX(th.rangeX);
+    h.SetRangeY(th.rangeY);
+    h.SetRangeT(th.rangeT);
+
+    h.SetId(iHit);
+    h.SetStation(th.iStation);
 
     // save hit
     fvExternalHits.push_back(CbmL1HitId(th.Det, th.ExtIndex));
diff --git a/reco/L1/L1Algo/L1BranchExtender.cxx b/reco/L1/L1Algo/L1BranchExtender.cxx
index 42d03fb982..a065721421 100644
--- a/reco/L1/L1Algo/L1BranchExtender.cxx
+++ b/reco/L1/L1Algo/L1BranchExtender.cxx
@@ -45,24 +45,24 @@ void L1Algo::BranchFitterFast(const L1Branch& t, TrackParamV& Tout, const bool u
   const ca::Hit& hit1 = fInputData.GetHit(hits[iFirstHit + step]);
   const ca::Hit& hit2 = fInputData.GetHit(hits[iFirstHit + 2 * step]);
 
-  int ista0 = hit0.iSt;
-  int ista1 = hit1.iSt;
-  int ista2 = hit2.iSt;
+  int ista0 = hit0.Station();
+  int ista1 = hit1.Station();
+  int ista2 = hit2.Station();
 
   const ca::Station& sta0 = fParameters.GetStation(ista0);
   const ca::Station& sta1 = fParameters.GetStation(ista1);
   const ca::Station& sta2 = fParameters.GetStation(ista2);
 
-  fvec x0 = hit0.x;
-  fvec y0 = hit0.y;
-  fvec z0 = hit0.z;
+  fvec x0 = hit0.X();
+  fvec y0 = hit0.Y();
+  fvec z0 = hit0.Z();
 
-  fvec x1 = hit1.x;
-  fvec y1 = hit1.y;
-  fvec z1 = hit1.z;
+  fvec x1 = hit1.X();
+  fvec y1 = hit1.Y();
+  fvec z1 = hit1.Z();
 
-  fvec x2 = hit2.x;
-  fvec y2 = hit2.y;
+  fvec x2 = hit2.X();
+  fvec y2 = hit2.Y();
 
   T.X() = x0;
   T.Y() = y0;
@@ -75,16 +75,16 @@ void L1Algo::BranchFitterFast(const L1Branch& t, TrackParamV& Tout, const bool u
   fit.SetQp0(qp0);
 
   T.Z()    = z0;
-  T.Time() = hit0.t;
+  T.Time() = hit0.T();
   T.Vi()   = 0.;
 
-  T.ResetErrors(1., 1., .1, .1, 1., (sta0.timeInfo ? hit0.dt2 : 1.e6), 1.e6);
+  T.ResetErrors(1., 1., .1, .1, 1., (sta0.timeInfo ? hit0.dT2() : 1.e6), 1.e6);
   T.Ndf()     = fvec(2.);
   T.NdfTime() = sta0.timeInfo ? fvec(-1.) : fvec(-2.);
 
-  T.C00() = hit0.dx2;
-  T.C10() = hit0.dxy;
-  T.C11() = hit0.dy2;
+  T.C00() = hit0.dX2();
+  T.C10() = hit0.dXY();
+  T.C11() = hit0.dY2();
 
   ca::FieldRegion fld _fvecalignment;
   fvec fldZ0 = sta1.fZ;  // suppose field is smoth
@@ -100,10 +100,10 @@ void L1Algo::BranchFitterFast(const L1Branch& t, TrackParamV& Tout, const bool u
 
   for (int i = iFirstHit + step; step * i <= step * iLastHit; i += step) {
     const ca::Hit& hit     = fInputData.GetHit(hits[i]);
-    int ista               = hit.iSt;
+    int ista               = hit.Station();
     const ca::Station& sta = fParameters.GetStation(ista);
 
-    fit.Extrapolate(hit.z, fld);
+    fit.Extrapolate(hit.Z(), fld);
     fit.FilterHit(sta, hit);
     auto radThick = fParameters.GetMaterialThickness(ista, T.X(), T.Y());
     fit.AddMsInMaterial(radThick);
@@ -113,7 +113,7 @@ void L1Algo::BranchFitterFast(const L1Branch& t, TrackParamV& Tout, const bool u
     fldB1 = fldB2;
     fldZ0 = fldZ1;
     fldZ1 = fldZ2;
-    fldB2 = sta.fieldSlice.GetFieldValue(hit.x, hit.y);
+    fldB2 = sta.fieldSlice.GetFieldValue(hit.X(), hit.Y());
     fldZ2 = sta.fZ;
     fld.Set(fldB2, fldZ2, fldB1, fldZ1, fldB0, fldZ0);
   }  // i
@@ -155,22 +155,22 @@ void L1Algo::FindMoreHits(L1Branch& t, TrackParamV& Tout, const bool upstream, c
   const ca::Hit& hit1 = fInputData.GetHit(t.fHits[iFirstHit + step]);
   const ca::Hit& hit2 = fInputData.GetHit(t.fHits[iFirstHit + 2 * step]);
 
-  const int ista0 = hit0.iSt;
-  const int ista1 = hit1.iSt;
-  const int ista2 = hit2.iSt;
+  const int ista0 = hit0.Station();
+  const int ista1 = hit1.Station();
+  const int ista2 = hit2.Station();
 
   const ca::Station& sta0 = fParameters.GetStation(ista0);
   const ca::Station& sta1 = fParameters.GetStation(ista1);
   const ca::Station& sta2 = fParameters.GetStation(ista2);
 
-  fvec x0 = hit0.x;
-  fvec y0 = hit0.y;
+  fvec x0 = hit0.X();
+  fvec y0 = hit0.Y();
 
-  fvec x1 = hit1.x;
-  fvec y1 = hit1.y;
+  fvec x1 = hit1.X();
+  fvec y1 = hit1.Y();
 
-  fvec x2 = hit2.x;
-  fvec y2 = hit2.y;
+  fvec x2 = hit2.X();
+  fvec y2 = hit2.Y();
 
   ca::FieldRegion fld _fvecalignment;
   fvec fldZ0 = sta1.fZ;
@@ -214,28 +214,28 @@ void L1Algo::FindMoreHits(L1Branch& t, TrackParamV& Tout, const bool upstream, c
       const ca::Hit& hit = fWindowHits[ih];
 
       if (sta.timeInfo && tr.NdfTime()[0] > -2.) {
-        fscal dt = hit.t - tr.Time()[0];
-        if (fabs(dt) > sqrt(25. * tr.C55()[0]) + hit.rangeT) continue;
+        fscal dt = hit.T() - tr.Time()[0];
+        if (fabs(dt) > sqrt(25. * tr.C55()[0]) + hit.RangeT()) continue;
       }
 
       //if (GetFUsed((*fStripFlag)[hit.f] | (*fStripFlag)[hit.b])) continue;  // if used
       //L1_SHOW(fvHitKeyFlags.size());
       //L1_SHOW(hit.f);
       //L1_SHOW(hit.b);
-      if (fvHitKeyFlags[hit.f] || fvHitKeyFlags[hit.b]) { continue; }
+      if (fvHitKeyFlags[hit.FrontKey()] || fvHitKeyFlags[hit.BackKey()]) { continue; }
 
       fvec y, C11;
-      fit.ExtrapolateYC11Line(hit.z, y, C11);
+      fit.ExtrapolateYC11Line(hit.Z(), y, C11);
 
       //   fscal dym_est = ( fPickGather * sqrt(fabs(C11[0]+sta.XYInfo.C11[0])) );
       //   fscal y_minus_new = y[0] - dym_est;
       // if (yh < y_minus_new) continue;  // CHECKME take into account overlaping?
 
       fvec x, C00;
-      fit.ExtrapolateXC00Line(hit.z, x, C00);
+      fit.ExtrapolateXC00Line(hit.Z(), x, C00);
 
-      fscal d_x = hit.x - x[0];
-      fscal d_y = hit.y - y[0];
+      fscal d_x = hit.X() - x[0];
+      fscal d_y = hit.Y() - y[0];
       fscal d2  = d_x * d_x + d_y * d_y;
       if (d2 > r2_best) continue;
 
@@ -252,7 +252,7 @@ void L1Algo::FindMoreHits(L1Branch& t, TrackParamV& Tout, const bool upstream, c
 
     const ca::Hit& hit = fWindowHits[iHit_best];
 
-    fit.Extrapolate(hit.z, fld);
+    fit.Extrapolate(hit.Z(), fld);
     fit.FilterHit(sta, hit);
     auto radThick = fParameters.GetMaterialThickness(ista, tr.X(), tr.Y());
     fit.AddMsInMaterial(radThick);
@@ -262,7 +262,7 @@ void L1Algo::FindMoreHits(L1Branch& t, TrackParamV& Tout, const bool upstream, c
     fldB1 = fldB2;
     fldZ0 = fldZ1;
     fldZ1 = fldZ2;
-    fldB2 = sta.fieldSlice.GetFieldValue(hit.x, hit.y);
+    fldB2 = sta.fieldSlice.GetFieldValue(hit.X(), hit.Y());
     fldZ2 = sta.fZ;
     fld.Set(fldB2, fldZ2, fldB1, fldZ1, fldB0, fldZ0);
   }
diff --git a/reco/L1/L1Algo/L1CaTrackFinder.cxx b/reco/L1/L1Algo/L1CaTrackFinder.cxx
index d054875c45..ab026223b1 100644
--- a/reco/L1/L1Algo/L1CaTrackFinder.cxx
+++ b/reco/L1/L1Algo/L1CaTrackFinder.cxx
@@ -76,11 +76,11 @@ void L1Algo::CaTrackFinder()
 
       ca::HitIndex_t caHitId = fInputData.GetStreamStartIndex(iStream) + ih;
       const ca::Hit& h       = fInputData.GetHit(caHitId);
-      const ca::Station& st  = fParameters.GetStation(h.iSt);
+      const ca::Station& st  = fParameters.GetStation(h.Station());
 
-      fscal dx    = h.x - targX;
-      fscal dy    = h.y - targY;
-      fscal dz    = h.z - targZ;
+      fscal dx    = h.X() - targX;
+      fscal dy    = h.Y() - targY;
+      fscal dz    = h.Z() - targZ;
       fscal l     = sqrt(dx * dx + dy * dy + dz * dz);
 
       fscal timeOfFlightMin = l * constants::phys::SpeedOfLightInv;
@@ -88,11 +88,11 @@ void L1Algo::CaTrackFinder()
         1.5 * l
         * sqrt(1. + constants::phys::ProtonMassD * constants::phys::ProtonMassD / minProtonMomentum / minProtonMomentum)
         * constants::phys::SpeedOfLightInvD;
-      fscal dt = h.rangeT;
+      fscal dt = h.RangeT();
 
       L1HitTimeInfo& info = fHitTimeInfo[caHitId];
-      info.fEventTimeMin  = h.t - dt - timeOfFlightMax;
-      info.fEventTimeMax  = h.t + dt - timeOfFlightMin;
+      info.fEventTimeMin  = h.T() - dt - timeOfFlightMax;
+      info.fEventTimeMax  = h.T() + dt - timeOfFlightMin;
 
       if (!st.timeInfo) {
         info.fEventTimeMin = std::numeric_limits<fscal>::lowest();
@@ -148,7 +148,7 @@ void L1Algo::CaTrackFinder()
            ++caHitId) {
         L1HitTimeInfo& info = fHitTimeInfo[caHitId];
         const ca::Hit& h    = fInputData.GetHit(caHitId);
-        if (fvHitKeyFlags[h.f] || fvHitKeyFlags[h.b]) {  // the hit is already reconstructed
+        if (fvHitKeyFlags[h.FrontKey()] || fvHitKeyFlags[h.BackKey()]) {  // the hit is already reconstructed
           continue;
         }
         if (info.fEventTimeMin > tsStart + tsLength) {  // the hit is too late for the sub slice
@@ -160,7 +160,7 @@ void L1Algo::CaTrackFinder()
         }
         else {
           if (tsStart <= info.fEventTimeMax) {  // the hit belongs to the sub-slice
-            fSliceHitIds[h.iSt].push_back(caHitId);
+            fSliceHitIds[h.Station()].push_back(caHitId);
             if (info.fMaxTimeBeforeHit < tsStart + tsLength - tsOverlap) {
               // this hit and all hits before are before the overlap
               sliceFirstHit[iStream] = caHitId + 1;
@@ -206,8 +206,8 @@ void L1Algo::CaTrackFinder()
         for (int i = 0; i < it->fNofHits; i++) {
           int caHitId        = fSliceRecoHits[trackFirstHit + i];
           const auto& h      = fInputData.GetHit(caHitId);
-          fvHitKeyFlags[h.f] = 0;
-          fvHitKeyFlags[h.b] = 0;
+          fvHitKeyFlags[h.FrontKey()] = 0;
+          fvHitKeyFlags[h.BackKey()]  = 0;
         }
       }
       else {  // save the track
@@ -216,8 +216,8 @@ void L1Algo::CaTrackFinder()
         for (int i = 0; i < it->fNofHits; i++) {
           int caHitId        = fSliceRecoHits[trackFirstHit + i];
           const auto& h      = fInputData.GetHit(caHitId);
-          fvHitKeyFlags[h.f] = 1;
-          fvHitKeyFlags[h.b] = 1;
+          fvHitKeyFlags[h.FrontKey()] = 1;
+          fvHitKeyFlags[h.BackKey()]  = 1;
           fRecoHits.push_back(caHitId);
         }
       }
diff --git a/reco/L1/L1Algo/L1CaTrackFinderSlice.cxx b/reco/L1/L1Algo/L1CaTrackFinderSlice.cxx
index d775aaa7b2..bfcaedaf6d 100644
--- a/reco/L1/L1Algo/L1CaTrackFinderSlice.cxx
+++ b/reco/L1/L1Algo/L1CaTrackFinderSlice.cxx
@@ -136,7 +136,7 @@ void L1Algo::ReadWindowData()
   for (int iS = 0; iS < fParameters.GetNstationsActive(); iS++) {
     for (ca::HitIndex_t ih = 0; ih < fSliceHitIds[iS].size(); ++ih) {
       ca::Hit h = fInputData.GetHit(fSliceHitIds[iS][ih]);
-      h.fId     = fSliceHitIds[iS][ih];
+      h.SetId(fSliceHitIds[iS][ih]);
 
       fWindowHits[fStationHitsStartIndex[iS] + ih] = h;
     }
@@ -238,12 +238,12 @@ void L1Algo::CaTrackFinderSlice()
     for (ca::HitIndex_t ih = 0; ih < fSliceHitIds[iS].size(); ++ih) {
       const ca::Hit& h = fInputData.GetHit(fSliceHitIds[iS][ih]);
 
-      if (h.x < gridMinX) { gridMinX = h.x; }
-      if (h.x > gridMaxX) { gridMaxX = h.x; }
-      if (h.y < gridMinY) { gridMinY = h.y; }
-      if (h.y > gridMaxY) { gridMaxY = h.y; }
+      if (h.X() < gridMinX) { gridMinX = h.X(); }
+      if (h.X() > gridMaxX) { gridMaxX = h.X(); }
+      if (h.Y() < gridMinY) { gridMinY = h.Y(); }
+      if (h.Y() > gridMaxY) { gridMaxY = h.Y(); }
 
-      const fscal time = h.t;
+      const fscal time = h.T();
       assert(std::isfinite(time));
       if (timeUninitialised || lasttime < time) { lasttime = time; }
       if (timeUninitialised || starttime > time) { starttime = time; }
@@ -475,8 +475,8 @@ void L1Algo::CaTrackFinderSlice()
         for (Tindex itrip = 0; itrip < (Tindex) fTriplets[istaF].size(); ++itrip) {
 
           ca::Triplet& first_trip = (fTriplets[istaF][itrip]);
-          if (fvHitKeyFlags[fWindowHits[first_trip.GetLHit()].f]
-              || fvHitKeyFlags[fWindowHits[first_trip.GetLHit()].b]) {
+          if (fvHitKeyFlags[fWindowHits[first_trip.GetLHit()].FrontKey()]
+              || fvHitKeyFlags[fWindowHits[first_trip.GetLHit()].BackKey()]) {
             continue;
           }
           //               ghost suppression !!!
@@ -484,7 +484,7 @@ void L1Algo::CaTrackFinderSlice()
 
           if (!fpCurrentIteration->GetTrackFromTripletsFlag()) {  // ghost suppression !!!
             int nHits = 3 + first_trip.GetLevel();
-            if (fWindowHits[first_trip.GetLHit()].iSt == 0) {
+            if (fWindowHits[first_trip.GetLHit()].Station() == 0) {
               if (nHits < fpCurrentIteration->GetMinNhitsStation0()) { continue; }
             }
             else {
@@ -568,7 +568,7 @@ void L1Algo::CaTrackFinderSlice()
             const ca::Hit& h = fInputData.GetHit(tr.fHits[iHit]);
             bool isAlive     = true;
             {  // front  strip
-              auto& stripF = (fStripToTrack)[h.f];
+              auto& stripF = (fStripToTrack)[h.FrontKey()];
               if ((stripF >= 0) && (stripF != tr.fID)) {  // strip is used by other candidate
                 const auto& other = fTrackCandidates[stripF];
                 if (!other.fIsAlive && L1Branch::compareCand(tr, other)) { stripF = tr.fID; }
@@ -583,7 +583,7 @@ void L1Algo::CaTrackFinderSlice()
             }
 
             {  // back strip
-              auto& stripB = (fStripToTrack)[h.b];
+              auto& stripB = (fStripToTrack)[h.BackKey()];
               if ((stripB >= 0) && (stripB != tr.fID)) {  // strip is used by other candidate
                 const auto& other = fTrackCandidates[stripB];
                 if (!other.fIsAlive && L1Branch::compareCand(tr, other)) { stripB = tr.fID; }
@@ -608,14 +608,15 @@ void L1Algo::CaTrackFinderSlice()
           tr.fIsAlive = true;
           for (int iHit = 0; tr.fIsAlive && (iHit < (int) tr.fHits.size()); ++iHit) {
             const ca::Hit& h = fInputData.GetHit(tr.fHits[iHit]);
-            tr.fIsAlive      = tr.fIsAlive && ((fStripToTrack)[h.f] == tr.fID) && ((fStripToTrack)[h.b] == tr.fID);
+            tr.fIsAlive =
+              tr.fIsAlive && ((fStripToTrack)[h.FrontKey()] == tr.fID) && ((fStripToTrack)[h.BackKey()] == tr.fID);
           }
 
           if (!tr.fIsAlive) {  // release strips
             for (int iHit = 0; (iHit < (int) tr.fHits.size()); ++iHit) {
               const ca::Hit& h = fInputData.GetHit(tr.fHits[iHit]);
-              if (fStripToTrack[h.f] == tr.fID) { fStripToTrack[h.f] = -1; }
-              if (fStripToTrack[h.b] == tr.fID) { fStripToTrack[h.b] = -1; }
+              if (fStripToTrack[h.FrontKey()] == tr.fID) { fStripToTrack[h.FrontKey()] = -1; }
+              if (fStripToTrack[h.BackKey()] == tr.fID) { fStripToTrack[h.BackKey()] = -1; }
             }
           }
           else {
@@ -650,8 +651,8 @@ void L1Algo::CaTrackFinderSlice()
 
           /// used strips are marked
 
-          fvHitKeyFlags[hit.f] = 1;
-          fvHitKeyFlags[hit.b] = 1;
+          fvHitKeyFlags[hit.FrontKey()] = 1;
+          fvHitKeyFlags[hit.BackKey()]  = 1;
 
           fSliceRecoHits.push_back(iHit);
         }
@@ -675,9 +676,9 @@ void L1Algo::CaTrackFinderSlice()
     // suppress strips of suppressed hits
     for (unsigned int ih = 0; ih < fWindowHits.size(); ih++) {
       if (fIsWindowHitSuppressed[ih]) {
-        const ca::Hit& hit   = fWindowHits[ih];
-        fvHitKeyFlags[hit.f] = 1;
-        fvHitKeyFlags[hit.b] = 1;
+        const ca::Hit& hit            = fWindowHits[ih];
+        fvHitKeyFlags[hit.FrontKey()] = 1;
+        fvHitKeyFlags[hit.BackKey()]  = 1;
       }
     }
 
@@ -770,7 +771,7 @@ void L1Algo::CAFindTrack(int ista, L1Branch& best_tr, unsigned char& best_L, fsc
     //L1_SHOW(fvHitKeyFlags.size());
     //L1_SHOW(fGridHits[ihitm].f);
     //L1_SHOW(fGridHits[ihitm].b);
-    if (!(fvHitKeyFlags[fWindowHits[ihitm].f] || fvHitKeyFlags[fWindowHits[ihitm].b])) {
+    if (!(fvHitKeyFlags[fWindowHits[ihitm].FrontKey()] || fvHitKeyFlags[fWindowHits[ihitm].BackKey()])) {
 
       //        curr_tr.Hits.push_back(fGridHitIds[ihitm]);
 
@@ -786,7 +787,7 @@ void L1Algo::CAFindTrack(int ista, L1Branch& best_tr, unsigned char& best_L, fsc
     //L1_SHOW(fvHitKeyFlags.size());
     //L1_SHOW(fGridHits[ihitr].f);
     //L1_SHOW(fGridHits[ihitr].b);
-    if (!(fvHitKeyFlags[fWindowHits[ihitr].f] || fvHitKeyFlags[fWindowHits[ihitr].b])) {
+    if (!(fvHitKeyFlags[fWindowHits[ihitr].FrontKey()] || fvHitKeyFlags[fWindowHits[ihitr].BackKey()])) {
 
       //curr_tr.Hits.push_back(fGridHitIds[ihitr]);
       curr_tr.fHits.push_back(fWindowHits[ihitr].Id());
@@ -842,8 +843,8 @@ void L1Algo::CAFindTrack(int ista, L1Branch& best_tr, unsigned char& best_L, fsc
       fscal dchi2 = 0.;
       if (!checkTripletMatch(*curr_trip, new_trip, dchi2)) continue;
 
-      if (fvHitKeyFlags[fWindowHits[new_trip.GetLHit()].f]
-          || fvHitKeyFlags[fWindowHits[new_trip.GetLHit()].b]) {  //hits are used
+      if (fvHitKeyFlags[fWindowHits[new_trip.GetLHit()].FrontKey()]
+          || fvHitKeyFlags[fWindowHits[new_trip.GetLHit()].BackKey()]) {  //hits are used
         //  no used hits allowed -> compare and store track
         if ((curr_L > best_L) || ((curr_L == best_L) && (curr_chi2 < best_chi2))) {
           best_tr = curr_tr;
diff --git a/reco/L1/L1Algo/L1CloneMerger.cxx b/reco/L1/L1Algo/L1CloneMerger.cxx
index 977f25c64a..f62bb60e53 100644
--- a/reco/L1/L1Algo/L1CloneMerger.cxx
+++ b/reco/L1/L1Algo/L1CloneMerger.cxx
@@ -68,10 +68,10 @@ void L1CloneMerger::Exec(Vector<Track>& extTracks, Vector<ca::HitIndex_t>& extRe
 #endif
   for (int iTr = 0; iTr < nTracks; iTr++) {
     firstHit[iTr]     = start_hit;
-    firstStation[iTr] = frAlgo.GetInputData().GetHit(extRecoHits[start_hit]).iSt;
+    firstStation[iTr] = frAlgo.GetInputData().GetHit(extRecoHits[start_hit]).Station();
     start_hit += extTracks[iTr].fNofHits - 1;
     lastHit[iTr]     = start_hit;
-    lastStation[iTr] = frAlgo.GetInputData().GetHit(extRecoHits[start_hit]).iSt;
+    lastStation[iTr] = frAlgo.GetInputData().GetHit(extRecoHits[start_hit]).Station();
     start_hit++;
 
     isStored[iTr]              = false;
diff --git a/reco/L1/L1Algo/L1Fit.cxx b/reco/L1/L1Algo/L1Fit.cxx
index a6ba2bf0d4..70d81b0a00 100644
--- a/reco/L1/L1Algo/L1Fit.cxx
+++ b/reco/L1/L1Algo/L1Fit.cxx
@@ -308,11 +308,11 @@ void L1Fit::FilterXY(const L1XYMeasurementInfo& info, cnst& x, cnst& y)
 void L1Fit::FilterHit(const ca::Station& sta, const ca::Hit& hit)
 {
   L1XYMeasurementInfo info;
-  info.C00 = hit.dx2;
-  info.C10 = hit.dxy;
-  info.C11 = hit.dy2;
-  FilterXY(info, hit.x, hit.y);
-  FilterTime(hit.t, hit.dt2, sta.timeInfo);
+  info.C00 = hit.dX2();
+  info.C10 = hit.dXY();
+  info.C11 = hit.dY2();
+  FilterXY(info, hit.X(), hit.Y());
+  FilterTime(hit.T(), hit.dT2(), sta.timeInfo);
 }
 
 void L1Fit::FilterExtrapolatedXY(cnst& x, cnst& y, const L1XYMeasurementInfo& info, cnst& extrX, cnst& extrY,
diff --git a/reco/L1/L1Algo/L1TrackFitter.cxx b/reco/L1/L1Algo/L1TrackFitter.cxx
index 5353b385b0..82917095cc 100644
--- a/reco/L1/L1Algo/L1TrackFitter.cxx
+++ b/reco/L1/L1Algo/L1TrackFitter.cxx
@@ -129,7 +129,7 @@ void L1Algo::L1KFTrackFitter()
       for (int ih = 0; ih < nHitsTrack; ih++) {
 
         const ca::Hit& hit = fInputData.GetHit(fSliceRecoHits[start_hit++]);
-        const int ista   = hit.iSt;
+        const int ista     = hit.Station();
 
         //if (sta[ista].fieldStatus) { isFieldPresent[iVec] = true; }
 
@@ -137,16 +137,16 @@ void L1Algo::L1KFTrackFitter()
         w[ista][iVec] = true;
         if (sta[ista].timeInfo) { w_time[ista][iVec] = true; }
 
-        x[ista][iVec]    = hit.x;  //x_temp[iVec];
-        y[ista][iVec]    = hit.y;  //y_temp[iVec];
-        time[ista][iVec] = hit.t;
-        dt2[ista][iVec]  = hit.dt2;
+        x[ista][iVec]    = hit.X();  //x_temp[iVec];
+        y[ista][iVec]    = hit.Y();  //y_temp[iVec];
+        time[ista][iVec] = hit.T();
+        dt2[ista][iVec]  = hit.dT2();
         if (!sta[ista].timeInfo) { dt2[ista][iVec] = 1.e4; }
-        z[ista][iVec] = hit.z;
+        z[ista][iVec]          = hit.Z();
         fB_temp                = sta[ista].fieldSlice.GetFieldValue(x[ista], y[ista]);
-        cov_xy[ista].C00[iVec] = hit.dx2;
-        cov_xy[ista].C10[iVec] = hit.dxy;
-        cov_xy[ista].C11[iVec] = hit.dy2;
+        cov_xy[ista].C00[iVec] = hit.dX2();
+        cov_xy[ista].C10[iVec] = hit.dXY();
+        cov_xy[ista].C11[iVec] = hit.dY2();
 
         fB[ista].x[iVec] = fB_temp.x[iVec];
         fB[ista].y[iVec] = fB_temp.y[iVec];
diff --git a/reco/L1/L1Algo/L1TripletConstructor.cxx b/reco/L1/L1Algo/L1TripletConstructor.cxx
index 9e6042279c..68fd9c1dbf 100644
--- a/reco/L1/L1Algo/L1TripletConstructor.cxx
+++ b/reco/L1/L1Algo/L1TripletConstructor.cxx
@@ -408,14 +408,14 @@ void L1TripletConstructor::FitTriplets()
 
     for (int ih = 0; ih < NHits; ++ih) {
       const ca::Hit& hit = fAlgo->fInputData.GetHit(ihit[ih]);
-      x[ih]              = hit.x;
-      y[ih]              = hit.y;
-      z[ih]              = hit.z;
-      t[ih]              = hit.t;
-      cov[ih].C00        = hit.dx2;
-      cov[ih].C10        = hit.dxy;
-      cov[ih].C11        = hit.dy2;
-      dt2[ih]            = hit.dt2;
+      x[ih]              = hit.X();
+      y[ih]              = hit.Y();
+      z[ih]              = hit.Z();
+      t[ih]              = hit.T();
+      cov[ih].C00        = hit.dX2();
+      cov[ih].C10        = hit.dXY();
+      cov[ih].C11        = hit.dY2();
+      dt2[ih]            = hit.dT2();
     };
 
     // find the field along the track
@@ -534,9 +534,9 @@ void L1TripletConstructor::FitTriplets()
       if ((mc1 >= 0) && (mc1 == mc2) && (mc1 == mc3)) {
         const CbmL1MCTrack& mctr = CbmL1::Instance()->GetMcTracks()[mc1];
         cbm::ca::tools::Debugger::Instance().FillNtuple(
-          "triplets", mctr.iEvent, fAlgo->fCurrentIterationIndex, ih0, h0.x, h0.y, h0.z, ih1, h1.x, h1.y, h1.z, ih2,
-          h2.x, h2.y, h2.z, mc1, fIstaL, mctr.p, mctr.x, mctr.y, mctr.z, (float) T.GetChiSq()[0], (float) T.Ndf()[0],
-          (float) T.ChiSqTime()[0], (float) T.NdfTime()[0]);
+          "triplets", mctr.iEvent, fAlgo->fCurrentIterationIndex, ih0, h0.X(), h0.Y(), h0.Z(), ih1, h1.X(), h1.Y(),
+          h1.Z(), ih2, h2.X(), h2.Y(), h2.Z(), mc1, fIstaL, mctr.p, mctr.x, mctr.y, mctr.z, (float) T.GetChiSq()[0],
+          (float) T.Ndf()[0], (float) T.ChiSqTime()[0], (float) T.NdfTime()[0]);
       }
     }
   }  //i3
diff --git a/reco/L1/L1Algo/utils/L1AlgoDraw.cxx b/reco/L1/L1Algo/utils/L1AlgoDraw.cxx
index 17da462b57..b4e6b7850b 100644
--- a/reco/L1/L1Algo/utils/L1AlgoDraw.cxx
+++ b/reco/L1/L1Algo/utils/L1AlgoDraw.cxx
@@ -238,7 +238,7 @@ void L1AlgoDraw::DrawRecoTracks()
   int NRecTracks = 0;
   //   CbmL1 &L1 = *CbmL1::Instance();
 
-  int curRecoHit                   = 0;
+  int curRecoHit                                  = 0;
   cbm::algo::ca::Vector<ca::HitIndex_t>& recoHits = algo->fSliceRecoHits;
   for (vector<Track>::iterator it = algo->fSliceRecoTracks.begin(); it != algo->fSliceRecoTracks.end(); ++it) {
     Track& T  = *it;
@@ -373,8 +373,8 @@ void L1AlgoDraw::DrawDoublets(vector<ca::HitIndex_t>* Doublets_hits,
                               ca::HitIndex_t* StsRestHitsStartIndex, unsigned int* realIHit)
 {
   for (int iSta = 0; iSta < NStations - 1; iSta++) {
-    const int firstHitOnSta                           = StsRestHitsStartIndex[iSta];
-    const int firstHitOnNextSta                       = StsRestHitsStartIndex[iSta + 1];
+    const int firstHitOnSta                               = StsRestHitsStartIndex[iSta];
+    const int firstHitOnNextSta                           = StsRestHitsStartIndex[iSta + 1];
     ca::HitIndex_t* staDoubletsHits                       = &(Doublets_hits[iSta][0]);
     map<ca::HitIndex_t, ca::HitIndex_t>& staDoubletsStart = Doublets_start[iSta];
 
@@ -405,8 +405,8 @@ void L1AlgoDraw::DrawDoublets(vector<ca::HitIndex_t>* Doublets_hits,
 void L1AlgoDraw::DrawDoubletsOnSta(int iSta, ca::HitIndex_t* Doublets_hits, ca::HitIndex_t* Doublets_start,
                                    const int MaxArrSize, ca::HitIndex_t* StsRestHitsStartIndex, unsigned int* realIHit)
 {
-  const int firstHitOnSta        = StsRestHitsStartIndex[iSta];
-  const int firstHitOnNextSta    = StsRestHitsStartIndex[iSta + 1];
+  const int firstHitOnSta          = StsRestHitsStartIndex[iSta];
+  const int firstHitOnNextSta      = StsRestHitsStartIndex[iSta + 1];
   ca::HitIndex_t* staDoubletsHits  = Doublets_hits + MaxArrSize * iSta;
   ca::HitIndex_t* staDoubletsStart = Doublets_start + MaxArrSize * iSta;
 
@@ -562,10 +562,10 @@ void L1AlgoDraw::DrawInputHits()
     Int_t n_poly_fake = 0;
     for (int ih = HitsStartIndex[ista]; ih < HitsStopIndex[ista]; ih++) {
       ca::Hit& h = vHits[ih];
-      int iMC  = CbmL1::Instance()->GetHitBestMcRefs()[ih];
+      int iMC    = CbmL1::Instance()->GetHitBestMcRefs()[ih];
       //if( (vSFlag[h.f] | vSFlagB[h.b] )&0x02 ) continue; // if used
 
-      fscal x = h.x, y = h.y, z = h.z;
+      fscal x = h.X(), y = h.Y(), z = h.Z();
       fscal x_t, z_t;
 
       TVector3 v3(x, y, z);
@@ -693,12 +693,12 @@ void L1AlgoDraw::DrawRestHits(ca::HitIndex_t* StsRestHitsStartIndex, ca::HitInde
     Int_t n_poly      = 0;
     Int_t n_poly_fake = 0;
     for (ca::HitIndex_t iRestHit = StsRestHitsStartIndex[ista]; iRestHit < StsRestHitsStopIndex[ista]; iRestHit++) {
-      int ih   = realIHit[iRestHit];
+      int ih     = realIHit[iRestHit];
       ca::Hit& h = vHits[ih];
-      int iMC  = CbmL1::Instance()->GetHitBestMcRefs()[ih];
+      int iMC    = CbmL1::Instance()->GetHitBestMcRefs()[ih];
       //if( (vSFlag[h.f] | vSFlagB[h.b] )&0x02 ) continue; // if used
 
-      fscal x = h.x, y = h.y, z = h.z;
+      fscal x = h.X(), y = h.Y(), z = h.Z();
 
       if (iMC >= 0) {
         x_poly[n_poly] = x;
@@ -795,7 +795,7 @@ void L1AlgoDraw::ClearVeiw()
 L1AlgoDraw::Point L1AlgoDraw::GetHitCoor(int ih)
 {
   ca::Hit& hit = vHits[ih];
-  return Point(hit.x, hit.y, hit.z);
+  return Point(hit.X(), hit.Y(), hit.Z());
 };
 
 void L1AlgoDraw::SaveCanvas(TString name)
-- 
GitLab