96 if(ParametersChanged ==
TRUE)
130 if(ParametersChanged ==
TRUE)
134 std::ostringstream Temp;
135 Temp <<
"Mean value of " << Mean <<
" out of range";
136 G4Exception(
"G4FPYGaussianOps::G4SampleIntegerGaussian()",
139 "A value of '0' will be used instead.");
172 if(ParametersChanged ==
TRUE)
205 std::ostringstream Temp;
217 if(Mean / StdDev < 2)
230 if(ParametersChanged ==
TRUE)
246 }
while (RandInt < 0);
271 G4double Difference = Upper - Lower;
356 G4int IsotopeIndex = 0;
361 for(
G4int i = 0; SpontaneousWattIsotopesIndex[i] != -1; i++)
363 if(SpontaneousWattIsotopesIndex[i] ==
373 A = SpontaneousWattConstants[IsotopeIndex][0];
378 for(
G4int i = 0; NeutronInducedWattIsotopesIndex[i] != -1; i++)
391 A = NeutronInducedWattConstants[IsotopeIndex][0][0];
396 "Incident neutron energy above 14 MeV requested.",
398 "Using Watt fission constants for 14 Mev.");
400 A = NeutronInducedWattConstants[IsotopeIndex][2][0];
404 G4int EnergyIndex = 0;
406 G4double RangeDifference, ConstantDifference;
408 for(
G4int i = 1; IncidentEnergyBins[i] != -1; i++)
414 if(EnergyDifference != 0)
416 std::ostringstream Temp;
417 Temp <<
"Incident neutron energy of ";
419 Temp <<
"explicitly listed in the data tables";
429 RangeDifference = IncidentEnergyBins[EnergyIndex] - IncidentEnergyBins[EnergyIndex - 1];
433 NeutronInducedWattConstants[IsotopeIndex][EnergyIndex][0] -
434 NeutronInducedWattConstants[IsotopeIndex]
435 [EnergyIndex - 1][0];
436 A = (EnergyDifference / RangeDifference) * ConstantDifference +
437 NeutronInducedWattConstants[IsotopeIndex]
438 [EnergyIndex - 1][0];
442 NeutronInducedWattConstants[IsotopeIndex][EnergyIndex][1] -
443 NeutronInducedWattConstants[IsotopeIndex]
444 [EnergyIndex - 1][1];
446 (EnergyDifference / RangeDifference) * ConstantDifference +
447 NeutronInducedWattConstants[IsotopeIndex]
448 [EnergyIndex - 1][1];
454 G4String Temp =
"Watt fission spectra data not available for ";
457 Temp +=
"proton induced fission.";
460 Temp +=
"gamma induced fission.";
463 Temp +=
"!Warning! unknown cause.";
468 "Fission events will not be sampled in this run.");
502 }
while (Radius > 1.0);
505 MappingFactor = std::sqrt(-2.0*std::log(Radius)/Radius) *
StdDev_;
546 G4double ErfContainer, AdjustedErfContainer, Container;
555 G4bool ToleranceCheck =
false;
570 AdjustedErfContainer = 0;
573 for(
G4int i = 0; i <= UpperLimit; i++)
576 LowErf = ((AdjMean - i) / Normalization);
577 HighErf = ((AdjMean - (i + 1.0)) / Normalization);
589 Container = (erf(HighErf) - erf(LowErf))/2.0;
591 }
else if (HighErf < 0)
599 Container = (erf(HighErf) + erf(LowErf))/2.0;
607 Container = (erf(LowErf) - erf(HighErf))/2.0;
612 ErfContainer += Container;
613 AdjustedErfContainer += Container * i;
617 Container = AdjustedErfContainer / ErfContainer;
621 if(ToleranceCheck ==
TRUE)
627 if(HalfDelta ==
TRUE)
633 if(Container >
Mean_)
G4double G4SampleGaussian(G4double Mean, G4double StdDev)
G4double SampleGaussian(void)
void EvaluateWattConstants(void)
G4double G4SampleWatt(G4int WhatIsotope, G4FFGEnumerations::FissionCause WhatCause, G4double WhatEnergy)
#define G4FFG_SAMPLING_FUNCTIONENTER__
G4double G4SampleUniform(void)
G4double G4FindShiftedMean(G4double RequestedMean, G4double RequestedStdDev)
G4FFGEnumerations::FissionCause Cause
G4ShiftedGaussian * ShiftedGaussianValues_
static HepRandomEngine * getTheEngine()
WattSpectrumConstants * WattConstants_
void G4SetVerbosity(G4int WhatVerbosity)
void G4InsertShiftedMean(G4double ShiftedMean, G4double RequestedMean, G4double RequestedStdDev)
void ShiftParameters(G4FFGEnumerations::GaussianReturnType Type)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
CLHEP::HepRandomEngine * RandomEngine_
#define G4FFG_FUNCTIONLEAVE__
static double erf(double x)
#define G4FFG_SAMPLING_FUNCTIONLEAVE__
void G4SetVerbosity(G4int WhatVerbosity)
G4bool CheckAndSetParameters(void)
#define G4FFG_FUNCTIONENTER__
G4bool NextGaussianIsStoredInMemory_
G4int G4SampleIntegerGaussian(G4double Mean, G4double StdDev)