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

RandomObjects/CLHEP/Random/RandStudentT.h
Go to the documentation of this file.
1 // $Id: RandStudentT.h,v 1.5 2010/06/16 17:24:53 garren Exp $
2 // -*- C++ -*-
3 //
4 // -----------------------------------------------------------------------
5 // HEP Random
6 // --- RandStudentT ---
7 // class header file
8 // -----------------------------------------------------------------------
9 
10 // Class defining methods for shooting Student's t- distributed random
11 // values, given a number of degrees of freedom a (default=1.0).
12 // Default values are used for operator()().
13 
14 // Valid input values are a > 0. When invalid values are presented, the
15 // code silently returns DBL_MAX from <float.h> which is the same as
16 // MAXDOUBLE in <values.h> on systems where the latter exists.
17 
18 // =======================================================================
19 // John Marraffino - Created: Based on the C-Rand package
20 // by Ernst Stadlober and Franz Niederl of the Technical
21 // University of Graz, Austria : 12th May 1998
22 // - Removed <values.h> because that won't work
23 // on NT : 26th Jun 1998
24 // Gabriele Cosmo - Fixed minor bug on inline definition for shoot()
25 // methods. Created .icc file : 20th Aug 1998
26 // - Removed useless methods and data: 5th Jan 1999
27 // M Fischler - put and get to/from streams 12/10/04
28 // =======================================================================
29 
30 #ifndef RandStudentT_h
31 #define RandStudentT_h 1
32 
33 #include "CLHEP/Random/defs.h"
34 #include "CLHEP/Random/Random.h"
35 #include "CLHEP/Utility/memory.h"
36 
37 namespace CLHEP {
38 
43 class RandStudentT : public HepRandom {
44 
45 public:
46 
47  inline RandStudentT ( HepRandomEngine& anEngine, double a=1.0 );
48  inline RandStudentT ( HepRandomEngine* anEngine, double a=1.0 );
49  // These constructors should be used to instantiate a RandStudentT
50  // distribution object defining a local engine for it.
51  // The static generator will be skipped using the non-static methods
52  // defined below.
53  // If the engine is passed by pointer the corresponding engine object
54  // will be deleted by the RandStudentT destructor.
55  // If the engine is passed by reference the corresponding engine object
56  // will not be deleted by the RandStudentT destructor.
57 
58  virtual ~RandStudentT();
59  // Destructor
60 
61  // Save and restore to/from streams
62 
63  std::ostream & put ( std::ostream & os ) const;
64  std::istream & get ( std::istream & is );
65 
66  // Static methods to shoot random values using the static generator
67 
68  static inline double shoot();
69 
70  static double shoot( double a );
71 
72  static void shootArray ( const int size, double* vect,
73  double a=1.0 );
74 
75  // Static methods to shoot random values using a given engine
76  // by-passing the static generator.
77 
78  static inline double shoot( HepRandomEngine* anEngine );
79 
80  static double shoot( HepRandomEngine* anEngine,
81  double a );
82 
83  static void shootArray ( HepRandomEngine* anEngine, const int size,
84  double* vect, double a=1.0 );
85 
86  // Methods using the localEngine to shoot random values, by-passing
87  // the static generator.
88 
89  inline double fire();
90 
91  double fire( double a );
92 
93  void fireArray ( const int size, double* vect );
94  void fireArray ( const int size, double* vect, double a );
95  double operator()();
96  double operator()( double a );
97 
98  std::string name() const;
99  HepRandomEngine & engine();
100 
101  static std::string distributionName() {return "RandStudentT";}
102  // Provides the name of this distribution class
103 
104 
105 private:
106 
107  shared_ptr<HepRandomEngine> localEngine;
108  double defaultA;
109 
110 };
111 
112 } // namespace CLHEP
113 
114 #ifdef ENABLE_BACKWARDS_COMPATIBILITY
115 // backwards compatibility will be enabled ONLY in CLHEP 1.9
116 using namespace CLHEP;
117 #endif
118 
119 #include "CLHEP/Random/RandStudentT.icc"
120 
121 #endif
CLHEP::shared_ptr
Definition: Matrix/CLHEP/Utility/memory.h:66
a
@ a
Definition: testCategories.cc:125
CLHEP::RandStudentT::get
std::istream & get(std::istream &is)
Definition: RandStudentT.cc:158
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::RandStudentT::shoot
static double shoot()
CLHEP::RandStudentT::fire
double fire()
CLHEP::RandStudentT::operator()
double operator()()
Definition: RandStudentT.cc:35
CLHEP::RandStudentT::distributionName
static std::string distributionName()
Definition: RandomObjects/CLHEP/Random/RandStudentT.h:101
CLHEP::RandStudentT::engine
HepRandomEngine & engine()
Definition: RandStudentT.cc:29
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::RandStudentT::fireArray
void fireArray(const int size, double *vect)
Definition: RandStudentT.cc:113
CLHEP::RandStudentT::put
std::ostream & put(std::ostream &os) const
Definition: RandStudentT.cc:140
CLHEP::RandStudentT::RandStudentT
RandStudentT(HepRandomEngine &anEngine, double a=1.0)
CLHEP::RandStudentT::shootArray
static void shootArray(const int size, double *vect, double a=1.0)
Definition: RandStudentT.cc:84
CLHEP
Definition: ClhepVersion.h:13
CLHEP::RandStudentT::~RandStudentT
virtual ~RandStudentT()
Definition: RandStudentT.cc:31
CLHEP::RandStudentT::name
std::string name() const
Definition: RandStudentT.cc:28