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 <list>
21 #include <string>
22 #include <vector>
23 
24 namespace CLHEP {
25  class HepRandomEngine;
26 }
27 
29 public:
32 
33  ~CSCStripElectronicsSim() override;
34 
35  void fillDigis(CSCStripDigiCollection &digis, CSCComparatorDigiCollection &comparators, CLHEP::HepRandomEngine *);
36 
37  void fillMissingLayer(const CSCLayer *layer,
38  const CSCComparatorDigiCollection &comparators,
40  CLHEP::HepRandomEngine *);
41 
43 
44  CSCAnalogSignal makeNoiseSignal(int element, CLHEP::HepRandomEngine *) override;
45 
46  void createDigi(int istrip,
47  const CSCAnalogSignal &signal,
48  std::vector<CSCStripDigi> &result,
49  CLHEP::HepRandomEngine *);
50 
51 private:
53  void initParameters() override;
54 
55  int readoutElement(int strip) const override;
56 
57  float calculateAmpResponse(float t) const override;
59 
60  void runComparator(std::vector<CSCComparatorDigi> &result, CLHEP::HepRandomEngine *);
61 
63  float comparatorReading(const CSCAnalogSignal &signal, float time, CLHEP::HepRandomEngine *) const;
64 
65  // tells which strips to read out around the input strip
66  void getReadoutRange(int inputStrip, int &minStrip, int &maxStrip);
67 
69  std::list<int> getKeyStrips(const std::vector<CSCComparatorDigi> &comparators) const;
70 
72  std::list<int> getKeyStripsFromMC() const;
75  std::list<int> channelsToRead(const std::list<int> &keyStrips, int window) const;
76 
77  void fillStripDigis(const std::list<int> &keyStrips, CSCStripDigiCollection &digis, CLHEP::HepRandomEngine *);
78 
79  void addCrosstalk(CLHEP::HepRandomEngine *);
80  void addCrosstalk(const CSCAnalogSignal &signal, int thisStrip, int otherStrip, CLHEP::HepRandomEngine *);
81 
82  void selfTest() const;
83 
84  // saturation of the 12-bit ADC. Max reading is 4095
85  void doSaturation(CSCStripDigi &digi);
86 
87  // useful constants
88  float theComparatorThreshold; // in fC
91  // note that we don't implement the effect of the x3.5 amplifier
93  // all of these times are in nanoseconds
97  // save the calculation of time-of-flight+drift+shaping
99 
105 
107  // the length of each SCA time bin, in ns. 50 by default
109  // the SCA bin which holds the peak signal. 4, by default.
110  // that's really the 5th, since We start counting at 0
112  // which time bin the trigger crossing goes in
114  // to center comparator signals
117  // tweaks the timing of the SCA
118  std::vector<double> theSCATimingOffsets;
119  // remeber toe TOF correction in comparators,
120  // so we can undo it for SCA
122 };
123 
124 #endif
void initParameters() override
initialization for each layer
void addCrosstalk(CLHEP::HepRandomEngine *)
float comparatorReading(const CSCAnalogSignal &signal, float time, CLHEP::HepRandomEngine *) const
calculates the comparator reading, including saturation and offsets
void runComparator(std::vector< CSCComparatorDigi > &result, CLHEP::HepRandomEngine *)
void getReadoutRange(int inputStrip, int &minStrip, int &maxStrip)
void setStripConditions(CSCStripConditions *cond)
int readoutElement(int strip) const override
CSCStripConditions * theStripConditions
std::list< int > getKeyStripsFromMC() const
get ths strips that have detector hits
std::vector< double > theSCATimingOffsets
CSCAnalogSignal makeNoiseSignal(int element, CLHEP::HepRandomEngine *) override
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:643
void fillMissingLayer(const CSCLayer *layer, const CSCComparatorDigiCollection &comparators, CSCStripDigiCollection &digis, CLHEP::HepRandomEngine *)
CSCCrosstalkGenerator * theCrosstalkGenerator
void doSaturation(CSCStripDigi &digi)
std::list< int > channelsToRead(const std::list< int > &keyStrips, int window) const
CSCStripElectronicsSim(const edm::ParameterSet &p)
configurable parameters
Definition: plugin.cc:23
void fillDigis(CSCStripDigiCollection &digis, CSCComparatorDigiCollection &comparators, CLHEP::HepRandomEngine *)
float calculateAmpResponse(float t) const override
CSCStripAmpResponse theAmpResponse
std::list< int > getKeyStrips(const std::vector< CSCComparatorDigi > &comparators) const
finds the key strips from these comparators
void createDigi(int istrip, const CSCAnalogSignal &signal, std::vector< CSCStripDigi > &result, CLHEP::HepRandomEngine *)
void fillStripDigis(const std::list< int > &keyStrips, CSCStripDigiCollection &digis, CLHEP::HepRandomEngine *)