116 #include "StMemoryPool.hh"
122 StTpcHit() :
StHit() {mMinpad = mMaxpad = mMintmbk = mMaxtmbk = 0; mMcl_x = mMcl_t = 0; mAdc =0; mChargeModified = 0; mdX = 0;}
125 UInt_t hw,
float q, UChar_t c = 0,
126 Int_t IdTruth=0, UShort_t quality=0,
128 Short_t mnpad=0, Short_t mxpad=0, Short_t mntmbk=0,
129 Short_t mxtmbk=0, Float_t cl_x = 0, Float_t cl_t = 0, UShort_t Adc = 0)
130 :
StHit(p, e, hw, q, c, IdTruth, quality, Id), mAdc(Adc) {
131 setExtends(cl_x, cl_t, mnpad, mxpad, mntmbk, mxtmbk); mChargeModified = 0; mdX = 0;}
134 StDetectorId detector()
const;
136 void*
operator new(
size_t ,
void *p) {
return p;}
137 void*
operator new(size_t) {
return mPool.alloc(); }
138 void operator delete(
void* p) { mPool.free(p); }
140 void setChargeModified(Float_t Charge) {mChargeModified = Charge;}
141 void setPadTmbk(Float_t cl_x, Float_t cl_t) { mMcl_x = TMath::Nint(cl_x*64); mMcl_t = TMath::Nint(cl_t*64);}
142 void setExtends(Float_t cl_x, Float_t cl_t, Short_t mnpad, Short_t mxpad, Short_t mntmbk, Short_t mxtmbk);
143 void setAdc(UShort_t Adc = 0) {mAdc = Adc;}
144 void setdX(Float_t dX) {mdX = dX;}
145 UInt_t sector()
const {
return bits(4, 5);}
146 UInt_t padrow()
const {
return bits(9, 7);}
147 UInt_t padsInHit()
const {
return maxPad() - minPad() + 1;}
148 UInt_t pixelsInHit()
const {
return bits(22,10);};
149 UChar_t minPad()
const {
return TMath::Nint(mMcl_x/64.) - mMinpad;}
150 UChar_t maxPad()
const {
return TMath::Nint(mMcl_x/64.) + mMaxpad;}
151 Short_t minTmbk()
const {
return TMath::Nint(mMcl_t/64.) - mMintmbk;}
152 Short_t maxTmbk()
const {
return TMath::Nint(mMcl_t/64.) + mMaxtmbk;}
153 Int_t volumeID()
const {
return 100 * sector() + padrow();}
154 Short_t timeBucketsInHit()
const {
return maxTmbk() - minTmbk() + 1;}
155 Float_t timeBucket()
const {
return static_cast<float>(mMcl_t)/64.;}
156 Float_t pad()
const {
return static_cast<float>(mMcl_x)/64.;}
157 UShort_t adc()
const {
return mAdc;}
158 Float_t chargeModified()
const {
return mChargeModified;}
159 Float_t dX() {
return mdX;}
160 void Print(Option_t *option=
"")
const;
161 virtual Bool_t IsSortable()
const {
return kTRUE; }
162 virtual Int_t Compare(
const TObject *obj)
const {
164 if (sector() > hit->sector())
return kTRUE;
165 if (padrow() > hit->padrow())
return kTRUE;
166 if (TMath::Abs(position().z()) > TMath::Abs(hit->position().z()))
return kTRUE;
169 virtual const StThreeVectorF& positionU()
const {
return *&mPositionU;}
170 virtual const StThreeVectorF& positionL()
const {
return *&mPositionL;}
171 virtual void setPositionU(
const StThreeVectorF& p) {mPositionU = p;}
172 virtual void setPositionL(
const StThreeVectorF& p) {mPositionL = p;}
183 Float_t mChargeModified;
189 ostream& operator<<(ostream& os,
StTpcHit const & v);
191 inline StDetectorId StTpcHit::detector()
const {
return (bits(1,1) ? kiTpcId : kTpcId);}