Import Geant4 11.3.1 source tree
This commit is contained in:
+28
@@ -102,6 +102,34 @@ void RandFlat::fireArray( const int size, double* vect,
|
||||
vect[i] = fire( lx, dx );
|
||||
}
|
||||
|
||||
void RandFlat::shootBits() {
|
||||
const double factor= 2.0*MSB; // this should fit into a double!
|
||||
staticFirstUnusedBit= MSB;
|
||||
staticRandomInt= (unsigned long)(factor*shoot());
|
||||
}
|
||||
|
||||
int RandFlat::shootBit() {
|
||||
if (staticFirstUnusedBit==0)
|
||||
shootBits();
|
||||
unsigned long temp= staticFirstUnusedBit&staticRandomInt;
|
||||
staticFirstUnusedBit>>= 1;
|
||||
return temp!=0;
|
||||
}
|
||||
|
||||
void RandFlat::shootBits(HepRandomEngine* engine) {
|
||||
const double factor= 2.0*MSB; // this should fit into a double!
|
||||
staticFirstUnusedBit= MSB;
|
||||
staticRandomInt= (unsigned long)(factor*shoot(engine));
|
||||
}
|
||||
|
||||
int RandFlat::shootBit(HepRandomEngine* engine) {
|
||||
if (staticFirstUnusedBit==0)
|
||||
shootBits(engine);
|
||||
unsigned long temp= staticFirstUnusedBit&staticRandomInt;
|
||||
staticFirstUnusedBit>>= 1;
|
||||
return temp!=0;
|
||||
}
|
||||
|
||||
void RandFlat::saveEngineStatus ( const char filename[] ) {
|
||||
|
||||
// First save the engine status just like the base class would do:
|
||||
|
||||
Reference in New Issue
Block a user