Geant4-11
Public Member Functions | Private Attributes
G4INCL::Ranecu Class Reference

#include <G4INCLRanecu.hh>

Inheritance diagram for G4INCL::Ranecu:
G4INCL::IRandomGenerator

Public Member Functions

G4double flat ()
 
Random::SeedVector getSeeds ()
 
 Ranecu ()
 
 Ranecu (const Random::SeedVector &sv)
 
void setSeeds (const Random::SeedVector &sv)
 
virtual ~Ranecu ()
 

Private Attributes

G4int iseed1
 
G4int iseed2
 

Detailed Description

Definition at line 53 of file G4INCLRanecu.hh.

Constructor & Destructor Documentation

◆ Ranecu() [1/2]

G4INCL::Ranecu::Ranecu ( )

Definition at line 49 of file G4INCLRanecu.cc.

49 {
50 iseed1 = 666;
51 iseed2 = 777;
52 }

References iseed1, and iseed2.

◆ Ranecu() [2/2]

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

References setSeeds().

◆ ~Ranecu()

G4INCL::Ranecu::~Ranecu ( )
virtual

Definition at line 58 of file G4INCLRanecu.cc.

58{}

Member Function Documentation

◆ flat()

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
76 if(iz < 1) iz=iz+2147483562;
77
78 return iz*uscale;
79 }
double G4double
Definition: G4Types.hh:83
int G4int
Definition: G4Types.hh:85

References iseed1, and iseed2.

◆ getSeeds()

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 }

References iseed1, and iseed2.

◆ setSeeds()

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 }

References iseed1, and iseed2.

Referenced by Ranecu().

Field Documentation

◆ iseed1

G4int G4INCL::Ranecu::iseed1
private

Definition at line 75 of file G4INCLRanecu.hh.

Referenced by flat(), getSeeds(), Ranecu(), and setSeeds().

◆ iseed2

G4int G4INCL::Ranecu::iseed2
private

Definition at line 75 of file G4INCLRanecu.hh.

Referenced by flat(), getSeeds(), Ranecu(), and setSeeds().


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