CMS 3D CMS Logo

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 
9 template
10 void
12  >::noisify(CSCAnalogSignal&,
13  CLHEP::HepRandomEngine*,
14  const std::vector<double>* rangau) const ;
15 
16 
18  : theNoisifier(0)
19  {}
20 
21 
23 {
24 }
25 
26 
27 float CSCStripConditions::smearedGain(const CSCDetId & detId, int channel, CLHEP::HepRandomEngine* engine) const
28 {
29  return CLHEP::RandGaussQ::shoot(engine, gain(detId, channel), gainSigma(detId, channel) );
30 }
31 
32 
33 void CSCStripConditions::noisify(const CSCDetId & detId, CSCAnalogSignal & signal, CLHEP::HepRandomEngine* engine)
34 {
35  const int nScaBins = 8;
36  const float scaBinSize = 50.;
37  int channel = signal.getElement();
38  std::vector<float> binValues(nScaBins, 0.);
39  // use a temporary signal, in case we have to rebin
40  CSCAnalogSignal tmpSignal(channel, scaBinSize, binValues,
41  0., signal.getTimeOffset());
42 
43  fetchNoisifier(detId, channel );
44  theNoisifier->noisify(tmpSignal, engine);
45  // noise matrix is in ADC counts. onvert to fC
46  tmpSignal *= 1./gain(detId, channel);
47  signal.superimpose(tmpSignal);
48 }
49 
50 
51 float CSCStripConditions::analogNoise(const CSCDetId & detId, int channel) const
52 {
53  return sqrt(2) * pedestalSigma(detId, channel) / gain(detId, channel);
54 }
55 
56 
adds noise to the given frame.
Definition: EcalCoder.h:11
float analogNoise(const CSCDetId &detId, int channel) const
calculated from pedestalSigma & gain
virtual void fetchNoisifier(const CSCDetId &detId, int istrip)=0
virtual float gainSigma(const CSCDetId &detId, int channel) const =0
void noisify(T &frame, CLHEP::HepRandomEngine *, const VecDou *rangau=0) const
int getElement() const
constructor from time and amp shape
math::ErrorD< 8 >::type CSCCorrelatedNoiseMatrix
virtual float gain(const CSCDetId &detId, int channel) const =0
T sqrt(T t)
Definition: SSEVec.h:18
virtual float pedestalSigma(const CSCDetId &detId, int channel) const =0
float getTimeOffset() const
void noisify(const CSCDetId &detId, CSCAnalogSignal &signal, CLHEP::HepRandomEngine *)
superimposes noise, in fC, on the signal
void superimpose(const CSCAnalogSignal &signal2)
CSCCorrelatedNoisifier * theNoisifier
virtual float smearedGain(const CSCDetId &detId, int channel, CLHEP::HepRandomEngine *) const