Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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 40 of file G4FermiChannels.hh.

Constructor & Destructor Documentation

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

Definition at line 44 of file G4FermiChannels.hh.

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

Member Function Documentation

void G4FermiChannels::AddChannel ( const G4FermiPair ptr)
inline

Definition at line 98 of file G4FermiChannels.hh.

99 {
100  fvect.push_back(ptr);
101  cum_prob.push_back(1.0);
102  ++nch;
103 }
const std::vector< const G4FermiPair * > & G4FermiChannels::GetChannels ( ) const
inline

Definition at line 79 of file G4FermiChannels.hh.

80 {
81  return fvect;
82 }
G4double G4FermiChannels::GetExcitation ( ) const
inline

Definition at line 110 of file G4FermiChannels.hh.

111 {
112  return excitation;
113 }
G4double G4FermiChannels::GetMass ( ) const
inline

Definition at line 115 of file G4FermiChannels.hh.

116 {
117  return excitation + ground_mass;
118 }
size_t G4FermiChannels::GetNumberOfChannels ( ) const
inline

Definition at line 74 of file G4FermiChannels.hh.

75 {
76  return nch;
77 }
const G4FermiPair * G4FermiChannels::GetPair ( size_t  idx) const
inline

Definition at line 84 of file G4FermiChannels.hh.

85 {
86  return (idx < nch) ? fvect[idx] : nullptr;
87 }
std::vector< G4double > & G4FermiChannels::GetProbabilities ( )
inline

Definition at line 105 of file G4FermiChannels.hh.

106 {
107  return cum_prob;
108 }
const G4FermiPair * G4FermiChannels::SamplePair ( G4double  rand) const
inline

Definition at line 89 of file G4FermiChannels.hh.

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

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