00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073 #ifndef StSvtHit_hh
00074 #define StSvtHit_hh
00075
00076 #include "StHit.h"
00077 #include "StMemoryPool.hh"
00078
00079 class StSvtHit : public StHit {
00080 public:
00081 StSvtHit();
00082 StSvtHit(const StThreeVectorF&,
00083 const StThreeVectorF&,
00084 unsigned int, float, unsigned char = 0);
00085
00086
00087 ~StSvtHit();
00088
00089 void* operator new(size_t sz,void *p) { return p;}
00090 void* operator new(size_t) { return mPool.alloc(); }
00091 void operator delete(void* p) { mPool.free(p); }
00092
00093 unsigned int layer() const;
00094 static unsigned int layer(unsigned int barrel, unsigned int ladder);
00095 unsigned int ladder() const;
00096 unsigned int wafer() const;
00097 unsigned int barrel() const;
00098 unsigned int hybrid() const;
00099 unsigned int index() const;
00100 float anode() const;
00101 float timebucket() const;
00102 float peakADC() const;
00103 float localPosition(unsigned int) const;
00104 int numberOfAnodes() const;
00105 int numberOfPixels() const;
00106
00107 static unsigned int shell(unsigned int barrel, unsigned int ladder);
00108 unsigned int shell() const;
00109
00110 void setPeak(float);
00111 void setAnode(float);
00112 void setTimebucket(float);
00113 void setLocalPosition(float, float);
00114 virtual int volumeID() const;
00115 void setNumberOfAnodes(unsigned short);
00116 void setNumberOfPixels(unsigned short);
00117 void Print(Option_t *option="") const;
00118
00119 protected:
00120 static StMemoryPool mPool;
00121 Float_t mPeak;
00122 Float_t mAnode;
00123 Float_t mTimebucket;
00124 Float_t mLocalPosition[2];
00125 UShort_t mNumberOfAnodes;
00126 UShort_t mNumberOfPixels;
00127
00128 private:
00129 enum {mNBarrel=3};
00130 ClassDef(StSvtHit,3)
00131 };
00132
00133 inline unsigned int
00134 StSvtHit::index() const
00135 {
00136
00137 return (mHardwarePosition>>4)&((1L<<9)-1);
00138 }
00139
00140
00141 inline float StSvtHit::timebucket() const { return mTimebucket; }
00142 inline void StSvtHit::setPeak(float val) { mPeak = val; }
00143 inline void StSvtHit::setAnode(float val) { mAnode = val; }
00144 inline void StSvtHit::setTimebucket(float val) { mTimebucket = val; }
00145 ostream& operator<<(ostream& os, StSvtHit const & v);
00146
00147 #endif