CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CSCCrosstalkGenerator Class Reference

#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. More...
 
void setParameters (float crosstalk, float delay, float resistiveFraction)
 

Private Attributes

float theCrosstalk
 
float theDelay
 
float theResistiveFraction
 

Detailed Description

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.

Author
Rick Wilkinson,

Definition at line 19 of file CSCCrosstalkGenerator.h.

Constructor & Destructor Documentation

CSCCrosstalkGenerator::CSCCrosstalkGenerator ( )
inline

Member Function Documentation

CSCAnalogSignal CSCCrosstalkGenerator::getCrosstalk ( const CSCAnalogSignal inputSignal) const

Definition at line 4 of file CSCCrosstalkGenerator.cc.

References CSCAnalogSignal::getBinSize(), CSCAnalogSignal::getSize(), CSCAnalogSignal::getTimeOffset(), CSCAnalogSignal::getValue(), seedmultiplicitymonitor_newtracking_cfi::nBins, slope, theCrosstalk, theDelay, and theResistiveFraction.

Referenced by CSCStripElectronicsSim::addCrosstalk(), and setParameters().

4  {
5  int nBins = inputSignal.getSize();
6  float binSize = inputSignal.getBinSize();
7  std::vector<float> binValues(nBins);
8 
9  for (int outputBin = 0; outputBin < nBins; ++outputBin) {
10  float aTime = outputBin * binSize - theDelay;
11  float slope = inputSignal.getValue(aTime) - inputSignal.getValue(aTime - 1.);
12  binValues[outputBin] = slope * theCrosstalk + theResistiveFraction * inputSignal.getValue(aTime);
13  }
14 
15  return CSCAnalogSignal(0, binSize, binValues, 0., inputSignal.getTimeOffset());
16 }
float getBinSize() const
static const double slope[3]
float getTimeOffset() const
int getSize() const
float getValue(float t) const
float CSCCrosstalkGenerator::ratio ( const CSCAnalogSignal crosstalkSignal,
const CSCAnalogSignal signal 
) const

analyzes the ratio between two signals.

Definition at line 18 of file CSCCrosstalkGenerator.cc.

References CSCAnalogSignal::getBinValue(), CSCAnalogSignal::getSize(), mps_fire::i, and LaserClient_cfi::nbins.

Referenced by setParameters().

18  {
19  float maxFirst = 0., maxSecond = 0.;
20  int nbins = signal.getSize();
21  for (int i = 1; i < nbins; ++i) {
22  float v1 = signal.getBinValue(i);
23  float v2 = crosstalkSignal.getBinValue(i);
24 
25  if (v1 > maxFirst)
26  maxFirst = v1;
27  if (v2 > maxSecond)
28  maxSecond = v2;
29  }
30 
31  return maxSecond / maxFirst;
32 }
float getBinValue(int i) const
int getSize() const
void CSCCrosstalkGenerator::setParameters ( float  crosstalk,
float  delay,
float  resistiveFraction 
)
inline

Definition at line 23 of file CSCCrosstalkGenerator.h.

References getCrosstalk(), ratio(), theCrosstalk, theDelay, and theResistiveFraction.

Referenced by CSCStripElectronicsSim::addCrosstalk().

23  {
24  theCrosstalk = crosstalk;
25  theDelay = delay;
26  theResistiveFraction = resistiveFraction;
27  }

Member Data Documentation

float CSCCrosstalkGenerator::theCrosstalk
private

Definition at line 35 of file CSCCrosstalkGenerator.h.

Referenced by getCrosstalk(), and setParameters().

float CSCCrosstalkGenerator::theDelay
private

Definition at line 36 of file CSCCrosstalkGenerator.h.

Referenced by getCrosstalk(), and setParameters().

float CSCCrosstalkGenerator::theResistiveFraction
private

Definition at line 38 of file CSCCrosstalkGenerator.h.

Referenced by getCrosstalk(), and setParameters().