LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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 146 of file pyRandomize.cc.

Referenced by export_Randomize().

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

Definition at line 152 of file pyRandomize.cc.

Referenced by export_Randomize().

153 {
154  return RandGaussQ::shoot();
155 }
void pyRandomize::f1_restoreEngineStatus ( )

Definition at line 135 of file pyRandomize.cc.

Referenced by export_Randomize().

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

Definition at line 124 of file pyRandomize.cc.

Referenced by export_Randomize().

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

Definition at line 45 of file pyRandomize.cc.

Referenced by export_Randomize().

46 {
47  HepRandom::setTheSeed(seed);
48 }
long seed
Definition: chem4.cc:67
void pyRandomize::f1_setTheSeeds ( const list &  seedList)

Definition at line 56 of file pyRandomize.cc.

Referenced by export_Randomize().

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

Definition at line 157 of file pyRandomize.cc.

Referenced by export_Randomize().

158 {
159  return RandGaussQ::shoot(mean, stdDev);
160 }
double mean(const std::vector< short > &wf, size_t start, size_t nsample)
Definition: UtilFunc.cxx:13
void pyRandomize::f2_restoreEngineStatus ( const char *  filename)

Definition at line 140 of file pyRandomize.cc.

Referenced by export_Randomize().

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

Definition at line 129 of file pyRandomize.cc.

Referenced by export_Randomize().

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

Definition at line 50 of file pyRandomize.cc.

Referenced by export_Randomize().

51 {
52  HepRandom::setTheSeed(seed, lux);
53 }
long seed
Definition: chem4.cc:67
void pyRandomize::f2_setTheSeeds ( const list &  seedList,
int  aux 
)

Definition at line 76 of file pyRandomize.cc.

Referenced by export_Randomize().

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

Definition at line 164 of file pyRandomize.cc.

Referenced by export_Randomize().

165 {
166  return G4UniformRand();
167 }
list pyRandomize::f_getTheSeeds ( )

Definition at line 96 of file pyRandomize.cc.

References tca::seeds.

Referenced by export_Randomize().

97 {
98  list seedList;
99  const long* seeds= HepRandom::getTheSeeds();
100  int idx=0;
101  while(1) {
102  if( seeds[idx]==0) break;
103  seedList.append(seeds[idx]);
104  idx++;
105  }
106  return seedList;
107 }
std::vector< TrajPoint > seeds
Definition: DataStructs.cxx:14
list pyRandomize::f_getTheTableSeeds ( int  index)

Definition at line 110 of file pyRandomize.cc.

Referenced by export_Randomize().

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