Import Geant4 11.3.1 source tree

This commit is contained in:
Gabriele Cosmo
2025-03-24 16:45:22 +01:00
parent 32390e802b
commit df176550b3
388 changed files with 29491 additions and 29435 deletions
+28
View File
@@ -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: