#include #include #include using namespace RAT; using namespace RAT::geo; #include #include #include using namespace CLHEP; using namespace std; G4VSolid* Sphere::Construct( const std::string& name, DBLinkPtr table ) const { const double rMax =table->GetD( "r_max" ) * 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 - phiStart; try { phiDelta = table->GetD( "phi_delta" ) * deg; } catch( DBNotFoundError& e ) { }; double thetaStart = 0.0; try { thetaStart = table->GetD( "theta_start" ) * deg; } catch( DBNotFoundError& e ) { }; double thetaDelta = pi - thetaStart; try { thetaDelta = table->GetD( "theta_delta" ) * deg; } catch( DBNotFoundError& e ) { }; return new G4Sphere( name + "_solid", rMin, rMax, phiStart, phiDelta, thetaStart, thetaDelta ); }