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 9 of file Torus.cc.

References DDI::Solid::p_.

15  : Solid(ddtorus)
16 {
17  p_.push_back(pRMin); // ......... 0
18  p_.push_back(pRMax); // ......... 1
19  p_.push_back(pRTor); // ......... 2
20  p_.push_back(pSPhi); // ......... 3
21  p_.push_back(pDPhi); // ......... 4
22 }
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 25 of file Torus.cc.

26 {
27  os << " rMin=" << p_[0]/cm
28  << " rMax=" << p_[1]/deg
29  << " rTor=" << p_[2]/deg
30  << " sPhi=" << p_[3]/cm
31  << " dPhi=" << p_[4]/cm;
32 }
std::vector< double > p_
Definition: Solid.h:32
double DDI::Torus::volume ( void  ) const
virtual

Reimplemented from DDI::Solid.

Definition at line 34 of file Torus.cc.

References pi.

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