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

RandomObjects/CLHEP/Random/RandBreitWigner.h
Go to the documentation of this file.
1 // $Id: RandBreitWigner.h,v 1.5 2010/06/16 17:24:53 garren Exp $
2 // -*- C++ -*-
3 //
4 // -----------------------------------------------------------------------
5 // HEP Random
6 // --- RandBreitWigner ---
7 // class header file
8 // -----------------------------------------------------------------------
9 // This file is part of Geant4 (simulation toolkit for HEP).
10 //
11 // Class defining methods for shooting numbers according to the
12 // Breit-Wigner distribution algorithms (plain or mean^2).
13 // Default values are set: mean=1, gamma=.2, cut=1.
14 // Plain algorithm is used for shootArray() and fireArray().
15 // Plain algorithm with default values is used for operator()().
16 
17 // =======================================================================
18 // Gabriele Cosmo - Created: 5th September 1995
19 // - Added methods to shoot arrays: 28th July 1997
20 // J.Marraffino - Added default arguments as attributes and
21 // operator() with arguments: 16th Feb 1998
22 // M Fischler - put and get to/from streams 12/10/04
23 // =======================================================================
24 
25 #ifndef RandBreitWigner_h
26 #define RandBreitWigner_h 1
27 
28 #include "CLHEP/Random/defs.h"
29 #include "CLHEP/Random/RandFlat.h"
30 #include "CLHEP/Utility/memory.h"
31 
32 namespace CLHEP {
33 
38 class RandBreitWigner : public HepRandom {
39 
40 public:
41 
42  inline RandBreitWigner ( HepRandomEngine& anEngine, double a=1.0,
43  double b=0.2 );
44  inline RandBreitWigner ( HepRandomEngine* anEngine, double a=1.0,
45  double b=0.2 );
46  // These constructors should be used to instantiate a RandBreitWigner
47  // distribution object defining a local engine for it.
48  // The static generator will be skipped using the non-static methods
49  // defined below.
50  // If the engine is passed by pointer the corresponding engine object
51  // will be deleted by the RandBreitWigner destructor.
52  // If the engine is passed by reference the corresponding engine object
53  // will not be deleted by the RandBreitWigner destructor.
54 
55  virtual ~RandBreitWigner();
56  // Destructor
57 
58  // Static methods to shoot random values using the static generator
59 
60  static double shoot( double a=1.0, double b=0.2 );
61 
62  static double shoot( double a, double b, double c );
63 
64  static double shootM2( double a=1.0, double b=0.2 );
65 
66  static double shootM2( double a, double b, double c );
67 
68  static void shootArray ( const int size, double* vect);
69 
70  static void shootArray ( const int size, double* vect,
71  double a, double b );
72 
73  static void shootArray ( const int size, double* vect,
74  double a, double b, double c );
75 
76  // Static methods to shoot random values using a given engine
77  // by-passing the static generator.
78 
79  static double shoot( HepRandomEngine* anEngine, double a=1.0,
80  double b=0.2 );
81  static double shoot( HepRandomEngine* anEngine, double a,
82  double b, double c );
83  static double shootM2( HepRandomEngine* anEngine, double a=1.0,
84  double b=0.2 );
85  static double shootM2( HepRandomEngine* anEngine, double a,
86  double b, double c );
87  static void shootArray ( HepRandomEngine* anEngine,
88  const int size, double* vect );
89  static void shootArray ( HepRandomEngine* anEngine,
90  const int size, double* vect,
91  double a, double b );
92  static void shootArray ( HepRandomEngine* anEngine,
93  const int size, double* vect,
94  double a, double b, double c );
95 
96  // Methods using the localEngine to shoot random values, by-passing
97  // the static generator. These methods respect distribution parameters
98  // passed by the user at instantiation unless superseded by actual
99  // arguments in the call.
100 
101  double fire();
102 
103  double fire( double a, double b );
104 
105  double fire( double a, double b, double c );
106 
107  double fireM2();
108 
109  double fireM2( double a, double b );
110 
111  double fireM2( double a, double b, double c );
112 
113  void fireArray ( const int size, double* vect);
114 
115  void fireArray ( const int size, double* vect,
116  double a, double b );
117 
118  void fireArray ( const int size, double* vect,
119  double a, double b, double c );
120  double operator()();
121  double operator()( double a, double b );
122  double operator()( double a, double b, double c );
123 
124  // Save and restore to/from streams
125 
126  std::ostream & put ( std::ostream & os ) const;
127  std::istream & get ( std::istream & is );
128 
129  std::string name() const;
130  HepRandomEngine & engine();
131 
132  static std::string distributionName() {return "RandBreitWigner";}
133  // Provides the name of this distribution class
134 
135 private:
136 
137  shared_ptr<HepRandomEngine> localEngine;
138  double defaultA;
139  double defaultB;
140 
141 };
142 
143 } // namespace CLHEP
144 
145 #ifdef ENABLE_BACKWARDS_COMPATIBILITY
146 // backwards compatibility will be enabled ONLY in CLHEP 1.9
147 using namespace CLHEP;
148 #endif
149 
150 #include "CLHEP/Random/RandBreitWigner.icc"
151 
152 #endif
CLHEP::shared_ptr
Definition: Matrix/CLHEP/Utility/memory.h:66
a
@ a
Definition: testCategories.cc:125
CLHEP::RandBreitWigner::shootM2
static double shootM2(double a=1.0, double b=0.2)
Definition: RandBreitWigner.cc:71
b
@ b
Definition: testCategories.cc:125
CLHEP::RandBreitWigner::shoot
static double shoot(double a=1.0, double b=0.2)
Definition: RandBreitWigner.cc:49
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::RandBreitWigner::shootArray
static void shootArray(const int size, double *vect)
Definition: RandBreitWigner.cc:98
CLHEP::RandBreitWigner::fire
double fire()
Definition: RandBreitWigner.cc:199
CLHEP::RandBreitWigner::RandBreitWigner
RandBreitWigner(HepRandomEngine &anEngine, double a=1.0, double b=0.2)
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::RandBreitWigner::fireArray
void fireArray(const int size, double *vect)
Definition: RandBreitWigner.cc:258
CLHEP
Definition: ClhepVersion.h:13
CLHEP::RandBreitWigner::fireM2
double fireM2()
Definition: RandBreitWigner.cc:226
CLHEP::RandBreitWigner::~RandBreitWigner
virtual ~RandBreitWigner()
Definition: RandBreitWigner.cc:34
CLHEP::RandBreitWigner::distributionName
static std::string distributionName()
Definition: RandomObjects/CLHEP/Random/RandBreitWigner.h:132
CLHEP::RandBreitWigner::engine
HepRandomEngine & engine()
Definition: RandBreitWigner.cc:32
CLHEP::RandBreitWigner::operator()
double operator()()
Definition: RandBreitWigner.cc:37
CLHEP::RandBreitWigner::put
std::ostream & put(std::ostream &os) const
Definition: RandBreitWigner.cc:279
CLHEP::RandBreitWigner::name
std::string name() const
Definition: RandBreitWigner.cc:31
CLHEP::RandBreitWigner::get
std::istream & get(std::istream &is)
Definition: RandBreitWigner.cc:299