CMS 3D CMS Logo

EllipticalTube.cc
Go to the documentation of this file.
3 
4 #include <ostream>
5 
6 using namespace geant_units::operators;
7 
8 void DDI::EllipticalTube::stream(std::ostream & os) const
9 {
10  os << " xSemiAxis[cm]=" << convertMmToCm( p_[0] )
11  << " ySemiAxis[cm]=" << convertMmToCm( p_[1] )
12  << " zHeight[cm]=" << convertMmToCm( p_[2] );
13 }
14 
15 double DDI::EllipticalTube::volume() const {
16  double volume(0.);
17  // who cares major or minor axis? pi * a * b == pi * xhalf * yhalf
18  // area of a slice.
19  // we KNOW they are all cm... CMS uses cm
20  double area(1_pi*p_[0]*p_[1]);
21  //volume is z * area. I'm pretty sure :)
22  volume = area * p_[2] * 2;
23  return volume;
24 }
void stream(std::ostream &os) const override
double volume() const override
Not as flexible and possibly less accurate than G4 volume.
constexpr NumType convertMmToCm(NumType millimeters)
Definition: GeantUnits.h:110