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

◆ Tubs()

DDI::Tubs::Tubs ( double  zhalf,
double  rIn,
double  rOut,
double  startPhi,
double  deltaPhi 
)

Definition at line 13 of file Tubs.cc.

14  p_.emplace_back(zhalf);
15  p_.emplace_back(rIn);
16  p_.emplace_back(rOut);
17  p_.emplace_back(startPhi);
18  p_.emplace_back(deltaPhi);
19 }

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

Member Function Documentation

◆ stream()

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

Reimplemented from DDI::Solid.

Definition at line 21 of file Tubs.cc.

21  {
22  os << " zhalf=" << convertMmToCm(p_[0]) << " rIn=" << convertMmToCm(p_[1]) << " rOut=" << convertMmToCm(p_[2])
23  << " startPhi=" << convertRadToDeg(p_[3]) << " deltaPhi=" << convertRadToDeg(p_[4]);
24 }

References geant_units::operators::convertMmToCm(), and angle_units::operators::convertRadToDeg().

◆ volume()

double DDI::Tubs::volume ( void  ) const
overridevirtual

Reimplemented from DDI::Solid.

Definition at line 26 of file Tubs.cc.

26  {
27  double volume = 0;
28  double z = 2. * p_[0];
29  double rIn = p_[1];
30  double rOut = p_[2];
31  double phi = p_[4];
32 
33  double volume1 = 1_pi * rIn * rIn * z;
34  double volume2 = 1_pi * rOut * rOut * z;
35 
36  double slice = fabs(phi / (2_pi));
37 
38  volume = slice * (volume2 - volume1);
39 
40  return volume;
41 }

References mergeAndRegister::slice.

angle_units::operators::convertRadToDeg
constexpr NumType convertRadToDeg(NumType radians)
Definition: angle_units.h:21
DDSolidShape::ddtubs
SiPixelRawToDigiRegional_cfi.deltaPhi
deltaPhi
Definition: SiPixelRawToDigiRegional_cfi.py:9
DDAxes::z
DDI::Tubs::volume
double volume() const override
Definition: Tubs.cc:26
DDI::Solid::Solid
Solid()
Definition: Solid.h:12
DDAxes::phi
geant_units::operators::convertMmToCm
constexpr NumType convertMmToCm(NumType millimeters)
Definition: GeantUnits.h:62
mergeAndRegister.slice
slice
Definition: mergeAndRegister.py:121
DDI::Solid::p_
std::vector< double > p_
Definition: Solid.h:30