#include <CSCCrosstalkGenerator.h>
Public Member Functions | |
CSCCrosstalkGenerator () | |
CSCAnalogSignal | getCrosstalk (const CSCAnalogSignal &inputSignal) const |
float | ratio (const CSCAnalogSignal &crosstalkSignal, const CSCAnalogSignal &signal) const |
analyzes the ratio between two signals. | |
void | setParameters (float crosstalk, float delay, float resistiveFraction) |
Private Attributes | |
float | theCrosstalk |
float | theDelay |
float | theResistiveFraction |
Cross-talk generator for digitization simulation of Endcap Muon CSCs. We model crosstalk by making the signal on a neighboring strip or wire proportional to the slope of the original signal. The constant should be chosen to give the appropriate level of crosstalk, maybe 10% of the signal. The user is responsible for subtracting the crosstalk from the input signal, and adding the crosstalk signal to the neighbors.
Definition at line 19 of file CSCCrosstalkGenerator.h.
CSCCrosstalkGenerator::CSCCrosstalkGenerator | ( | ) | [inline] |
Definition at line 22 of file CSCCrosstalkGenerator.h.
: theCrosstalk(0), theDelay(0), theResistiveFraction(0.) {};
CSCAnalogSignal CSCCrosstalkGenerator::getCrosstalk | ( | const CSCAnalogSignal & | inputSignal | ) | const |
Definition at line 4 of file CSCCrosstalkGenerator.cc.
References CSCAnalogSignal::getBinSize(), CSCAnalogSignal::getSize(), CSCAnalogSignal::getTimeOffset(), CSCAnalogSignal::getValue(), slope, theCrosstalk, theDelay, and theResistiveFraction.
Referenced by CSCStripElectronicsSim::addCrosstalk().
{ int nBins = inputSignal.getSize(); float binSize = inputSignal.getBinSize(); std::vector<float> binValues(nBins); for(int outputBin = 0; outputBin < nBins; ++outputBin) { float aTime = outputBin*binSize - theDelay; float slope = inputSignal.getValue(aTime) - inputSignal.getValue(aTime-1.); binValues[outputBin] = slope * theCrosstalk + theResistiveFraction * inputSignal.getValue(aTime); } return CSCAnalogSignal(0, binSize, binValues, 0., inputSignal.getTimeOffset()); }
float CSCCrosstalkGenerator::ratio | ( | const CSCAnalogSignal & | crosstalkSignal, |
const CSCAnalogSignal & | signal | ||
) | const |
analyzes the ratio between two signals.
Definition at line 20 of file CSCCrosstalkGenerator.cc.
References CSCAnalogSignal::getBinValue(), CSCAnalogSignal::getSize(), i, and pileupCalc::nbins.
{ float maxFirst = 0., maxSecond = 0.; int nbins = signal.getSize(); for(int i = 1; i < nbins; ++i) { float v1 = signal.getBinValue(i); float v2 = crosstalkSignal.getBinValue(i); if(v1 > maxFirst) maxFirst = v1; if(v2 > maxSecond) maxSecond = v2; } return maxSecond/maxFirst; }
void CSCCrosstalkGenerator::setParameters | ( | float | crosstalk, |
float | delay, | ||
float | resistiveFraction | ||
) | [inline] |
Definition at line 25 of file CSCCrosstalkGenerator.h.
References theCrosstalk, theDelay, and theResistiveFraction.
Referenced by CSCStripElectronicsSim::addCrosstalk().
{ theCrosstalk = crosstalk; theDelay = delay; theResistiveFraction = resistiveFraction; }
float CSCCrosstalkGenerator::theCrosstalk [private] |
Definition at line 37 of file CSCCrosstalkGenerator.h.
Referenced by getCrosstalk(), and setParameters().
float CSCCrosstalkGenerator::theDelay [private] |
Definition at line 38 of file CSCCrosstalkGenerator.h.
Referenced by getCrosstalk(), and setParameters().
float CSCCrosstalkGenerator::theResistiveFraction [private] |
Definition at line 40 of file CSCCrosstalkGenerator.h.
Referenced by getCrosstalk(), and setParameters().