66 #ifndef ST_TRS_ANALOG_SIGNAL_GENERATOR_HH
67 #define ST_TRS_ANALOG_SIGNAL_GENERATOR_HH
72 #if defined (__SUNPRO_CC) && __SUNPRO_CC >= 0x500
77 #include "Randomize.h"
79 #include "StTrsAnalogSignal.hh"
80 #include "StTpcGeometry.hh"
81 #include "StTpcSlowControl.hh"
82 #include "StTpcElectronics.hh"
83 #define TPC_DATABASE_PARAMETERS
84 #ifndef TPC_DATABASE_PARAMETERS
85 #include "StTpcCoordinateTransform.hh"
87 #include "StDbUtilities/StTpcCoordinateTransform.hh"
89 #include "StTrsWireHistogram.hh"
90 #include "StTrsSector.hh"
101 virtual void sampleAnalogSignal() = 0;
105 void setDeltaPad(
int);
106 void setDeltaRow(
int);
107 void setSignalThreshold(
double);
108 void setSuppressEmptyTimeBins(
bool);
109 virtual void setNormalFactor(
double FudgeFactor) {assert(0);}
112 void setNoiseRMS(
double);
113 void generateNoiseUnderSignalOnly(
bool);
116 void fractionSampled();
117 double generateNoise()
const;
126 pair<int, int> mRowLimits;
127 pair<int, int> mPadLimits;
132 double mSignalThreshold;
133 bool mSuppressEmptyTimeBins;
135 #ifndef ST_NO_TEMPLATE_DEF_ARGS
136 vector<StTrsAnalogSignal> mDiscreteAnalogTimeSequence;
137 vector<StTrsAnalogSignal>::iterator mTimeSequenceIterator;
139 vector<StTrsAnalogSignal, allocator<StTrsAnalogSignal> > mDiscreteAnalogTimeSequence;
140 vector<StTrsAnalogSignal, allocator<StTrsAnalogSignal> >::iterator mTimeSequenceIterator;
146 double mSamplingFrequency;
148 double mFractionSampled;
152 bool mAddNoiseUnderSignalOnly;
157 double mTimeShiftOfSignalCentroid;
163 void inline StTrsAnalogSignalGenerator::setDeltaRow(
int dr) { mDeltaRow = (dr >=0) ? dr : 0;}
164 void inline StTrsAnalogSignalGenerator::setDeltaPad(
int dp) { mDeltaPad = (dp >=0) ? dp : 0;}
165 void inline StTrsAnalogSignalGenerator::setSignalThreshold(
double th) { mSignalThreshold = th;}
166 void inline StTrsAnalogSignalGenerator::setSuppressEmptyTimeBins(
bool su) {mSuppressEmptyTimeBins = su;}
167 void inline StTrsAnalogSignalGenerator::addNoise(
bool v) {mAddNoise = v;}
168 void inline StTrsAnalogSignalGenerator::setNoiseRMS(
double v) {mNoiseRMS = v*mGain;}
169 void inline StTrsAnalogSignalGenerator::generateNoiseUnderSignalOnly(
bool v) {mAddNoiseUnderSignalOnly = v;}
170 double inline StTrsAnalogSignalGenerator::generateNoise()
const {
return fabs(mGaussDistribution.shoot(0.,mNoiseRMS));}