CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
 
 Torus (double pRMin, double pRMax, double pRTor, double pSPhi, double pDPhi)
 
double volume () const
 
- 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

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

Definition at line 15 of file Torus.cc.

References DDI::Solid::p_.

21  : Solid(ddtorus)
22 {
23  p_.push_back(pRMin); // ......... 0
24  p_.push_back(pRMax); // ......... 1
25  p_.push_back(pRTor); // ......... 2
26  p_.push_back(pSPhi); // ......... 3
27  p_.push_back(pDPhi); // ......... 4
28 }
Solid()
Definition: Solid.h:14
std::vector< double > p_
Definition: Solid.h:32

Member Function Documentation

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

Reimplemented from DDI::Solid.

Definition at line 31 of file Torus.cc.

32 {
33  os << " rMin=" << p_[0]/cm
34  << " rMax=" << p_[1]/deg
35  << " rTor=" << p_[2]/deg
36  << " sPhi=" << p_[3]/cm
37  << " dPhi=" << p_[4]/cm;
38 }
std::vector< double > p_
Definition: Solid.h:32
double DDI::Torus::volume ( void  ) const
virtual

Reimplemented from DDI::Solid.

Definition at line 40 of file Torus.cc.

References pi.

41 {
42  double volume=0;
43 
44  /* use notation as described in documentation about geant 4 shapes */
45 
46  // From Geant4: { fCubicVolume = fDPhi*pi*fRtor*(fRmax*fRmax-fRmin*fRmin);
47 
48  volume = p_[4]*pi*p_[2]*(p_[1]*p_[1]-p_[0]*p_[0]);
49 
50  return volume;
51 }
double volume() const
Definition: Torus.cc:40
const Double_t pi
std::vector< double > p_
Definition: Solid.h:32