Geant4  10.02.p03
G4ParticleHPWattSpectrum Class Reference

#include <G4ParticleHPWattSpectrum.hh>

Inheritance diagram for G4ParticleHPWattSpectrum:
Collaboration diagram for G4ParticleHPWattSpectrum:

Public Member Functions

 G4ParticleHPWattSpectrum ()
 
 ~G4ParticleHPWattSpectrum ()
 
void Init (std::istream &aDataFile)
 
G4double GetFractionalProbability (G4double anEnergy)
 
G4double Sample (G4double anEnergy)
 
- Public Member Functions inherited from G4VParticleHPEDis
 G4VParticleHPEDis ()
 
virtual ~G4VParticleHPEDis ()
 

Private Member Functions

G4double Watt (G4double anEnergy, G4double a, G4double b)
 

Private Attributes

G4double expm1
 
G4ParticleHPVector theFractionalProb
 
G4ParticleHPVector theApar
 
G4ParticleHPVector theBpar
 

Detailed Description

Definition at line 44 of file G4ParticleHPWattSpectrum.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPWattSpectrum()

G4ParticleHPWattSpectrum::G4ParticleHPWattSpectrum ( )
inline

Definition at line 47 of file G4ParticleHPWattSpectrum.hh.

48  {
49  expm1 = G4Exp(-1.);
50  }
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
Here is the call graph for this function:

◆ ~G4ParticleHPWattSpectrum()

G4ParticleHPWattSpectrum::~G4ParticleHPWattSpectrum ( )
inline

Definition at line 51 of file G4ParticleHPWattSpectrum.hh.

52  {
53  }

Member Function Documentation

◆ GetFractionalProbability()

G4double G4ParticleHPWattSpectrum::GetFractionalProbability ( G4double  anEnergy)
inlinevirtual

Implements G4VParticleHPEDis.

Definition at line 62 of file G4ParticleHPWattSpectrum.hh.

63  {
64  return theFractionalProb.GetY(anEnergy);
65  }
G4double GetY(G4double x)
Here is the call graph for this function:

◆ Init()

void G4ParticleHPWattSpectrum::Init ( std::istream &  aDataFile)
inlinevirtual

Implements G4VParticleHPEDis.

Definition at line 55 of file G4ParticleHPWattSpectrum.hh.

56  {
57  theFractionalProb.Init(aDataFile, CLHEP::eV);
58  theApar.Init(aDataFile, CLHEP::eV);
59  theBpar.Init(aDataFile, CLHEP::eV);
60  }
void Init(std::istream &aDataFile, G4int total, G4double ux=1., G4double uy=1.)
static const double eV
Here is the call graph for this function:

◆ Sample()

G4double G4ParticleHPWattSpectrum::Sample ( G4double  anEnergy)
virtual

Implements G4VParticleHPEDis.

Definition at line 35 of file G4ParticleHPWattSpectrum.cc.

36  {
37  G4double a = theApar.GetY(anEnergy)*eV;
38  G4double b = theBpar.GetY(anEnergy)/eV;
39  G4double result;
40  G4double random, cut, max;
41  max = std::sinh(std::sqrt(b*15.*a));
42 
43  G4int icounter=0;
44  G4int icounter_max=1024;
45  do
46  {
47  icounter++;
48  if ( icounter > icounter_max ) {
49  G4cout << "Loop-counter exceeded the threshold value at " << __LINE__ << "th line of " << __FILE__ << "." << G4endl;
50  break;
51  }
52  random = G4UniformRand();
53  result = -a*G4Log(random);
54  cut = G4UniformRand();
55  }
56  while(cut>std::sinh(std::sqrt(b*result))/max); // Loop checking, 11.05.2015, T. Koi
57  return result;
58  }
int G4int
Definition: G4Types.hh:78
#define G4UniformRand()
Definition: Randomize.hh:97
G4GLOB_DLL std::ostream G4cout
G4double GetY(G4double x)
G4double G4Log(G4double x)
Definition: G4Log.hh:230
static const double eV
Definition: G4SIunits.hh:212
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76
Here is the call graph for this function:
Here is the caller graph for this function:

◆ Watt()

G4double G4ParticleHPWattSpectrum::Watt ( G4double  anEnergy,
G4double  a,
G4double  b 
)
inlineprivate

Definition at line 71 of file G4ParticleHPWattSpectrum.hh.

72  {
73  G4double energy = anEnergy/CLHEP::eV;
74  G4double result = G4Exp(-energy/a)*std::sinh(std::sqrt(b*energy));
75  return result;
76  }
double energy
Definition: plottest35.C:25
G4double G4Exp(G4double initial_x)
Exponential Function double precision.
Definition: G4Exp.hh:183
double G4double
Definition: G4Types.hh:76
static const double eV
Here is the call graph for this function:

Member Data Documentation

◆ expm1

G4double G4ParticleHPWattSpectrum::expm1
private

Definition at line 80 of file G4ParticleHPWattSpectrum.hh.

◆ theApar

G4ParticleHPVector G4ParticleHPWattSpectrum::theApar
private

Definition at line 84 of file G4ParticleHPWattSpectrum.hh.

◆ theBpar

G4ParticleHPVector G4ParticleHPWattSpectrum::theBpar
private

Definition at line 85 of file G4ParticleHPWattSpectrum.hh.

◆ theFractionalProb

G4ParticleHPVector G4ParticleHPWattSpectrum::theFractionalProb
private

Definition at line 82 of file G4ParticleHPWattSpectrum.hh.


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