StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StiShape.h
1 #ifndef STI_SHAPE_H
2 #define STI_SHAPE_H
3 #include <math.h>
4 #include "Sti/Base/Named.h"
5 #include "Stiostream.h"
6 using namespace std;
7 
8 // allowed values for shapeCode
9 enum StiShapeCode {kPlanar = 1, kCylindrical, kSector, kConical, kDisk};
10 
15 class StiShape : public Named
16 {
17 public:
18 
19  // constructor (for subclass use)
20  StiShape(const string &name="undefined",float halfDepth=0, float thickness=0, float edge=0) :
21  Named(name),_halfDepth(halfDepth),_thickness(thickness),_edgeWidth(edge) {}
22 
23  // accessors
24  float getHalfDepth() const { return _halfDepth; } //Z direction
25 virtual float getHalfWidth() const=0;
26  float getThickness() const { return _thickness; }
27 virtual StiShapeCode getShapeCode() const = 0;
28  float getEdgeWidth() const { return _edgeWidth; }
29 virtual float getOpeningAngle() const =0;
30 virtual float getOuterRadius() const {return -999;}
31 
32  virtual double getVolume() const = 0;
33 
34  // mutators
35  void setHalfDepth(float val) {if(val >= 0.) _halfDepth = val; }
36  void setThickness(float val) {if(val >= 0.) _thickness = val; }
37 
38  protected:
39 
40  double nice(double val);
41 
43  float _halfDepth;
45  float _thickness;
47  float _edgeWidth;
48 };
49 //Non-members--------------------------
50 
51 ostream& operator<<(ostream& os, const StiShape& m);
52 
53 
54 inline double StiShape::nice(double val)
55 {
56  while (val < 0.){ val += 2*M_PI; }
57  while (val >= 2*M_PI){ val -= 2*M_PI; }
58  return val;
59 }
60 
61 #endif
float _thickness
&quot;thickness&quot;, always &gt;= 0
Definition: StiShape.h:45
float _edgeWidth
size of the edge used in tracking, deltaX local
Definition: StiShape.h:47
float _halfDepth
half extent along z, always &gt;= 0
Definition: StiShape.h:43
Definition: Named.h:16