CMS 3D CMS Logo

Public Member Functions

DDI::Tubs Class Reference

#include <Tubs.h>

Inheritance diagram for DDI::Tubs:
DDI::Solid

List of all members.

Public Member Functions

void stream (std::ostream &) const
 Tubs (double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
double volume () const

Detailed Description

Definition at line 9 of file Tubs.h.


Constructor & Destructor Documentation

DDI::Tubs::Tubs ( double  zhalf,
double  rIn,
double  rOut,
double  startPhi,
double  deltaPhi 
)

Definition at line 11 of file Tubs.cc.

References DDI::Solid::p_.

 : Solid(ddtubs)
{
  p_.push_back(zhalf);
  p_.push_back(rIn);
  p_.push_back(rOut);
  p_.push_back(startPhi);
  p_.push_back(deltaPhi);
}

Member Function Documentation

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

Reimplemented from DDI::Solid.

Definition at line 25 of file Tubs.cc.

{
  os << " zhalf=" << p_[0]/cm
     << " rIn=" << p_[1]/cm
     << " rOut=" << p_[2]/cm
     << " startPhi=" << p_[3]/deg
     << " deltaPhi=" << p_[4]/deg;              
}
double DDI::Tubs::volume ( void  ) const [virtual]

Reimplemented from DDI::Solid.

Definition at line 35 of file Tubs.cc.

References phi, pi, and z.

{
   double volume=0;
   double z=2.*p_[0];
   double rIn=p_[1];
   double rOut=p_[2];
   double phi=p_[4]/rad;

   double volume1=pi*rIn*rIn*z;
   double volume2=pi*rOut*rOut*z;

   double slice=fabs(phi/(2*pi));

   volume=slice*(volume2-volume1);
  
   return volume;                                                                                                                                               
}