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 
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 }
CSCStripConditions::analogNoise
float analogNoise(const CSCDetId &detId, int channel) const
calculated from pedestalSigma & gain
Definition: CSCStripConditions.cc:35
CSCStripConditions::CSCStripConditions
CSCStripConditions()
Definition: CSCStripConditions.cc:12
CSCStripConditions::noisify
void noisify(const CSCDetId &detId, CSCAnalogSignal &signal, CLHEP::HepRandomEngine *)
superimposes noise, in fC, on the signal
Definition: CSCStripConditions.cc:20
CSCAnalogSignal::superimpose
void superimpose(const CSCAnalogSignal &signal2)
Definition: CSCAnalogSignal.h:75
CorrelatedNoisifier::noisify
void noisify(T &frame, CLHEP::HepRandomEngine *, const VecDou *rangau=nullptr) const
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
CSCStripConditions::fetchNoisifier
virtual void fetchNoisifier(const CSCDetId &detId, int istrip)=0
CSCStripConditions::theNoisifier
CSCCorrelatedNoisifier * theNoisifier
Definition: CSCStripConditions.h:52
CSCAnalogSignal::getTimeOffset
float getTimeOffset() const
Definition: CSCAnalogSignal.h:72
CSCDetId
Definition: CSCDetId.h:26
CSCStripConditions::pedestalSigma
virtual float pedestalSigma(const CSCDetId &detId, int channel) const =0
CSCStripConditions.h
CSCStripConditions::gainSigma
virtual float gainSigma(const CSCDetId &detId, int channel) const =0
CSCStripConditions::smearedGain
virtual float smearedGain(const CSCDetId &detId, int channel, CLHEP::HepRandomEngine *) const
Definition: CSCStripConditions.cc:16
CSCAnalogSignal::getElement
int getElement() const
constructor from time and amp shape
Definition: CSCAnalogSignal.h:46
CorrelatedNoisifier
adds noise to the given frame.
Definition: EcalCoder.h:12
CSCAnalogSignal
Definition: CSCAnalogSignal.h:32
CSCStripConditions::gain
virtual float gain(const CSCDetId &detId, int channel) const =0
muonCSCDigis_cfi.nScaBins
nScaBins
Definition: muonCSCDigis_cfi.py:10
CSCStripConditions::~CSCStripConditions
virtual ~CSCStripConditions()
Definition: CSCStripConditions.cc:14