CMS 3D CMS Logo

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 15 of file Tubs.cc.

References DDI::Solid::p_.

19  : Solid(ddtubs)
20 {
21  p_.push_back(zhalf);
22  p_.push_back(rIn);
23  p_.push_back(rOut);
24  p_.push_back(startPhi);
25  p_.push_back(deltaPhi);
26 }
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 29 of file Tubs.cc.

References DDI::Solid::p_.

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

Reimplemented from DDI::Solid.

Definition at line 39 of file Tubs.cc.

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

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