Go to the documentation of this file.00001 #ifndef MU_END_STRIP_ELECTRONICS_SIM_H
00002 #define MU_END_STRIP_ELECTRONICS_SIM_H
00003
00011 #include "SimMuon/CSCDigitizer/src/CSCBaseElectronicsSim.h"
00012 #include "DataFormats/CSCDigi/interface/CSCStripDigiCollection.h"
00013 #include "DataFormats/CSCDigi/interface/CSCComparatorDigiCollection.h"
00014 #include "SimMuon/CSCDigitizer/src/CSCStripAmpResponse.h"
00015
00016 class CSCDetectorHit;
00017 class CSCComparatorDigi;
00018 class CSCCrosstalkGenerator;
00019 class CSCStripConditions;
00020 #include <vector>
00021 #include <string>
00022
00023 class CSCStripElectronicsSim : public CSCBaseElectronicsSim
00024 {
00025 public:
00027 explicit CSCStripElectronicsSim(const edm::ParameterSet & p);
00028
00029 virtual ~CSCStripElectronicsSim();
00030
00031 void fillDigis(CSCStripDigiCollection & digis,
00032 CSCComparatorDigiCollection & comparators);
00033
00034 void fillMissingLayer(const CSCLayer * layer, const CSCComparatorDigiCollection & comparators,
00035 CSCStripDigiCollection & digis);
00036
00037 void setStripConditions(CSCStripConditions * cond) {theStripConditions = cond;}
00038
00039 CSCAnalogSignal makeNoiseSignal(int element);
00040
00041 void createDigi(int istrip, const CSCAnalogSignal & signal, std::vector<CSCStripDigi> & result);
00042
00043 private:
00045 void initParameters();
00046
00047 virtual int readoutElement(int strip) const;
00048
00049 float calculateAmpResponse(float t) const;
00050 CSCStripAmpResponse theAmpResponse;
00051
00052 void runComparator(std::vector<CSCComparatorDigi> & result);
00053
00055 float comparatorReading(const CSCAnalogSignal & signal, float time) const;
00056
00057
00058 void getReadoutRange(int inputStrip,
00059 int & minStrip, int & maxStrip);
00060
00062 std::list<int>
00063 getKeyStrips(const std::vector<CSCComparatorDigi> & comparators) const;
00064
00066 std::list<int>
00067 getKeyStripsFromMC() const;
00070 std::list<int>
00071 channelsToRead(const std::list<int> & keyStrips, int window) const;
00072
00073 void fillStripDigis(const std::list<int> & keyStrips,
00074 CSCStripDigiCollection & digis);
00075
00076 void addCrosstalk();
00077 void addCrosstalk(const CSCAnalogSignal & signal,
00078 int thisStrip, int otherStrip);
00079
00080
00081 void selfTest() const;
00082
00083
00084 void doSaturation(CSCStripDigi & digi);
00085
00086
00087 float theComparatorThreshold;
00088 float theComparatorNoise;
00089 float theComparatorRMSOffset;
00090
00091 float theComparatorSaturation;
00092
00093 float theComparatorWait;
00094 float theComparatorDeadTime;
00095 float theDaqDeadTime;
00096
00097 float theTimingOffset;
00098
00099 int nScaBins_;
00100 bool doSuppression_;
00101 bool doCrosstalk_;
00102 CSCStripConditions * theStripConditions;
00103 CSCCrosstalkGenerator * theCrosstalkGenerator;
00104
00105 int theComparatorClockJump;
00106
00107 float sca_time_bin_size;
00108
00109
00110 int sca_peak_bin;
00111
00112 double theComparatorTimeBinOffset;
00113
00114 double theComparatorTimeOffset;
00115 double theComparatorSamplingTime;
00116
00117 std::vector<double> theSCATimingOffsets;
00118
00119
00120 float theAverageTimeOfFlight;
00121 };
00122
00123 #endif
00124