Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ShiftedGaussian Class Reference

#include <G4ShiftedGaussian.hh>

Public Member Functions

 G4ShiftedGaussian ()
 
 G4ShiftedGaussian (G4int Verbosity)
 
G4double G4FindShiftedMean (G4double RequestedMean, G4double RequestedStdDev)
 
void G4InsertShiftedMean (G4double ShiftedMean, G4double RequestedMean, G4double RequestedStdDev)
 
void G4SetVerbosity (G4int WhatVerbosity)
 
 ~G4ShiftedGaussian ()
 

Protected Member Functions

void Initialize ()
 

Protected Attributes

std::vector< std::pair< std::pair< G4double, G4double >, G4double > > ShiftedMean_
 
G4int Verbosity_
 

Detailed Description

G4ShiftedGaussian is a class for storing the shifted values used for sampling a Gaussian distribution and returning only positive values; it is integrated into G4FPYSamplingOps

Definition at line 45 of file G4ShiftedGaussian.hh.

Constructor & Destructor Documentation

◆ G4ShiftedGaussian() [1/2]

G4ShiftedGaussian::G4ShiftedGaussian ( )

Default constructor

  • Usage: No arguments required
  • Notes:

Definition at line 41 of file G4ShiftedGaussian.cc.

42{
43 // Set the default verbosity
44 Verbosity_ = G4FFGDefaultValues::Verbosity;
45
46 // Initialize the class
47 Initialize();
48}

◆ G4ShiftedGaussian() [2/2]

G4ShiftedGaussian::G4ShiftedGaussian ( G4int Verbosity)

Overloaded constructor

  • Usage:
    • Verbosity: Verbosity level
  • Notes:

Definition at line 50 of file G4ShiftedGaussian.cc.

51{
52 // Set the default verbosity
54
55 // Initialize the class
56 Initialize();
57}

◆ ~G4ShiftedGaussian()

G4ShiftedGaussian::~G4ShiftedGaussian ( )

Default deconstructor.

Definition at line 105 of file G4ShiftedGaussian.cc.

106{
108
109 // Nothing here!
111}
#define G4FFG_FUNCTIONLEAVE__
#define G4FFG_FUNCTIONENTER__

Member Function Documentation

◆ G4FindShiftedMean()

G4double G4ShiftedGaussian::G4FindShiftedMean ( G4double RequestedMean,
G4double RequestedStdDev )

Returns the shifted mean that correlates to a RequestedMean and RequestedStdDev pair. 0 is returned if there is no associated value.

Definition at line 65 of file G4ShiftedGaussian.cc.

66{
68
69 std::size_t VectorSize = ShiftedMean_.size();
70
71 for (std::size_t i = 0; i < VectorSize; ++i) {
72 if (ShiftedMean_[i].first.first == RequestedMean) {
73 if (ShiftedMean_[i].first.second == RequestedStdDev) {
75 return ShiftedMean_[i].second;
76 }
77 }
78 }
79
81 return 0.;
82}
#define G4FFG_SAMPLING_FUNCTIONENTER__
#define G4FFG_SAMPLING_FUNCTIONLEAVE__
std::vector< std::pair< std::pair< G4double, G4double >, G4double > > ShiftedMean_

Referenced by G4FPYSamplingOps::CheckAndSetParameters().

◆ G4InsertShiftedMean()

void G4ShiftedGaussian::G4InsertShiftedMean ( G4double ShiftedMean,
G4double RequestedMean,
G4double RequestedStdDev )

Inserts a ShiftedMean indexed by the RequestedMean and RequestedStdDev

Definition at line 84 of file G4ShiftedGaussian.cc.

86{
88
89 ShiftedMean_.push_back(
90 std::make_pair(std::make_pair(RequestedMean, RequestedStdDev), ShiftedMean));
91
93 return;
94}

Referenced by G4FPYSamplingOps::ShiftParameters().

◆ G4SetVerbosity()

void G4ShiftedGaussian::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 96 of file G4ShiftedGaussian.cc.

Referenced by G4FPYSamplingOps::G4SetVerbosity().

◆ Initialize()

void G4ShiftedGaussian::Initialize ( )
protected

Initialize is a common function called by all constructors.

Definition at line 59 of file G4ShiftedGaussian.cc.

60
61 // Nothing here
62

Referenced by G4ShiftedGaussian(), and G4ShiftedGaussian().

Member Data Documentation

◆ ShiftedMean_

std::vector<std::pair<std::pair<G4double, G4double>, G4double> > G4ShiftedGaussian::ShiftedMean_
protected

Contains the adjusted mean of the POSITIVE only Gaussian distribution associated with a RequestedMean and RequestedStdDev pair.

Definition at line 99 of file G4ShiftedGaussian.hh.

Referenced by G4FindShiftedMean(), and G4InsertShiftedMean().

◆ Verbosity_

G4int G4ShiftedGaussian::Verbosity_
protected

Verbosity level

Definition at line 101 of file G4ShiftedGaussian.hh.

Referenced by G4SetVerbosity(), G4ShiftedGaussian(), and G4ShiftedGaussian().


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