File indexing completed on 2024-04-06 12:30:43
0001 #include "SimMuon/CSCDigitizer/src/CSCStripAmpResponse.h"
0002 #include "SimMuon/CSCDigitizer/src/CSCCrosstalkGenerator.h"
0003 #include "SimMuon/CSCDigitizer/src/CSCAnalogSignal.h"
0004 #include <iostream>
0005
0006 int main()
0007 {
0008 CSCStripAmpResponse ampResponse(100, CSCStripAmpResponse::RADICAL);
0009 std::vector<float> binValues(200, 0.);
0010
0011 float maxSlope = 0.;
0012 float timeBinSize = 25.;
0013
0014 for(int i = 1; i < 200; ++i)
0015 {
0016 binValues[i] = ampResponse.calculateAmpResponse(i*timeBinSize);
0017 float slope = binValues[i] - binValues[i-1];
0018 if(slope > maxSlope) maxSlope = slope;
0019 }
0020
0021 CSCAnalogSignal signal(0, timeBinSize, binValues);
0022
0023 float stripLength = 320.;
0024
0025 CSCCrosstalkGenerator crosstalkGenerator;
0026 crosstalkGenerator.setParameters(stripLength/70, 0., 0.02);
0027 CSCAnalogSignal crosstalkSignal = crosstalkGenerator.getCrosstalk(signal);
0028
0029 std::cout << signal << std::endl;;
0030 std::cout << crosstalkSignal << std::endl;
0031 float maxFirst = 0., maxSecond = 0.;
0032 for(int i = 1; i < 200; ++i)
0033 {
0034 float v1 = signal.getBinValue(i);
0035 float v2 = crosstalkSignal.getBinValue(i);
0036
0037 if(v1 > maxFirst) maxFirst = v1;
0038 if(v2 > maxSecond) maxSecond = v2;
0039
0040
0041 std::cout << "RATIO " << i<< " " << v2/v1 << std::endl;
0042 }
0043
0044 std::cout << "CROSSTALK " << maxSecond / maxFirst << std::endl;
0045 std::cout << "MAXSLOPE " << maxSlope << std::endl;
0046 }
0047