CMS 3D CMS Logo

DDI::Tubs Class Reference

#include <DetectorDescription/Core/src/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_.

00015  : Solid(ddtubs)
00016 {
00017   p_.push_back(zhalf);
00018   p_.push_back(rIn);
00019   p_.push_back(rOut);
00020   p_.push_back(startPhi);
00021   p_.push_back(deltaPhi);
00022 }


Member Function Documentation

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

Reimplemented from DDI::Solid.

Definition at line 25 of file Tubs.cc.

References DDI::Solid::p_.

00026 {
00027   os << " zhalf=" << p_[0]/cm
00028      << " rIn=" << p_[1]/cm
00029      << " rOut=" << p_[2]/cm
00030      << " startPhi=" << p_[3]/deg
00031      << " deltaPhi=" << p_[4]/deg;              
00032 }

double DDI::Tubs::volume (  )  const [virtual]

Reimplemented from DDI::Solid.

Definition at line 35 of file Tubs.cc.

References DDI::Solid::p_, phi, pi, and z.

00036 {
00037    double volume=0;
00038    double z=2.*p_[0];
00039    double rIn=p_[1];
00040    double rOut=p_[2];
00041    double phi=p_[4]/rad;
00042 
00043    double volume1=pi*rIn*rIn*z;
00044    double volume2=pi*rOut*rOut*z;
00045 
00046    double slice=fabs(phi/(2*pi));
00047 
00048    volume=slice*(volume2-volume1);
00049   
00050    return volume;                                                                                                                                               
00051 }                                                                                                                                               


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:37:10 2009 for CMSSW by  doxygen 1.5.4