StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StPxlHit.h
1 
6 /***************************************************************************
7  *
8  * $Id: StPxlHit.h,v 2.6 2017/05/04 00:58:28 perev Exp $
9  *
10  * Author: S. Margetis, J. Bouchet, Jan 2013
11  ***************************************************************************
12  *
13  * Description:
14  *
15  ***************************************************************************
16  *
17  * $Log: StPxlHit.h,v $
18  * Revision 2.6 2017/05/04 00:58:28 perev
19  * Cleanup
20  *
21  * Revision 2.5 2016/02/25 17:10:20 ullrich
22  * Implemented detector() which is now a pure abstract method in StHit.
23  *
24  * Revision 2.4 2015/05/13 18:05:25 ullrich
25  * New constructors for setting local hit position, proper initialization
26  * of all data member, modified existing constructor, new getter and
27  * setter for local hit coordinates.
28  *
29  * Revision 2.3 2014/04/10 16:00:13 jeromel
30  * Changes to inlcude Ist structure (Thomas OK-ed / may revisit some comments)
31  *
32  * Revision 2.2 2013/06/09 22:04:42 ullrich
33  * Modified layer() method.
34  *
35  * Revision 2.1 2013/03/05 14:40:40 ullrich
36  * Initial Revision.
37  *
38  **************************************************************************/
39 #ifndef StPxlHit_hh
40 #define StPxlHit_hh
41 #include "StHit.h"
42 #include "StMemoryPool.hh"
43 #include "StEnumerations.h"
44 
45 class StPxlHit : public StHit
46 {
47 public:
48  StPxlHit();
49  StPxlHit(const double localPos[3], unsigned int sector, unsigned int ladder,
50  unsigned int sensor, const StThreeVectorF& position, const StThreeVectorF& error,
51  unsigned int hwPosition, float charge, unsigned char trackRefCount = 0,
52  unsigned short idTruth=0, unsigned short quality=0, unsigned short id=0);
53  StPxlHit(const double localPos[3], unsigned int sector, unsigned int ladder,
54  unsigned int sensor, unsigned short idTruth);
55  StPxlHit(float meanRow, float meanColumn, unsigned int sector, unsigned int ladder,
56  unsigned int sensor);
57  ~StPxlHit();
58 
59  StDetectorId detector() const;
60 
61  unsigned int sector() const;
62  unsigned int ladder() const;
63  unsigned int sensor() const;
64  float meanRow() const;
65  float meanColumn() const;
66  unsigned int nRawHits() const;
67  unsigned int layer() const ;
68 
69  float localPosition(unsigned int) const;
70  const float* localPosition() const;
71  void setLocalPosition(float, float, float);
72  void setLocalY(float y);
73 
74  void setSector(unsigned char);
75  void setLadder(unsigned char);
76  void setSensor(unsigned char);
77  void setDetectorId(StDetectorId);
78  void setMeanRow(float);
79  void setMeanColumn(float);
80  void setNRawHits(unsigned char);
81 
82  virtual bool isSortable() const;
83 
84  void* operator new(size_t sz,void *p) { return p;}
85  void* operator new(size_t) { return mPool.alloc(); }
86  void operator delete(void* p) { mPool.free(p); }
87 
88 protected:
89  UChar_t mSector; //Sector : 1-10
90  UChar_t mLadder; //Ladder : 1-4
91  UChar_t mSensor; //Sensor : 1-10
92  Float_t mMeanRow; // mean row : mean row of the pxl cluster
93  Float_t mMeanColumn; // mean column : mean column of the pxl cluster
94  UChar_t mNRawHits; // nRawHits
95  //local position of hit inside the wafer
96  // 3D : u,v,TPS
97  Float_t mLocalPosition[3];
98 
99  // this has to go once the playing and testing is over.
100  // should be hard wired in member function.
101  StDetectorId mDetectorId;
102 
103  static StMemoryPool mPool;
104 
105  ClassDef(StPxlHit,1)
106 };
107 
108 ostream& operator<<(ostream&, const StPxlHit&);
109 
110 inline unsigned int StPxlHit::sector() const {return mSector;}
111 inline unsigned int StPxlHit::ladder() const {return mLadder;}
112 inline unsigned int StPxlHit::sensor() const {return mSensor;}
113 inline float StPxlHit::meanRow() const {return mMeanRow;}
114 inline float StPxlHit::meanColumn() const {return mMeanColumn;}
115 inline unsigned int StPxlHit::nRawHits() const {return mNRawHits;}
116 inline unsigned int StPxlHit::layer() const {return (mLadder==1)? 1 : 2;}
117 inline const Float_t* StPxlHit::localPosition() const { return mLocalPosition; }
118 inline void StPxlHit::setLocalY(float y) { mLocalPosition[1] = y; }
119 inline void StPxlHit::setSector(unsigned char v) {mSector = v;}
120 inline void StPxlHit::setLadder(unsigned char v) {mLadder = v;}
121 inline void StPxlHit::setSensor(unsigned char v) {mSensor = v;}
122 inline void StPxlHit::setMeanRow(float v) {mMeanRow = v;}
123 inline void StPxlHit::setMeanColumn(float v) {mMeanColumn = v;}
124 inline void StPxlHit::setNRawHits(unsigned char v) {mNRawHits = v;}
125 
126 inline bool StPxlHit::isSortable() const { return true; }
127 
128 #endif
Definition: StHit.h:125