Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4MTRandGaussQ.hh
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 //
27 // $Id:$
28 //
29 // Class G4MTRandGaussQ
30 //
31 // Modified version with MT extensions
32 // of corresponding CLHEP class RandGaussQ
33 
34 // --------------------------------------------------------------------
35 #ifndef G4MTRandGaussQ_h
36 #define G4MTRandGaussQ_h 1
37 
38 #include "G4MTRandGauss.hh"
39 
41 {
42 
43 public:
44 
45  inline G4MTRandGaussQ ( CLHEP::HepRandomEngine& anEngine, G4double mean=0.0,
46  G4double stdDev=1.0 );
47  inline G4MTRandGaussQ ( CLHEP::HepRandomEngine* anEngine, G4double mean=0.0,
48  G4double stdDev=1.0 );
49  // These constructors should be used to instantiate a G4MTRandGaussQ
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 G4MTRandGaussQ destructor.
55  // If the engine is passed by reference the corresponding engine object
56  // will not be deleted by the G4MTRandGaussQ destructor.
57 
58  // Destructor
59  virtual ~G4MTRandGaussQ();
60 
61  //
62  // Methods to generate Gaussian-distributed random deviates:
63  //
64  // If a fast good engine takes 1 usec, G4MTRandGauss::fire()
65  // adds 1 usec while G4MTRandGaussQ::fire() adds only .4 usec.
66  //
67 
68  // Static methods to shoot random values using the static generator
69 
70  static inline G4double shoot();
71 
72  static inline G4double shoot( G4double mean, G4double stdDev );
73 
74  static void shootArray ( const G4int size, G4double* vect,
75  G4double mean=0.0, G4double stdDev=1.0 );
76 
77  // Static methods to shoot random values using a given engine
78  // by-passing the static generator.
79 
80  static inline G4double shoot( CLHEP::HepRandomEngine* anotherEngine );
81 
82  static inline G4double shoot( CLHEP::HepRandomEngine* anotherEngine,
83  G4double mean, G4double stdDev );
84 
85 
86  static void shootArray ( CLHEP::HepRandomEngine* anotherEngine,
87  const G4int size,
88  G4double* vect, G4double mean=0.0,
89  G4double stdDev=1.0 );
90 
91  // Instance methods using the localEngine to instead of the static
92  // generator, and the default mean and stdDev established at construction
93 
94  inline G4double fire();
95 
96  inline G4double fire ( G4double mean, G4double stdDev );
97 
98  void fireArray ( const G4int size, G4double* vect);
99  void fireArray ( const G4int size, G4double* vect,
100  G4double mean, G4double stdDev );
101 
102  virtual G4double operator()();
103  virtual G4double operator()( G4double mean, G4double stdDev );
104 
105 protected:
106 
107  static G4double transformQuick (G4double r);
108  static G4double transformSmall (G4double r);
109 
110 private:
111 
112  // Private copy constructor. Defining it here disallows use.
113  G4MTRandGaussQ(const G4MTRandGaussQ& d);
114 
115  // All the engine info, and the default mean and sigma,
116  // are in the G4MTRandGauss base class.
117 
118 };
119 
120 #include "G4MTRandGaussQ.icc"
121 
122 #endif
G4double fire()
virtual ~G4MTRandGaussQ()
virtual G4double operator()()
int G4int
Definition: G4Types.hh:78
G4MTRandGaussQ(CLHEP::HepRandomEngine &anEngine, G4double mean=0.0, G4double stdDev=1.0)
static G4double transformQuick(G4double r)
static G4double shoot()
static G4double transformSmall(G4double r)
static void shootArray(const G4int size, G4double *vect, G4double mean=0.0, G4double stdDev=1.0)
double G4double
Definition: G4Types.hh:76
void fireArray(const G4int size, G4double *vect)