CMS 3D CMS Logo

CSCStripElectronicsSim.h

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 CSCScaNoiseGenerator;
00020 class CSCStripConditions;
00021 #include <vector>
00022 #include <string>
00023 
00024 class CSCStripElectronicsSim : public CSCBaseElectronicsSim
00025 {
00026 public:
00028   explicit CSCStripElectronicsSim(const edm::ParameterSet & p);
00029 
00030   virtual ~CSCStripElectronicsSim();
00031 
00032   void fillDigis(CSCStripDigiCollection & digis,
00033                  CSCComparatorDigiCollection & comparators);
00034 
00035   void setStripConditions(CSCStripConditions * cond) {theStripConditions = cond;}
00036 
00037 private:
00039   void initParameters();
00040 
00041   virtual int readoutElement(int strip) const;
00042 
00043   float calculateAmpResponse(float t) const;
00044   CSCStripAmpResponse theAmpResponse;
00045 
00046   void runComparator(std::vector<CSCComparatorDigi> & result);
00047 
00049   float comparatorReading(const CSCAnalogSignal & signal, float time) const;
00050 
00051   CSCAnalogSignal makeNoiseSignal(int element);
00052 
00053   virtual float signalDelay(int element, float pos) const;
00054   
00055   // tells which strips to read out around the input strip
00056   void getReadoutRange(int inputStrip, 
00057                        int & minStrip, int & maxStrip);
00058 
00060   std::list<int>
00061   getKeyStrips(const std::vector<CSCComparatorDigi> & comparators) const;
00062 
00064   std::list<int>
00065   getKeyStripsFromMC() const;
00068   std::list<int>
00069   channelsToRead(const std::list<int> & keyStrips, int window) const;
00070 
00071   void addCrosstalk();
00072   void addCrosstalk(const CSCAnalogSignal & signal,
00073                     int thisStrip, int otherStrip);
00074 
00075 
00076   void selfTest() const;
00077 
00078   void createDigi(int istrip, float startTime, std::vector<CSCStripDigi> & result);
00079 
00080   // saturation of the 12-bit ADC.  Max reading is 4095
00081   void doSaturation(CSCStripDigi & digi);
00082 
00083   // useful constants
00084   float theComparatorThreshold;      // in fC
00085   float theComparatorNoise;
00086   float theComparatorRMSOffset;
00087   // note that we don't implement the effect of the x3.5 amplifier
00088   float theComparatorSaturation;
00089   // all of these times are in nanoseconds
00090   float theComparatorWait;
00091   float theComparatorDeadTime;
00092   float theDaqDeadTime;
00093   // save the calculation of time-of-flight+drift+shaping
00094   float theTimingOffset;
00095 
00096   int nScaBins_;
00097   bool doSuppression_;
00098   bool doCrosstalk_;
00099   CSCStripConditions * theStripConditions;
00100   CSCCrosstalkGenerator * theCrosstalkGenerator;
00101 
00102   int theComparatorClockJump;
00103   // the length of each SCA time bin, in ns.  50 by default
00104   float sca_time_bin_size;
00105   // the SCA bin which holds the peak signal.  4, by default.
00106   // that's really the 5th, since We start counting at 0
00107   int   sca_peak_bin;
00108   // which time bin the trigger crossing goes in
00109   double theComparatorTimeBinOffset;
00110   // to center comparator signals
00111   double theComparatorTimeOffset;
00112 
00113 };
00114 
00115 #endif
00116 

Generated on Tue Jun 9 17:47:31 2009 for CMSSW by  doxygen 1.5.4