ECCE @ EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4FPYSamplingOps Class Reference

#include <geant4/tree/geant4-10.6-release/source/processes/hadronic/models/particle_hp/include/G4FPYSamplingOps.hh>

+ Collaboration diagram for G4FPYSamplingOps:

Public Member Functions

 G4FPYSamplingOps (void)
 
 G4FPYSamplingOps (G4int Verbosity)
 
G4int G4SampleIntegerGaussian (G4double Mean, G4double StdDev)
 
G4int G4SampleIntegerGaussian (G4double Mean, G4double StdDev, G4FFGEnumerations::GaussianRange Range)
 
G4double G4SampleGaussian (G4double Mean, G4double StdDev)
 
G4double G4SampleGaussian (G4double Mean, G4double StdDev, G4FFGEnumerations::GaussianRange Range)
 
G4double G4SampleUniform (void)
 
G4double G4SampleUniform (G4double Lower, G4double Upper)
 
G4double G4SampleWatt (G4int WhatIsotope, G4FFGEnumerations::FissionCause WhatCause, G4double WhatEnergy)
 
void G4SetVerbosity (G4int WhatVerbosity)
 
 ~G4FPYSamplingOps (void)
 

Protected Member Functions

void Initialize (void)
 
G4bool CheckAndSetParameters (void)
 
void EvaluateWattConstants (void)
 
G4double SampleGaussian (void)
 
void ShiftParameters (G4FFGEnumerations::GaussianReturnType Type)
 

Protected Attributes

G4double Mean_
 
G4double StdDev_
 
G4ShiftedGaussianShiftedGaussianValues_
 
G4int Verbosity_
 
WattSpectrumConstantsWattConstants_
 
CLHEP::HepRandomEngineRandomEngine_
 
G4bool NextGaussianIsStoredInMemory_
 
G4double GaussianOne_
 
G4double GaussianTwo_
 
G4double Tolerance_
 

Detailed Description

G4FPYSamplingOps performs all the uniform and Gaussian distribution sampling operations

Definition at line 52 of file G4FPYSamplingOps.hh.

View newest version in sPHENIX GitHub at line 52 of file G4FPYSamplingOps.hh

Constructor & Destructor Documentation

G4FPYSamplingOps::G4FPYSamplingOps ( void  )

Default constructor

  • Usage: No arguments required
  • Notes:

Definition at line 49 of file G4FPYSamplingOps.cc.

View newest version in sPHENIX GitHub at line 49 of file G4FPYSamplingOps.cc

References Initialize(), G4FFGDefaultValues::Verbosity, and Verbosity_.

+ Here is the call graph for this function:

G4FPYSamplingOps::G4FPYSamplingOps ( G4int  Verbosity)

Overloaded constructor

  • Usage:
    • Verbosity: Verbosity level
  • Notes:

Definition at line 59 of file G4FPYSamplingOps.cc.

View newest version in sPHENIX GitHub at line 59 of file G4FPYSamplingOps.cc

References Initialize(), and Verbosity_.

+ Here is the call graph for this function:

G4FPYSamplingOps::~G4FPYSamplingOps ( void  )

Default deconstructor.

Definition at line 678 of file G4FPYSamplingOps.cc.

View newest version in sPHENIX GitHub at line 678 of file G4FPYSamplingOps.cc

References G4FFG_FUNCTIONENTER__, G4FFG_FUNCTIONLEAVE__, ShiftedGaussianValues_, and WattConstants_.

Member Function Documentation

G4bool G4FPYSamplingOps::CheckAndSetParameters ( void  )
protected

Check to see if the user requested parameters have already been calculated. If they have, it recalls the stored parameters and sets them as the current values.

Definition at line 341 of file G4FPYSamplingOps.cc.

View newest version in sPHENIX GitHub at line 341 of file G4FPYSamplingOps.cc

References FALSE, G4FFG_SAMPLING_FUNCTIONENTER__, G4FFG_SAMPLING_FUNCTIONLEAVE__, G4ShiftedGaussian::G4FindShiftedMean(), Mean_, ShiftedGaussianValues_, StdDev_, and TRUE.

Referenced by ShiftParameters().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G4FPYSamplingOps::EvaluateWattConstants ( void  )
protected

Evaluates the constants that are required for the Watt fission spectrum sampling.

Definition at line 359 of file G4FPYSamplingOps.cc.

View newest version in sPHENIX GitHub at line 359 of file G4FPYSamplingOps.cc

References A(), WattSpectrumConstants::B, WattSpectrumConstants::Cause, WattSpectrumConstants::Energy, G4Exception(), G4FFG_SAMPLING_FUNCTIONENTER__, G4FFG_SAMPLING_FUNCTIONLEAVE__, G4FFGEnumerations::GAMMA_INDUCED, G4Pow::GetInstance(), IncidentEnergyBins, JustWarning, WattSpectrumConstants::L, WattSpectrumConstants::M, CLHEP::MeV, G4FFGEnumerations::NEUTRON_INDUCED, NeutronInducedWattConstants, NeutronInducedWattIsotopesIndex, G4Pow::powA(), WattSpectrumConstants::Product, G4FFGEnumerations::PROTON_INDUCED, RunMustBeAborted, G4FFGEnumerations::SPONTANEOUS, SpontaneousWattConstants, SpontaneousWattIsotopesIndex, G4FFGDefaultValues::ThermalNeutronEnergy, and WattConstants_.

Referenced by G4SampleWatt().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G4double G4FPYSamplingOps::G4SampleGaussian ( G4double  Mean,
G4double  StdDev 
)

Returns a double value taken from a Gaussian distribution about Mean and with a standard deviation of StdDev.

  • Usage:
    • Mean: Mean about which the Gaussian distribution will be sampled
    • StdDev: Standard deviation of the Gaussian distribution. 68.3% of the values will lie within the first standard deviation, 95.4% within the second standard deviation, etc...
  • Notes:

Definition at line 92 of file G4FPYSamplingOps.cc.

View newest version in sPHENIX GitHub at line 92 of file G4FPYSamplingOps.cc

References FALSE, G4FFG_SAMPLING_FUNCTIONENTER__, G4FFG_SAMPLING_FUNCTIONLEAVE__, Mean_, NextGaussianIsStoredInMemory_, SampleGaussian(), StdDev_, and TRUE.

Referenced by G4FissionProductYieldDist::G4GetFission(), G4SampleGaussian(), and G4FissionProductYieldDist::SampleAlphaEnergies().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G4double G4FPYSamplingOps::G4SampleGaussian ( G4double  Mean,
G4double  StdDev,
G4FFGEnumerations::GaussianRange  Range 
)

Returns a double value taken from a Gaussian distribution about Mean and with a standard deviation of StdDev.

  • Usage:
    • Mean: Mean about which the Gaussian distribution will be sampled
    • StdDev: Standard deviation of the Gaussian distribution. 68.3% of the values will lie within the first standard deviation, 95.4% within the second standard deviation, etc...
    • Range: POSITIVE or ALL
  • Notes:

Definition at line 115 of file G4FPYSamplingOps.cc.

View newest version in sPHENIX GitHub at line 115 of file G4FPYSamplingOps.cc

References G4FFGEnumerations::ALL, G4FFGEnumerations::DOUBLE, G4Exception(), G4FFG_SAMPLING_FUNCTIONENTER__, G4FFG_SAMPLING_FUNCTIONLEAVE__, G4SampleGaussian(), JustWarning, Mean_, SampleGaussian(), ShiftParameters(), StdDev_, and TRUE.

+ Here is the call graph for this function:

G4int G4FPYSamplingOps::G4SampleIntegerGaussian ( G4double  Mean,
G4double  StdDev 
)

Returns an integer value taken from a Gaussian distribution. This overloaded version assumes that the range is not restricted to positive values only.

  • Usage:
    • Mean: Mean about which the Gaussian distribution will be sampled
    • StdDev: Standard deviation of the Gaussian distribution. 68.3% of the values will lie within the first standard deviation, 95.4% within the second standard deviation, etc...
  • Notes:

Definition at line 168 of file G4FPYSamplingOps.cc.

View newest version in sPHENIX GitHub at line 168 of file G4FPYSamplingOps.cc

References FALSE, G4FFG_SAMPLING_FUNCTIONENTER__, G4FFG_SAMPLING_FUNCTIONLEAVE__, Mean_, NextGaussianIsStoredInMemory_, SampleGaussian(), StdDev_, and TRUE.

Referenced by G4SampleIntegerGaussian(), G4FissionProductYieldDist::GenerateAlphas(), and G4FissionProductYieldDist::GenerateNeutrons().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G4int G4FPYSamplingOps::G4SampleIntegerGaussian ( G4double  Mean,
G4double  StdDev,
G4FFGEnumerations::GaussianRange  Range 
)

Returns an integer value taken from a Gaussian distribution about Mean and with a standard deviation of StdDev.

  • Usage:
    • Mean: Mean about which the Gaussian distribution will be sampled
    • StdDev: Standard deviation of the Gaussian distribution. 68.3% of the values will lie within the first standard deviation, 95.4% within the second standard deviation, etc...
    • Range: POSITIVE or ALL
  • Notes:

Definition at line 192 of file G4FPYSamplingOps.cc.

View newest version in sPHENIX GitHub at line 192 of file G4FPYSamplingOps.cc

References G4FFGEnumerations::ALL, G4FFG_SAMPLING_FUNCTIONENTER__, G4FFG_SAMPLING_FUNCTIONLEAVE__, G4SampleIntegerGaussian(), G4FFGEnumerations::INT, Mean_, SampleGaussian(), ShiftParameters(), StdDev_, and TRUE.

+ Here is the call graph for this function:

G4double G4FPYSamplingOps::G4SampleUniform ( void  )

Returns a double value evenly distributed in the range (0, 1].

  • Usage: No arguments required
  • Notes:

Definition at line 257 of file G4FPYSamplingOps.cc.

View newest version in sPHENIX GitHub at line 257 of file G4FPYSamplingOps.cc

References CLHEP::HepRandomEngine::flat(), G4FFG_SAMPLING_FUNCTIONENTER__, G4FFG_SAMPLING_FUNCTIONLEAVE__, and RandomEngine_.

Referenced by G4FissionProductYieldDist::G4GetFission(), G4FissionProductYieldDist::G4GetFissionProduct(), G4SampleUniform(), G4SampleWatt(), G4FissionProductYieldDist::GenerateAlphas(), G4FPYNormalFragmentDist::GetFissionProduct(), G4FPYBiasedLightFragmentDist::GetFissionProduct(), and SampleGaussian().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

G4double G4FPYSamplingOps::G4SampleUniform ( G4double  Lower,
G4double  Upper 
)

Returns a double value evenly distributed in the range (Lower, Upper].

  • Usage:
    • Lower: Lower bounds of the distribution
    • Upper: Upper bounds of the distribution
  • Notes:

Definition at line 268 of file G4FPYSamplingOps.cc.

View newest version in sPHENIX GitHub at line 268 of file G4FPYSamplingOps.cc

References G4FFG_SAMPLING_FUNCTIONENTER__, G4FFG_SAMPLING_FUNCTIONLEAVE__, and G4SampleUniform().

+ Here is the call graph for this function:

G4double G4FPYSamplingOps::G4SampleWatt ( G4int  WhatIsotope,
G4FFGEnumerations::FissionCause  WhatCause,
G4double  WhatEnergy 
)

Samples the Watt fission spectrum for the selected isotope, using an algorithm adopted from Ref. 1

  • Usage:
    • WhatIsotope: The isotope that is to be sampled
    • WhatCause: The cause of the isotope to be sampled
    • WhatEnergy: The energy, in MeV of the incident particle
  • Notes:
    • All variables needed for this function are grouped together in WattConstants_.

Definition at line 284 of file G4FPYSamplingOps.cc.

View newest version in sPHENIX GitHub at line 284 of file G4FPYSamplingOps.cc

References WattSpectrumConstants::B, WattSpectrumConstants::Cause, WattSpectrumConstants::Energy, EvaluateWattConstants(), G4cout, G4endl, G4FFG_SAMPLING_FUNCTIONENTER__, G4FFG_SAMPLING_FUNCTIONLEAVE__, G4Log(), G4SampleUniform(), G4Pow::GetInstance(), WattSpectrumConstants::L, WattSpectrumConstants::M, WattSpectrumConstants::Product, WattConstants_, X, and Y.

Referenced by G4FissionProductYieldDist::SampleNeutronEnergies().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G4FPYSamplingOps::G4SetVerbosity ( G4int  WhatVerbosity)

Sets the verbosity levels

  • Usage:
    • WhichVerbosity: Combination of levels
  • Notes:
    • SILENT: All verbose output is repressed
    • UPDATES: Only high-level internal changes are reported
    • DAUGHTER_INFO: Displays information about daughter product sampling
    • NEUTRON_INFO: Displays information about neutron sampling
    • GAMMA_INFO: Displays information about gamma sampling
    • ALPHA_INFO: Displays information about alpha sampling
    • MOMENTUM_INFO: Displays information about momentum balancing
    • EXTRAPOLATION_INTERPOLATION_INFO: Displays information about any data extrapolation or interpolation that occurs
    • DEBUG: Reports program flow as it steps through functions
    • PRINT_ALL: Displays any and all output

Definition at line 329 of file G4FPYSamplingOps.cc.

View newest version in sPHENIX GitHub at line 329 of file G4FPYSamplingOps.cc

References G4FFG_SAMPLING_FUNCTIONENTER__, G4FFG_SAMPLING_FUNCTIONLEAVE__, G4ShiftedGaussian::G4SetVerbosity(), ShiftedGaussianValues_, and Verbosity_.

Referenced by G4FissionProductYieldDist::G4SetVerbosity().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G4FPYSamplingOps::Initialize ( void  )
protected

Initialize is a common function called by all constructors.

Definition at line 69 of file G4FPYSamplingOps.cc.

View newest version in sPHENIX GitHub at line 69 of file G4FPYSamplingOps.cc

References FALSE, G4FFG_FUNCTIONENTER__, G4FFG_FUNCTIONLEAVE__, GaussianOne_, GaussianTwo_, Mean_, NextGaussianIsStoredInMemory_, WattSpectrumConstants::Product, RandomEngine_, ShiftedGaussianValues_, StdDev_, Tolerance_, and WattConstants_.

Referenced by G4FPYSamplingOps().

+ Here is the caller graph for this function:

G4double G4FPYSamplingOps::SampleGaussian ( void  )
protected

Samples a Gaussian distribution defined by the internal class variables NewMean_ and NewStdDev_.

Definition at line 490 of file G4FPYSamplingOps.cc.

View newest version in sPHENIX GitHub at line 490 of file G4FPYSamplingOps.cc

References FALSE, G4FFG_SAMPLING_FUNCTIONENTER__, G4FFG_SAMPLING_FUNCTIONLEAVE__, G4Log(), G4SampleUniform(), GaussianOne_, GaussianTwo_, Mean_, NextGaussianIsStoredInMemory_, StdDev_, and TRUE.

Referenced by G4SampleGaussian(), and G4SampleIntegerGaussian().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void G4FPYSamplingOps::ShiftParameters ( G4FFGEnumerations::GaussianReturnType  Type)
protected

Sets the mean and standard deviation of the Gaussian distribution sampled by this class when POSITIVE values are requested. ShiftMean() performs two different operations based on the requested data type.

  • INTEGER: Iteratively searches for an adjusted mean that produces the same result as the mean requested by the implementor. In this instance the standard deviation is not adjusted.
  • DOUBLE: Adjusts the standard deviation of the Gaussian distribution so that the first seven standard deviations occur are all positive. The chance that a negative value will result using this method is 2.56E-12

Definition at line 527 of file G4FPYSamplingOps.cc.

View newest version in sPHENIX GitHub at line 527 of file G4FPYSamplingOps.cc

References CheckAndSetParameters(), Delta, CLHEP::HepStat::erf(), FALSE, G4cout, G4endl, G4FFG_SAMPLING_FUNCTIONENTER__, G4FFG_SAMPLING_FUNCTIONLEAVE__, G4ShiftedGaussian::G4InsertShiftedMean(), G4FFGEnumerations::INT, Mean_, NextGaussianIsStoredInMemory_, ShiftedGaussianValues_, StdDev_, Tolerance_, and TRUE.

Referenced by G4SampleGaussian(), and G4SampleIntegerGaussian().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

G4double G4FPYSamplingOps::GaussianOne_
protected

Contains the first of the two paired random numbers from the Gaussian distribution sampling.

Definition at line 203 of file G4FPYSamplingOps.hh.

View newest version in sPHENIX GitHub at line 203 of file G4FPYSamplingOps.hh

Referenced by Initialize(), and SampleGaussian().

G4double G4FPYSamplingOps::GaussianTwo_
protected

Contains the second of the two paired random numbers from the Gaussian distribution sampling.

Definition at line 207 of file G4FPYSamplingOps.hh.

View newest version in sPHENIX GitHub at line 207 of file G4FPYSamplingOps.hh

Referenced by Initialize(), and SampleGaussian().

G4double G4FPYSamplingOps::Mean_
protected

Mean for sampling a Gaussian distribution

Definition at line 177 of file G4FPYSamplingOps.hh.

View newest version in sPHENIX GitHub at line 177 of file G4FPYSamplingOps.hh

Referenced by CheckAndSetParameters(), G4SampleGaussian(), G4SampleIntegerGaussian(), Initialize(), SampleGaussian(), and ShiftParameters().

G4bool G4FPYSamplingOps::NextGaussianIsStoredInMemory_
protected

Declares whether the second paired random number has been already returned.

Definition at line 199 of file G4FPYSamplingOps.hh.

View newest version in sPHENIX GitHub at line 199 of file G4FPYSamplingOps.hh

Referenced by G4SampleGaussian(), G4SampleIntegerGaussian(), Initialize(), SampleGaussian(), and ShiftParameters().

CLHEP::HepRandomEngine* G4FPYSamplingOps::RandomEngine_
protected

Pointer to the CLHEP random number generator.

Definition at line 193 of file G4FPYSamplingOps.hh.

View newest version in sPHENIX GitHub at line 193 of file G4FPYSamplingOps.hh

Referenced by G4SampleUniform(), and Initialize().

G4ShiftedGaussian* G4FPYSamplingOps::ShiftedGaussianValues_
protected

Structure chain that contains the all the previous values used for sampling a Gaussian distribution

Definition at line 183 of file G4FPYSamplingOps.hh.

View newest version in sPHENIX GitHub at line 183 of file G4FPYSamplingOps.hh

Referenced by CheckAndSetParameters(), G4SetVerbosity(), Initialize(), ShiftParameters(), and ~G4FPYSamplingOps().

G4double G4FPYSamplingOps::StdDev_
protected

Standard deviation for sampling a GaussianDistribution

Definition at line 179 of file G4FPYSamplingOps.hh.

View newest version in sPHENIX GitHub at line 179 of file G4FPYSamplingOps.hh

Referenced by CheckAndSetParameters(), G4SampleGaussian(), G4SampleIntegerGaussian(), Initialize(), SampleGaussian(), and ShiftParameters().

G4double G4FPYSamplingOps::Tolerance_
protected

Defines the tolerance that ShiftParameters() must match.

Definition at line 209 of file G4FPYSamplingOps.hh.

View newest version in sPHENIX GitHub at line 209 of file G4FPYSamplingOps.hh

Referenced by Initialize(), and ShiftParameters().

G4int G4FPYSamplingOps::Verbosity_
protected

Verbosity level

Definition at line 185 of file G4FPYSamplingOps.hh.

View newest version in sPHENIX GitHub at line 185 of file G4FPYSamplingOps.hh

Referenced by G4FPYSamplingOps(), and G4SetVerbosity().

WattSpectrumConstants* G4FPYSamplingOps::WattConstants_
protected

Structure that contains the values for sampling the Watt fission spectrum

Definition at line 189 of file G4FPYSamplingOps.hh.

View newest version in sPHENIX GitHub at line 189 of file G4FPYSamplingOps.hh

Referenced by EvaluateWattConstants(), G4SampleWatt(), Initialize(), and ~G4FPYSamplingOps().


The documentation for this class was generated from the following files: