Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Functions
pyRandomize Namespace Reference

Functions

void f1_setTheSeed (long seed)
 
void f2_setTheSeed (long seed, int lux)
 
void f1_setTheSeeds (const list &seedList)
 
void f2_setTheSeeds (const list &seedList, int aux)
 
list f_getTheSeeds ()
 
list f_getTheTableSeeds (int index)
 
void f1_saveEngineStatus ()
 
void f2_saveEngineStatus (const char *filename)
 
void f1_restoreEngineStatus ()
 
void f2_restoreEngineStatus (const char *filename)
 
int f1_RandBit_shootBit ()
 
double f1_RandGaussQ_shoot ()
 
double f2_RandGaussQ_shoot (double mean, double stdDev)
 
double f_G4UniformRand ()
 

Function Documentation

int pyRandomize::f1_RandBit_shootBit ( )

Definition at line 147 of file pyRandomize.cc.

Referenced by export_Randomize().

148 {
149  return RandBit::shootBit();
150 }
double pyRandomize::f1_RandGaussQ_shoot ( )

Definition at line 153 of file pyRandomize.cc.

References G4INCL::DeJongSpin::shoot().

Referenced by export_Randomize().

154 {
155  return RandGaussQ::shoot();
156 }
ThreeVector shoot(const G4int Ap, const G4int Af)
void pyRandomize::f1_restoreEngineStatus ( )

Definition at line 136 of file pyRandomize.cc.

Referenced by export_Randomize().

137 {
138  HepRandom::restoreEngineStatus();
139 }
void pyRandomize::f1_saveEngineStatus ( )

Definition at line 125 of file pyRandomize.cc.

Referenced by export_Randomize().

126 {
127  HepRandom::saveEngineStatus();
128 }
void pyRandomize::f1_setTheSeed ( long  seed)

Definition at line 46 of file pyRandomize.cc.

Referenced by export_Randomize().

47 {
48  HepRandom::setTheSeed(seed);
49 }
void pyRandomize::f1_setTheSeeds ( const list &  seedList)

Definition at line 57 of file pyRandomize.cc.

Referenced by export_Randomize().

58 {
59  // check size...
60  int idx=0;
61  while(1) {
62  long val= extract<long>(seedList[idx]);
63  if(val==0) break;
64  idx++;
65  }
66  int nsize= idx+1;
67 
68  long* seedArray= new long[nsize]; // should not be deleted!!
69  // (this is a problem with CLHEP.)
70  for (int i=0; i< nsize; i++) {
71  seedArray[i]= extract<long>(seedList[i]);
72  }
73 
74  HepRandom::setTheSeeds(seedArray);
75 }
double pyRandomize::f2_RandGaussQ_shoot ( double  mean,
double  stdDev 
)

Definition at line 158 of file pyRandomize.cc.

References G4INCL::DeJongSpin::shoot().

Referenced by export_Randomize().

159 {
160  return RandGaussQ::shoot(mean, stdDev);
161 }
ThreeVector shoot(const G4int Ap, const G4int Af)
void pyRandomize::f2_restoreEngineStatus ( const char *  filename)

Definition at line 141 of file pyRandomize.cc.

Referenced by export_Randomize().

142 {
143  HepRandom::restoreEngineStatus(filename);
144 }
void pyRandomize::f2_saveEngineStatus ( const char *  filename)

Definition at line 130 of file pyRandomize.cc.

Referenced by export_Randomize().

131 {
132  HepRandom::saveEngineStatus(filename);
133 }
void pyRandomize::f2_setTheSeed ( long  seed,
int  lux 
)

Definition at line 51 of file pyRandomize.cc.

Referenced by export_Randomize().

52 {
53  HepRandom::setTheSeed(seed, lux);
54 }
void pyRandomize::f2_setTheSeeds ( const list &  seedList,
int  aux 
)

Definition at line 77 of file pyRandomize.cc.

Referenced by export_Randomize().

78 {
79  // check size...
80  int idx=0;
81  while(1) {
82  long val= extract<long>(seedList[idx]);
83  if(val==0) break;
84  idx++;
85  }
86  int nsize= idx+1;
87 
88  long* seedArray= new long[nsize];
89  for (int i=0; i< nsize; i++) {
90  seedArray[i]= extract<long>(seedList[i]);
91  }
92 
93  HepRandom::setTheSeeds(seedArray, aux);
94 }
double pyRandomize::f_G4UniformRand ( )

Definition at line 165 of file pyRandomize.cc.

References G4UniformRand.

Referenced by export_Randomize().

166 {
167  return G4UniformRand();
168 }
#define G4UniformRand()
Definition: Randomize.hh:87
list pyRandomize::f_getTheSeeds ( )

Definition at line 97 of file pyRandomize.cc.

Referenced by export_Randomize().

98 {
99  list seedList;
100  const long* seeds= HepRandom::getTheSeeds();
101  int idx=0;
102  while(1) {
103  if( seeds[idx]==0) break;
104  seedList.append(seeds[idx]);
105  idx++;
106  }
107  return seedList;
108 }
list pyRandomize::f_getTheTableSeeds ( int  index)

Definition at line 111 of file pyRandomize.cc.

Referenced by export_Randomize().

112 {
113  long seedPair[2];
114  HepRandom::getTheTableSeeds(seedPair, index);
115 
116  list seedList;
117  seedList.append(seedPair[0]);
118  seedList.append(seedPair[1]);
119 
120  return seedList;
121 }