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 override
 
 Tubs (double zhalf, double rIn, double rOut, double startPhi, double deltaPhi)
 
double volume () const override
 
- 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 14 of file Tubs.cc.

References DDI::Solid::p_.

18  : Solid(ddtubs)
19 {
20  p_.emplace_back(zhalf);
21  p_.emplace_back(rIn);
22  p_.emplace_back(rOut);
23  p_.emplace_back(startPhi);
24  p_.emplace_back(deltaPhi);
25 }
Solid()
Definition: Solid.h:14
std::vector< double > p_
Definition: Solid.h:32

Member Function Documentation

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

Reimplemented from DDI::Solid.

Definition at line 28 of file Tubs.cc.

References DDI::Solid::p_.

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

Reimplemented from DDI::Solid.

Definition at line 38 of file Tubs.cc.

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

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