StRoot  1
StiPlacement.h
1 // Represents the position and orientation of a detector in STAR.
2 //
3 // Ben Norman, Kent State
4 // 26 July 01
5 //
6 // The "center" of a planar detector is its center of gravity (the mindpoint
7 // in local x, y, and z). For curved
8 // (cylindrical or conical sections) detectors, the "center" is the midpoint
9 // in z, opening angle, and radial thickness.
10 //
11 // The "normal" coordinates give the magnitude and azimuthal angle of a
12 // normal vector from the global origin to the plane of the detector. The
13 // plane of a planar detector is simply the one in which it lies. For a
14 // curved detector, the plane is the one which contains the tangent to the
15 // curved section at its center and is normal to the transverse projection of
16 // the radial vector from the
17 // origin to its center. Note that these definitions all assume that the
18 // plane of the detector is parallel to global z. The third "normal"
19 // cooridnate gives the location of the detector center along the detector
20 // plane in the aximuthal direction (i.e., local y). This representation is
21 // best for the Kalman local track model.
22 //
23 // The "center" coordinates are a little more natural and are best used for
24 // rendering and radial ordering. Here, the magnitude and azimuthal angle
25 // of a vector from the global origin to the center of the detector are
26  // given, as well as an orientation angle. The orientation angle is the
27 // angle from the vector above to the detector plane's outward normal.
28 // It is 0 for detectors which have xOffset==0.
29 //
30 // when setting the values, one must set all 3 for a representation at once.
31 // the other representation is then recalculated and both are available
32 // for quick access
33 //
34 // The layerRadius is independent and is used for ordering detectors in R.
35
36 #ifndef STI_PLACEMENT_H
37 #define STI_PLACEMENT_H
38
39 #include <ostream>
40
41 #include "TGeoMatrix.h"
42 #include "TVector3.h"
43
44
46
47 public:
48
49  enum StiRegion {kBackwardRapidity, kMidRapidity, kForwardRapidity, kUndefined};
50
51  // constructors
52  StiPlacement();
53
57  StiPlacement(float normRefAngle,float normRadius,float normYOffset,float centralZ);
58  StiPlacement(const TGeoMatrix& transMatrix, const TVector3& localCenter=TVector3(), const TVector3& normal=TVector3(0, 1, 0));
59  // accessors
60  float getNormalRefAngle() const { return normalRefAngle; }
62  float getNormalYoffset() const { return normalYoffset; }
63  float getCenterRefAngle() const { return centerRefAngle; }
65  float getCenterOrientation()const { return centerOrientation;}
67  float getLayerAngle() const { return layerAngle; }
68  float getZcenter() const { return zCenter; }
69  StiRegion getRegion() const { return mRegion; }
70
71  // mutators
72  void setNormalRep(float refAngle_, float radius_, float xOffset_);
73  // void setCenterRep(float refAngle_, float radius_, float orientation_);
75  void setLayerAngle(float angle);
76  void setZcenter(float val) { zCenter = val; }
77  void setRegion(StiRegion r) { mRegion = r;}
78
79  friend std::ostream& operator<<(std::ostream& os, const StiPlacement& p);
80
81 protected:
82
83  // store both representations
84  float normalRefAngle; // in [-pi, pi)
85  float normalRadius; // >= 0
86  float normalYoffset;
87  float centerRefAngle; // in [-pi, pi)
88  float centerRadius; // >= 0
89  float centerOrientation; // in [-pi/2, pi/2)
90
91  // independent radius for ordering