CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/Mixing/Base/interface/PoissonPUGenerator.h

Go to the documentation of this file.
00001 #ifndef POISSON_PU_GENERATOR_H
00002 #define POISSON_PU_GENERATOR_H
00003 
00004 #include "Mixing/Base/interface/PUGenerator.h"
00005 #include "CLHEP/Random/RandPoissonQ.h"
00006 
00007 /*----------------------------------------------------------------------
00008 
00009 ----------------------------------------------------------------------*/
00010 
00011 namespace edm 
00012 {
00013 
00014   class PoissonPUGenerator: public PUGenerator
00015     {
00016     public:
00017       explicit PoissonPUGenerator(double av) :average(av){ }
00018       ~PoissonPUGenerator() { }
00019     
00020     private:
00021       virtual unsigned int numberOfEventsPerBunch() const {return CLHEP::RandPoissonQ::fire(average);}
00022       double average;
00023     };
00024 }//edm
00025 
00026 #endif