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(), 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
13  + theResistiveFraction * inputSignal.getValue(aTime);
14  }
15 
16  return CSCAnalogSignal(0, binSize, binValues, 0., inputSignal.getTimeOffset());
17 }
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 20 of file CSCCrosstalkGenerator.cc.

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

Referenced by setParameters().

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

Definition at line 25 of file CSCCrosstalkGenerator.h.

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

Referenced by CSCStripElectronicsSim::addCrosstalk().

25  {
26  theCrosstalk = crosstalk;
27  theDelay = delay;
28  theResistiveFraction = resistiveFraction;
29  }

Member Data Documentation

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