source: trunk/source/processes/hadronic/models/incl/include/G4InclRandomNumbers.hh @ 1340

Last change on this file since 1340 was 1340, checked in by garnier, 14 years ago

update ti head

File size: 3.3 KB
Line 
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// $Id: G4InclRandomNumbers.hh,v 1.6 2010/10/26 02:47:59 kaitanie Exp $
27// Translation of INCL4.2/ABLA V3
28// Pekka Kaitaniemi, HIP (translation)
29// Christelle Schmidt, IPNL (fission code)
30// Alain Boudard, CEA (contact person INCL/ABLA)
31// Aatos Heikkinen, HIP (project coordination)
32
33#include "globals.hh"
34#include "Randomize.hh"
35
36#ifndef G4InclRandomNumbers_hh
37#define G4InclRandomNumbers_hh 1
38
39/**
40 * Interface for the random number services.
41 */
42class G4InclRandomInterface {
43
44public:
45  G4InclRandomInterface() { }
46  G4InclRandomInterface(G4long seed) {
47    this->seed = seed;
48  }
49
50  virtual ~G4InclRandomInterface() { }
51
52  /**
53   * Provide evenly distributed random numbers.
54   */
55  virtual G4double getRandom() = 0;
56  virtual void printSeeds() = 0;
57private:
58  G4long seed;
59};
60
61/**
62 * Provides dummy random number generator that always produces one
63 * number.
64 */
65class G4InclDummyRandom : public G4InclRandomInterface {
66
67public:
68  G4InclDummyRandom() { }
69
70  ~G4InclDummyRandom() { }
71
72  /**
73   * Always return one "random" number. This interface is intended as
74   * a debugging tool in order to produce some specific event.
75   */
76  G4double getRandom() {
77    return 0.5;
78  }
79
80  void printSeeds() {};
81};
82
83/**
84 * Interface to the Geant4 random number services.
85 */
86class G4InclGeant4Random : public G4InclRandomInterface {
87
88public:
89  G4InclGeant4Random() { }
90
91  ~G4InclGeant4Random() { }
92
93  /**
94   * Always return one "random" number. This interface is intended as
95   * a debugging tool in order to produce some specific event.
96   */
97  G4double getRandom() {
98    return G4UniformRand();
99  }
100
101  void printSeeds() {
102    G4cout <<"Using Geant4 random number generator." << G4endl;
103  };
104};
105
106#endif
Note: See TracBrowser for help on using the repository browser.