CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
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();
51 
52  virtual int readoutElement(int strip) const;
53 
54  float calculateAmpResponse(float t) const;
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 
def window
Definition: svgfig.py:642
std::list< int > getKeyStripsFromMC() const
get ths strips that have detector hits
void addCrosstalk(CLHEP::HepRandomEngine *)
float calculateAmpResponse(float t) const
void runComparator(std::vector< CSCComparatorDigi > &result, CLHEP::HepRandomEngine *)
void getReadoutRange(int inputStrip, int &minStrip, int &maxStrip)
void setStripConditions(CSCStripConditions *cond)
CSCStripConditions * theStripConditions
tuple result
Definition: mps_fire.py:83
float comparatorReading(const CSCAnalogSignal &signal, float time, CLHEP::HepRandomEngine *) const
calculates the comparator reading, including saturation and offsets
std::vector< double > theSCATimingOffsets
std::list< int > channelsToRead(const std::list< int > &keyStrips, int window) const
CSCAnalogSignal makeNoiseSignal(int element, CLHEP::HepRandomEngine *) override
void fillMissingLayer(const CSCLayer *layer, const CSCComparatorDigiCollection &comparators, CSCStripDigiCollection &digis, CLHEP::HepRandomEngine *)
CSCCrosstalkGenerator * theCrosstalkGenerator
void initParameters()
initialization for each layer
void doSaturation(CSCStripDigi &digi)
CSCStripElectronicsSim(const edm::ParameterSet &p)
configurable parameters
std::list< int > getKeyStrips(const std::vector< CSCComparatorDigi > &comparators) const
finds the key strips from these comparators
virtual int readoutElement(int strip) const
void fillDigis(CSCStripDigiCollection &digis, CSCComparatorDigiCollection &comparators, CLHEP::HepRandomEngine *)
CSCStripAmpResponse theAmpResponse
void createDigi(int istrip, const CSCAnalogSignal &signal, std::vector< CSCStripDigi > &result, CLHEP::HepRandomEngine *)
void fillStripDigis(const std::list< int > &keyStrips, CSCStripDigiCollection &digis, CLHEP::HepRandomEngine *)