CMS 3D CMS Logo

CSCCrosstalkGenerator.cc
Go to the documentation of this file.
3 
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 }
17 
18 float CSCCrosstalkGenerator::ratio(const CSCAnalogSignal &crosstalkSignal, const CSCAnalogSignal &signal) const {
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
float getBinSize() const
static const double slope[3]
float ratio(const CSCAnalogSignal &crosstalkSignal, const CSCAnalogSignal &signal) const
analyzes the ratio between two signals.
float getTimeOffset() const
int getSize() const
CSCAnalogSignal getCrosstalk(const CSCAnalogSignal &inputSignal) const
float getValue(float t) const