Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:30:39

0001 /** \class GaussianTailNoiseGenerator
0002  * Generation of random noise
0003  * on "numberOfChannels" channels with a given threshold.
0004  * The generated noise : <BR>
0005  * - corresponds to a Gaussian distribution of RMS = "noiseRMS" <BR>
0006  * - is larger than threshold*noiseRMS. <BR>
0007  *
0008  * Initial author : Veronique Lefebure 08.10.98 <BR>
0009  *                  according to the FORTRAN code tgreset.F from Pascal Vanlaer
0010  * <BR> Modified by C. Delaere 01.10.09 <BR>
0011  *
0012  * Fills in a map \< channel number, generated noise \>
0013  */
0014 #ifndef GaussianTailNoiseGenerator_h
0015 #define GaussianTailNoiseGenerator_h
0016 
0017 #include <map>
0018 #include <vector>
0019 
0020 namespace CLHEP {
0021   class HepRandomEngine;
0022 }
0023 
0024 class GaussianTailNoiseGenerator {
0025 public:
0026   GaussianTailNoiseGenerator();
0027 
0028   // Compiler-generated destructor, copy c'tor, and assignment are all
0029   // correct.
0030 
0031   void generate(
0032       int NumberOfchannels, float threshold, float noiseRMS, std::map<int, float> &theMap, CLHEP::HepRandomEngine *);
0033 
0034   void generate(int NumberOfchannels,
0035                 float threshold,
0036                 float noiseRMS,
0037                 std::vector<std::pair<int, float>> &,
0038                 CLHEP::HepRandomEngine *);
0039   /*
0040     void generateRaw(int NumberOfchannels,
0041                      float noiseRMS,
0042                      std::vector<std::pair<int,float> >&,
0043                      CLHEP::HepRandomEngine*);
0044   */
0045   void generateRaw(float noiseRMS, std::vector<double> &, CLHEP::HepRandomEngine *);
0046 
0047 protected:
0048   int *getRandomChannels(int, int, CLHEP::HepRandomEngine *);
0049 
0050   double generate_gaussian_tail(const double, const double, CLHEP::HepRandomEngine *);
0051 
0052 private:
0053   int channel512_[512];
0054   int channel768_[768];
0055 };
0056 
0057 #endif