diff --git a/DDCore/include/DD4hep/Shapes.h b/DDCore/include/DD4hep/Shapes.h index 2faa1a2766a8b739d58022ff6db3ac450284479c..a186bb448bc31572d07c6ee90cc313f0ed52184a 100644 --- a/DDCore/include/DD4hep/Shapes.h +++ b/DDCore/include/DD4hep/Shapes.h @@ -45,6 +45,7 @@ #include <TGeoScaledShape.h> #include <TGeoCompositeShape.h> #include <TGeoShapeAssembly.h> +#include <TGeoPara.h> #if ROOT_VERSION_CODE > ROOT_VERSION(6,21,0) #include <TGeoTessellated.h> #endif diff --git a/DDG4/src/Geant4Converter.cpp b/DDG4/src/Geant4Converter.cpp index 52f56ddd25398b74aaec2074954aa99853abdfe2..f1534a86f5ecde0ca5ac1e9148408ef396adffb2 100644 --- a/DDG4/src/Geant4Converter.cpp +++ b/DDG4/src/Geant4Converter.cpp @@ -610,6 +610,8 @@ void* Geant4Converter::handleSolid(const string& name, const TGeoShape* shape) c solid = convertShape<TGeoTrap>(shape); else if (isa == TGeoArb8::Class()) solid = convertShape<TGeoArb8>(shape); + else if (isa == TGeoPara::Class()) + solid = convertShape<TGeoPara>(shape); #if ROOT_VERSION_CODE > ROOT_VERSION(6,21,0) else if (isa == TGeoTessellated::Class()) solid = convertShape<TGeoTessellated>(shape); diff --git a/DDG4/src/Geant4ShapeConverter.cpp b/DDG4/src/Geant4ShapeConverter.cpp index 8cab4d9360e0e44266351277460008cedd29e304..78855d744e47db8a20b9f1c95bb48a0ff131eab4 100644 --- a/DDG4/src/Geant4ShapeConverter.cpp +++ b/DDG4/src/Geant4ShapeConverter.cpp @@ -31,6 +31,7 @@ #include <G4Trap.hh> #include <G4Cons.hh> #include <G4Hype.hh> +#include <G4Para.hh> #include <G4Torus.hh> #include <G4Sphere.hh> #include <G4CutTubs.hh> @@ -140,6 +141,14 @@ namespace dd4hep { return new G4GenericTrap(sh->GetName(), sh->GetDz() * CM_2_MM, vertices); } + template <> G4VSolid* convertShape<TGeoPara>(const TGeoShape* shape) { + const auto* sh = static_cast<const TGeoPara*>(shape); + return new G4Para(sh->GetName(), + sh->GetX() * CM_2_MM, sh->GetY() * CM_2_MM, sh->GetZ() * CM_2_MM, + sh->GetAlpha() * DEGREE_2_RAD, sh->GetTheta() * DEGREE_2_RAD, + sh->GetPhi() * DEGREE_2_RAD); + } + template <> G4VSolid* convertShape<TGeoXtru>(const TGeoShape* shape) { const TGeoXtru* sh = (const TGeoXtru*) shape; std::size_t nz = sh->GetNz();