StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFgtPoint.h
1 
5 /***************************************************************************
6  *
7  * $Id: StFgtPoint.h,v 2.4 2013/04/24 17:35:09 ullrich Exp $
8  * Author: S. Gliske, Oct 2011
9  *
10  ***************************************************************************
11  *
12  * Description: data for individual ``point'' on the FGT, i.e. a pair
13  * of 1D clusters. Note, if errors during construction, the key will
14  * be set to -999. Need to check this after constructing.
15  *
16  ***************************************************************************
17  *
18  * $Log: StFgtPoint.h,v $
19  * Revision 2.4 2013/04/24 17:35:09 ullrich
20  * Implemented detector() and removed redundant semicolons.
21  *
22  * Revision 2.3 2013/01/08 19:53:15 ullrich
23  * Added comparison operators.
24  *
25  * Revision 1.3 2012/12/11 00:13:10 avossen
26  * update of StFgtPoint
27  *
28  * Revision 1.4 2012/03/07 19:20:43 sgliske
29  * updated based on reviewer comments
30  *
31  * Revision 1.3 2012/03/06 22:28:01 sgliske
32  * asserts removed in StFgtPoint constructor.
33  * Now must check key after constructing
34  *
35  * Revision 1.2 2011/11/01 18:42:57 sgliske
36  * Added ::Clear(Option_t*) and few other missing things to FGT containers
37  *
38  * Revision 1.1 2011/10/31 21:51:30 sgliske
39  * creation: StEvent containers, take 2
40  *
41  *
42  **************************************************************************/
43 #ifndef _ST_FGT_POINT_H_
44 #define _ST_FGT_POINT_H_
45 
46 #include "StHit.h"
47 #include "StFgtHit.h"
48 
49 class StFgtPoint : public StHit {
50 public:
51  // constructors
52  StFgtPoint();
53  StFgtPoint( StFgtHit* hit1, StFgtHit* hit2, int key, int rank );
54 
55  // StFgtPoint(const StFgtPoint&); --> use default
56  // StFgtPoint& operator=(const StFgtPoint&); --> use default
57  const bool operator < (const StFgtPoint& rhs) const;
58  const bool operator > (const StFgtPoint& rhs) const;
59  const bool operator >= (const StFgtPoint& rhs) const;
60  const bool operator <= (const StFgtPoint& rhs) const;
61  // deconstructor
62  ~StFgtPoint();
63 
64  StDetectorId detector() const;
65  void setHardwarePosition(short disc, short quad);
66 
67  // other accessors
68  int getKey();
69  int getDisc();
70  int getQuad();
71  const StFgtHit* getHitR() const;
72  const StFgtHit* getHitPhi() const;
73 
74  float getPositionR() const;
75  float getPositionPhi() const;
76  float getChargeAsymmetry() const;
77  int getRank() const;
78  void setRank(int rank);
79 
80 protected:
81  // data members
82  Int_t mKey; // unique label
83  Float_t mChargeAsymmetry;
84  Int_t mRank;
85 
86  StFgtHit *mHitR;
88 
89 private:
90  ClassDef(StFgtPoint,2);
91 };
92 
93 
94 // inline functions
95 
96 inline StFgtPoint::StFgtPoint() : StHit(), mHitR(0), mHitPhi(0) {
97  // nothing else
98 }
99 
100 inline int StFgtPoint::getDisc() {
101  return static_cast< int >(mHardwarePosition/8);
102 }
103 
104 inline int StFgtPoint::getQuad() {
105  return static_cast< int >((mHardwarePosition/2)%4);
106 }
107 
108 inline StDetectorId StFgtPoint::detector() const {return kFgtId;}
109 
110 inline int StFgtPoint::getKey() {
111  return mKey;
112 }
113 
114 inline const StFgtHit* StFgtPoint::getHitR() const {
115  return mHitR;
116 }
117 
118 inline const StFgtHit* StFgtPoint::getHitPhi() const {
119  return mHitPhi;
120 }
121 
122 inline float StFgtPoint::getPositionR() const {
123  return mHitR->getPositionR();
124 }
125 
126 inline float StFgtPoint::getPositionPhi() const {
127  return mHitPhi->getPositionPhi();
128 }
129 
130 inline float StFgtPoint::getChargeAsymmetry() const {
131  return mChargeAsymmetry;
132 }
133 
134 inline int StFgtPoint::getRank() const {
135  return mRank;
136 }
137 
138 inline void StFgtPoint::setRank(int rank) {
139  mRank=rank;
140 }
141 
142 inline const bool StFgtPoint::operator >(const StFgtPoint& rhs) const {
143  return mRank>rhs.mRank;
144 }
145 
146 inline const bool StFgtPoint::operator >=(const StFgtPoint& rhs) const {
147  return mRank>=rhs.mRank;
148 }
149 
150 inline const bool StFgtPoint::operator <(const StFgtPoint& rhs) const {
151  return mRank<rhs.mRank;
152 }
153 
154 inline const bool StFgtPoint::operator <=(const StFgtPoint& rhs) const {
155  return mRank<=rhs.mRank;
156 }
157 
158 inline void StFgtPoint::setHardwarePosition(short disc, short quad){
159  mHardwarePosition = disc*4+quad+1;
160 }
161 
162 #endif
Definition: StHit.h:125
StFgtHit * mHitPhi
do not stream pointers
Definition: StFgtPoint.h:87
Represents a point in the FGT.
Definition: StFgtPoint.h:49