StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StiPolygon.h
1 //StiPolygon.h
2 //M.L. Miller (Yale Software)
3 //06/01
4 
5 #ifndef StiPolygon_HH
6 #define StiPolygon_HH
7 
8 /*
9  Simple class to represent the skeleton information of a polygon relevant for tracking.
10  By no means is this a full representation of a Polygon.
11 
12  Define the polygon concentric around the z-axis in a right handed system by:
13 
14  1) number of sides
15  2) offset of first side w.r.t. x-axis
16  3) Radial distance to all sides
17 
18  y
19  | Side Number one at radius=mradius
20  | /
21  | /
22  | / \ phi0
23  | / \
24  |/ \
25  |---------------------------- x
26 
27  Sides are numbered from 0 to n-1 in order of increasing phi. All angles are in degrees
28 */
29 
31 {
32 public:
33  StiPolygon();
34  StiPolygon(unsigned int nsides, double phi0, double r);
35  virtual ~StiPolygon();
36 
37  //Access
38  unsigned int numberOfSides() const;
39  double phi0() const;
40  double radius() const;
41  double deltaPhi() const; //Return the azimuthal angle subtended by each side (2*pi/nsides)
42 
43  virtual void setNumberOfSides(unsigned int); //These might be more complicated in derived class
44  virtual void setPhi0(double);
45  virtual void setRadius(double);
46 
47  virtual void write(const char* file) const;
48  virtual void build(const char* file);
49 
50 protected:
51 
52  unsigned int mnsides; //Number of sides
53  double mphi0; //Offset w.r.t x-axis (radians)
54  double mradius; //Radial distance to the center of all sides (cm)
55 
56 private:
57 
58 };
59 
60 //inlines--------------------------------------
61 
62 #endif
63