StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StRpsTrackPoint.h
1 /***************************************************************************
2  *
3  * $Id: StRpsTrackPoint.h,v 2.2 2015/10/07 17:30:13 ullrich Exp $
4  *
5  * Author: Rafal Sikora, 1 Oct 2015
6  *
7  ***************************************************************************
8  *
9  * Description: StRpsTrackPoint class representing reconstructed (x,y,z)
10  * position of the hit in single Roman Pot detector
11  *
12  ***************************************************************************
13  *
14  * $Log: StRpsTrackPoint.h,v $
15  * Revision 2.2 2015/10/07 17:30:13 ullrich
16  * Changed const to enums and related changes.
17  *
18  * Revision 2.1 2015/10/02 19:48:14 ullrich
19  * Initial Revision.
20  *
21  **************************************************************************/
22 #ifndef StRpsTrackPoint_hh
23 #define StRpsTrackPoint_hh
24 
25 #include "StObject.h"
26 #include "StThreeVectorF.hh"
27 
28 
29 class StRpsTrackPoint : public StObject {
30 public:
33  ~StRpsTrackPoint();
34 
35  StRpsTrackPoint& operator=(const StRpsTrackPoint&);
36  enum StRpsTrackPointQuality {rpsNormal, rpsGolden, rpsNotSet};
37 
38  StThreeVectorF positionVec() const;
39  int rpId() const;
40  int clusterId(unsigned int) const;
41  double time(unsigned int) const;
42  StRpsTrackPointQuality quality() const;
43  unsigned int planesUsed() const;
44 
45  double x() const;
46  double y() const;
47  double z() const;
48 
49  void setPosition(const StThreeVectorF&);
50  void setRpId(int);
51  void setClusterId(int, unsigned int);
52  void setTime(double, unsigned int);
53  void setQuality(StRpsTrackPointQuality);
54 
55  enum {mNumberOfPmtsInRp = 2, mNumberOfPlanesInRp = 4};
56 
57 private:
58  int mRpId;
59  int mClusterId[mNumberOfPlanesInRp];
60  double mTime[mNumberOfPmtsInRp];
61 
62  StThreeVectorF mPosition;
63  StRpsTrackPointQuality mQuality;
64 
65  ClassDef( StRpsTrackPoint, 1 )
66 };
67 
68 inline StThreeVectorF StRpsTrackPoint::positionVec() const { return mPosition; }
69 inline int StRpsTrackPoint::rpId() const { return mRpId; }
70 inline int StRpsTrackPoint::clusterId(unsigned int planeId ) const
71 {
72  return planeId<mNumberOfPlanesInRp ? mClusterId[planeId] : -1;
73 }
74 inline double StRpsTrackPoint::time(unsigned int pmtId) const
75 {
76  return pmtId<mNumberOfPmtsInRp ? mTime[pmtId] : -1;
77 }
78 inline StRpsTrackPoint::StRpsTrackPointQuality StRpsTrackPoint::quality() const { return mQuality; }
79 inline double StRpsTrackPoint::x() const { return mPosition.x(); }
80 inline double StRpsTrackPoint::y() const { return mPosition.y(); }
81 inline double StRpsTrackPoint::z() const { return mPosition.z(); }
82 
83 inline void StRpsTrackPoint::setPosition(const StThreeVectorF& position)
84 {
85  mPosition = position;
86 }
87 inline void StRpsTrackPoint::setRpId(int rpId) { mRpId = rpId; }
88 inline void StRpsTrackPoint::setClusterId(int clusterId, unsigned int planeId)
89 {
90  if( planeId<mNumberOfPlanesInRp )
91  mClusterId[planeId] = clusterId;
92 }
93 inline void StRpsTrackPoint::setTime(double timeVal, unsigned int pmtId)
94 {
95  if( pmtId<mNumberOfPmtsInRp ) mTime[pmtId] = timeVal;
96 }
97 inline void StRpsTrackPoint::setQuality(StRpsTrackPoint::StRpsTrackPointQuality quality )
98 {
99  mQuality = quality;
100 }
101 
102 #endif