Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4MTRandExponential.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 G4MTRandExponential
30 //
31 // Modified version with MT extensions
32 // of corresponding CLHEP class RandExponential
33 
34 // --------------------------------------------------------------------
35 #ifndef G4MTRandExponential_h
36 #define G4MTRandExponential_h 1
37 
38 #include "G4MTHepRandom.hh"
39 
41 {
42 
43 public:
44 
45  inline G4MTRandExponential ( CLHEP::HepRandomEngine& anEngine, G4double mean=1.0 );
46  inline G4MTRandExponential ( CLHEP::HepRandomEngine* anEngine, G4double mean=1.0 );
47  // These constructors should be used to instantiate a G4MTRandExponential
48  // distribution object defining a local engine for it.
49  // The static generator will be skipped using the non-static methods
50  // defined below.
51  // If the engine is passed by pointer the corresponding engine object
52  // will be deleted by the G4MTRandExponential destructor.
53  // If the engine is passed by reference the corresponding engine object
54  // will not be deleted by the G4MTRandExponential destructor.
55 
56  virtual ~G4MTRandExponential();
57  // Destructor
58 
59  // Static methods to shoot random values using the static generator
60 
61  static G4double shoot();
62 
63  static G4double shoot( G4double mean );
64 
65  static void shootArray ( const G4int size, G4double* vect,
66  G4double mean=1.0 );
67 
68  // Static methods to shoot random values using a given engine
69  // by-passing the static generator.
70 
71  static inline G4double shoot( CLHEP::HepRandomEngine* anEngine );
72 
73  static inline G4double shoot( CLHEP::HepRandomEngine* anEngine, G4double mean );
74 
75  static void shootArray ( CLHEP::HepRandomEngine* anEngine, const G4int size,
76  G4double* vect, G4double mean=1.0 );
77 
78  // Methods using the localEngine to shoot random values, by-passing
79  // the static generator.
80 
81  inline G4double fire();
82 
83  inline G4double fire( G4double mean );
84 
85  void fireArray ( const G4int size, G4double* vect );
86  void fireArray ( const G4int size, G4double* vect, G4double mean );
87 
90 
91 private:
92 
93  CLHEP::HepRandomEngine* localEngine;
94  G4bool deleteEngine;
95  G4double defaultMean;
96 
97 };
98 
99 #include "G4MTRandExponential.icc"
100 
101 #endif
G4double operator()()
static G4double shoot()
int G4int
Definition: G4Types.hh:78
G4MTRandExponential(CLHEP::HepRandomEngine &anEngine, G4double mean=1.0)
virtual ~G4MTRandExponential()
bool G4bool
Definition: G4Types.hh:79
static void shootArray(const G4int size, G4double *vect, G4double mean=1.0)
void fireArray(const G4int size, G4double *vect)
double G4double
Definition: G4Types.hh:76