GeoModel - GeoModelCore
GeoPcon.h
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef GEOMODELKERNEL_GEOPCON_H
6 #define GEOMODELKERNEL_GEOPCON_H
7 
17 #include "GeoModelKernel/GeoShape.h"
18 #include <vector>
19 
20 class GeoPcon : public GeoShape
21 {
22  public:
23  // Constructor for the PCON. Note that the constructor
24  // does not fully build this object. The PCON is not valid
25  // until at least two polygon planes have been added.
26  GeoPcon (double SPhi, double DPhi);
27 
28  // Returns the volume of the shape, for mass inventory
29  virtual double volume () const;
30 
31  // Returns the PCON shape type, as a string.
32  virtual const std::string & type () const;
33 
34  // Returns the PCON shape type, as a coded integer.
35  virtual ShapeType typeID () const;
36 
37  // Add another plane to the polycone A minimum of two
38  // planes are required to create a valid polycone.
39  void addPlane (double ZPlane, double RMinPlane, double RMaxPlane);
40 
41  // Returns the number of planes that have been created for
42  // the polycone.
43  unsigned int getNPlanes () const;
44 
45  // True if the polycone has at least two planes. False
46  // otherwise.
47  bool isValid () const;
48 
49  // Get the Z Position of the specified plane.
50  const double & getZPlane (unsigned int i) const;
51 
52  // Get the RMin of the specified plane.
53  const double & getRMinPlane (unsigned int i) const;
54 
55  // Get the Z Position of the specified plane.
56  const double & getRMaxPlane (unsigned int i) const;
57 
58  // Executes a GeoShapeAction
59  virtual void exec (GeoShapeAction *action) const;
60 
61  // For type identification.
62  static const std::string& getClassType ();
63 
64  // For type identification.
65  static ShapeType getClassTypeID ();
66 
67  // Starting angle of the segment in radians.
68  const double& getSPhi () const;
69 
70  // Delta angle of the segment in radians.
71  const double& getDPhi () const;
72 
73  protected:
74  virtual ~GeoPcon();
75 
76  private:
77  GeoPcon(const GeoPcon &right);
78  GeoPcon & operator=(const GeoPcon &right);
79 
80  static const std::string s_classType;
81  static const ShapeType s_classTypeID;
82 
83  double m_sPhi;
84  double m_dPhi;
85 
86  // Z Position of poly-cone planes.
87  std::vector<double> m_zPlane;
88 
89  // Minimum radius of poly-cone planes.
90  std::vector<double> m_rMinPlane;
91 
92  // Maximum radius of poly-cone planes.
93  std::vector<double> m_rMaxPlane;
94 };
95 
96 inline unsigned int GeoPcon::getNPlanes () const
97 {
98  return m_zPlane.size ();
99 }
100 
101 inline bool GeoPcon::isValid () const
102 {
103  return getNPlanes () >= 2;
104 }
105 
106 inline const double & GeoPcon::getZPlane (unsigned int i) const
107 {
108  return m_zPlane[i];
109 }
110 
111 inline const double & GeoPcon::getRMinPlane (unsigned int i) const
112 {
113  return m_rMinPlane[i];
114 }
115 
116 inline const double & GeoPcon::getRMaxPlane (unsigned int i) const
117 {
118  return m_rMaxPlane[i];
119 }
120 
121 inline const std::string& GeoPcon::getClassType ()
122 {
123  return s_classType;
124 }
125 
126 inline ShapeType GeoPcon::getClassTypeID ()
127 {
128  return s_classTypeID;
129 }
130 
131 inline const double& GeoPcon::getSPhi () const
132 {
133  return m_sPhi;
134 }
135 
136 inline const double& GeoPcon::getDPhi () const
137 {
138  return m_dPhi;
139 }
140 
141 #endif
This shape represents a polycone. Specify the starting angle and delta angle (subtended angle) of the...
Definition: GeoPcon.h:20
This class is a visitor for shapes. It allows a navigation of the boolean expression tree for shapes...
This class describes a Shape. Shapes will be able to do the following things:
Definition: GeoShape.h:38