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 #include <list>
23 
24 namespace CLHEP {
25  class HepRandomEngine;
26 }
27 
29 {
30 public:
32  explicit CSCStripElectronicsSim(const edm::ParameterSet & p);
33 
34  ~CSCStripElectronicsSim() override;
35 
36  void fillDigis(CSCStripDigiCollection & digis,
37  CSCComparatorDigiCollection & comparators,
38  CLHEP::HepRandomEngine*);
39 
40  void fillMissingLayer(const CSCLayer * layer, const CSCComparatorDigiCollection & comparators,
41  CSCStripDigiCollection & digis, CLHEP::HepRandomEngine*);
42 
43  void setStripConditions(CSCStripConditions * cond) {theStripConditions = cond;}
44 
45  CSCAnalogSignal makeNoiseSignal(int element, CLHEP::HepRandomEngine*) override;
46 
47  void createDigi(int istrip, const CSCAnalogSignal & signal, std::vector<CSCStripDigi> & result, CLHEP::HepRandomEngine*);
48 
49 private:
51  void initParameters() override;
52 
53  int readoutElement(int strip) const override;
54 
55  float calculateAmpResponse(float t) const override;
57 
58  void runComparator(std::vector<CSCComparatorDigi> & result, CLHEP::HepRandomEngine*);
59 
61  float comparatorReading(const CSCAnalogSignal & signal, float time, CLHEP::HepRandomEngine*) const;
62 
63  // tells which strips to read out around the input strip
64  void getReadoutRange(int inputStrip,
65  int & minStrip, int & maxStrip);
66 
68  std::list<int>
69  getKeyStrips(const std::vector<CSCComparatorDigi> & comparators) const;
70 
72  std::list<int>
73  getKeyStripsFromMC() const;
76  std::list<int>
77  channelsToRead(const std::list<int> & keyStrips, int window) const;
78 
79  void fillStripDigis(const std::list<int> & keyStrips,
80  CSCStripDigiCollection & digis,
81  CLHEP::HepRandomEngine*);
82 
83  void addCrosstalk(CLHEP::HepRandomEngine*);
84  void addCrosstalk(const CSCAnalogSignal & signal,
85  int thisStrip, int otherStrip, CLHEP::HepRandomEngine*);
86 
87 
88  void selfTest() const;
89 
90  // saturation of the 12-bit ADC. Max reading is 4095
91  void doSaturation(CSCStripDigi & digi);
92 
93  // useful constants
94  float theComparatorThreshold; // in fC
97  // note that we don't implement the effect of the x3.5 amplifier
99  // all of these times are in nanoseconds
103  // save the calculation of time-of-flight+drift+shaping
105 
111 
113  // the length of each SCA time bin, in ns. 50 by default
115  // the SCA bin which holds the peak signal. 4, by default.
116  // that's really the 5th, since We start counting at 0
118  // which time bin the trigger crossing goes in
120  // to center comparator signals
123  // tweaks the timing of the SCA
124  std::vector<double> theSCATimingOffsets;
125  // remeber toe TOF correction in comparators,
126  // so we can undo it for SCA
128 };
129 
130 #endif
131 
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