00001 #include "DetectorDescription/Core/src/Torus.h"
00002 #include "CLHEP/Units/PhysicalConstants.h"
00003 #include "CLHEP/Units/SystemOfUnits.h"
00004 #include <cmath>
00005
00006 using std::sqrt;
00007
00008
00009 DDI::Torus::Torus( double pRMin,
00010 double pRMax,
00011 double pRTor,
00012 double pSPhi,
00013 double pDPhi
00014 )
00015 : Solid(ddtorus)
00016 {
00017 p_.push_back(pRMin);
00018 p_.push_back(pRMax);
00019 p_.push_back(pRTor);
00020 p_.push_back(pSPhi);
00021 p_.push_back(pDPhi);
00022 }
00023
00024
00025 void DDI::Torus::stream(std::ostream & os) const
00026 {
00027 os << " rMin=" << p_[0]/cm
00028 << " rMax=" << p_[1]/deg
00029 << " rTor=" << p_[2]/deg
00030 << " sPhi=" << p_[3]/cm
00031 << " dPhi=" << p_[4]/cm;
00032 }
00033
00034 double DDI::Torus::volume() const
00035 {
00036 double volume=0;
00037
00038
00039
00040
00041
00042 volume = p_[4]*pi*p_[2]*(p_[1]*p_[1]-p_[0]*p_[0]);
00043
00044 return volume;
00045 }