Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:30:12

0001 #include "SimMuon/CSCDigitizer/src/CSCStripConditions.h"
0002 
0003 #include "SimGeneral/NoiseGenerators/interface/CorrelatedNoisifier.icc"
0004 
0005 #include "CLHEP/Random/RandGaussQ.h"
0006 
0007 template class CorrelatedNoisifier<CSCStripConditions::CSCCorrelatedNoiseMatrix>;
0008 
0009 template void CorrelatedNoisifier<CSCStripConditions::CSCCorrelatedNoiseMatrix>::noisify(
0010     CSCAnalogSignal &, CLHEP::HepRandomEngine *, const std::vector<double> *rangau) const;
0011 
0012 CSCStripConditions::CSCStripConditions() : theNoisifier(nullptr) {}
0013 
0014 CSCStripConditions::~CSCStripConditions() {}
0015 
0016 float CSCStripConditions::smearedGain(const CSCDetId &detId, int channel, CLHEP::HepRandomEngine *engine) const {
0017   return CLHEP::RandGaussQ::shoot(engine, gain(detId, channel), gainSigma(detId, channel));
0018 }
0019 
0020 void CSCStripConditions::noisify(const CSCDetId &detId, CSCAnalogSignal &signal, CLHEP::HepRandomEngine *engine) {
0021   const int nScaBins = 8;
0022   const float scaBinSize = 50.;
0023   int channel = signal.getElement();
0024   std::vector<float> binValues(nScaBins, 0.);
0025   // use a temporary signal, in case we have to rebin
0026   CSCAnalogSignal tmpSignal(channel, scaBinSize, binValues, 0., signal.getTimeOffset());
0027 
0028   fetchNoisifier(detId, channel);
0029   theNoisifier->noisify(tmpSignal, engine);
0030   // noise matrix is in ADC counts. onvert to fC
0031   tmpSignal *= 1. / gain(detId, channel);
0032   signal.superimpose(tmpSignal);
0033 }
0034 
0035 float CSCStripConditions::analogNoise(const CSCDetId &detId, int channel) const {
0036   return sqrt(2) * pedestalSigma(detId, channel) / gain(detId, channel);
0037 }