Geant4 11.4.0
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 (const std::size_t idx) const
G4int TransitionType (const std::size_t idx) const
G4double GetTimeGamma () const
G4float GammaProbability (std::size_t idx) const
G4float GammaCumProbability (const std::size_t idx) const
G4float MultipolarityRatio (const std::size_t idx) const
std::size_t SampleGammaTransition (const G4double rndm) const
G4int SampleShell (const std::size_t idx, const G4double rndm) const
const std::vector< G4float > * ShellProbabilty (const 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}

Referenced by G4NucLevel(), operator!=(), operator<(), operator=(), and operator==().

◆ ~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 ( const 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 ( const 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 ( const 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 ( const G4double rndm) const
inline

Definition at line 140 of file G4NucLevel.hh.

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

◆ SampleShell()

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

Definition at line 152 of file G4NucLevel.hh.

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

◆ ShellProbabilty()

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

Definition at line 165 of file G4NucLevel.hh.

166{
167 return fShellProbability[idx];
168}

◆ 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
G4int TransitionType(const std::size_t idx) const
std::size_t FinalExcitationIndex(const std::size_t idx) const

◆ TransitionType()

G4int G4NucLevel::TransitionType ( const 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: