GeoModel - GeoModelCore
GeoTubs.cxx
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "GeoModelKernel/GeoTubs.h"
6 #include "GeoModelKernel/GeoShapeAction.h"
7 
8 const std::string GeoTubs::s_classType = "Tubs";
9 const ShapeType GeoTubs::s_classTypeID = 0x18;
10 
11 GeoTubs::GeoTubs (double RMin, double RMax, double ZHalfLength, double SPhi, double DPhi)
12  : m_rMin (RMin)
13  , m_rMax (RMax)
14  , m_zHalfLength (ZHalfLength)
15  , m_sPhi (SPhi)
16  , m_dPhi (DPhi)
17 {
18 }
19 
20 GeoTubs::~GeoTubs()
21 {
22 }
23 
24 double GeoTubs::volume () const
25 {
26  return m_dPhi * (m_rMax * m_rMax - m_rMin * m_rMin) * m_zHalfLength;
27 }
28 
29 const std::string & GeoTubs::type () const
30 {
31  return s_classType;
32 }
33 
34 ShapeType GeoTubs::typeID () const
35 {
36  return s_classTypeID;
37 }
38 
39 void GeoTubs::exec (GeoShapeAction *action) const
40 {
41  action->handleTubs(this);
42 }
43 
This class is a visitor for shapes. It allows a navigation of the boolean expression tree for shapes...