85 #include "StTrsFastDigitalSignalGenerator.hh"
93 mSimpleConversion = conv;
94 if (!mSimpleConversion) mSimpleConversion = mElectronicsDb->adcConversion();
96 StTrsFastDigitalSignalGenerator::~StTrsFastDigitalSignalGenerator() {}
102 if(!mInstance && !el) {
103 cerr <<
"StTrsFastDigitalSignalGenerator::instance() Must Supply a File name" << endl;
104 cerr <<
"Aborting..." << endl;
116 unsigned char StTrsFastDigitalSignalGenerator::do10to8Translation(
int index)
const
119 if(index<-1.0e-30)index=0;
120 if(index>1023)index=1023;
121 return log10to8_table[index];
123 void StTrsFastDigitalSignalGenerator::digitizeSignal()
131 StDigitalTimeBins digPadData;
134 for(
int irow=1; irow<=mSector->numberOfRows(); irow++) {
135 for(
unsigned int ipad=1; ipad<=mSector->padsOfRow(irow).size(); ipad++) {
137 tpcTimeBins ¤tPad = mSector->timeBinsOfRowAndPad(irow,ipad);
139 int currentSize = currentPad.size();
140 if(!currentSize)
continue;
146 int currentTimeBin = -2005;
147 for (
int icur=0;icur<currentSize;icur++) {
148 float amp = currentPad[icur].amplitude();
150 if (mSimpleConversion>0) amp = amp/mSimpleConversion;
151 int temporary_digitalAmplitude = int(amp);
152 if (!temporary_digitalAmplitude)
continue;
154 int timeBinIndex = int(currentPad[icur].time()+1e-3);
155 assert(timeBinIndex > currentTimeBin);
156 if (timeBinIndex != currentTimeBin+1) digPadData.push_back(
StDigitalPair(timeBinIndex));
157 currentTimeBin = timeBinIndex;
159 unsigned char digitalAmplitude = do10to8Translation(temporary_digitalAmplitude);
160 int id = currentPad[icur].id();
161 digPadData.back().add(digitalAmplitude,
id);
164 mDigitalSector->assignTimeBins(irow,ipad,&digPadData);
170 void StTrsFastDigitalSignalGenerator::addCorrelatedNoise()
172 cerr <<
"StTrsFastDigitalSignalGenerator::addCorrelatedNoise()" << endl;
173 cerr <<
"Not Implemented!" << endl;
176 void StTrsFastDigitalSignalGenerator::addWhiteNoise()
178 cerr <<
"StTrsFastDigitalSignalGenerator::addWhiteNoise()" << endl;
179 cerr <<
"Not Implemented!" << endl;