Skip to content

Commit

Permalink
Correct the behaviour of (fake) TwistedTube object when converted to …
Browse files Browse the repository at this point in the history
…Geant4
  • Loading branch information
MarkusFrankATcernch committed Feb 19, 2024
1 parent e5d51fe commit 4db360e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion DDG4/src/Geant4ShapeConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,18 @@ namespace dd4hep {

template <> G4VSolid* convertShape<TwistedTubeObject>(const TGeoShape* shape) {
const TwistedTubeObject* sh = (const TwistedTubeObject*) shape;
if ( std::fabs(std::fabs(sh->GetNegativeEndZ()) - std::fabs(sh->GetPositiveEndZ())) < 1e-10 ) {
return new G4TwistedTubs(sh->GetName(),sh->GetPhiTwist() * DEGREE_2_RAD,
sh->GetRmin() * CM_2_MM, sh->GetRmax() * CM_2_MM,
sh->GetNegativeEndZ() * CM_2_MM,
sh->GetNsegments(),
(sh->GetPhi2()-sh->GetPhi1()) * DEGREE_2_RAD);
}
return new G4TwistedTubs(sh->GetName(),sh->GetPhiTwist() * DEGREE_2_RAD,
sh->GetRmin() * CM_2_MM, sh->GetRmax() * CM_2_MM,
sh->GetNegativeEndZ() * CM_2_MM, sh->GetPositiveEndZ() * CM_2_MM,
sh->GetNsegments(), (sh->GetPhi2()-sh->GetPhi1()) * DEGREE_2_RAD);
sh->GetNsegments(),
(sh->GetPhi2()-sh->GetPhi1()) * DEGREE_2_RAD);
}

template <> G4VSolid* convertShape<TGeoTrd1>(const TGeoShape* shape) {
Expand Down

0 comments on commit 4db360e

Please sign in to comment.