21 #include "StSvtHybridPixelsD.hh"
33 mNumberOfTimeBins = 0;
35 mTotalNumberOfPixels = 0;
41 StSvtHybridPixelsD::StSvtHybridPixelsD(
int barrel,
int ladder,
int wafer,
int hybrid,
int size,
double* x) :
46 mNumberOfAnodes = 240;
47 mNumberOfTimeBins = 128;
49 mTotalNumberOfPixels = mNumberOfAnodes*mNumberOfTimeBins;
55 Set(mTotalNumberOfPixels,x);
59 Set(mTotalNumberOfPixels);
60 mTrackId.Set(GetSize());
67 StSvtHybridPixelsD::~StSvtHybridPixelsD()
74 for (
int i=0;i<mTotalNumberOfPixels;i++) {
86 for (
int i=0;i<mTotalNumberOfPixels;i++) {
91 AddAt((
double)(x1+x2),i);
99 double StSvtHybridPixelsD::getPixelContent(
int anode,
int time)
102 int index = getPixelIndex(anode, time);
104 return (
double)At(index);
108 void StSvtHybridPixelsD::addToPixel(
int anode,
int time,
double x,
int trackId)
110 int index = getPixelIndex(anode, time);
111 addToPixel(index, x,trackId);
115 void StSvtHybridPixelsD::addToPixel(
int index,
double x,
int trackId)
123 if (TMath::Abs(x)<=0)
return;
125 mTruthTmp->Add(index,trackId,TMath::Abs(x));
129 int StSvtHybridPixelsD::getPixelIndex(
int anode,
int time)
136 index = mNumberOfTimeBins*(anode-1) + time;
142 void StSvtHybridPixelsD::reset()
144 for (
int i=0;i<mTotalNumberOfPixels;i++)
149 StMCTruth StSvtHybridPixelsD::getTrackId(
int index)
151 return mTrackId[index];
154 void StSvtHybridPixelsD::updateTruth()
157 if (!mTruthTmp)
return;
158 #if ROOT_VERSION_CODE <= ROOT_VERSION(5,22,0)
165 if (index==-1)
break;
166 mTrackId.AddAt(tru,(
int)index);
168 delete mTruthTmp; mTruthTmp=0;