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  os << " xSemiAxis[cm]=" << convertMmToCm(p_[0]) << " ySemiAxis[cm]=" << convertMmToCm(p_[1])
10  << " zHeight[cm]=" << convertMmToCm(p_[2]);
11 }
12 
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 }
double volume() const override
Not as flexible and possibly less accurate than G4 volume.
constexpr NumType convertMmToCm(NumType millimeters)
Definition: angle_units.h:44
void stream(std::ostream &os) const override