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

Random/Random/RandGaussQ.h
Go to the documentation of this file.
1 // $Id: RandGaussQ.h,v 1.5 2010/06/16 17:24:53 garren Exp $
2 // -*- C++ -*-
3 //
4 // -----------------------------------------------------------------------
5 // HEP Random
6 // --- RandGaussQ ---
7 // class header file
8 // -----------------------------------------------------------------------
9 
10 // Class defining methods RandGaussQ, which is derived from RandGauss.
11 // The user interface is identical; but RandGaussQ is faster and a bit less
12 // accurate.
13 
14 // =======================================================================
15 // M. Fischler - Created: 24th Jan 2000
16 // M Fischler - put and get to/from streams 12/10/04
17 //
18 // =======================================================================
19 
20 #ifndef RandGaussQ_h
21 #define RandGaussQ_h 1
22 
23 #include "CLHEP/Random/defs.h"
24 #include "CLHEP/Random/RandGauss.h"
25 
26 namespace CLHEP {
27 
32 class RandGaussQ : public RandGauss {
33 
34 public:
35 
36  inline RandGaussQ ( HepRandomEngine& anEngine, double mean=0.0,
37  double stdDev=1.0 );
38  inline RandGaussQ ( HepRandomEngine* anEngine, double mean=0.0,
39  double stdDev=1.0 );
40  // These constructors should be used to instantiate a RandGaussQ
41  // distribution object defining a local engine for it.
42  // The static generator will be skipped using the non-static methods
43  // defined below.
44  // If the engine is passed by pointer the corresponding engine object
45  // will be deleted by the RandGaussQ destructor.
46  // If the engine is passed by reference the corresponding engine object
47  // will not be deleted by the RandGaussQ destructor.
48 
49  // Destructor
50  virtual ~RandGaussQ();
51 
52  //
53  // Methods to generate Gaussian-distributed random deviates:
54  //
55  // If a fast good engine takes 1 usec, RandGauss::fire() adds 1 usec while
56  // RandGaussQ::fire() adds only .4 usec.
57  //
58 
59  // Static methods to shoot random values using the static generator
60 
61  static inline double shoot();
62 
63  static inline double shoot( double mean, double stdDev );
64 
65  static void shootArray ( const int size, double* vect,
66  double mean=0.0, double stdDev=1.0 );
67 
68  // Static methods to shoot random values using a given engine
69  // by-passing the static generator.
70 
71  static inline double shoot( HepRandomEngine* anotherEngine );
72 
73  static inline double shoot( HepRandomEngine* anotherEngine,
74  double mean, double stdDev );
75 
76 
77  static void shootArray ( HepRandomEngine* anotherEngine,
78  const int size,
79  double* vect, double mean=0.0,
80  double stdDev=1.0 );
81 
82  // Instance methods using the localEngine to instead of the static
83  // generator, and the default mean and stdDev established at construction
84 
85  inline double fire();
86 
87  inline double fire ( double mean, double stdDev );
88 
89  void fireArray ( const int size, double* vect);
90  void fireArray ( const int size, double* vect,
91  double mean, double stdDev );
92 
93  virtual double operator()();
94  virtual double operator()( double mean, double stdDev );
95 
96  // Save and restore to/from streams
97 
98  std::ostream & put ( std::ostream & os ) const;
99  std::istream & get ( std::istream & is );
100 
101  std::string name() const;
102  HepRandomEngine & engine();
103 
104  static std::string distributionName() {return "RandGaussQ";}
105  // Provides the name of this distribution class
106 
107 
108 protected:
109 
110  static double transformQuick (double r);
111  static double transformSmall (double r);
112 
113 private:
114 
115  // All the engine info, and the default mean and sigma, are in the RandGauss
116  // base class.
117 
118 };
119 
120 } // namespace CLHEP
121 
122 #ifdef ENABLE_BACKWARDS_COMPATIBILITY
123 // backwards compatibility will be enabled ONLY in CLHEP 1.9
124 using namespace CLHEP;
125 #endif
126 
127 #include "CLHEP/Random/RandGaussQ.icc"
128 
129 #endif
CLHEP::RandGaussQ::distributionName
static std::string distributionName()
Definition: Random/Random/RandGaussQ.h:104
CLHEP::RandGaussQ::engine
HepRandomEngine & engine()
Definition: RandGaussQ.cc:24
CLHEP::RandGaussQ::RandGaussQ
RandGaussQ(HepRandomEngine &anEngine, double mean=0.0, double stdDev=1.0)
CLHEP::RandGaussQ::fire
double fire()
RandGauss
How the various random distributions are validated The distributions in for example RandGauss
Definition: validation.doc:4
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::RandGaussQ::shoot
static double shoot()
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::RandGaussQ::shootArray
static void shootArray(const int size, double *vect, double mean=0.0, double stdDev=1.0)
Definition: RandGaussQ.cc:37
CLHEP::RandGaussQ::transformQuick
static double transformQuick(double r)
Definition: RandGaussQ.cc:95
CLHEP::RandGaussQ::transformSmall
static double transformSmall(double r)
Definition: RandGaussQ.cc:130
CLHEP::RandGaussQ::fireArray
void fireArray(const int size, double *vect)
Definition: RandGaussQ.cc:52
CLHEP::RandGaussQ::name
std::string name() const
Definition: RandGaussQ.cc:23
CLHEP::RandGaussQ::~RandGaussQ
virtual ~RandGaussQ()
Definition: RandGaussQ.cc:26
CLHEP::RandGaussQ::get
std::istream & get(std::istream &is)
Definition: RandGaussQ.cc:179
CLHEP::RandGaussQ::operator()
virtual double operator()()
Definition: RandGaussQ.cc:29
CLHEP::RandGaussQ::put
std::ostream & put(std::ostream &os) const
Definition: RandGaussQ.cc:171