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

Random/Random/RandLandau.h
Go to the documentation of this file.
1 // $Id: RandLandau.h,v 1.5 2010/06/16 17:24:53 garren Exp $
2 // -*- C++ -*-
3 //
4 // -----------------------------------------------------------------------
5 // HEP Random
6 // --- RandLandau ---
7 // class header file
8 // -----------------------------------------------------------------------
9 // This file is part of Geant4 (simulation toolkit for HEP).
10 
11 // Class defining methods for shooting or firing Landau distributed
12 // random values.
13 //
14 // The Landau distribution is parameterless and describes the fluctuations
15 // in energy loss of a particle, making certain assumptions. For
16 // definitions and algorithms, the following papers could be read:
17 //
18 // Landau, Jour Phys VIII, No. 4, p. 201 (1944)
19 // Borsh-Supan, Jour Res. of NBS 65B NO. 4 p. 245 (1961)
20 // Kolbig & Schorr Comp Phys Comm 31 p. 97 (1984)
21 //
22 // The algorithm implemented comes form RANLAN in CERNLIB.
23 
24 // =======================================================================
25 // M. Fischler - Created: 5th January 2000
26 // M Fischler - put and get to/from streams 12/10/04
27 //
28 // =======================================================================
29 
30 #ifndef RandLandau_h
31 #define RandLandau_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 RandLandau : public HepRandom {
44 
45 public:
46 
47  inline RandLandau ( HepRandomEngine& anEngine );
48  inline RandLandau ( HepRandomEngine* anEngine );
49 
50  // These constructors should be used to instantiate a RandLandau
51  // distribution object defining a local engine for it.
52  // The static generator will be skipped using the non-static methods
53  // defined below.
54  // If the engine is passed by pointer the corresponding engine object
55  // will be deleted by the RandLandau destructor.
56  // If the engine is passed by reference the corresponding engine object
57  // will not be deleted by the RandLandau destructor.
58 
59  virtual ~RandLandau();
60  // Destructor
61 
62  // Save and restore to/from streams
63 
64  std::ostream & put ( std::ostream & os ) const;
65  std::istream & get ( std::istream & is );
66 
67  //
68  // Methods to generate Landau-distributed random deviates.
69  //
70  // These deviates are accurate to the actual Landau distribution to
71  // one part in 10**5 or better.
72 
73  // Static methods to shoot random values using the static generator
74 
75  static inline double shoot();
76 
77  static void shootArray ( const int size, double* vect );
78 
79  // Static methods to shoot random values using a given engine
80  // by-passing the static generator.
81 
82  static inline double shoot( HepRandomEngine* anotherEngine );
83 
84  static void shootArray ( HepRandomEngine* anotherEngine,
85  const int size,
86  double* vect );
87 
88  // Instance methods using the localEngine to instead of the static
89  // generator, and the default mean and stdDev established at construction
90 
91  inline double fire();
92 
93  void fireArray ( const int size, double* vect);
94 
95  inline double operator()();
96 
97  std::string name() const;
98  HepRandomEngine & engine();
99 
100  static std::string distributionName() {return "RandLandau";}
101  // Provides the name of this distribution class
102 
103 
104 protected:
105 
106  static double transform (double r);
107  static double transformSmall (double r);
108 
109 private:
110 
111  shared_ptr<HepRandomEngine> localEngine;
112 
113 };
114 
115 } // namespace CLHEP
116 
117 #ifdef ENABLE_BACKWARDS_COMPATIBILITY
118 // backwards compatibility will be enabled ONLY in CLHEP 1.9
119 using namespace CLHEP;
120 #endif
121 
122 #include "CLHEP/Random/RandLandau.icc"
123 
124 #endif
CLHEP::shared_ptr
Definition: Matrix/CLHEP/Utility/memory.h:66
CLHEP::RandLandau::get
std::istream & get(std::istream &is)
Definition: RandLandau.cc:374
CLHEP::RandLandau::put
std::ostream & put(std::ostream &os) const
Definition: RandLandau.cc:367
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::RandLandau::transformSmall
static double transformSmall(double r)
CLHEP::RandLandau::fireArray
void fireArray(const int size, double *vect)
Definition: RandLandau.cc:48
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::RandLandau::operator()
double operator()()
CLHEP::RandLandau::distributionName
static std::string distributionName()
Definition: Random/Random/RandLandau.h:100
CLHEP
Definition: ClhepVersion.h:13
CLHEP::RandLandau::shoot
static double shoot()
CLHEP::RandLandau::fire
double fire()
CLHEP::RandLandau::name
std::string name() const
Definition: RandLandau.cc:28
CLHEP::RandLandau::~RandLandau
virtual ~RandLandau()
Definition: RandLandau.cc:31
CLHEP::RandLandau::shootArray
static void shootArray(const int size, double *vect)
Definition: RandLandau.cc:34
CLHEP::RandLandau::engine
HepRandomEngine & engine()
Definition: RandLandau.cc:29
CLHEP::RandLandau::RandLandau
RandLandau(HepRandomEngine &anEngine)
CLHEP::RandLandau::transform
static double transform(double r)
Definition: RandLandau.cc:289