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::CSCCrosstalkGenerator ( )
inline

Member Function Documentation

◆ getCrosstalk()

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().

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 }
static const double slope[3]
int getSize() const
float getValue(float t) const
float getBinSize() const
float getTimeOffset() const

◆ ratio()

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.

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 }
int getSize() const
float getBinValue(int i) const

◆ setParameters()

void CSCCrosstalkGenerator::setParameters ( float  crosstalk,
float  delay,
float  resistiveFraction 
)
inline

Member Data Documentation

◆ theCrosstalk

float CSCCrosstalkGenerator::theCrosstalk
private

Definition at line 35 of file CSCCrosstalkGenerator.h.

Referenced by getCrosstalk(), and setParameters().

◆ theDelay

float CSCCrosstalkGenerator::theDelay
private

Definition at line 36 of file CSCCrosstalkGenerator.h.

Referenced by getCrosstalk(), and setParameters().

◆ theResistiveFraction

float CSCCrosstalkGenerator::theResistiveFraction
private

Definition at line 38 of file CSCCrosstalkGenerator.h.

Referenced by getCrosstalk(), and setParameters().