CMS 3D CMS Logo

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

#include <EllipticalTube.h>

Inheritance diagram for DDI::EllipticalTube:
DDI::Solid

Public Member Functions

 EllipticalTube (double xSemiAxis, double ySemiAxis, double zHeight)
 
void stream (std::ostream &os) const override
 
double volume () const override
 Not as flexible and possibly less accurate than G4 volume. More...
 
 ~EllipticalTube () 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 13 of file EllipticalTube.h.

Constructor & Destructor Documentation

◆ EllipticalTube()

DDI::EllipticalTube::EllipticalTube ( double  xSemiAxis,
double  ySemiAxis,
double  zHeight 
)
inline

Definition at line 15 of file EllipticalTube.h.

16  p_.emplace_back(xSemiAxis);
17  p_.emplace_back(ySemiAxis);
18  p_.emplace_back(zHeight);
19  }

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

◆ ~EllipticalTube()

DDI::EllipticalTube::~EllipticalTube ( )
inlineoverride

Definition at line 20 of file EllipticalTube.h.

20 {}

Member Function Documentation

◆ stream()

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

Reimplemented from DDI::Solid.

Definition at line 8 of file EllipticalTube.cc.

8  {
9  os << " xSemiAxis[cm]=" << convertMmToCm(p_[0]) << " ySemiAxis[cm]=" << convertMmToCm(p_[1])
10  << " zHeight[cm]=" << convertMmToCm(p_[2]);
11 }

References geant_units::operators::convertMmToCm().

◆ volume()

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

Not as flexible and possibly less accurate than G4 volume.

Reimplemented from DDI::Solid.

Definition at line 13 of file EllipticalTube.cc.

13  {
14  double volume(0.);
15  // who cares major or minor axis? pi * a * b == pi * xhalf * yhalf
16  // area of a slice.
17  // we KNOW they are all cm... CMS uses cm
18  double area(1_pi * p_[0] * p_[1]);
19  //volume is z * area. I'm pretty sure :)
20  volume = area * p_[2] * 2;
21  return volume;
22 }

References custom_jme_cff::area.

DDSolidShape::ddellipticaltube
DDI::Solid::Solid
Solid()
Definition: Solid.h:12
DDI::EllipticalTube::volume
double volume() const override
Not as flexible and possibly less accurate than G4 volume.
Definition: EllipticalTube.cc:13
geant_units::operators::convertMmToCm
constexpr NumType convertMmToCm(NumType millimeters)
Definition: GeantUnits.h:62
custom_jme_cff.area
area
Definition: custom_jme_cff.py:140
DDI::Solid::p_
std::vector< double > p_
Definition: Solid.h:30