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

#include <G4FermiChannels.hh>

Public Member Functions

 G4FermiChannels (size_t nmax, G4double ex, G4double gmass)
 
size_t GetNumberOfChannels () const
 
const std::vector< const G4FermiPair * > & GetChannels () const
 
const G4FermiPairGetPair (size_t idx) const
 
const G4FermiPairSamplePair (G4double rand) const
 
void AddChannel (const G4FermiPair *)
 
std::vector< G4double > & GetProbabilities ()
 
G4double GetExcitation () const
 
G4double GetMass () const
 

Detailed Description

Definition at line 39 of file G4FermiChannels.hh.

Constructor & Destructor Documentation

◆ G4FermiChannels()

G4FermiChannels::G4FermiChannels ( size_t  nmax,
G4double  ex,
G4double  gmass 
)
inlineexplicit

Definition at line 43 of file G4FermiChannels.hh.

44 : nch(0), excitation(ex), ground_mass(gmass)
45 { fvect.reserve(nmax); cum_prob.reserve(nmax); };

Member Function Documentation

◆ AddChannel()

void G4FermiChannels::AddChannel ( const G4FermiPair ptr)
inline

Definition at line 97 of file G4FermiChannels.hh.

98{
99 fvect.push_back(ptr);
100 cum_prob.push_back(1.0);
101 ++nch;
102}

◆ GetChannels()

const std::vector< const G4FermiPair * > & G4FermiChannels::GetChannels ( ) const
inline

Definition at line 78 of file G4FermiChannels.hh.

79{
80 return fvect;
81}

◆ GetExcitation()

G4double G4FermiChannels::GetExcitation ( ) const
inline

Definition at line 109 of file G4FermiChannels.hh.

110{
111 return excitation;
112}

◆ GetMass()

G4double G4FermiChannels::GetMass ( ) const
inline

Definition at line 114 of file G4FermiChannels.hh.

115{
116 return excitation + ground_mass;
117}

◆ GetNumberOfChannels()

size_t G4FermiChannels::GetNumberOfChannels ( ) const
inline

Definition at line 73 of file G4FermiChannels.hh.

74{
75 return nch;
76}

◆ GetPair()

const G4FermiPair * G4FermiChannels::GetPair ( size_t  idx) const
inline

Definition at line 83 of file G4FermiChannels.hh.

84{
85 return (idx < nch) ? fvect[idx] : nullptr;
86}

◆ GetProbabilities()

std::vector< G4double > & G4FermiChannels::GetProbabilities ( )
inline

Definition at line 104 of file G4FermiChannels.hh.

105{
106 return cum_prob;
107}

◆ SamplePair()

const G4FermiPair * G4FermiChannels::SamplePair ( G4double  rand) const
inline

Definition at line 88 of file G4FermiChannels.hh.

89{
90 const G4FermiPair* ptr = nullptr;
91 for(size_t i=0; i<nch; ++i) {
92 if(rand <= cum_prob[i]) { ptr = fvect[i]; break; }
93 }
94 return ptr;
95}

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