38 #include "StSvtHybridPixelsC.hh"
48 mNumberOfTimeBins = 0;
50 mTotalNumberOfPixels = 0;
55 StSvtHybridPixelsC::StSvtHybridPixelsC(
int barrel,
int ladder,
int wafer,
int hybrid,
int size,
unsigned char* x) :
60 mNumberOfAnodes = 240;
61 mNumberOfTimeBins = 128;
63 mTotalNumberOfPixels = mNumberOfAnodes*mNumberOfTimeBins;
69 Set(mTotalNumberOfPixels,(
char*)x);
73 Set(mTotalNumberOfPixels);
76 StSvtHybridPixelsC::~StSvtHybridPixelsC()
83 for (
int i=0;i<mTotalNumberOfPixels;i++) {
94 for (
int i=0;i<mTotalNumberOfPixels;i++) {
99 AddAt((
char)(x1+x2),i);
106 unsigned char StSvtHybridPixelsC::getPixelContent(
int anode,
int time)
109 int index = getPixelIndex(anode, time);
111 return (
unsigned char)At(index);
114 void StSvtHybridPixelsC::addToPixel(
int anode,
int time,
unsigned char x)
116 int index = getPixelIndex(anode, time);
117 addToPixel(index, x);
120 void StSvtHybridPixelsC::addToPixel(
int index,
unsigned char x)
129 AddAt((
unsigned char)sum,index);
131 AddAt((
unsigned char)255,index);
134 void StSvtHybridPixelsC::addToPixel(
int anode,
int time,
int x)
136 int index = getPixelIndex(anode, time);
137 addToPixel(index, x);
140 void StSvtHybridPixelsC::addToPixel(
int index,
int x)
148 if (sum >=0 && sum < 255)
149 AddAt((
unsigned char)sum,index);
151 AddAt((
unsigned char)0,index);
153 AddAt((
unsigned char)255,index);
156 void StSvtHybridPixelsC::addToPixel(
int anode,
int time,
double x)
158 int index = getPixelIndex(anode, time);
159 addToPixel(index, x);
162 void StSvtHybridPixelsC::addToPixel(
int index,
double x)
166 x1 = (double)At(index);
170 if (sum >=0 && sum < 255)
171 AddAt((
unsigned char)sum,index);
173 AddAt((
unsigned char)0,index);
175 AddAt((
unsigned char)255,index);
178 int StSvtHybridPixelsC::getPixelIndex(
int anode,
int time)
185 index = mNumberOfTimeBins*(anode-1) + time;
190 void StSvtHybridPixelsC::reset()
192 for (
int i=0;i<mTotalNumberOfPixels;i++)