CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/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 <ostream>
00004 
00005 void DDI::EllipticalTube::stream(std::ostream & os) const
00006 {
00007    os << " xSemiAxis[cm]=" << p_[0]/cm
00008       << " ySemiAxis[cm]=" << p_[1]/cm
00009       << " zHeight[cm]=" << p_[2]/cm;
00010 
00011 }
00012 
00013 double DDI::EllipticalTube::volume() const { 
00014   double volume(0.);
00015   // who cares major or minor axis? pi * a * b == pi * xhalf * yhalf
00016   // area of a slice.
00017   // we KNOW they are all cm... CMS uses cm
00018   double area(Geom::pi()*p_[0]*p_[1]);
00019   //volume is z * area.  I'm pretty sure :)
00020   volume = area * p_[2] * 2;
00021   return volume; 
00022 
00023 }