StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StFstHit.h
1 /***************************************************************************
2 * $Id: StFstHit.h $
3 *
4 * Author: Shenghui Zhang, Oct. 2021
5 ****************************************************************************
6 * Description:
7 * Data structure for individual FST hit (a 1D cluster).
8 ***************************************************************************/
9 
10 #ifndef StFstHit_hh
11 #define StFstHit_hh
12 
13 #include "StarClassLibrary/StMemoryPool.hh"
14 #include "StEvent/StHit.h"
15 #include "StEvent/StEnumerations.h"
16 #include "StEvent/StFstConsts.h"
17 
18 #include <iostream>
19 
20 class StFstHit : public StHit
21 {
22 public:
23  StFstHit(unsigned char disk = -1, unsigned char wedge = -1, unsigned char sensor = -1, unsigned char apv = -1, float Charge = 0., float ChargeErr = 0.,
24  unsigned char maxTB = 0, float meanRStrip = -1, float meanPhiStrip = -1, unsigned char nRawHits = 1, unsigned char nRawHitsR = 0,
25  unsigned char nRawHitsPhi = 0);
26  StFstHit(const StThreeVectorF &position, const StThreeVectorF &error, unsigned int hwPosition, float charge,
27  unsigned char trackRefCount = 0);
28 
29  StDetectorId detector() const;
30  void setDetectorId(StDetectorId);
31 
32  unsigned char getDisk() const;
33  unsigned char getWedge() const;
34  unsigned char getSensor() const;
35  unsigned char getApv() const;
36  unsigned char getMaxTimeBin() const;
37  float getMeanPhiStrip() const;
38  float getMeanRStrip() const;
39  float getChargeErr() const;
40  unsigned char getNRawHits() const;
41  unsigned char getNRawHitsR() const;
42  unsigned char getNRawHitsPhi() const;
43  float localPosition(unsigned int ) const;
44 
45  void setDiskWedgeSensor(unsigned char disk, unsigned char wedge, unsigned char sensor);
46  void setDisk(unsigned char disk);
47  void setWedge(unsigned char wedge);
48  void setSensor(unsigned char sensor);
49  void setApv(unsigned char apv);
50  void setMaxTimeBin(unsigned char tb);
51  void setChargeErr(float chargeErr);
52  void setMeanPhiStrip(float meanPhiStrip);
53  void setMeanRStrip(float meanRStrip);
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  void* operator new(size_t sz, void *p) { return p; }
60  void* operator new(size_t) { return mPool.alloc(); }
61  void operator delete(void* p) { mPool.free(p); }
62 
63 protected:
64  UChar_t mApv;
65  UChar_t mMaxTimeBin;
66  Float_t mMeanRStrip;
67  Float_t mMeanPhiStrip;
68  Float_t mChargeErr;
69  UChar_t mNRawHits;
70  UChar_t mNRawHitsR;
71  UChar_t mNRawHitsPhi;
72  Float_t mLocalPosition[3];
73  StDetectorId mDetectorId;
74 
75  static StMemoryPool mPool;
76 
77  ClassDef(StFstHit, 1)
78 };
79 
80 std::ostream &operator<<(std::ostream &, const StFstHit &);
81 
82 inline unsigned char StFstHit::getDisk() const { return 1 + (mHardwarePosition - 1) / kFstNumSensorsPerWedge / kFstNumWedgePerDisk;};
83 inline unsigned char StFstHit::getWedge() const { return 1 + (mHardwarePosition - 1) / kFstNumSensorsPerWedge;};
84 inline unsigned char StFstHit::getSensor() const { return (mHardwarePosition - 1) % kFstNumSensorsPerWedge;};
85 inline unsigned char StFstHit::getApv() const { return mApv; };
86 inline unsigned char StFstHit::getMaxTimeBin() const { return mMaxTimeBin; };
87 inline float StFstHit::getMeanPhiStrip() const { return mMeanPhiStrip; };
88 inline float StFstHit::getMeanRStrip() const { return mMeanRStrip; };
89 inline float StFstHit::getChargeErr() const { return mChargeErr; };
90 inline unsigned char StFstHit::getNRawHits() const { return mNRawHits; };
91 inline unsigned char StFstHit::getNRawHitsR() const { return mNRawHitsR; };
92 inline unsigned char StFstHit::getNRawHitsPhi() const { return mNRawHitsPhi; };
93 
94 inline void StFstHit::setDiskWedgeSensor(unsigned char disk, unsigned char wedge, unsigned char sensor) { setHardwarePosition(
95  (1+disk)*kFstNumWedgePerDisk * kFstNumSensorsPerWedge*0 + (1 + (wedge - 1)*kFstNumSensorsPerWedge + sensor) ); }
96 inline void StFstHit::setApv(unsigned char apv) { mApv = apv; };
97 inline void StFstHit::setMaxTimeBin(unsigned char tb) { mMaxTimeBin = tb; };
98 inline void StFstHit::setMeanPhiStrip(float meanPhiStrip) { mMeanPhiStrip = meanPhiStrip; };
99 inline void StFstHit::setMeanRStrip(float meanRStrip) { mMeanRStrip = meanRStrip; };
100 inline void StFstHit::setChargeErr(float chargeErr) { mChargeErr = chargeErr; };
101 inline void StFstHit::setNRawHits(unsigned char nRawHits) { mNRawHits = nRawHits; };
102 inline void StFstHit::setNRawHitsR(unsigned char nRawHitsR) { mNRawHitsR = nRawHitsR; };
103 inline void StFstHit::setNRawHitsPhi(unsigned char nRawHitsPhi) { mNRawHitsPhi = nRawHitsPhi; };
104 
105 #endif
106 
107 
108 /***************************************************************************
109 * StFstHit.h,v 1.0
110 * Revision 1.0 2021/10/04 Shenghui Zhang
111 * Initial version
112 ****************************************************************************/
Definition: StHit.h:125
Float_t mMeanPhiStrip
Hit&#39;s mean phistrip.
Definition: StFstHit.h:67
Float_t mLocalPosition[3]
local position of hit inside the sensor
Definition: StFstHit.h:72
Float_t mMeanRStrip
Hit&#39;s mean rstrip.
Definition: StFstHit.h:66
Float_t mChargeErr
charge uncertainty
Definition: StFstHit.h:68
UChar_t mMaxTimeBin
max charge time bin
Definition: StFstHit.h:65
UChar_t mNRawHitsR
cluster size in Z direction
Definition: StFstHit.h:70
UChar_t mApv
Apv id the hit belongs to.
Definition: StFstHit.h:64
UChar_t mNRawHits
nRawHits: cluster size
Definition: StFstHit.h:69
UChar_t mNRawHitsPhi
cluster size in r-phi direction
Definition: StFstHit.h:71