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

Random/Random/RandExponential.h
Go to the documentation of this file.
1 // $Id: RandExponential.h,v 1.5 2010/06/16 17:24:53 garren Exp $
2 // -*- C++ -*-
3 //
4 // -----------------------------------------------------------------------
5 // HEP Random
6 // --- RandExponential ---
7 // class header file
8 // -----------------------------------------------------------------------
9 // This file is part of Geant4 (simulation toolkit for HEP).
10 //
11 // Class defining methods for shooting exponential distributed random
12 // values, given a mean (default mean = 1).
13 // Default mean is used for operator()().
14 
15 // =======================================================================
16 // Gabriele Cosmo - Created: 5th September 1995
17 // - Added methods to shoot arrays: 28th July 1997
18 // J.Marraffino - Added default mean as attribute and
19 // operator() with mean: 16th Feb 1998
20 // M Fischler - put and get to/from streams 12/10/04
21 // =======================================================================
22 
23 #ifndef RandExponential_h
24 #define RandExponential_h 1
25 
26 #include "CLHEP/Random/defs.h"
27 #include "CLHEP/Random/Random.h"
28 #include "CLHEP/Utility/memory.h"
29 
30 namespace CLHEP {
31 
36 class RandExponential : public HepRandom {
37 
38 public:
39 
40  inline RandExponential ( HepRandomEngine& anEngine, double mean=1.0 );
41  inline RandExponential ( HepRandomEngine* anEngine, double mean=1.0 );
42  // These constructors should be used to instantiate a RandExponential
43  // distribution object defining a local engine for it.
44  // The static generator will be skipped using the non-static methods
45  // defined below.
46  // If the engine is passed by pointer the corresponding engine object
47  // will be deleted by the RandExponential destructor.
48  // If the engine is passed by reference the corresponding engine object
49  // will not be deleted by the RandExponential destructor.
50 
51  virtual ~RandExponential();
52  // Destructor
53 
54  // Static methods to shoot random values using the static generator
55 
56  static double shoot();
57 
58  static double shoot( double mean );
59 
60  static void shootArray ( const int size, double* vect,
61  double mean=1.0 );
62 
63  // Static methods to shoot random values using a given engine
64  // by-passing the static generator.
65 
66  static inline double shoot( HepRandomEngine* anEngine );
67 
68  static inline double shoot( HepRandomEngine* anEngine, double mean );
69 
70  static void shootArray ( HepRandomEngine* anEngine, const int size,
71  double* vect, double mean=1.0 );
72 
73  // Methods using the localEngine to shoot random values, by-passing
74  // the static generator.
75 
76  inline double fire();
77 
78  inline double fire( double mean );
79 
80  void fireArray ( const int size, double* vect );
81  void fireArray ( const int size, double* vect, double mean );
82 
83  double operator()();
84  double operator()( double mean );
85 
86  // Save and restore to/from streams
87 
88  std::ostream & put ( std::ostream & os ) const;
89  std::istream & get ( std::istream & is );
90 
91  std::string name() const;
92  HepRandomEngine & engine();
93 
94  static std::string distributionName() {return "RandExponential";}
95  // Provides the name of this distribution class
96 
97 private:
98 
99  shared_ptr<HepRandomEngine> localEngine;
100  double defaultMean;
101 
102 };
103 
104 } // namespace CLHEP
105 
106 #ifdef ENABLE_BACKWARDS_COMPATIBILITY
107 // backwards compatibility will be enabled ONLY in CLHEP 1.9
108 using namespace CLHEP;
109 #endif
110 
111 #include "CLHEP/Random/RandExponential.icc"
112 
113 #endif
CLHEP::shared_ptr
Definition: Matrix/CLHEP/Utility/memory.h:66
CLHEP::RandExponential::engine
HepRandomEngine & engine()
Definition: RandExponential.cc:29
CLHEP::RandExponential::fire
double fire()
CLHEP::RandExponential::~RandExponential
virtual ~RandExponential()
Definition: RandExponential.cc:31
CLHEP::RandExponential::distributionName
static std::string distributionName()
Definition: Random/Random/RandExponential.h:94
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::RandExponential::operator()
double operator()()
Definition: RandExponential.cc:34
CLHEP::RandExponential::fireArray
void fireArray(const int size, double *vect)
Definition: RandExponential.cc:64
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::RandExponential::shoot
static double shoot()
Definition: RandExponential.cc:42
CLHEP
Definition: ClhepVersion.h:13
CLHEP::RandExponential::RandExponential
RandExponential(HepRandomEngine &anEngine, double mean=1.0)
CLHEP::RandExponential::get
std::istream & get(std::istream &is)
Definition: RandExponential.cc:95
CLHEP::RandExponential::shootArray
static void shootArray(const int size, double *vect, double mean=1.0)
Definition: RandExponential.cc:50
CLHEP::RandExponential::name
std::string name() const
Definition: RandExponential.cc:28
CLHEP::RandExponential::put
std::ostream & put(std::ostream &os) const
Definition: RandExponential.cc:77