CMS 3D CMS Logo

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