55 #include "StSvtClassLibrary/StSvtHybridPixelsD.hh"
57 #include "StSvtSignal.hh"
58 #include "StSvtSimulation.hh"
59 #include "StMCTruth.h"
69 mElectronCloud = NULL;
71 mSvtSignal->setOption(0);
73 setPasaSigAttributes(kFALSE,8);
76 StSvtSimulation::~StSvtSimulation()
81 void StSvtSimulation::setOptions(
int option)
83 mSignalOption = option;
84 mSvtSignal->setOption(mSignalOption);
89 mElectronCloud = elCloud;
92 void StSvtSimulation::setAnodeTimeBinSizes(
double timBinSize,
double anodeSize)
94 mTimeBinSize = timBinSize ;
95 mAnodeSize = anodeSize;
96 mSvtSignal->setAnodeTimeBinSizes(mTimeBinSize,mAnodeSize);
100 void StSvtSimulation::setDriftVelocity(
double driftVelocity)
103 mDriftVelocity = driftVelocity;
104 mSvtSignal->setDriftVelocity(mDriftVelocity);
105 mSvtSignal->pasaRelatedStuff();
110 void StSvtSimulation::setPasaSigAttributes(
int pasaSigAttributes,
int numOfAnodesPerHit)
112 mNumOfAnodesPerHit = numOfAnodesPerHit;
113 mPasaDebug = pasaSigAttributes;
115 if(mNumOfAnodesPerHit == 0){
122 mUpperAn = (int)(mNumOfAnodesPerHit/2);
124 if((mNumOfAnodesPerHit%2) == 0){
126 mUpperAn = mUpperAn + 1;
129 mLowerAn = -mUpperAn;
139 void StSvtSimulation::doCloud(
double time,
double Energy,
double mTheta,
double mPhi,
int trackId)
141 mElectronCloud->setPar(Energy,mTheta,mPhi,mTimeBinSize,trackId);
142 mElectronCloud->setDriftVelocity(mDriftVelocity);
143 mElectronCloud->CalcExpansion(time);
145 mSvtSignal->setCloud(mElectronCloud);
150 void StSvtSimulation::fillBuffer(
double mAnHit,
double mTimeHit,
StSvtHybridPixelsD *svtSimDataPixels)
155 resetAnodeAttributes();
160 int centAn = (int)(mAnHit) + 1;
162 for(
int an = mLowerAn; an <= mUpperAn ; an++)
164 int anode = centAn+an;
165 if( (anode<=0)||(anode>240) )
continue;
166 int counter = an-mLowerAn;
169 double chargeOnAnode = mSvtSignal->chargeFraction(anode,mAnHit);
172 if(mPasaDebug)mPasaSignals.mCharge[counter] = chargeOnAnode;
174 if(chargeOnAnode == 0.0)
continue;
176 mSvtSignal->timeCenterAndWidth(mAnHit,mTimeHit);
177 mSvtSignal->calcConvSignal(chargeOnAnode);
179 int lowBin = mSvtSignal->getLowTBin();
180 int hiBin = mSvtSignal->getHiTBin();
182 mPeakSignal = -1.0e-20;
183 for(
int n = lowBin; n <= hiBin; n++)
186 double adc = mSvtSignal->getSignal(n-1);
187 if(adc==0.0)
continue;
190 if(adc > mPeakSignal) mPeakSignal = adc;
191 int trackId = mSvtSignal->getTrackId();
194 if(mPasaDebug) mPasaSignals.mTempBuffer[counter][n-1] = adc;
196 int pixelIndex = svtSimDataPixels->getPixelIndex(anode, n - 1);
197 svtSimDataPixels->addToPixel(pixelIndex, adc,trackId);
203 mPasaSignals.anode[counter] = anode;
204 mPasaSignals.mPeak[counter] = mSvtSignal->getPeak()/4;
205 mPasaSignals.mTimeCenter[counter] = mSvtSignal->getTimeCenter();
206 mPasaSignals.mTimeWidth[counter] = mSvtSignal->getTimeWidth();
207 mPasaSignals.mUnderShoot[counter] = mSvtSignal->getMinUnderShoot();
213 void StSvtSimulation::resetAnodeAttributes()
215 for(
int j = 0; j <SvtSim_MaxBufferSize; j++)
217 mPasaSignals.anode[j] = 0;
218 mPasaSignals.mPeak[j] = 0;
219 mPasaSignals.mTimeCenter[j] = 0;
220 mPasaSignals.mTimeWidth[j] = 0;
221 mPasaSignals.mUnderShoot[j] = 0;
225 void StSvtSimulation::resetBuffer()
227 for (
int an= 0; an<SvtSim_MaxBufferSize;an++)
for(
int n = 0; n < 128; n++)
228 mPasaSignals.mTempBuffer[an][n] = 0;
SVT electron cloud expansion routines Simulates electron cloud expansion inside of the silicon wafer...