CMS 3D CMS Logo

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/DetectorDescription/Core/src/EllipticalTube.cc

Go to the documentation of this file.
00001 #include "DetectorDescription/Core/src/EllipticalTube.h"
00002 #include "CLHEP/Units/GlobalSystemOfUnits.h"
00003 #include <DataFormats/GeometryVector/interface/Pi.h>
00004 #include <ostream>
00005 
00006 void DDI::EllipticalTube::stream(std::ostream & os) const
00007 {
00008    os << " xSemiAxis[cm]=" << p_[0]/cm
00009       << " ySemiAxis[cm]=" << p_[1]/cm
00010       << " zHeight[cm]=" << p_[2]/cm;
00011 
00012 }
00013 
00014 double DDI::EllipticalTube::volume() const { 
00015   double volume(0.);
00016   // who cares major or minor axis? pi * a * b == pi * xhalf * yhalf
00017   // area of a slice.
00018   // we KNOW they are all cm... CMS uses cm
00019   double area(Geom::pi()*p_[0]*p_[1]);
00020   //volume is z * area.  I'm pretty sure :)
00021   volume = area * p_[2] * 2;
00022   return volume; 
00023 
00024 }