Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 ()
 

Detailed Description

Definition at line 44 of file G4ParticleHPWattSpectrum.hh.

Constructor & Destructor Documentation

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 ( )
inline

Definition at line 51 of file G4ParticleHPWattSpectrum.hh.

52  {
53  }

Member Function Documentation

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:

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 constexpr double eV

Here is the call graph for this function:

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;
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  }
G4double G4ParticleHPJENDLHEData::G4double result
std::vector< ExP01TrackerHit * > a
Definition: ExP01Classes.hh:33
int G4int
Definition: G4Types.hh:78
tuple b
Definition: test.py:12
#define G4UniformRand()
Definition: Randomize.hh:97
G4GLOB_DLL std::ostream G4cout
static constexpr double eV
Definition: G4SIunits.hh:215
G4double GetY(G4double x)
G4double G4Log(G4double x)
Definition: G4Log.hh:230
T max(const T t1, const T t2)
brief Return the largest of the two arguments
#define G4endl
Definition: G4ios.hh:61
double G4double
Definition: G4Types.hh:76

Here is the call graph for this function:


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