CLHEP VERSION Reference Documentation
   
CLHEP Home Page     CLHEP Documentation     CLHEP Bug Reports

Random/Random/RandPoissonT.h
Go to the documentation of this file.
1 // $Id: RandPoissonT.h,v 1.5 2010/06/16 17:24:53 garren Exp $
2 // -*- C++ -*-
3 //
4 // -----------------------------------------------------------------------
5 // HEP Random
6 // --- RandPoissonT ---
7 // class header file
8 // -----------------------------------------------------------------------
9 
10 // Class defining methods for shooting numbers according to the Poisson
11 // distribution, given a mean. RandPoissonT is derived from RandPoisson
12 // and shares the identical user interface. RandPoissonT is always
13 // perfectly accurate for any value of mu.
14 
15 // For mu > 100 the algorithm used is taken from the base class RandPoisson
16 // (Algorithm from "W.H.Press et al., Numerical Recipes in C, Second Edition".)
17 //
18 // For mu < 100, algorithm used is a table lookup based on [mu/K] for some
19 // smallish K, followed by an explicit series-drived poisson for the small
20 // remaining part of mu. This method is exact, and is substantially faster
21 // than the method used by the base class. The implementation of this method
22 // is in the RandPoissonQ class.
23 
24 // =======================================================================
25 // M. Fischler - Created 26 Jan 2000
26 // M Fischler - put and get to/from streams 12/10/04
27 // =======================================================================
28 
29 #ifndef RandPoissonT_h
30 #define RandPoissonT_h 1
31 
32 #include "CLHEP/Random/defs.h"
33 #include "CLHEP/Random/RandPoisson.h"
34 
35 namespace CLHEP {
36 
41 class RandPoissonT : public RandPoisson {
42 
43 public:
44 
45  RandPoissonT ( HepRandomEngine& anEngine, double m=1.0 );
46  RandPoissonT ( HepRandomEngine* anEngine, double m=1.0 );
47  // These constructors should be used to instantiate a RandPoissonT
48  // distribution object defining a local engine for it.
49  // The static generator will be skipped using the non-static methods
50  // defined below.
51  // If the engine is passed by pointer the corresponding engine object
52  // will be deleted by the RandPoissonT destructor.
53  // If the engine is passed by reference the corresponding engine object
54  // will not be deleted by the RandPoissonT destructor.
55 
56  virtual ~RandPoissonT();
57  // Destructor
58 
59  // Save and restore to/from streams
60 
61  std::ostream & put ( std::ostream & os ) const;
62  std::istream & get ( std::istream & is );
63 
64  // Static methods to shoot random values using the static generator
65 
66  static long shoot( double m=1.0 );
67 
68  static void shootArray ( const int size, long* vect, double m=1.0 );
69 
70  // Static methods to shoot random values using a given engine
71  // by-passing the static generator.
72 
73  static long shoot( HepRandomEngine* anEngine, double m=1.0 );
74 
75  static void shootArray ( HepRandomEngine* anEngine,
76  const int size, long* vect, double m=1.0 );
77 
78  // Methods using the localEngine to shoot random values, by-passing
79  // the static generator.
80 
81  long fire();
82  long fire( double m );
83 
84  void fireArray ( const int size, long* vect );
85  void fireArray ( const int size, long* vect, double m);
86 
87  double operator()();
88  double operator()( double m );
89 
90  std::string name() const;
91  HepRandomEngine & engine();
92 
93  static std::string distributionName() {return "RandPoissonT";}
94  // Provides the name of this distribution class
95 
96 
97 private:
98 
99 };
100 
101 } // namespace CLHEP
102 
103 #ifdef ENABLE_BACKWARDS_COMPATIBILITY
104 // backwards compatibility will be enabled ONLY in CLHEP 1.9
105 using namespace CLHEP;
106 #endif
107 
108 #include "CLHEP/Random/RandPoissonT.icc"
109 
110 #endif
CLHEP::RandPoissonT::~RandPoissonT
virtual ~RandPoissonT()
Definition: RandPoissonT.cc:49
CLHEP::RandPoissonT::shootArray
static void shootArray(const int size, long *vect, double m=1.0)
Definition: RandPoissonT.cc:93
CLHEP::RandPoissonT::name
std::string name() const
Definition: RandPoissonT.cc:38
CLHEP::RandPoissonT::operator()
double operator()()
Definition: RandPoissonT.cc:61
is
HepRotation and so forth isNear() norm2() rectify() static Rotation row1 row4(To avoid bloat in the code pulled in for programs which don 't use all these features, we split the implementation .cc files. Only isNear() goes into the original Rotation.cc) --------------------------------------- HepAxisAngle and HepEulerAngles classes --------------------------------------- These classes are very useful and simple structures for holding the result of a nice intuituve decomposition of a rotation there is no longer much content in the distinct ZOOM PhysicsVectors library The only content left in the library is the object files representing the various Exception objects When we build the CLHEP classes for the ZOOM we will set up so as to use ZOOM SpaceVector is(but we can disable namespace usage and most of our users do so at this point). What I do is leave Hep3Vector in the global namespace
CLHEP::RandPoissonT::distributionName
static std::string distributionName()
Definition: Random/Random/RandPoissonT.h:93
size
user code seldom needs to call this function directly ZMerrno whether or not they are still recorded ZMerrno size() Return the(integer) number of ZMthrow 'n exceptions currently recorded. 5) ZMerrno.clear() Set an internal counter to zero. This counter is available(see next function) to user code to track ZMthrow 'n exceptions that have occurred during any arbitrary time interval. 6) ZMerrno.countSinceCleared() Return the(integer) number of ZMthrow 'n exceptions that have been recorded via ZMerrno.write()
CLHEP
Definition: ClhepVersion.h:13
CLHEP::RandPoissonT::RandPoissonT
RandPoissonT(HepRandomEngine &anEngine, double m=1.0)
Definition: RandPoissonT.cc:41
CLHEP::RandPoissonT::shoot
static long shoot(double m=1.0)
Definition: RandPoissonT.cc:56
CLHEP::RandPoissonT::engine
HepRandomEngine & engine()
Definition: RandPoissonT.cc:39
CLHEP::RandPoissonT::fire
long fire()
Definition: RandPoissonT.cc:73
CLHEP::RandPoissonT::fireArray
void fireArray(const int size, long *vect)
Definition: RandPoissonT.cc:106
CLHEP::RandPoissonT::get
std::istream & get(std::istream &is)
Definition: RandPoissonT.cc:122
CLHEP::RandPoissonT::put
std::ostream & put(std::ostream &os) const
Definition: RandPoissonT.cc:114