From b7f3f574c4ceae2b61bd2023a4b1869fbcfff37f Mon Sep 17 00:00:00 2001
From: Whitney Armstrong <warmstrong@anl.gov>
Date: Wed, 21 Jul 2021 16:13:25 -0500
Subject: [PATCH] Fixed the G4Sphere construction using delta angles

- G4Sphere  uses delta theta/phi instead of TGeo's ending angles
  phi2/theta2.
---
 DDG4/src/Geant4ShapeConverter.cpp | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/DDG4/src/Geant4ShapeConverter.cpp b/DDG4/src/Geant4ShapeConverter.cpp
index 2a79a69a2..6f4af522d 100644
--- a/DDG4/src/Geant4ShapeConverter.cpp
+++ b/DDG4/src/Geant4ShapeConverter.cpp
@@ -205,8 +205,9 @@ namespace dd4hep {
 
     template <> G4VSolid* convertShape<TGeoSphere>(const TGeoShape* shape)  {
       const TGeoSphere* sh = (const TGeoSphere*) shape;
-      return new G4Sphere(sh->GetName(), sh->GetRmin() * CM_2_MM, sh->GetRmax() * CM_2_MM, sh->GetPhi1() * DEGREE_2_RAD,
-                          sh->GetPhi2() * DEGREE_2_RAD, sh->GetTheta1() * DEGREE_2_RAD, sh->GetTheta2() * DEGREE_2_RAD);
+      return new G4Sphere(sh->GetName(), sh->GetRmin() * CM_2_MM, sh->GetRmax() * CM_2_MM,
+                          sh->GetPhi1() * DEGREE_2_RAD, (sh->GetPhi2()-sh->GetPhi1()) * DEGREE_2_RAD,
+                          sh->GetTheta1() * DEGREE_2_RAD, (sh->GetTheta2()- sh->GetTheta1()) * DEGREE_2_RAD);
     }
 
     template <> G4VSolid* convertShape<TGeoTorus>(const TGeoShape* shape)  {
-- 
GitLab