From 18ecdbdf8f1fb87415e508609f287bcba8cf9987 Mon Sep 17 00:00:00 2001 From: Andrei Gheata Date: Thu, 6 Apr 2017 17:16:20 +0200 Subject: [PATCH] Fixed TGeoPGon::GetPhiCrossList for point on the Z axis. --- geom/geom/src/TGeoPgon.cxx | 23 +++++++++++------------ 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/geom/geom/src/TGeoPgon.cxx b/geom/geom/src/TGeoPgon.cxx index 1869a35bedce4..933bb99b5cdd4 100644 --- a/geom/geom/src/TGeoPgon.cxx +++ b/geom/geom/src/TGeoPgon.cxx @@ -540,24 +540,23 @@ Int_t TGeoPgon::GetPhiCrossList(const Double_t *point, const Double_t *dir, Int_ if (shootorig) { Double_t rdotn = point[0]*dir[0]+point[1]*dir[1]; if (rdotn>0) { - sphi[icrossed] = stepmax; - iphi[icrossed++] = istart; - return icrossed; + sphi[0] = stepmax; + iphi[0] = istart; + return 1; } - sphi[icrossed] = TMath::Sqrt((point[0]*point[0]+point[1]*point[1])/(1.-dir[2]*dir[2])); - iphi[icrossed++] = istart; - if (sphi[icrossed-1]>stepmax) { - sphi[icrossed-1] = stepmax; - return icrossed; + sphi[0] = TMath::Sqrt((point[0]*point[0]+point[1]*point[1])/(1.-dir[2]*dir[2])); + iphi[0] = istart; + if (sphi[0]>stepmax) { + sphi[0] = stepmax; + return 1; } phi = TMath::ATan2(dir[1], dir[0])*TMath::RadToDeg(); while (phifNedges-1) istart=-1; - iphi[icrossed] = istart; - sphi[icrossed] = stepmax; - icrossed++; - return icrossed; + iphi[0] = istart; + sphi[0] = stepmax; + return 1; } Int_t incsec = Int_t(TMath::Sign(1., point[0]*dir[1]-point[1]*dir[0])); Int_t ist;