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.

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

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 }
Solid()
Definition: Solid.h:12
std::vector< double > p_
Definition: Solid.h:30

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.

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

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 }
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
constexpr NumType convertMmToCm(NumType millimeters)
Definition: angle_units.h:44
std::vector< double > p_
Definition: Solid.h:30

◆ volume()

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

Reimplemented from DDI::Solid.

Definition at line 27 of file Torus.cc.

References angle_units::piRadians().

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 }
double volume() const override
Definition: Torus.cc:27
constexpr double piRadians(M_PI)
std::vector< double > p_
Definition: Solid.h:30