#include #include #include using namespace RAT; using namespace RAT::geo; #include #include #include using namespace CLHEP; using namespace std; G4VSolid* Torus::Construct( const std::string& name, DBLinkPtr table ) const { const double rMax = table->GetD( "r_max" ) * mm; const double rTorus = table->GetD( "r_torus" ) * mm; /// Optional parameters double rMin = 0.0; try { rMin = table->GetD( "r_min" ) * mm; } catch( DBNotFoundError& e ) { }; double phiStart = 0.0; try { phiStart = table->GetD( "phi_start" ) * deg; } catch( DBNotFoundError& e ) { }; double phiDelta = twopi; try { phiDelta = table->GetD( "phi_delta" ) * deg; } catch( DBNotFoundError& e ) { }; return new G4Torus( name + "_solid", rMin, rMax, rTorus, phiStart, phiDelta ); }