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 double DDI::EllipticalTube::volume() const {
17  double volume(0.);
18  // who cares major or minor axis? pi * a * b == pi * xhalf * yhalf
19  // area of a slice.
20  // we KNOW they are all cm... CMS uses cm
21  double area(Geom::pi()*p_[0]*p_[1]);
22  //volume is z * area. I'm pretty sure :)
23  volume = area * p_[2] * 2;
24  return volume;
25 
26 }
void stream(std::ostream &os) const override
double volume() const override
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