CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CSCStripConditions.cc
Go to the documentation of this file.
2 
3 #include "SimGeneral/NoiseGenerators/interface/CorrelatedNoisifier.icc"
4 
5 #include "CLHEP/Random/RandGaussQ.h"
6 
8 
10  CSCAnalogSignal &, CLHEP::HepRandomEngine *, const std::vector<double> *rangau) const;
11 
12 CSCStripConditions::CSCStripConditions() : theNoisifier(nullptr) {}
13 
15 
16 float CSCStripConditions::smearedGain(const CSCDetId &detId, int channel, CLHEP::HepRandomEngine *engine) const {
17  return CLHEP::RandGaussQ::shoot(engine, gain(detId, channel), gainSigma(detId, channel));
18 }
19 
20 void CSCStripConditions::noisify(const CSCDetId &detId, CSCAnalogSignal &signal, CLHEP::HepRandomEngine *engine) {
21  const int nScaBins = 8;
22  const float scaBinSize = 50.;
23  int channel = signal.getElement();
24  std::vector<float> binValues(nScaBins, 0.);
25  // use a temporary signal, in case we have to rebin
26  CSCAnalogSignal tmpSignal(channel, scaBinSize, binValues, 0., signal.getTimeOffset());
27 
28  fetchNoisifier(detId, channel);
29  theNoisifier->noisify(tmpSignal, engine);
30  // noise matrix is in ADC counts. onvert to fC
31  tmpSignal *= 1. / gain(detId, channel);
32  signal.superimpose(tmpSignal);
33 }
34 
35 float CSCStripConditions::analogNoise(const CSCDetId &detId, int channel) const {
36  return sqrt(2) * pedestalSigma(detId, channel) / gain(detId, channel);
37 }
adds noise to the given frame.
Definition: EcalCoder.h:12
virtual float pedestalSigma(const CSCDetId &detId, int channel) const =0
float analogNoise(const CSCDetId &detId, int channel) const
calculated from pedestalSigma &amp; gain
virtual void fetchNoisifier(const CSCDetId &detId, int istrip)=0
void noisify(T &frame, CLHEP::HepRandomEngine *, const VecDou *rangau=nullptr) const
int getElement() const
constructor from time and amp shape
T sqrt(T t)
Definition: SSEVec.h:19
float getTimeOffset() const
void noisify(const CSCDetId &detId, CSCAnalogSignal &signal, CLHEP::HepRandomEngine *)
superimposes noise, in fC, on the signal
void superimpose(const CSCAnalogSignal &signal2)
virtual float gain(const CSCDetId &detId, int channel) const =0
virtual float gainSigma(const CSCDetId &detId, int channel) const =0
CSCCorrelatedNoisifier * theNoisifier
virtual float smearedGain(const CSCDetId &detId, int channel, CLHEP::HepRandomEngine *) const