StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StMuFstHit.h
1 /**************************************************************************
2  *
3  * StMuFstHit.h
4  *
5  * Author: tchuang 2022
6  **************************************************************************
7  *
8  * Description: Data class for FST hit in StMuDst
9  *
10  **************************************************************************/
11 #ifndef StMuFstHit_h
12 #define StMuFstHit_h
13 
14 #include <TVector3.h>
15 #include <TObject.h>
16 #include <TRefArray.h>
17 #include "StEnumerations.h"
18 #include "StEvent/StFstConsts.h"
19 
20 class StFstHit;
21 
22 class StMuFstHit : public TObject {
23 public:
24  StMuFstHit();
25  ~StMuFstHit();
26 
27  int getId() const;
28  int getIdTruth() const;
29  unsigned char getDisk() const;
30  unsigned char getWedge() const;
31  unsigned char getSensor() const;
32  unsigned char getApv() const;
33  unsigned char getMaxTimeBin() const;
34  float getMeanRStrip() const;
35  float getMeanPhiStrip() const;
36  float getCharge() const;
37  float getChargeErr() const;
38  unsigned char getNRawHits() const;
39  unsigned char getNRawHitsR() const;
40  unsigned char getNRawHitsPhi() const;
41  float localPosition(unsigned int ) const;
42 
43  void setId(int id);
44  void setIdTruth(int idtruth);
45  void setDisk(unsigned char disk);
46  void setWedge(unsigned char wedge);
47  void setSensor(unsigned char sensor);
48  void setApv(unsigned char apv);
49  void setMaxTimeBin(unsigned char tb);
50  void setCharge(float charge);
51  void setChargeErr(float chargeErr);
52  void setMeanRStrip(float meanRStrip);
53  void setMeanPhiStrip(float meanPhiStrip);
54  void setNRawHits(unsigned char nRawHits);
55  void setNRawHitsR(unsigned char nRawHitsR);
56  void setNRawHitsPhi(unsigned char nRawHitsPhi);
57  void setLocalPosition(float, float, float);
58 
59  const TVector3& xyz() const; // position in global STAR coordinate
60  void setXYZ(const TVector3& p3);
61 
62  void setHardwarePosition(int HardwarePosition);
63 
64  void print(int option=0);
65 
66  void set( StFstHit *hit );
67 
68 private:
69 
70  Int_t mId;
71  Int_t mIdTruth;
72  UChar_t mApv;
73  UChar_t mMaxTimeBin;
74  Float_t mMeanRStrip;
75  Float_t mMeanPhiStrip;
76  Float_t mCharge;
77  Float_t mChargeErr;
78  UChar_t mNRawHits;
79  UChar_t mNRawHitsR;
80  UChar_t mNRawHitsPhi;
81  Float_t mLocalPosition[3];
82 
83  UInt_t mHardwarePosition;
84  TVector3 mXYZ; // position in STAR coordinate
85 
86  ClassDef(StMuFstHit, 1)
87 };
88 
89 
90 
91 inline int StMuFstHit::getId() const { return mId; };
92 inline int StMuFstHit::getIdTruth() const { return mIdTruth; };
93 inline unsigned char StMuFstHit::getDisk() const { return 1 + (mHardwarePosition - 1) / kFstNumSensorsPerWedge / kFstNumWedgePerDisk;};
94 inline unsigned char StMuFstHit::getWedge() const { return 1 + (mHardwarePosition - 1) / kFstNumSensorsPerWedge;};
95 inline unsigned char StMuFstHit::getSensor() const { return (mHardwarePosition - 1) % kFstNumSensorsPerWedge;};
96 inline unsigned char StMuFstHit::getApv() const { return mApv; };
97 inline unsigned char StMuFstHit::getMaxTimeBin() const { return mMaxTimeBin; };
98 inline float StMuFstHit::getMeanRStrip() const { return mMeanRStrip; };
99 inline float StMuFstHit::getMeanPhiStrip() const { return mMeanPhiStrip; };
100 inline float StMuFstHit::getCharge() const { return mCharge; };
101 inline float StMuFstHit::getChargeErr() const { return mChargeErr; };
102 inline unsigned char StMuFstHit::getNRawHits() const { return mNRawHits; };
103 inline unsigned char StMuFstHit::getNRawHitsR() const { return mNRawHitsR; };
104 inline unsigned char StMuFstHit::getNRawHitsPhi() const { return mNRawHitsPhi; };
105 
106 inline const TVector3& StMuFstHit::xyz() const { return mXYZ; };
107 
108 inline void StMuFstHit::setId(int id) { mId = id; };
109 inline void StMuFstHit::setIdTruth(int idtruth) { mIdTruth = idtruth; };
110 inline void StMuFstHit::setApv(unsigned char apv) { mApv = apv; };
111 inline void StMuFstHit::setMaxTimeBin(unsigned char tb) { mMaxTimeBin = tb; };
112 inline void StMuFstHit::setMeanRStrip(float meanRStrip) { mMeanRStrip = meanRStrip; };
113 inline void StMuFstHit::setMeanPhiStrip(float meanPhiStrip) { mMeanPhiStrip = meanPhiStrip; };
114 inline void StMuFstHit::setCharge(float charge) { mCharge = charge; };
115 inline void StMuFstHit::setChargeErr(float chargeErr) { mChargeErr = chargeErr; };
116 inline void StMuFstHit::setNRawHits(unsigned char nRawHits) { mNRawHits = nRawHits; };
117 inline void StMuFstHit::setNRawHitsR(unsigned char nRawHitsR) { mNRawHitsR = nRawHitsR; };
118 inline void StMuFstHit::setNRawHitsPhi(unsigned char nRawHitsPhi) { mNRawHitsPhi = nRawHitsPhi; };
119 
120 inline void StMuFstHit::setXYZ(const TVector3& p3) { mXYZ = p3; }
121 
122 inline void StMuFstHit::setHardwarePosition(int hardwarePosition) { mHardwarePosition = hardwarePosition; };
123 
124 #endif // StMuFstHit_h
125