#include #include #include #include #include #include using namespace RAT; using namespace RAT::geo; #include #include #include using namespace CLHEP; using namespace std; G4VSolid* HoldUpRope::Construct( const std::string& name, DBLinkPtr table ) const { const double rRope = table->GetD( "r_rope" ) * mm; const double rTorus = table->GetD( "r_torus" ) * mm; const double zRope = table->GetD( "z_rope" ) * mm; return ConstructHoldUpRope( name, rRope, rTorus, zRope ); } G4VSolid* HoldUpRope::ConstructHoldUpRope( const std::string& name, const double rRope, const double rTorus, const double zRope ) const { G4Torus* torus = new G4Torus( name + "_torus_solid", 0.0, rRope, rTorus, -pi / 2.0, pi ); G4Tubs* rope = new G4Tubs( name + "_rope_solid", 0.0, rRope, zRope / 2.0, 0.0, twopi ); G4RotationMatrix* torusRotation = new G4RotationMatrix(); torusRotation->rotateY( -pi / 2.0 ); G4DisplacedSolid* displacedTorus = new G4DisplacedSolid( name + "_displaced_torus_solid", torus, torusRotation, G4ThreeVector( 0.0, 0.0, 0.0 ) ); G4UnionSolid* torusRope = new G4UnionSolid( name + "_torus_rope1_solid", displacedTorus, rope, NULL, G4ThreeVector( 0.0, -rTorus, zRope / 2.0 - 1.0 * mm ) ); // Ensure overlap G4UnionSolid* fullSolid = new G4UnionSolid( name + "_solid", torusRope, rope, NULL, G4ThreeVector ( 0.0, rTorus, zRope / 2.0 - 1.0 * mm ) ); // Ensure overlap return fullSolid; }