Skip to content
Snippets Groups Projects
Commit ac16e4ac authored by Sergey Gorbunov's avatar Sergey Gorbunov Committed by Sergey Gorbunov
Browse files

fix the calculation of a mc position at a given z

parent e283f472
No related branches found
No related tags found
1 merge request!664fix the calculation of a mc position at a given z
Pipeline #15494 passed
......@@ -90,8 +90,8 @@ CbmStsPoint::CbmStsPoint(const CbmStsPoint& point, int32_t eventId, double event
double CbmStsPoint::GetX(double z) const
{
// LOG(info) << fZ << " " << z << " " << fZ_out;
if ((fZ_out - z) * (fZ - z) >= 0.) return (fX_out + fX) / 2.;
double dz = fZ_out - fZ;
if (fabs(dz) < 1.e-4) return 0.5 * (fX_out + fX);
return (fX + (z - fZ) / dz * (fX_out - fX));
}
// -------------------------------------------------------------------------
......@@ -100,9 +100,8 @@ double CbmStsPoint::GetX(double z) const
// ----- Point y coordinate from linear extrapolation ------------------
double CbmStsPoint::GetY(double z) const
{
if ((fZ_out - z) * (fZ - z) >= 0.) return (fY_out + fY) / 2.;
double dz = fZ_out - fZ;
// if ( abs(dz) < 1.e-3 ) return (fY_out+fY)/2.;
if (fabs(dz) < 1.e-4) return 0.5 * (fY_out + fY);
return (fY + (z - fZ) / dz * (fY_out - fY));
}
// -------------------------------------------------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment