74 static const char rcsid[] =
"$Id: StSvtHit.cxx,v 2.18 2009/11/23 22:20:51 ullrich Exp $";
85 mLocalPosition[0] = 0;
86 mLocalPosition[1] = 0;
93 unsigned int hw,
float q,
unsigned char c)
94 :
StHit(p, e, hw, q, c)
99 mLocalPosition[0] = 0;
100 mLocalPosition[1] = 0;
104 StSvtHit::~StSvtHit() {}
107 StSvtHit::barrel()
const {
111 if( Index < 0)
return 0;
113 if( Index < 64)
return 1;
114 else if( Index < 208)
return 2;
115 else if( Index < 432)
return 3;
121 StSvtHit::ladder()
const {
125 int mHybrid[3]={8,12,14};
126 int mLadderTot[2]={8,12};
129 mLadder = Index/mHybrid[0];
133 Index -= mHybrid[0]*mLadderTot[0];
134 mLadder = Index/mHybrid[1];
138 Index -= mHybrid[0]*mLadderTot[0];
139 Index -= mHybrid[1]*mLadderTot[1];
140 mLadder = Index/mHybrid[2];
149 StSvtHit::layer()
const {
return layer(barrel(), ladder());}
152 StSvtHit::layer(
unsigned int Barrel,
unsigned int Ladder) {
190 StSvtHit::wafer()
const
194 int Barrel = barrel()-1;
195 int Ladder = ladder()-1;
196 int mHybrid[3] ={8,12,14};
197 int mLadderTot[3] ={8,12,16};
199 for(
int B=0; B<Barrel; B++){
200 Index -= mHybrid[B]*mLadderTot[B];
203 for(
int L=0; L<Ladder; L++){
204 Index -= mHybrid[Barrel];
213 StSvtHit::hybrid()
const {
return ((index()%2)+1); }
216 StSvtHit::localPosition(
unsigned int i)
const
219 return mLocalPosition[i];
225 StSvtHit::setLocalPosition(
float u,
float v)
227 mLocalPosition[0] = u;
228 mLocalPosition[1] = v;
231 void StSvtHit::setNumberOfAnodes(
unsigned short val)
233 mNumberOfAnodes = val;
236 void StSvtHit::setNumberOfPixels(
unsigned short val)
238 mNumberOfPixels = val;
241 int StSvtHit::numberOfAnodes()
const
243 return mNumberOfAnodes;
246 int StSvtHit::numberOfPixels()
const
248 return mNumberOfPixels;
251 float StSvtHit::peakADC()
const
256 float StSvtHit::anode()
const
262 StSvtHit::shell(
unsigned int barrel,
unsigned int ladder) {
263 return ((barrel == 1 && ladder <= 4) ||
264 (barrel == 2 && ladder <= 6) ||
265 (barrel == 3 && ladder <= 8)) ? 1 : 2;
269 StSvtHit::shell()
const {
return shell(barrel(), ladder());}
273 StSvtHit::volumeID()
const {
return 10000 * shell() + 1000 * layer() + 100 * wafer() + ladder();}
275 ostream& operator<<(ostream& os,
const StSvtHit& v)
277 return os << Form(
"Svt b:%2i l:%2i w:%2i h:%1i",v.barrel(),v.ladder(), v.wafer(), v.hybrid())
279 << Form(
" P:%8.3f",v.peakADC())
280 << Form(
" Luv: %8.3f %8.3f anode %8.3f timeb %8.3f",v.localPosition(0),v.localPosition(1),v.anode(),v.timebucket());
282 void StSvtHit::Print(Option_t *option)
const {cout << *
this << endl;}