CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCStripConditions.cc
Go to the documentation of this file.
2 
3 #include "SimGeneral/NoiseGenerators/interface/CorrelatedNoisifier.icc"
4 
6 
7 template
8 void
10  >::noisify(CSCAnalogSignal&,
11  const std::vector<double>* rangau) const ;
12 
13 
15  : theNoisifier(0),
16  theRandGaussQ(0)
17  {}
18 
19 
21 {
22  delete theRandGaussQ;
23 }
24 
25 
26 void CSCStripConditions::setRandomEngine(CLHEP::HepRandomEngine& engine)
27 {
28  if(theRandGaussQ) delete theRandGaussQ;
29  theRandGaussQ = new CLHEP::RandGaussQ(engine);
30 }
31 
32 
33 float CSCStripConditions::smearedGain(const CSCDetId & detId, int channel) const
34 {
35  return theRandGaussQ->fire( gain(detId, channel), gainSigma(detId, channel) );
36 }
37 
38 
40 {
41  const int nScaBins = 8;
42  const float scaBinSize = 50.;
43  int channel = signal.getElement();
44  std::vector<float> binValues(nScaBins, 0.);
45  // use a temporary signal, in case we have to rebin
46  CSCAnalogSignal tmpSignal(channel, scaBinSize, binValues,
47  0., signal.getTimeOffset());
48 
49  fetchNoisifier(detId, channel );
50  theNoisifier->noisify(tmpSignal);
51  // noise matrix is in ADC counts. onvert to fC
52  tmpSignal *= 1./gain(detId, channel);
53  signal.superimpose(tmpSignal);
54 }
55 
56 
57 float CSCStripConditions::analogNoise(const CSCDetId & detId, int channel) const
58 {
59  return sqrt(2) * pedestalSigma(detId, channel) / gain(detId, channel);
60 }
61 
62 
adds noise to the given frame.
Definition: EcalCoder.h:11
virtual float pedestalSigma(const CSCDetId &detId, int channel) const =0
float analogNoise(const CSCDetId &detId, int channel) const
calculated from pedestalSigma &amp; gain
void setRandomEngine(CLHEP::HepRandomEngine &engine)
virtual void fetchNoisifier(const CSCDetId &detId, int istrip)=0
void noisify(const CSCDetId &detId, CSCAnalogSignal &signal)
superimposes noise, in fC, on the signal
int getElement() const
constructor from time and amp shape
math::ErrorD< 8 >::type CSCCorrelatedNoiseMatrix
T sqrt(T t)
Definition: SSEVec.h:46
float getTimeOffset() const
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
virtual float smearedGain(const CSCDetId &detId, int channel) const
CLHEP::RandGaussQ * theRandGaussQ
CSCCorrelatedNoisifier * theNoisifier
void noisify(T &frame, const VecDou *rangau=0) const