Geant4 10.7.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 (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 ()
 
size_t NumberOfTransitions () const
 
size_t FinalExcitationIndex (size_t idx) const
 
G4int TransitionType (size_t idx) const
 
G4double GetTimeGamma () const
 
G4float GammaProbability (size_t idx) const
 
G4float GammaCumProbability (size_t idx) const
 
G4float MultipolarityRatio (size_t idx) const
 
size_t SampleGammaTransition (G4double rndm) const
 
G4int SampleShell (size_t idx, G4double rndm) const
 
const std::vector< G4float > * ShellProbabilty (size_t idx) const
 
void StreamInfo (std::ostream &os) const
 

Detailed Description

Definition at line 52 of file G4NucLevel.hh.

Constructor & Destructor Documentation

◆ G4NucLevel()

G4NucLevel::G4NucLevel ( 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(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(size_t i=0; i<length; ++i) {
73 delete fShellProbability[i];
74 }
75}

Member Function Documentation

◆ FinalExcitationIndex()

size_t G4NucLevel::FinalExcitationIndex ( size_t  idx) const
inline

Definition at line 113 of file G4NucLevel.hh.

114{
115#ifdef G4VERBOSE
116 if(idx >= length) { PrintError(idx, "FinalExcitationIndex(idx)"); }
117#endif
118 return (size_t)(fTrans[idx]/10000);
119}

Referenced by StreamInfo().

◆ GammaCumProbability()

G4float G4NucLevel::GammaCumProbability ( size_t  idx) const
inline

Definition at line 142 of file G4NucLevel.hh.

143{
144#ifdef G4VERBOSE
145 if(idx >= length) { PrintError(idx, "GammaCumProbability(idx)"); }
146#endif
147 return fGammaCumProbability[idx];
148}

◆ GammaProbability()

G4float G4NucLevel::GammaProbability ( size_t  idx) const
inline

Definition at line 134 of file G4NucLevel.hh.

135{
136#ifdef G4VERBOSE
137 if(idx >= length) { PrintError(idx, "GammaProbability(idx)"); }
138#endif
139 return fGammaProbability[idx];
140}

◆ GetTimeGamma()

G4double G4NucLevel::GetTimeGamma ( ) const
inline

Definition at line 129 of file G4NucLevel.hh.

130{
131 return fTimeGamma;
132}

◆ MultipolarityRatio()

G4float G4NucLevel::MultipolarityRatio ( size_t  idx) const
inline

Definition at line 150 of file G4NucLevel.hh.

151{
152#ifdef G4VERBOSE
153 if(idx >= length) { PrintError(idx, "MultipolarityRatio(idx)"); }
154#endif
155 return fMpRatio[idx];
156}

◆ NumberOfTransitions()

size_t G4NucLevel::NumberOfTransitions ( ) const
inline

Definition at line 108 of file G4NucLevel.hh.

109{
110 return length;
111}

◆ SampleGammaTransition()

size_t G4NucLevel::SampleGammaTransition ( G4double  rndm) const
inline

Definition at line 158 of file G4NucLevel.hh.

159{
160 G4float x = (G4float)rndm;
161 size_t idx = 0;
162 for(; idx<length; ++idx) {
163 if(x <= fGammaCumProbability[idx]) { break; }
164 }
165 return idx;
166}
float G4float
Definition: G4Types.hh:84

◆ SampleShell()

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

Definition at line 168 of file G4NucLevel.hh.

169{
170#ifdef G4VERBOSE
171 if(idx >= length) { PrintError(idx, "SampleShell(idx,rndm)"); }
172#endif
173 const std::vector<G4float>* prob = fShellProbability[idx];
174 G4int i(-1);
175 if(prob) {
176 G4int nn = prob->size();
177 G4float x = (G4float)rndm;
178 for(i=0; i<nn; ++i) { if(x <= (*prob)[i]) { break; } }
179 }
180 return i;
181}
int G4int
Definition: G4Types.hh:85

◆ ShellProbabilty()

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

Definition at line 184 of file G4NucLevel.hh.

185{
186#ifdef G4VERBOSE
187 if(idx >= length) { PrintError(idx, "ShellProbability(idx)"); }
188#endif
189 return fShellProbability[idx];
190}

◆ StreamInfo()

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

Definition at line 96 of file G4NucLevel.cc.

97{
98 G4int prec = out.precision(4);
99 for(size_t i=0; i<length; ++i) {
100 out << std::setw(12) << FinalExcitationIndex(i)
101 << std::setw(4) << TransitionType(i)
102 << std::setw(7) << fMpRatio[i]
103 << std::setw(7) << fGammaCumProbability[i]
104 << std::setw(7) << fGammaProbability[i]
105 << "\n";
106 const std::vector<G4float>* vec = fShellProbability[i];
107 if(vec) {
108 size_t len = vec->size();
109 out << " ";
110 for(size_t j=0; j<len; ++j) { out << std::setw(7) << (*vec)[j]; }
111 out << "\n";
112 }
113 }
114 out.precision(prec);
115}
G4int TransitionType(size_t idx) const
Definition: G4NucLevel.hh:121
size_t FinalExcitationIndex(size_t idx) const
Definition: G4NucLevel.hh:113

◆ TransitionType()

G4int G4NucLevel::TransitionType ( size_t  idx) const
inline

Definition at line 121 of file G4NucLevel.hh.

122{
123#ifdef G4VERBOSE
124 if(idx >= length) { PrintError(idx, "TransitionType(idx)"); }
125#endif
126 return fTrans[idx]%10000;
127}

Referenced by StreamInfo().


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