CMS 3D CMS Logo

CSCStripElectronicsSim.h
Go to the documentation of this file.
1 #ifndef MU_END_STRIP_ELECTRONICS_SIM_H
2 #define MU_END_STRIP_ELECTRONICS_SIM_H
3 
15 
16 class CSCDetectorHit;
17 class CSCComparatorDigi;
19 class CSCStripConditions;
20 #include <vector>
21 #include <string>
22 
23 namespace CLHEP {
24  class HepRandomEngine;
25 }
26 
28 {
29 public:
31  explicit CSCStripElectronicsSim(const edm::ParameterSet & p);
32 
33  virtual ~CSCStripElectronicsSim();
34 
35  void fillDigis(CSCStripDigiCollection & digis,
36  CSCComparatorDigiCollection & comparators,
37  CLHEP::HepRandomEngine*);
38 
39  void fillMissingLayer(const CSCLayer * layer, const CSCComparatorDigiCollection & comparators,
40  CSCStripDigiCollection & digis, CLHEP::HepRandomEngine*);
41 
42  void setStripConditions(CSCStripConditions * cond) {theStripConditions = cond;}
43 
44  CSCAnalogSignal makeNoiseSignal(int element, CLHEP::HepRandomEngine*) override;
45 
46  void createDigi(int istrip, const CSCAnalogSignal & signal, std::vector<CSCStripDigi> & result, CLHEP::HepRandomEngine*);
47 
48 private:
50  void initParameters() override;
51 
52  virtual int readoutElement(int strip) const override;
53 
54  float calculateAmpResponse(float t) const override;
56 
57  void runComparator(std::vector<CSCComparatorDigi> & result, CLHEP::HepRandomEngine*);
58 
60  float comparatorReading(const CSCAnalogSignal & signal, float time, CLHEP::HepRandomEngine*) const;
61 
62  // tells which strips to read out around the input strip
63  void getReadoutRange(int inputStrip,
64  int & minStrip, int & maxStrip);
65 
67  std::list<int>
68  getKeyStrips(const std::vector<CSCComparatorDigi> & comparators) const;
69 
71  std::list<int>
72  getKeyStripsFromMC() const;
75  std::list<int>
76  channelsToRead(const std::list<int> & keyStrips, int window) const;
77 
78  void fillStripDigis(const std::list<int> & keyStrips,
79  CSCStripDigiCollection & digis,
80  CLHEP::HepRandomEngine*);
81 
82  void addCrosstalk(CLHEP::HepRandomEngine*);
83  void addCrosstalk(const CSCAnalogSignal & signal,
84  int thisStrip, int otherStrip, CLHEP::HepRandomEngine*);
85 
86 
87  void selfTest() const;
88 
89  // saturation of the 12-bit ADC. Max reading is 4095
90  void doSaturation(CSCStripDigi & digi);
91 
92  // useful constants
93  float theComparatorThreshold; // in fC
96  // note that we don't implement the effect of the x3.5 amplifier
98  // all of these times are in nanoseconds
102  // save the calculation of time-of-flight+drift+shaping
104 
110 
112  // the length of each SCA time bin, in ns. 50 by default
114  // the SCA bin which holds the peak signal. 4, by default.
115  // that's really the 5th, since We start counting at 0
117  // which time bin the trigger crossing goes in
119  // to center comparator signals
122  // tweaks the timing of the SCA
123  std::vector<double> theSCATimingOffsets;
124  // remeber toe TOF correction in comparators,
125  // so we can undo it for SCA
127 };
128 
129 #endif
130 
void setStripConditions(CSCStripConditions *cond)
CSCStripConditions * theStripConditions
std::vector< double > theSCATimingOffsets
def window(xmin, xmax, ymin, ymax, x=0, y=0, width=100, height=100, xlogbase=None, ylogbase=None, minusInfinity=-1000, flipx=False, flipy=True)
Definition: svgfig.py:642
CSCCrosstalkGenerator * theCrosstalkGenerator
Definition: plugin.cc:24
CSCStripAmpResponse theAmpResponse