5 #include "GeoModelKernel/GeoTrap.h" 6 #include "GeoModelKernel/GeoShapeAction.h" 8 const std::string GeoTrap::s_classType =
"Trap";
9 const ShapeType GeoTrap::s_classTypeID = 0x15;
11 GeoTrap::GeoTrap (
double ZHalfLength,
double Theta,
double Phi,
double Dydzn,
double Dxdyndzn,
double Dxdypdzn,
double Angleydzn,
double Dydzp,
double Dxdyndzp,
double Dxdypdzp,
double Angleydzp)
12 : m_zHalfLength (ZHalfLength)
16 , m_dxdyndzn (Dxdyndzn)
17 , m_dxdypdzn (Dxdypdzn)
18 , m_angleydzn (Angleydzn)
20 , m_dxdyndzp (Dxdyndzp)
21 , m_dxdypdzp (Dxdypdzp)
22 , m_angleydzp (Angleydzp)
30 double GeoTrap::volume ()
const 32 double fDz = m_zHalfLength;
33 double fDy1 = m_dydzn;
34 double pDx1 = m_dxdyndzn;
35 double pDx2 = m_dxdypdzn;
36 double fDy2 = m_dydzp;
37 double pDx3 = m_dxdyndzp;
38 double pDx4 = m_dxdypdzp;
41 double fDx1 = 0.5 * (pDx1 + pDx2);
42 double fDx2 = 0.5 * (pDx3 + pDx4);
44 return 4.0 * ((fDx1 + fDx2) * (fDy1 + fDy2) * (fDz * 0.5) +
45 (fDx2 - fDx1) * (fDy2 - fDy1) * (fDz * (1./6)));
48 const std::string & GeoTrap::type ()
const 53 ShapeType GeoTrap::typeID ()
const 60 action->handleTrap(
this);
This class is a visitor for shapes. It allows a navigation of the boolean expression tree for shapes...