Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4INCL::Ranecu Class Reference

#include <G4INCLRanecu.hh>

Inheritance diagram for G4INCL::Ranecu:
Collaboration diagram for G4INCL::Ranecu:

Public Member Functions

 Ranecu ()
 
 Ranecu (const Random::SeedVector &sv)
 
virtual ~Ranecu ()
 
Random::SeedVector getSeeds ()
 
void setSeeds (const Random::SeedVector &sv)
 
G4double flat ()
 
- Public Member Functions inherited from G4INCL::IRandomGenerator
 IRandomGenerator ()
 
virtual ~IRandomGenerator ()
 

Detailed Description

Definition at line 53 of file G4INCLRanecu.hh.

Constructor & Destructor Documentation

G4INCL::Ranecu::Ranecu ( )

Definition at line 49 of file G4INCLRanecu.cc.

49  {
50  iseed1 = 666;
51  iseed2 = 777;
52  }
G4INCL::Ranecu::Ranecu ( const Random::SeedVector sv)

Definition at line 54 of file G4INCLRanecu.cc.

54  {
55  setSeeds(sv);
56  }
void setSeeds(const Random::SeedVector &sv)
Definition: G4INCLRanecu.hh:66

Here is the call graph for this function:

G4INCL::Ranecu::~Ranecu ( )
virtual

Definition at line 58 of file G4INCLRanecu.cc.

58 {}

Member Function Documentation

G4double G4INCL::Ranecu::flat ( )
virtual

Implements G4INCL::IRandomGenerator.

Definition at line 60 of file G4INCLRanecu.cc.

61  {
62  // This is an adapted version of subroutine ranecu:
63  // A. Padal, J. Sempau Computer Physics Cummunications 175 (2006) 440-450
64  G4double uscale=1.0/2.147483563e9;
65 
66  G4int i1=iseed1/53668;
67  iseed1=40014*(iseed1-i1*53668)-i1*12211;
68 
69  if(iseed1 < 0) iseed1 = iseed1 + 2147483563;
70 
71  G4int i2=iseed2/52774;
72  iseed2=40692*(iseed2-i2*52774)-i2*3791;
73  if(iseed2 < 0) iseed2=iseed2+2147483399;
74 
75  G4int iz=iseed1-iseed2;
76  if(iz < 1) iz=iz+2147483562;
77 
78  return iz*uscale;
79  }
int G4int
Definition: G4Types.hh:78
double G4double
Definition: G4Types.hh:76
Random::SeedVector G4INCL::Ranecu::getSeeds ( )
inlinevirtual

Implements G4INCL::IRandomGenerator.

Definition at line 59 of file G4INCLRanecu.hh.

59  {
60  Random::SeedVector sv;
61  sv.push_back(iseed1);
62  sv.push_back(iseed2);
63  return sv;
64  }
void G4INCL::Ranecu::setSeeds ( const Random::SeedVector sv)
inlinevirtual

Implements G4INCL::IRandomGenerator.

Definition at line 66 of file G4INCLRanecu.hh.

66  {
67 // assert(sv.size()>=2);
68  iseed1 = sv.at(0);
69  iseed2 = sv.at(1);
70  }

Here is the caller graph for this function:


The documentation for this class was generated from the following files: