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

#include <G4NucLevel.hh>

Public Member Functions

 G4NucLevel (std::size_t ntrans, G4double tgamma, const std::vector< G4int > &vTrans, const std::vector< G4float > &wLevelGamma, const std::vector< G4float > &wGamma, const std::vector< G4float > &vRatio, const std::vector< const std::vector< G4float > * > &wShell)
 
 ~G4NucLevel ()
 
std::size_t NumberOfTransitions () const
 
std::size_t FinalExcitationIndex (std::size_t idx) const
 
G4int TransitionType (std::size_t idx) const
 
G4double GetTimeGamma () const
 
G4float GammaProbability (std::size_t idx) const
 
G4float GammaCumProbability (std::size_t idx) const
 
G4float MultipolarityRatio (std::size_t idx) const
 
std::size_t SampleGammaTransition (G4double rndm) const
 
G4int SampleShell (std::size_t idx, G4double rndm) const
 
const std::vector< G4float > * ShellProbabilty (std::size_t idx) const
 
void StreamInfo (std::ostream &os) const
 
 G4NucLevel (const G4NucLevel &right)=delete
 
G4bool operator== (const G4NucLevel &right) const =delete
 
G4bool operator!= (const G4NucLevel &right) const =delete
 
G4bool operator< (const G4NucLevel &right) const =delete
 
const G4NucLeveloperator= (const G4NucLevel &right)=delete
 

Detailed Description

Definition at line 52 of file G4NucLevel.hh.

Constructor & Destructor Documentation

◆ G4NucLevel() [1/2]

G4NucLevel::G4NucLevel ( std::size_t  ntrans,
G4double  tgamma,
const std::vector< G4int > &  vTrans,
const std::vector< G4float > &  wLevelGamma,
const std::vector< G4float > &  wGamma,
const std::vector< G4float > &  vRatio,
const std::vector< const std::vector< G4float > * > &  wShell 
)
explicit

Definition at line 46 of file G4NucLevel.cc.

52 : length(ntrans), fTimeGamma(tgamma)
53{
54 if(0 < length) {
55 fTrans.reserve(length);
56 fGammaCumProbability.reserve(length);
57 fGammaProbability.reserve(length);
58 fMpRatio.reserve(length);
59 fShellProbability.reserve(length);
60 for(std::size_t i=0; i<length; ++i) {
61 fTrans.push_back(vTrans[i]);
62 fGammaCumProbability.push_back(wLevelGamma[i]);
63 fGammaProbability.push_back(wGamma[i]);
64 fMpRatio.push_back(vRatio[i]);
65 fShellProbability.push_back(wShell[i]);
66 }
67 }
68}

◆ ~G4NucLevel()

G4NucLevel::~G4NucLevel ( )

Definition at line 70 of file G4NucLevel.cc.

71{
72 for(std::size_t i=0; i<length; ++i) {
73 delete fShellProbability[i];
74 }
75}

◆ G4NucLevel() [2/2]

G4NucLevel::G4NucLevel ( const G4NucLevel right)
delete

Member Function Documentation

◆ FinalExcitationIndex()

std::size_t G4NucLevel::FinalExcitationIndex ( std::size_t  idx) const
inline

Definition at line 110 of file G4NucLevel.hh.

111{
112 return (std::size_t)(fTrans[idx]/10000);
113}

Referenced by StreamInfo().

◆ GammaCumProbability()

G4float G4NucLevel::GammaCumProbability ( std::size_t  idx) const
inline

Definition at line 130 of file G4NucLevel.hh.

131{
132 return fGammaCumProbability[idx];
133}

◆ GammaProbability()

G4float G4NucLevel::GammaProbability ( std::size_t  idx) const
inline

Definition at line 125 of file G4NucLevel.hh.

126{
127 return fGammaProbability[idx];
128}

◆ GetTimeGamma()

G4double G4NucLevel::GetTimeGamma ( ) const
inline

Definition at line 120 of file G4NucLevel.hh.

121{
122 return fTimeGamma;
123}

◆ MultipolarityRatio()

G4float G4NucLevel::MultipolarityRatio ( std::size_t  idx) const
inline

Definition at line 135 of file G4NucLevel.hh.

136{
137 return fMpRatio[idx];
138}

◆ NumberOfTransitions()

std::size_t G4NucLevel::NumberOfTransitions ( ) const
inline

Definition at line 105 of file G4NucLevel.hh.

106{
107 return length;
108}

◆ operator!=()

G4bool G4NucLevel::operator!= ( const G4NucLevel right) const
delete

◆ operator<()

G4bool G4NucLevel::operator< ( const G4NucLevel right) const
delete

◆ operator=()

const G4NucLevel & G4NucLevel::operator= ( const G4NucLevel right)
delete

◆ operator==()

G4bool G4NucLevel::operator== ( const G4NucLevel right) const
delete

◆ SampleGammaTransition()

std::size_t G4NucLevel::SampleGammaTransition ( G4double  rndm) const
inline

Definition at line 140 of file G4NucLevel.hh.

141{
142 G4float x = rndm;
143 std::size_t idx = 0;
144 for(; idx<length; ++idx) {
145 if(x <= fGammaCumProbability[idx]) { break; }
146 }
147 return idx;
148}
float G4float
Definition: G4Types.hh:84

◆ SampleShell()

G4int G4NucLevel::SampleShell ( std::size_t  idx,
G4double  rndm 
) const
inline

Definition at line 151 of file G4NucLevel.hh.

152{
153 const std::vector<G4float>* prob = fShellProbability[idx];
154 G4int i(-1);
155 if(nullptr != prob) {
156 G4int nn = (G4int)prob->size();
157 G4float x = rndm;
158 for(i=0; i<nn; ++i) { if(x <= (*prob)[i]) { break; } }
159 }
160 return i;
161}
int G4int
Definition: G4Types.hh:85

◆ ShellProbabilty()

const std::vector< G4float > * G4NucLevel::ShellProbabilty ( std::size_t  idx) const
inline

Definition at line 164 of file G4NucLevel.hh.

165{
166 return fShellProbability[idx];
167}

◆ StreamInfo()

void G4NucLevel::StreamInfo ( std::ostream &  os) const

Definition at line 77 of file G4NucLevel.cc.

78{
79 G4long prec = out.precision(4);
80 for(std::size_t i=0; i<length; ++i) {
81 out << std::setw(12) << FinalExcitationIndex(i)
82 << std::setw(4) << TransitionType(i)
83 << std::setw(7) << fMpRatio[i]
84 << std::setw(7) << fGammaCumProbability[i]
85 << std::setw(7) << fGammaProbability[i]
86 << "\n";
87 const std::vector<G4float>* vec = fShellProbability[i];
88 if(vec) {
89 std::size_t len = vec->size();
90 out << " ";
91 for(std::size_t j=0; j<len; ++j) { out << std::setw(7) << (*vec)[j]; }
92 out << "\n";
93 }
94 }
95 out.precision(prec);
96}
long G4long
Definition: G4Types.hh:87
std::size_t FinalExcitationIndex(std::size_t idx) const
Definition: G4NucLevel.hh:110
G4int TransitionType(std::size_t idx) const
Definition: G4NucLevel.hh:115

◆ TransitionType()

G4int G4NucLevel::TransitionType ( std::size_t  idx) const
inline

Definition at line 115 of file G4NucLevel.hh.

116{
117 return fTrans[idx]%10000;
118}

Referenced by StreamInfo().


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