From b0b011386deb5096187412d5cca69242287f5c69 Mon Sep 17 00:00:00 2001
From: Wouter Deconinck <wdconinc@gmail.com>
Date: Sun, 24 Mar 2024 20:14:02 -0500
Subject: [PATCH] fix: Polycone::addZPlanes when already 2 planes defined

---
 DDCore/src/Shapes.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/DDCore/src/Shapes.cpp b/DDCore/src/Shapes.cpp
index 914fc21cb..a51d41a3c 100644
--- a/DDCore/src/Shapes.cpp
+++ b/DDCore/src/Shapes.cpp
@@ -268,7 +268,7 @@ void Polycone::addZPlanes(const std::vector<double>& rmin, const std::vector<dou
   TGeoPcon* sh = *this;
   std::vector<double> params;
   std::size_t num = sh->GetNz();
-  if (rmin.size() < 2)   {
+  if (num + rmin.size() < 2)   {
     except("PolyCone","++ addZPlanes: Not enough Z planes. minimum is 2!");
   }
   params.emplace_back(sh->GetPhi1());
-- 
GitLab