CMS 3D CMS Logo

CSCBaseElectronicsSim.h
Go to the documentation of this file.
1 #ifndef MU_END_BASE_ELECTRONICS_SIM_H
2 #define MU_END_BASE_ELECTRONICS_SIM_H
3 
18 #include <map>
19 #include <vector>
20 
23 
24 // declarations
25 class CSCLayer;
26 class CSCChamberSpecs;
27 class CSCDetectorHit;
28 class CSCLayerGeometry;
30 class DetId;
31 class PSimHit;
32 
33 namespace CLHEP {
34  class HepRandomEngine;
35 }
36 
38 public:
39  typedef std::map<int, CSCAnalogSignal, std::less<int>> CSCSignalMap;
41 
42  // takes the input detector hits, turns them into DIGIs, and
43  // stores them in the layer
44  void simulate(const CSCLayer *layer, const std::vector<CSCDetectorHit> &inputHits, CLHEP::HepRandomEngine *);
45 
46  const DigiSimLinks &digiSimLinks() const { return theDigiSimLinks; }
47 
48  virtual ~CSCBaseElectronicsSim();
49 
51  void setLayerId(const CSCDetId &id) { theLayerId = id; }
52 
53 protected:
54  // constructor protected, so this class must be a base class
56 
57  void setLayer(const CSCLayer *layer);
58  // initialize things that change from layer to layer
59  virtual void initParameters() = 0;
60 
61  void fillAmpResponse();
62  virtual float calculateAmpResponse(float t) const = 0;
63 
64  // this one turns CSCDetectorHits into CSCAnalogSignals
66 
67  // returns readout element. So wire 20 might be part of wire group 2.
68  virtual int readoutElement(int element) const = 0;
69 
70  // fills the member map of signals on strips, superimposing any duplicates
71  void combineAnalogSignals(const std::vector<CSCAnalogSignal> &);
72 
73  void setNoise(float rmsNoise, float noiseSigmaThreshold);
74 
77  void setSignalTimeRange(double startTime, double stopTime) {
78  theSignalStartTime = startTime;
79  theSignalStopTime = stopTime;
80  }
81 
82  void addNoise(CLHEP::HepRandomEngine *);
83 
84  CSCAnalogSignal &find(int element, CLHEP::HepRandomEngine *);
85  // the returned signal will be the one stored in the
86  // signal, not the original. If another signal
87  // is found on this element, they will be superimposed.
88  CSCAnalogSignal &add(const CSCAnalogSignal &, CLHEP::HepRandomEngine *);
89  virtual CSCAnalogSignal makeNoiseSignal(int element, CLHEP::HepRandomEngine *);
90 
94  virtual float signalDelay(int element, float pos) const;
95 
98  virtual void addLinks(int channelIndex);
99 
101  virtual int channelIndex(int channel) const { return channel; }
102 
104  CSCDetId layerId() const { return theLayerId; }
105 
108  double averageTimeOfFlight(const DetId &detId) const;
109 
110  // member data
112 
115  const CSCLayer *theLayer; // the one currently being digitized
117 
120 
121  // Useful parameters
123 
124  // lets routines know whether new signals should
125  // have noise added, or just be empty. If the
126  // noise hasn't been added yet, just make empty.
128 
129  // the numbers of wire groups or strips in this layer
131 
132  // amplifier parameters
135  // used to correct the bunch timing so that the signal event
136  // comes at BX zero.
137  std::vector<double> theBunchTimingOffsets;
138 
139  // when the signal is to be simulated
142 
143  // size of time bins for signal shape, in ns
145 
146  // time bins for pulse shape
148 
149  // Which bit in the 16-bit time word corresponds to the zeroth beam crossing?
150  int theOffsetOfBxZero; // bit corresponding to bx 0 (counting from 0-15)
153  std::vector<double> theSignalPropagationSpeed;
154  std::vector<double> theTimingCalibrationError;
155  bool doNoise_;
156 
157  // keeps track of which hits contribute to which channels
158  typedef std::multimap<int, CSCDetectorHit, std::less<int>> DetectorHitMap;
161 };
162 
163 #endif
CSCBaseElectronicsSim::theSpecs
const CSCChamberSpecs * theSpecs
Definition: CSCBaseElectronicsSim.h:113
CSCBaseElectronicsSim::CSCSignalMap
std::map< int, CSCAnalogSignal, std::less< int > > CSCSignalMap
Definition: CSCBaseElectronicsSim.h:39
CSCBaseElectronicsSim::setLayerId
void setLayerId(const CSCDetId &id)
for standalone apps who don't calculate it from the geometry
Definition: CSCBaseElectronicsSim.h:51
CSCBaseElectronicsSim::add
CSCAnalogSignal & add(const CSCAnalogSignal &, CLHEP::HepRandomEngine *)
Definition: CSCBaseElectronicsSim.cc:151
CSCBaseElectronicsSim::theAmpResponse
CSCAnalogSignal theAmpResponse
Definition: CSCBaseElectronicsSim.h:119
CSCBaseElectronicsSim::initParameters
virtual void initParameters()=0
edm::DetSet< StripDigiSimLink >
CSCBaseElectronicsSim::find
CSCAnalogSignal & find(int element, CLHEP::HepRandomEngine *)
Definition: CSCBaseElectronicsSim.cc:131
CSCBaseElectronicsSim::theNoiseWasAdded
bool theNoiseWasAdded
Definition: CSCBaseElectronicsSim.h:127
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
CSCBaseElectronicsSim::theSignalMap
CSCSignalMap theSignalMap
Definition: CSCBaseElectronicsSim.h:118
CSCChamberSpecs
Definition: CSCChamberSpecs.h:39
pos
Definition: PixelAliasList.h:18
CSCBaseElectronicsSim::theDigiSimLinks
DigiSimLinks theDigiSimLinks
Definition: CSCBaseElectronicsSim.h:160
CSCBaseElectronicsSim::theTimingCalibrationError
std::vector< double > theTimingCalibrationError
Definition: CSCBaseElectronicsSim.h:154
CSCBaseElectronicsSim::averageTimeOfFlight
double averageTimeOfFlight(const DetId &detId) const
CSCBaseElectronicsSim::CONSERVATIVE
Definition: CSCBaseElectronicsSim.h:111
CSCBaseElectronicsSim::CSCBaseElectronicsSim
CSCBaseElectronicsSim(const edm::ParameterSet &p)
Definition: CSCBaseElectronicsSim.cc:15
CSCLayer
Definition: CSCLayer.h:24
CSCBaseElectronicsSim::theSignalPropagationSpeed
std::vector< double > theSignalPropagationSpeed
Definition: CSCBaseElectronicsSim.h:153
CSCAnalogSignal.h
CSCBaseElectronicsSim::doNoise_
bool doNoise_
Definition: CSCBaseElectronicsSim.h:155
CSCDetId.h
CSCDetectorHit
Definition: CSCDetectorHit.h:16
CSCBaseElectronicsSim::setSignalTimeRange
void setSignalTimeRange(double startTime, double stopTime)
Definition: CSCBaseElectronicsSim.h:77
CSCBaseElectronicsSim::theSignalStopTime
float theSignalStopTime
Definition: CSCBaseElectronicsSim.h:141
DetId
Definition: DetId.h:17
CSCBaseElectronicsSim::theNumberOfSamples
int theNumberOfSamples
Definition: CSCBaseElectronicsSim.h:147
CSCBaseElectronicsSim::~CSCBaseElectronicsSim
virtual ~CSCBaseElectronicsSim()
Definition: CSCBaseElectronicsSim.cc:38
CSCBaseElectronicsSim::NONE
Definition: CSCBaseElectronicsSim.h:111
CSCBaseElectronicsSim::DigiSimLinks
edm::DetSet< StripDigiSimLink > DigiSimLinks
Definition: CSCBaseElectronicsSim.h:40
CSCBaseElectronicsSim::makeNoiseSignal
virtual CSCAnalogSignal makeNoiseSignal(int element, CLHEP::HepRandomEngine *)
Definition: CSCBaseElectronicsSim.cc:113
CSCBaseElectronicsSim::thePeakTimeSigma
float thePeakTimeSigma
Definition: CSCBaseElectronicsSim.h:134
CSCBaseElectronicsSim::addLinks
virtual void addLinks(int channelIndex)
Definition: CSCBaseElectronicsSim.cc:167
CSCBaseElectronicsSim::theOffsetOfBxZero
int theOffsetOfBxZero
Definition: CSCBaseElectronicsSim.h:150
CSCLayerGeometry
Definition: CSCLayerGeometry.h:25
CSCBaseElectronicsSim::digiSimLinks
const DigiSimLinks & digiSimLinks() const
Definition: CSCBaseElectronicsSim.h:46
CSCBaseElectronicsSim::signalDelay
virtual float signalDelay(int element, float pos) const
Definition: CSCBaseElectronicsSim.cc:158
CSCBaseElectronicsSim::theSignalStartTime
float theSignalStartTime
Definition: CSCBaseElectronicsSim.h:140
CSCBaseElectronicsSim::theBunchTimingOffsets
std::vector< double > theBunchTimingOffsets
Definition: CSCBaseElectronicsSim.h:137
CSCBaseElectronicsSim::readoutElement
virtual int readoutElement(int element) const =0
CSCBaseElectronicsSim::theLayerId
CSCDetId theLayerId
Definition: CSCBaseElectronicsSim.h:116
CLHEP
Definition: CocoaGlobals.h:27
CSCBaseElectronicsSim::theLayer
const CSCLayer * theLayer
Definition: CSCBaseElectronicsSim.h:115
CSCBaseElectronicsSim::nElements
int nElements
Definition: CSCBaseElectronicsSim.h:130
CSCBaseElectronicsSim::theLayerGeometry
const CSCLayerGeometry * theLayerGeometry
Definition: CSCBaseElectronicsSim.h:114
CSCBaseElectronicsSim::setLayer
void setLayer(const CSCLayer *layer)
Definition: CSCBaseElectronicsSim.cc:73
edm::ParameterSet
Definition: ParameterSet.h:47
CSCBaseElectronicsSim::setNoise
void setNoise(float rmsNoise, float noiseSigmaThreshold)
CSCDetId
Definition: CSCDetId.h:26
CSCBaseElectronicsSim::theSamplingTime
float theSamplingTime
Definition: CSCBaseElectronicsSim.h:144
CSCBaseElectronicsSim
Definition: CSCBaseElectronicsSim.h:37
CSCBaseElectronicsSim::theShapingTime
int theShapingTime
Definition: CSCBaseElectronicsSim.h:133
CSCBaseElectronicsSim::DetectorHitMap
std::multimap< int, CSCDetectorHit, std::less< int > > DetectorHitMap
Definition: CSCBaseElectronicsSim.h:158
CSCBaseElectronicsSim::RADICAL
Definition: CSCBaseElectronicsSim.h:111
CSCBaseElectronicsSim::calculateAmpResponse
virtual float calculateAmpResponse(float t) const =0
CSCBaseElectronicsSim::amplifySignal
CSCAnalogSignal amplifySignal(const CSCDetectorHit &)
Definition: CSCBaseElectronicsSim.cc:98
CSCBaseElectronicsSim::combineAnalogSignals
void combineAnalogSignals(const std::vector< CSCAnalogSignal > &)
CSCBaseElectronicsSim::theDetectorHitMap
DetectorHitMap theDetectorHitMap
Definition: CSCBaseElectronicsSim.h:159
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
CSCAnalogSignal
Definition: CSCAnalogSignal.h:32
CSCBaseElectronicsSim::addNoise
void addNoise(CLHEP::HepRandomEngine *)
Definition: CSCBaseElectronicsSim.cc:119
CSCBaseElectronicsSim::channelIndex
virtual int channelIndex(int channel) const
lets users map channels to different indices for links
Definition: CSCBaseElectronicsSim.h:101
CSCBaseElectronicsSim::layerId
CSCDetId layerId() const
the CSCDetId corresponding to the current layer
Definition: CSCBaseElectronicsSim.h:104
DetSet.h
ParameterSet.h
CSCBaseElectronicsSim::theBunchSpacing
float theBunchSpacing
Definition: CSCBaseElectronicsSim.h:122
PSimHit
Definition: PSimHit.h:15
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
CSCBaseElectronicsSim::fillAmpResponse
void fillAmpResponse()
Definition: CSCBaseElectronicsSim.cc:83
CSCBaseElectronicsSim::simulate
void simulate(const CSCLayer *layer, const std::vector< CSCDetectorHit > &inputHits, CLHEP::HepRandomEngine *)
Definition: CSCBaseElectronicsSim.cc:40