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::Tubs Class Reference

#include <Tubs.h>

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

Public Member Functions

void stream (std::ostream &) const
 
 Tubs (double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
 
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 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_.

15  : Solid(ddtubs)
16 {
17  p_.push_back(zhalf);
18  p_.push_back(rIn);
19  p_.push_back(rOut);
20  p_.push_back(startPhi);
21  p_.push_back(deltaPhi);
22 }
Solid()
Definition: Solid.h:14
std::vector< double > p_
Definition: Solid.h:32

Member Function Documentation

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

Reimplemented from DDI::Solid.

Definition at line 25 of file Tubs.cc.

26 {
27  os << " zhalf=" << p_[0]/cm
28  << " rIn=" << p_[1]/cm
29  << " rOut=" << p_[2]/cm
30  << " startPhi=" << p_[3]/deg
31  << " deltaPhi=" << p_[4]/deg;
32 }
std::vector< double > p_
Definition: Solid.h:32
double DDI::Tubs::volume ( void  ) const
virtual

Reimplemented from DDI::Solid.

Definition at line 35 of file Tubs.cc.

References phi(), and pi.

36 {
37  double volume=0;
38  double z=2.*p_[0];
39  double rIn=p_[1];
40  double rOut=p_[2];
41  double phi=p_[4]/rad;
42 
43  double volume1=pi*rIn*rIn*z;
44  double volume2=pi*rOut*rOut*z;
45 
46  double slice=fabs(phi/(2*pi));
47 
48  volume=slice*(volume2-volume1);
49 
50  return volume;
51 }
float float float z
const Double_t pi
Geom::Phi< T > phi() const
double volume() const
Definition: Tubs.cc:35
std::vector< double > p_
Definition: Solid.h:32