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 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /externals/clhep/include/CLHEP/Random/RandPoissonQ.h (Version 11.3.0) and /externals/clhep/include/CLHEP/Random/RandPoissonQ.h (Version 9.3.p1)


  1 // -*- C++ -*-                                      1 
  2 //                                                
  3 // -------------------------------------------    
  4 //                             HEP Random         
  5 //                         --- RandPoissonQ --    
  6 //                          class header file     
  7 // -------------------------------------------    
  8                                                   
  9 // Class defining RandPoissonQ, which is deriv    
 10 // The user interface is identical; but RandGa    
 11 // and a bit less accurate when mu > 100.         
 12                                                   
 13 // ===========================================    
 14 // M. Fischler - Created: 4th Feb 2000            
 15 // M Fischler      - put and get to/from strea    
 16 //                                                
 17 // ===========================================    
 18                                                   
 19 #ifndef RandPoissonQ_h                            
 20 #define RandPoissonQ_h 1                          
 21                                                   
 22 #include "CLHEP/Random/Random.h"                  
 23 #include "CLHEP/Random/RandPoisson.h"             
 24                                                   
 25 namespace CLHEP {                                 
 26                                                   
 27 /**                                               
 28  * @author                                        
 29  * @ingroup random                                
 30  */                                               
 31 class RandPoissonQ : public RandPoisson {         
 32                                                   
 33 public:                                           
 34                                                   
 35   inline RandPoissonQ ( HepRandomEngine& anEng    
 36   inline RandPoissonQ ( HepRandomEngine* anEng    
 37   // These constructors should be used to inst    
 38   // distribution object defining a local engi    
 39   // The static generator will be skipped usin    
 40   // defined below.                               
 41   // If the engine is passed by pointer the co    
 42   // will be deleted by the RandPoissonQ destr    
 43   // If the engine is passed by reference the     
 44   // will not be deleted by the RandPoissonQ d    
 45                                                   
 46   virtual ~RandPoissonQ();                        
 47   // Destructor                                   
 48                                                   
 49   // Save and restore to/from streams             
 50                                                   
 51   std::ostream & put ( std::ostream & os ) con    
 52   std::istream & get ( std::istream & is );       
 53                                                   
 54   // Methods to generate Poisson-distributed r    
 55                                                   
 56   //   The method used for mu <= 100 is exact,    
 57   //   that used by RandPoisson.                  
 58   //   For mu > 100 then we use a corrected ve    
 59   //   (quick) Gaussian approximation.  Naivel    
 60   //                                              
 61   //  Poisson(mu) ~ floor( mu + .5 + Gaussian(    
 62   //                                              
 63   //   but actually, that would give a slightl    
 64   //   very different skew than a true Poisson    
 65   //                                              
 66   //  Poisson(mu) ~ floor( a0*mu + a1*g + a2*g    
 67   //            (with g a gaussian normal)        
 68   //                                              
 69   //   where a0, a1, a2 are chosen to give the    
 70   //   and skew for the Poisson distribution.     
 71                                                   
 72   // Static methods to shoot random values usi    
 73                                                   
 74   static  long shoot( double mean=1.0 );          
 75                                                   
 76   static  void shootArray ( const int size, lo    
 77                                                   
 78   //  Static methods to shoot random values us    
 79   //  by-passing the static generator.            
 80                                                   
 81   static  long shoot( HepRandomEngine* anEngin    
 82                                                   
 83   static  void shootArray ( HepRandomEngine* a    
 84                             const int size, lo    
 85                                                   
 86   //  Methods using the localEngine to shoot r    
 87   //  the static generator.                       
 88                                                   
 89   long  fire();                                   
 90   long  fire( double mean );                      
 91                                                   
 92   void fireArray ( const int size, long* vect     
 93   void fireArray ( const int size, long* vect,    
 94                                                   
 95   double operator()();                            
 96   double operator()( double mean );               
 97                                                   
 98   std::string name() const;                       
 99   HepRandomEngine & engine();                     
100                                                   
101   static std::string distributionName() {retur    
102   // Provides the name of this distribution cl    
103                                                   
104                                                   
105   // static constants of possible interest to     
106                                                   
107   // RandPoisson will never return a deviate g    
108   static const double MAXIMUM_POISSON_DEVIATE;    
109                                                   
110   static inline int tableBoundary();              
111                                                   
112 private:                                          
113                                                   
114   // constructor helper                           
115   void setupForDefaultMu();                       
116                                                   
117   // algorithm helper methods - all static sin    
118   static long poissonDeviateSmall ( HepRandomE    
119   static long poissonDeviateQuick ( HepRandomE    
120   static long poissonDeviateQuick ( HepRandomE    
121     double A0, double A1, double A2, double si    
122                                                   
123   // All the engine info, and the default mean    
124   // RandPoisson base class.                      
125                                                   
126   // quantities for approximate Poisson by cor    
127   double a0;                                      
128   double a1;                                      
129   double a2;                                      
130   double sigma;                                   
131                                                   
132   // static data - constants only, so that sav    
133                                                   
134   // The following MUST MATCH the correspondin    
135   // poissonTables.cc) when poissonTables.cdat    
136   // poissonTables.cc gets these values by inc    
137   // but we must be careful not to change thes    
138   // and rebuild RandPoissonQ before re-genera    
139                                                   
140   // (These statics are given values near the     
141                                                   
142   static const double FIRST_MU;  // lowest mu     
143   static const double LAST_MU;   // highest mu    
144   static const double S;         // Spacing be    
145   static const int BELOW;        // Starting p    
146   static const int ENTRIES;      // Number of     
147                                                   
148 };                                                
149                                                   
150 }  // namespace CLHEP                             
151                                                   
152 #include "CLHEP/Random/RandPoissonQ.icc"          
153                                                   
154 #endif                                            
155