29 #ifdef G4MULTITHREADED
40 : deleteEngine(false),
42 InterpolationType(IntType)
45 prepareTable(aProbFunc);
52 : localEngine(&anEngine),
55 InterpolationType(IntType)
57 prepareTable(aProbFunc);
64 : localEngine(anEngine),
67 InterpolationType(IntType)
69 prepareTable(aProbFunc);
79 "G4MTRandGeneral constructed with no bins - will use flat distribution\n";
89 for ( ptn = 0; ptn<
nBins; ++ptn ) {
90 weight = aProbFunc[ptn];
95 "G4MTRandGeneral constructed with negative-weight bin " << ptn <<
96 " = " << weight <<
" \n -- will substitute 0 weight \n";
105 "G4MTRandGeneral constructed nothing in bins - will use flat distribution\n";
110 for ( ptn = 0; ptn < nBins+1; ++ptn ) {
123 <<
"\n Will use type 0 (continuous linear interpolation \n";
124 InterpolationType = 0;
167 while (nabove > nbelow+1) {
168 middle = (nabove + nbelow+1)>>1;
191 if ( binMeasure == 0 ) {
198 G4double binFraction = (rand - theIntegralPdf[nbelow]) / binMeasure;
209 for (
G4int i=0; i<size; ++i)
210 vect[i] =
shoot(anEngine);
215 for (
G4int i=0; i<size; ++i)
static CLHEP::HepRandomEngine * getTheEngine()
void shootArray(const G4int size, G4double *vect)
G4double mapRandom(G4double rand) const
void fireArray(const G4int size, G4double *vect)
CLHEP::HepRandomEngine * localEngine
std::vector< G4double > theIntegralPdf
G4MTRandGeneral(const G4double *aProbFunc, G4int theProbSize, G4int IntType=0)
void prepareTable(const G4double *aProbFunc)
virtual ~G4MTRandGeneral()
void useFlatDistribution()