StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StIstHit.h
1 /***************************************************************************
2 *
3 * $Id: StIstHit.h,v 2.2 2016/02/25 17:10:20 ullrich Exp $
4 *
5 * Author: Yaping Wang, March 2013
6 ****************************************************************************
7 * Description:
8 * Data structure for individual IST hit (a 1D cluster).
9 ***************************************************************************/
10 
11 #ifndef StIstHit_hh
12 #define StIstHit_hh
13 
14 #include "StarClassLibrary/StMemoryPool.hh"
15 #include "StEvent/StHit.h"
16 #include "StEvent/StEnumerations.h"
17 
18 using namespace StIstConsts;
19 
20 
21 class StIstHit : public StHit
22 {
23 public:
24  StIstHit(unsigned char ladder = -1, unsigned char sensor = -1, float Charge = 0., float ChargeErr = 0.,
25  unsigned char maxTB = 0, unsigned char nRawHits = 1, unsigned char nRawHitsZ = 0,
26  unsigned char nRawHitsRPhi = 0);
27  StIstHit(const StThreeVectorF &position, const StThreeVectorF &error, unsigned int hwPosition, float charge,
28  unsigned char trackRefCount = 0);
29 
30  StDetectorId detector() const;
31  void setDetectorId(StDetectorId);
32 
33  unsigned char getLadder() const;
34  unsigned char getSensor() const;
35  unsigned char getMaxTimeBin() const;
36  float getChargeErr() const;
37  unsigned char getNRawHits() const;
38  unsigned char getNRawHitsZ() const;
39  unsigned char getNRawHitsRPhi() const;
40  float localPosition(unsigned int ) const;
41 
42  void setMaxTimeBin(unsigned char tb);
43  void setChargeErr(float chargeErr);
44  void setNRawHits(unsigned char nRawHits);
45  void setNRawHitsZ(unsigned char nRawHitsZ);
46  void setNRawHitsRPhi(unsigned char nRawHitsRPhi);
47  void setLocalPosition(float, float, float);
48 
49  void* operator new(size_t sz, void *p) { return p; }
50  void* operator new(size_t) { return mPool.alloc(); }
51  void operator delete(void* p) { mPool.free(p); }
52 
53 protected:
54  UChar_t mMaxTimeBin;
55  Float_t mChargeErr;
56  UChar_t mNRawHits;
57  UChar_t mNRawHitsZ;
58  UChar_t mNRawHitsRPhi;
59  Float_t mLocalPosition[3];
60  StDetectorId mDetectorId;
61 
62  static StMemoryPool mPool;
63 
64  ClassDef(StIstHit, 1)
65 };
66 
67 ostream &operator<<(ostream &, const StIstHit &);
68 
69 inline unsigned char StIstHit::getLadder() const { return 1 + (mHardwarePosition - 1) / kIstNumSensorsPerLadder;};
70 inline unsigned char StIstHit::getSensor() const { return 1 + (mHardwarePosition - 1) % kIstNumSensorsPerLadder;};
71 inline unsigned char StIstHit::getMaxTimeBin() const { return mMaxTimeBin; };
72 inline float StIstHit::getChargeErr() const { return mChargeErr; };
73 inline unsigned char StIstHit::getNRawHits() const { return mNRawHits; };
74 inline unsigned char StIstHit::getNRawHitsZ() const { return mNRawHitsZ; };
75 inline unsigned char StIstHit::getNRawHitsRPhi() const { return mNRawHitsRPhi; };
76 
77 inline void StIstHit::setMaxTimeBin(unsigned char tb) { mMaxTimeBin = tb; };
78 inline void StIstHit::setChargeErr(float chargeErr) { mChargeErr = chargeErr; };
79 inline void StIstHit::setNRawHits(unsigned char nRawHits) { mNRawHits = nRawHits; };
80 inline void StIstHit::setNRawHitsZ(unsigned char nRawHitsZ) { mNRawHitsZ = nRawHitsZ; };
81 inline void StIstHit::setNRawHitsRPhi(unsigned char nRawHitsRPhi) { mNRawHitsRPhi = nRawHitsRPhi; };
82 
83 #endif
84 
85 
86 /***************************************************************************
87 *
88 * $Log: StIstHit.h,v $
89 * Revision 2.2 2016/02/25 17:10:20 ullrich
90 * Implemented detector() which is now a pure abstract method in StHit.
91 *
92 * Revision 2.1 2014/04/10 16:16:24 jeromel
93 * Add hit def for Ist (Thmas OK-ed)
94 *
95 * Revision 1.10 2014/03/13 22:17:09 smirnovd
96 * Minor whitespace alignment fixes
97 *
98 * Revision 1.9 2014/03/13 22:10:30 smirnovd
99 * Expand tabs and trim trailing whitespace
100 *
101 * Revision 1.8 2014/03/13 22:10:21 smirnovd
102 * Fixed constructor's initialization list
103 *
104 * Revision 1.7 2014/03/13 22:10:12 smirnovd
105 * Move some constants from StIstUtil/StIstConsts.h to StEvent/StEnumerations.h to avoid external dependance of StEvent on StIstUtil
106 *
107 * Revision 1.6 2014/02/26 21:18:08 smirnovd
108 * Style corrected with astyle -s3 -p -H -A3 -k3 -O -o -y -Y -f
109 *
110 * Revision 1.5 2014/02/26 01:35:36 ypwang
111 * get rid of meanColumn/meanRow/Apv transformations and local position uncertainties to avoid external constants access
112 *
113 * Revision 1.4 2014/02/25 17:04:50 ypwang
114 * get rid of mClusteringType and its accessory/modifier functions
115 *
116 *
117 ****************************************************************************
118 * StIstHit.h,v 1.0
119 * Revision 1.0 2013/11/04 15:25:30 Yaping
120 * Initial version
121 ****************************************************************************/
Definition: StHit.h:125
UChar_t mNRawHits
nRawHits: cluster size
Definition: StIstHit.h:56
UChar_t mNRawHitsZ
cluster size in Z direction
Definition: StIstHit.h:57
UChar_t mNRawHitsRPhi
cluster size in r-phi direction
Definition: StIstHit.h:58
Float_t mChargeErr
charge uncertainty
Definition: StIstHit.h:55
UChar_t mMaxTimeBin
max charge time bin
Definition: StIstHit.h:54
const int kIstNumSensorsPerLadder
6 sensor per one IST Ladder