CMS 3D CMS Logo

EllipticalTube.cc
Go to the documentation of this file.
3 
4 #include <ostream>
5 
6 using namespace dd::operators;
7 
8 void DDI::EllipticalTube::stream(std::ostream & os) const
9 {
10  os << " xSemiAxis[cm]=" << CONVERT_TO( p_[0], cm )
11  << " ySemiAxis[cm]=" << CONVERT_TO( p_[1], cm )
12  << " zHeight[cm]=" << CONVERT_TO( p_[2], cm );
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
#define CONVERT_TO(_x, _y)
Definition: DDUnits.h:6
double volume() const override
Not as flexible and possibly less accurate than G4 volume.
constexpr long double _pi(M_PI)