StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuRpsTrackPoint.h
1 #ifndef __StMuRpsTrackPoint_hh__
2 #define __StMuRpsTrackPoint_hh__
3 
4 #include "TObject.h"
5 #include "TVector3.h"
6 
7 // #include "StEvent/StRpsTrackPoint.h"
8 
9 class StRpsTrackPoint;
10 
11 class StMuRpsTrackPoint : public TObject {
12 
13 public:
14  enum StMuRpsTrackPointQuality {rpsNormal, rpsGolden, rpsNotSet};
15  enum {mNumberOfPmtsInRp = 2, mNumberOfPlanesInRp = 4};
16 protected:
17 
18  // position (x, y, z)
19  TVector3 mPosition;
20  // RP# (e.g. E1U=0)
21  Int_t mRpId;
22  // IDs of clusters in RpsCollection
23  Int_t mClusterId[mNumberOfPlanesInRp];
24  // Track Point Quality
25  StMuRpsTrackPointQuality mQuality;
26  // time
27  double mTime[mNumberOfPmtsInRp];
28 
29 public:
33 
34  StMuRpsTrackPoint& operator=(const StMuRpsTrackPoint&);
35 
36  TVector3 positionVec() const;
37  Int_t rpId() const;
38  Int_t clusterId(unsigned int planeId ) const;
39  double time(unsigned int) const;
40  StMuRpsTrackPointQuality quality() const;
41 
42  double x() const;
43  double y() const;
44  double z() const;
45 
46  void setPosition(const TVector3&);
47  void setRpId(Int_t);
48  void setClusterId(Int_t, unsigned int);
49  void setQuality(StMuRpsTrackPointQuality quality);
50  unsigned int planesUsed() const;
51 
52  void setTime(double, unsigned int);
53 
54 
55 private:
56 
57  ClassDef(StMuRpsTrackPoint,1)
58 };
59 
60 inline TVector3 StMuRpsTrackPoint::positionVec() const { return mPosition; }
61 inline Int_t StMuRpsTrackPoint::rpId() const { return mRpId; }
62 inline Int_t StMuRpsTrackPoint::clusterId(unsigned int planeId ) const {
63  return planeId<mNumberOfPlanesInRp ? mClusterId[planeId] : -1;
64 }
65 inline StMuRpsTrackPoint::StMuRpsTrackPointQuality StMuRpsTrackPoint::quality() const { return mQuality; }
66 inline double StMuRpsTrackPoint::x() const { return mPosition.x(); }
67 inline double StMuRpsTrackPoint::y() const { return mPosition.y(); }
68 inline double StMuRpsTrackPoint::z() const { return mPosition.z(); }
69 
70 inline void StMuRpsTrackPoint::setPosition(const TVector3& position){
71  mPosition = position;
72 }
73 inline void StMuRpsTrackPoint::setRpId(Int_t rpId) { mRpId = rpId; }
74 inline void StMuRpsTrackPoint::setClusterId(int clusterId, unsigned int planeId) {
75  if( planeId<mNumberOfPlanesInRp )
76  mClusterId[planeId] = clusterId;
77 }
78 inline void StMuRpsTrackPoint::setQuality(StMuRpsTrackPointQuality quality ) {
79  mQuality = quality;
80 }
81 inline double StMuRpsTrackPoint::time(unsigned int pmtId) const {
82  return pmtId<mNumberOfPmtsInRp ? mTime[pmtId] : -1;
83 }
84 inline void StMuRpsTrackPoint::setTime(double timeVal, unsigned int pmtId){
85  if( pmtId<mNumberOfPmtsInRp ) mTime[pmtId] = timeVal;
86 }
87 
88 
89 
90 #endif