CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
EllipticalTube.cc
Go to the documentation of this file.
2 #include "CLHEP/Units/GlobalSystemOfUnits.h"
4 #include <ostream>
5 
6 void DDI::EllipticalTube::stream(std::ostream & os) const
7 {
8  os << " xSemiAxis[cm]=" << p_[0]/cm
9  << " ySemiAxis[cm]=" << p_[1]/cm
10  << " zHeight[cm]=" << p_[2]/cm;
11 
12 }
13 
14 double DDI::EllipticalTube::volume() const {
15  double volume(0.);
16  // who cares major or minor axis? pi * a * b == pi * xhalf * yhalf
17  // area of a slice.
18  // we KNOW they are all cm... CMS uses cm
19  double area(Geom::pi()*p_[0]*p_[1]);
20  //volume is z * area. I'm pretty sure :)
21  volume = area * p_[2] * 2;
22  return volume;
23 
24 }
void stream(std::ostream &os) const
double volume() const
Not as flexible and possibly less accurate than G4 volume.
double pi()
Definition: Pi.h:31
std::vector< double > p_
Definition: Solid.h:41