CMS 3D CMS Logo

List of all members | Public Member Functions
DDI::EllipticalTube Class Reference

#include <EllipticalTube.h>

Inheritance diagram for DDI::EllipticalTube:
DDI::Solid

Public Member Functions

 EllipticalTube (double xSemiAxis, double ySemiAxis, double zHeight)
 
void stream (std::ostream &os) const override
 
double volume () const override
 Not as flexible and possibly less accurate than G4 volume. More...
 
 ~EllipticalTube () override
 
- Public Member Functions inherited from DDI::Solid
const std::vector< double > & parameters () const
 
void setParameters (std::vector< double > const &p)
 
DDSolidShape shape () const
 
 Solid ()
 
 Solid (DDSolidShape shape)
 
virtual ~Solid ()
 

Additional Inherited Members

- Protected Attributes inherited from DDI::Solid
std::vector< double > p_
 
DDSolidShape shape_
 

Detailed Description

Definition at line 13 of file EllipticalTube.h.

Constructor & Destructor Documentation

DDI::EllipticalTube::EllipticalTube ( double  xSemiAxis,
double  ySemiAxis,
double  zHeight 
)
inline

Definition at line 16 of file EllipticalTube.h.

References DDI::Solid::p_.

18  {
19  p_.emplace_back(xSemiAxis);
20  p_.emplace_back(ySemiAxis);
21  p_.emplace_back(zHeight);
22  }
Solid()
Definition: Solid.h:14
std::vector< double > p_
Definition: Solid.h:32
DDI::EllipticalTube::~EllipticalTube ( )
inlineoverride

Definition at line 23 of file EllipticalTube.h.

References stream(), and volume().

23 { }

Member Function Documentation

void DDI::EllipticalTube::stream ( std::ostream &  os) const
overridevirtual

Reimplemented from DDI::Solid.

Definition at line 9 of file EllipticalTube.cc.

References DDI::Solid::p_.

Referenced by ~EllipticalTube().

10 {
11  os << " xSemiAxis[cm]=" << p_[0]/cm
12  << " ySemiAxis[cm]=" << p_[1]/cm
13  << " zHeight[cm]=" << p_[2]/cm;
14 }
std::vector< double > p_
Definition: Solid.h:32
double DDI::EllipticalTube::volume ( void  ) const
overridevirtual

Not as flexible and possibly less accurate than G4 volume.

Reimplemented from DDI::Solid.

Definition at line 16 of file EllipticalTube.cc.

References jets_cff::area, DDI::Solid::p_, and Geom::pi().

Referenced by ~EllipticalTube().

16  {
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 }
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