CMS 3D CMS Logo

List of all members | Public Member Functions
DDI::Torus Class Reference

#include <Torus.h>

Inheritance diagram for DDI::Torus:
DDI::Solid

Public Member Functions

void stream (std::ostream &) const override
 
 Torus (double pRMin, double pRMax, double pRTor, double pSPhi, double pDPhi)
 
double volume () const override
 
- Public Member Functions inherited from DDI::Solid
const std::vector< double > & parameters () const
 
void setParameters (std::vector< double > const &p)
 
DDSolidShape shape () const
 
 Solid ()
 
 Solid (DDSolidShape shape)
 
virtual ~Solid ()
 

Additional Inherited Members

- Protected Attributes inherited from DDI::Solid
std::vector< double > p_
 
DDSolidShape shape_
 

Detailed Description

Definition at line 9 of file Torus.h.

Constructor & Destructor Documentation

◆ Torus()

DDI::Torus::Torus ( double  pRMin,
double  pRMax,
double  pRTor,
double  pSPhi,
double  pDPhi 
)

Definition at line 14 of file Torus.cc.

15  p_.emplace_back(pRMin); // ......... 0
16  p_.emplace_back(pRMax); // ......... 1
17  p_.emplace_back(pRTor); // ......... 2
18  p_.emplace_back(pSPhi); // ......... 3
19  p_.emplace_back(pDPhi); // ......... 4
20 }

References ddtorus, and DDI::Solid::p_.

Member Function Documentation

◆ stream()

void DDI::Torus::stream ( std::ostream &  os) const
overridevirtual

Reimplemented from DDI::Solid.

Definition at line 22 of file Torus.cc.

22  {
23  os << " rMin=" << convertMmToCm(p_[0]) << " rMax=" << convertRadToDeg(p_[1]) << " rTor=" << convertRadToDeg(p_[2])
24  << " sPhi=" << convertMmToCm(p_[3]) << " dPhi=" << convertMmToCm(p_[4]);
25 }

References geant_units::operators::convertMmToCm(), and angle_units::operators::convertRadToDeg().

◆ volume()

double DDI::Torus::volume ( void  ) const
overridevirtual

Reimplemented from DDI::Solid.

Definition at line 27 of file Torus.cc.

27  {
28  double volume = 0;
29 
30  /* use notation as described in documentation about geant 4 shapes */
31 
32  // From Geant4: { fCubicVolume = fDPhi*pi*fRtor*(fRmax*fRmax-fRmin*fRmin);
33 
34  volume = p_[4] * piRadians * p_[2] * (p_[1] * p_[1] - p_[0] * p_[0]);
35 
36  return volume;
37 }

References angle_units::piRadians().

DDSolidShape::ddtorus
angle_units::operators::convertRadToDeg
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
DDI::Solid::Solid
Solid()
Definition: Solid.h:12
DDI::Torus::volume
double volume() const override
Definition: Torus.cc:27
angle_units::piRadians
constexpr double piRadians(M_PI)
geant_units::operators::convertMmToCm
constexpr NumType convertMmToCm(NumType millimeters)
Definition: GeantUnits.h:63
DDI::Solid::p_
std::vector< double > p_
Definition: Solid.h:30