StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StRnDHit.h
1 
5 /***************************************************************************
6  *
7  * $Id: StRnDHit.h,v 2.3 2017/05/04 01:06:46 perev Exp $
8  *
9  * Author: Mike Miller and Andrew Rose, Jan 2006
10  ***************************************************************************
11  *
12  * Description: This is an experimental class and not final yet
13  *
14  ***************************************************************************
15  *
16  * $Log: StRnDHit.h,v $
17  * Revision 2.3 2017/05/04 01:06:46 perev
18  * Own err matrix added
19  *
20  * Revision 2.2 2006/09/27 18:31:43 ullrich
21  * Fixed setDouble() interface. Was sooo wrong.
22  *
23  * Revision 2.1 2006/01/19 21:42:06 ullrich
24  * Initial Revision.
25  *
26  **************************************************************************/
27 #ifndef StRnDHit_hh
28 #define StRnDHit_hh
29 #include "StHit.h"
30 #include "StMemoryPool.hh"
31 #include "StEnumerations.h"
32 
33 class StRnDHit : public StHit
34 {
35 public:
36  StRnDHit();
37  StRnDHit(const StThreeVectorF& position,
38  const StThreeVectorF& error,
39  unsigned int hwPosition, float charge, unsigned char trackRefCount = 0,
40  unsigned short idTruth=0, unsigned short quality=0, unsigned short id =0,
41  StDetectorId = kUnknownId);
42  ~StRnDHit();
43 
44  StDetectorId detector() const;
45  unsigned int layer() const;
46  unsigned int ladder() const;
47  unsigned int wafer() const;
48 
49  int extraByte0() const;
50  int extraByte1() const;
51 
52  int key() const;
53  int volumeId() const;
54 
55  double double0() const;
56  double double1() const;
57  double double2() const;
58  double double3() const;
59  double double4() const;
60 
61  void setLayer(short);
62  void setLadder(short);
63  void setWafer(short);
64  void setExtraByte0(int);
65  void setExtraByte1(int);
66  void setDetectorId(StDetectorId);
67 
68  void setKey(int);
69  void setVolumeId(int);
70 
71  void setDouble0(double);
72  void setDouble1(double);
73  void setDouble2(double);
74  void setDouble3(double);
75  void setDouble4(double);
76 
77  void setErrorMatrix(const float* M);
78 
79  StMatrixF covariantMatrix() const;//{ return mErrMatrix; }
80 
81  void* operator new(size_t sz,void *p) { return p;}
82  void* operator new(size_t) { return mPool.alloc(); }
83  void operator delete(void* p) { mPool.free(p); }
84 
85  friend ostream& operator<<(ostream& os, const StRnDHit& h);
86 
87 protected:
88  Short_t mLayer;
89  Short_t mLadder;
90  Short_t mWafer;
91 
92  //Extras
93  Int_t mExtraByte0;
94  Int_t mExtraByte1;
95 
96  //info to get back to StMcHit pointer:
97  Int_t mKey;
98  Int_t mVolumeId;
99 
100  //and 5 overflow doubles
101  Double_t mDouble0;
102  Double_t mDouble1;
103  Double_t mDouble2;
104  Double_t mDouble3;
105  Double_t mDouble4;
106 
107  // this has to go once the playing and testing is over.
108  // should be hard wired in member function.
109  StDetectorId mDetectorId;
110 
111  float mErrorMatrix[9];
112 
113  static StMemoryPool mPool;
114 
115  ClassDef(StRnDHit,2)
116 };
117 
118 inline unsigned int StRnDHit::layer() const {return mLayer;}
119 inline unsigned int StRnDHit::ladder() const {return mLadder;}
120 inline unsigned int StRnDHit::wafer() const {return mWafer;}
121 inline int StRnDHit::extraByte0() const {return mExtraByte0;}
122 inline int StRnDHit::extraByte1() const {return mExtraByte1;}
123 inline int StRnDHit::key() const {return mKey;}
124 inline int StRnDHit::volumeId() const {return mVolumeId;}
125 inline double StRnDHit::double0() const {return mDouble0;}
126 inline double StRnDHit::double1() const {return mDouble1;}
127 inline double StRnDHit::double2() const {return mDouble2;}
128 inline double StRnDHit::double3() const {return mDouble3;}
129 inline double StRnDHit::double4() const {return mDouble4;}
130 
131 inline void StRnDHit::setLayer(short v) {mLayer = v;}
132 inline void StRnDHit::setLadder(short v) {mLadder = v;}
133 inline void StRnDHit::setWafer(short v) {mWafer = v;}
134 inline void StRnDHit::setExtraByte0(int v) {mExtraByte0=v;}
135 inline void StRnDHit::setExtraByte1(int v) {mExtraByte1=v;}
136 inline void StRnDHit::setKey(int v) {mKey = v;}
137 inline void StRnDHit::setVolumeId(int v) {mVolumeId=v;}
138 inline void StRnDHit::setDouble0(double val) {mDouble0 = val;}
139 inline void StRnDHit::setDouble1(double val) {mDouble1 = val;}
140 inline void StRnDHit::setDouble2(double val) {mDouble2 = val;}
141 inline void StRnDHit::setDouble3(double val) {mDouble3 = val;}
142 inline void StRnDHit::setDouble4(double val) {mDouble4 = val;}
143 
144 #endif
Short_t mLadder
Layer.
Definition: StRnDHit.h:89
Definition: StHit.h:125
Int_t mVolumeId
key from StMcHit
Definition: StRnDHit.h:98
Int_t mExtraByte0
Wafer.
Definition: StRnDHit.h:93
Short_t mWafer
Ladder.
Definition: StRnDHit.h:90
Double_t mDouble0
VolumeId from StMcHit.
Definition: StRnDHit.h:101