CMS 3D CMS Logo

List of all members | Public Member Functions
DDI::Box Class Reference

#include <Box.h>

Inheritance diagram for DDI::Box:
DDI::Solid

Public Member Functions

 Box (double xHalf, double yHalf, double zHalf)
 
void stream (std::ostream &os) const override
 
double volume () const override
 
 ~Box () 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 12 of file Box.h.

Constructor & Destructor Documentation

◆ Box()

DDI::Box::Box ( double  xHalf,
double  yHalf,
double  zHalf 
)
inline

Definition at line 14 of file Box.h.

15  p_.emplace_back(xHalf);
16  p_.emplace_back(yHalf);
17  p_.emplace_back(zHalf);
18  }

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

◆ ~Box()

DDI::Box::~Box ( )
inlineoverride

Definition at line 19 of file Box.h.

19 {}

Member Function Documentation

◆ stream()

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

Reimplemented from DDI::Solid.

Definition at line 8 of file Box.cc.

8  {
9  os << " xhalf[cm]=" << convertMmToCm(p_[0]) << " yhalf[cm]=" << convertMmToCm(p_[1])
10  << " zhalf[cm]=" << convertMmToCm(p_[2]);
11 }

References geant_units::operators::convertMmToCm().

◆ volume()

double DDI::Box::volume ( void  ) const
inlineoverridevirtual

Reimplemented from DDI::Solid.

Definition at line 21 of file Box.h.

21 { return 8. * p_[0] * p_[1] * p_[2]; }

References DDI::Solid::p_.

DDI::Solid::Solid
Solid()
Definition: Solid.h:12
DDSolidShape::ddbox
geant_units::operators::convertMmToCm
constexpr NumType convertMmToCm(NumType millimeters)
Definition: GeantUnits.h:62
DDI::Solid::p_
std::vector< double > p_
Definition: Solid.h:30