CMS 3D CMS Logo

Public Member Functions

DDI::Torus Class Reference

#include <Torus.h>

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

List of all members.

Public Member Functions

void stream (std::ostream &) const
 Torus (double pRMin, double pRMax, double pRTor, double pSPhi, double pDPhi)
double volume () const

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_.

 : Solid(ddtorus) 
{                
  p_.push_back(pRMin); // ......... 0
  p_.push_back(pRMax); // ......... 1
  p_.push_back(pRTor); // ......... 2
  p_.push_back(pSPhi); // ......... 3
  p_.push_back(pDPhi); // ......... 4
}

Member Function Documentation

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

Reimplemented from DDI::Solid.

Definition at line 25 of file Torus.cc.

{
  os << " rMin=" << p_[0]/cm
     << " rMax=" << p_[1]/deg
     << " rTor=" << p_[2]/deg
     << " sPhi=" << p_[3]/cm
     << " dPhi=" << p_[4]/cm;
}
double DDI::Torus::volume ( ) const [virtual]

Reimplemented from DDI::Solid.

Definition at line 34 of file Torus.cc.

References pi.

{
  double volume=0;
  
  /* use notation as described in documentation about geant 4 shapes */
  
  // From Geant4: { fCubicVolume = fDPhi*pi*fRtor*(fRmax*fRmax-fRmin*fRmin);
  
  volume = p_[4]*pi*p_[2]*(p_[1]*p_[1]-p_[0]*p_[0]);
  
  return volume;
}