From 9c3bdbfd7ba3b68fa95866ff85138779e9c70381 Mon Sep 17 00:00:00 2001
From: "se.gorbunov" <se.gorbunov@gsi.de>
Date: Sat, 30 Dec 2023 14:21:28 +0000
Subject: [PATCH] mvd: bugfix in the coordinate transformation

---
 .../detectors/mvd/plugins/tasks/CbmMvdSensorFindHitTask.cxx | 6 ++----
 .../mvd/plugins/tasks/CbmMvdSensorHitfinderTask.cxx         | 6 ++----
 2 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/reco/detectors/mvd/plugins/tasks/CbmMvdSensorFindHitTask.cxx b/reco/detectors/mvd/plugins/tasks/CbmMvdSensorFindHitTask.cxx
index 7fc5b0394e..1ef479a453 100644
--- a/reco/detectors/mvd/plugins/tasks/CbmMvdSensorFindHitTask.cxx
+++ b/reco/detectors/mvd/plugins/tasks/CbmMvdSensorFindHitTask.cxx
@@ -556,10 +556,8 @@ void CbmMvdSensorFindHitTask::CreateHit(vector<Int_t>* clusterArray, TVector3& p
 
 
   Int_t indexX, indexY;
-  //Double_t x,y;
-  Double_t local[2];
-  local[0] = pos.X();
-  local[1] = pos.Y();
+  Double_t local[3] = {pos.X(), pos.Y(), pos.Z()};
+
   //LOG(debug) << "found center of gravity at: " << local[0] << " , " << local[1];
 
   fSensor->TopToPixel(local, indexX, indexY);
diff --git a/reco/detectors/mvd/plugins/tasks/CbmMvdSensorHitfinderTask.cxx b/reco/detectors/mvd/plugins/tasks/CbmMvdSensorHitfinderTask.cxx
index 3c4a4365ca..22268461f0 100644
--- a/reco/detectors/mvd/plugins/tasks/CbmMvdSensorHitfinderTask.cxx
+++ b/reco/detectors/mvd/plugins/tasks/CbmMvdSensorHitfinderTask.cxx
@@ -257,10 +257,8 @@ void CbmMvdSensorHitfinderTask::CreateHit(CbmMvdCluster* cluster, TVector3& pos,
 
 
   Int_t indexX, indexY;
-  //Double_t x,y;
-  Double_t local[2];
-  local[0] = pos.X();
-  local[1] = pos.Y();
+  Double_t local[3] = {pos.X(), pos.Y(), pos.Z()};
+
   //LOG(debug)<< "found center of gravity at: " << local[0] << " , " << local[1];
 
   fSensor->TopToPixel(local, indexX, indexY);
-- 
GitLab