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

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

18 {
19  p_.emplace_back(zhalf);
20  p_.emplace_back(rIn);
21  p_.emplace_back(rOut);
22  p_.emplace_back(startPhi);
23  p_.emplace_back(deltaPhi);
24 }
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 26 of file Tubs.cc.

References geant_units::operators::convertMmToCm(), geant_units::operators::convertRadToDeg(), and DDI::Solid::p_.

27 {
28  os << " zhalf=" << convertMmToCm( p_[0] )
29  << " rIn=" << convertMmToCm( p_[1] )
30  << " rOut=" << convertMmToCm( p_[2] )
31  << " startPhi=" << convertRadToDeg( p_[3] )
32  << " deltaPhi=" << convertRadToDeg( p_[4] );
33 }
constexpr NumType convertRadToDeg(NumType radians)
Definition: GeantUnits.h:98
std::vector< double > p_
Definition: Solid.h:32
constexpr NumType convertMmToCm(NumType millimeters)
Definition: GeantUnits.h:110
double DDI::Tubs::volume ( void  ) const
overridevirtual

Reimplemented from DDI::Solid.

Definition at line 35 of file Tubs.cc.

References DDI::Solid::p_.

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];
42 
43  double volume1=1_pi*rIn*rIn*z;
44  double volume2=1_pi*rOut*rOut*z;
45 
46  double slice=fabs(phi/(2_pi));
47 
48  volume=slice*(volume2-volume1);
49 
50  return volume;
51 }
double volume() const override
Definition: Tubs.cc:35
std::vector< double > p_
Definition: Solid.h:32