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

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

Definition at line 14 of file Box.h.

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

15  p_.emplace_back(xHalf);
16  p_.emplace_back(yHalf);
17  p_.emplace_back(zHalf);
18  }
Solid()
Definition: Solid.h:12
std::vector< double > p_
Definition: Solid.h:30
DDI::Box::~Box ( )
inlineoverride

Definition at line 19 of file Box.h.

19 {}

Member Function Documentation

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

Reimplemented from DDI::Solid.

Definition at line 8 of file Box.cc.

References geant_units::operators::convertMmToCm().

Referenced by volume().

8  {
9  os << " xhalf[cm]=" << convertMmToCm(p_[0]) << " yhalf[cm]=" << convertMmToCm(p_[1])
10  << " zhalf[cm]=" << convertMmToCm(p_[2]);
11 }
std::vector< double > p_
Definition: Solid.h:30
constexpr NumType convertMmToCm(NumType millimeters)
Definition: GeantUnits.h:62
double DDI::Box::volume ( void  ) const
inlineoverridevirtual

Reimplemented from DDI::Solid.

Definition at line 21 of file Box.h.

References DDI::Solid::p_, and stream().

21 { return 8. * p_[0] * p_[1] * p_[2]; }
std::vector< double > p_
Definition: Solid.h:30