Geant4  10.01.p02
G4MTRandGamma.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 G4MTRandGamma
30 //
31 // Modified version with MT extensions
32 // of corresponding CLHEP class RandGamma
33 
34 // --------------------------------------------------------------------
35 #ifndef G4MTRandGamma_h
36 #define G4MTRandGamma_h 1
37 
38 #include "G4MTHepRandom.hh"
39 
41 {
42 
43 public:
44 
45  inline G4MTRandGamma ( CLHEP::HepRandomEngine& anEngine, G4double k=1.0,
46  G4double lambda=1.0 );
47  inline G4MTRandGamma ( CLHEP::HepRandomEngine* anEngine, G4double k=1.0,
48  G4double lambda=1.0 );
49  // These constructors should be used to instantiate a G4MTRandGamma
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 G4MTRandGamma destructor.
55  // If the engine is passed by reference the corresponding engine object
56  // will not be deleted by the G4MTRandGamma destructor.
57 
58  virtual ~G4MTRandGamma();
59  // Destructor
60 
61  // Static methods to shoot random values using the static generator
62 
63  static inline G4double shoot();
64 
65  static G4double shoot( G4double k, G4double lambda );
66 
67  static void shootArray ( const G4int size, G4double* vect,
68  G4double k=1.0, G4double lambda=1.0 );
69 
70  // Static methods to shoot random values using a given engine
71  // by-passing the static generator.
72 
73  static inline G4double shoot( CLHEP::HepRandomEngine* anEngine );
74 
75  static G4double shoot( CLHEP::HepRandomEngine* anEngine,
76  G4double k, G4double lambda );
77 
78  static void shootArray ( CLHEP::HepRandomEngine* anEngine, const G4int size,
79  G4double* vect, G4double k=1.0,
80  G4double lambda=1.0 );
81 
82  // Methods using the localEngine to shoot random values, by-passing
83  // the static generator.
84 
85  inline G4double fire();
86 
87  G4double fire( G4double k, G4double lambda );
88 
89  void fireArray ( const G4int size, G4double* vect);
90  void fireArray ( const G4int size, G4double* vect,
91  G4double k, G4double lambda );
92  inline G4double operator()();
93  inline G4double operator()( G4double k, G4double lambda );
94 
95 private:
96 
97  static G4double genGamma( CLHEP::HepRandomEngine *anEngine, G4double k,
98  G4double lambda );
99 
100  CLHEP::HepRandomEngine* localEngine;
104 
105 };
106 
107 #include "G4MTRandGamma.icc"
108 
109 #endif
G4double operator()()
void fireArray(const G4int size, G4double *vect)
G4double fire()
static G4double shoot()
G4double defaultK
int G4int
Definition: G4Types.hh:78
CLHEP::HepRandomEngine * localEngine
bool G4bool
Definition: G4Types.hh:79
G4MTRandGamma(CLHEP::HepRandomEngine &anEngine, G4double k=1.0, G4double lambda=1.0)
G4double defaultLambda
static void shootArray(const G4int size, G4double *vect, G4double k=1.0, G4double lambda=1.0)
virtual ~G4MTRandGamma()
double G4double
Definition: G4Types.hh:76
static G4double genGamma(CLHEP::HepRandomEngine *anEngine, G4double k, G4double lambda)