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
CSCStripElectronicsSim::theAmpResponse
CSCStripAmpResponse theAmpResponse
Definition: CSCStripElectronicsSim.h:58
CSCStripAmpResponse
Definition: CSCStripAmpResponse.h:4
CSCStripElectronicsSim::getReadoutRange
void getReadoutRange(int inputStrip, int &minStrip, int &maxStrip)
CSCStripElectronicsSim::theComparatorSamplingTime
double theComparatorSamplingTime
Definition: CSCStripElectronicsSim.h:116
CSCStripElectronicsSim::sca_time_bin_size
float sca_time_bin_size
Definition: CSCStripElectronicsSim.h:108
CSCStripElectronicsSim::getKeyStripsFromMC
std::list< int > getKeyStripsFromMC() const
get ths strips that have detector hits
Definition: CSCStripElectronicsSim.cc:221
CSCStripElectronicsSim::theComparatorThreshold
float theComparatorThreshold
Definition: CSCStripElectronicsSim.h:88
CSCStripElectronicsSim::calculateAmpResponse
float calculateAmpResponse(float t) const override
Definition: CSCStripElectronicsSim.cc:77
CSCStripAmpResponse.h
CSCStripElectronicsSim::setStripConditions
void setStripConditions(CSCStripConditions *cond)
Definition: CSCStripElectronicsSim.h:42
CSCStripElectronicsSim::getKeyStrips
std::list< int > getKeyStrips(const std::vector< CSCComparatorDigi > &comparators) const
finds the key strips from these comparators
Definition: CSCStripElectronicsSim.cc:207
CSCStripElectronicsSim::theComparatorDeadTime
float theComparatorDeadTime
Definition: CSCStripElectronicsSim.h:95
CSCStripElectronicsSim::fillStripDigis
void fillStripDigis(const std::list< int > &keyStrips, CSCStripDigiCollection &digis, CLHEP::HepRandomEngine *)
Definition: CSCStripElectronicsSim.cc:306
CSCStripElectronicsSim
Definition: CSCStripElectronicsSim.h:28
CSCStripElectronicsSim::initParameters
void initParameters() override
initialization for each layer
Definition: CSCStripElectronicsSim.cc:59
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CSCStripDigiCollection
CSCStripElectronicsSim::comparatorReading
float comparatorReading(const CSCAnalogSignal &signal, float time, CLHEP::HepRandomEngine *) const
calculates the comparator reading, including saturation and offsets
Definition: CSCStripElectronicsSim.cc:94
svgfig.window
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
CSCCrosstalkGenerator
Definition: CSCCrosstalkGenerator.h:19
protons_cff.time
time
Definition: protons_cff.py:39
CSCLayer
Definition: CSCLayer.h:24
CSCStripElectronicsSim::nScaBins_
int nScaBins_
Definition: CSCStripElectronicsSim.h:100
CSCStripElectronicsSim::makeNoiseSignal
CSCAnalogSignal makeNoiseSignal(int element, CLHEP::HepRandomEngine *) override
Definition: CSCStripElectronicsSim.cc:79
CSCStripElectronicsSim::theComparatorNoise
float theComparatorNoise
Definition: CSCStripElectronicsSim.h:89
CSCStripElectronicsSim::theComparatorTimeOffset
double theComparatorTimeOffset
Definition: CSCStripElectronicsSim.h:115
CSCStripElectronicsSim::theComparatorRMSOffset
float theComparatorRMSOffset
Definition: CSCStripElectronicsSim.h:90
CSCStripElectronicsSim::theCrosstalkGenerator
CSCCrosstalkGenerator * theCrosstalkGenerator
Definition: CSCStripElectronicsSim.h:104
CSCStripElectronicsSim::theSCATimingOffsets
std::vector< double > theSCATimingOffsets
Definition: CSCStripElectronicsSim.h:118
CSCStripElectronicsSim::doCrosstalk_
bool doCrosstalk_
Definition: CSCStripElectronicsSim.h:102
CSCDetectorHit
Definition: CSCDetectorHit.h:16
CSCStripElectronicsSim::addCrosstalk
void addCrosstalk(CLHEP::HepRandomEngine *)
Definition: CSCStripElectronicsSim.cc:320
CSCStripElectronicsSim::theComparatorClockJump
int theComparatorClockJump
Definition: CSCStripElectronicsSim.h:106
CSCBaseElectronicsSim.h
CSCStripElectronicsSim::theDaqDeadTime
float theDaqDeadTime
Definition: CSCStripElectronicsSim.h:96
CSCStripElectronicsSim::readoutElement
int readoutElement(int strip) const override
Definition: CSCStripElectronicsSim.cc:75
CSCStripElectronicsSim::CSCStripElectronicsSim
CSCStripElectronicsSim(const edm::ParameterSet &p)
configurable parameters
Definition: CSCStripElectronicsSim.cc:23
CSCComparatorDigi
Definition: CSCComparatorDigi.h:16
CSCStripConditions
Definition: CSCStripConditions.h:13
CSCStripElectronicsSim::fillDigis
void fillDigis(CSCStripDigiCollection &digis, CSCComparatorDigiCollection &comparators, CLHEP::HepRandomEngine *)
Definition: CSCStripElectronicsSim.cc:286
CSCStripElectronicsSim::doSuppression_
bool doSuppression_
Definition: CSCStripElectronicsSim.h:101
phase1PixelTopology::layer
constexpr std::array< uint8_t, layerIndexSize > layer
Definition: phase1PixelTopology.h:99
CLHEP
Definition: CocoaGlobals.h:27
cond
Definition: plugin.cc:23
edm::ParameterSet
Definition: ParameterSet.h:47
CSCStripElectronicsSim::theStripConditions
CSCStripConditions * theStripConditions
Definition: CSCStripElectronicsSim.h:103
CSCStripElectronicsSim::theTimingOffset
float theTimingOffset
Definition: CSCStripElectronicsSim.h:98
CSCStripElectronicsSim::sca_peak_bin
int sca_peak_bin
Definition: CSCStripElectronicsSim.h:111
CSCBaseElectronicsSim
Definition: CSCBaseElectronicsSim.h:37
CSCStripDigiCollection.h
CSCComparatorDigiCollection
CSCStripElectronicsSim::theComparatorWait
float theComparatorWait
Definition: CSCStripElectronicsSim.h:94
cscdigivalidator_cfi.inputStrip
inputStrip
Definition: cscdigivalidator_cfi.py:4
CSCStripElectronicsSim::selfTest
void selfTest() const
Definition: CSCStripElectronicsSim.cc:422
CSCStripElectronicsSim::createDigi
void createDigi(int istrip, const CSCAnalogSignal &signal, std::vector< CSCStripDigi > &result, CLHEP::HepRandomEngine *)
Definition: CSCStripElectronicsSim.cc:362
CSCStripElectronicsSim::theAverageTimeOfFlight
float theAverageTimeOfFlight
Definition: CSCStripElectronicsSim.h:121
CSCStripDigi
Definition: CSCStripDigi.h:17
CSCStripElectronicsSim::channelsToRead
std::list< int > channelsToRead(const std::list< int > &keyStrips, int window) const
Definition: CSCStripElectronicsSim.cc:238
CSCStripElectronicsSim::theComparatorTimeBinOffset
double theComparatorTimeBinOffset
Definition: CSCStripElectronicsSim.h:113
CSCAnalogSignal
Definition: CSCAnalogSignal.h:32
CSCStripElectronicsSim::fillMissingLayer
void fillMissingLayer(const CSCLayer *layer, const CSCComparatorDigiCollection &comparators, CSCStripDigiCollection &digis, CLHEP::HepRandomEngine *)
Definition: CSCStripElectronicsSim.cc:398
CSCComparatorDigiCollection.h
CSCStripElectronicsSim::doSaturation
void doSaturation(CSCStripDigi &digi)
Definition: CSCStripElectronicsSim.cc:390
mps_fire.result
result
Definition: mps_fire.py:311
CSCStripElectronicsSim::theComparatorSaturation
float theComparatorSaturation
Definition: CSCStripElectronicsSim.h:92
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
CSCStripElectronicsSim::~CSCStripElectronicsSim
~CSCStripElectronicsSim() override
Definition: CSCStripElectronicsSim.cc:53
CSCStripElectronicsSim::runComparator
void runComparator(std::vector< CSCComparatorDigi > &result, CLHEP::HepRandomEngine *)
Definition: CSCStripElectronicsSim.cc:101