Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4NucLevel Class Reference

#include <G4NucLevel.hh>

Public Member Functions

 G4NucLevel (size_t ntrans, G4float 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
 
G4float GetTimeGamma () const
 
G4float MixingRatio (size_t idx) 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
 

Detailed Description

Definition at line 52 of file G4NucLevel.hh.

Constructor & Destructor Documentation

G4NucLevel::G4NucLevel ( size_t  ntrans,
G4float  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 ( )

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

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, "FinalExcitationEnergy"); }
117 #endif
118  return (size_t)(fTrans[idx]/10000);
119 }
G4float G4NucLevel::GammaCumProbability ( size_t  idx) const
inline

Definition at line 150 of file G4NucLevel.hh.

151 {
152 #ifdef G4VERBOSE
153  if(idx >= length) { PrintError(idx, "GammaCumProbability"); }
154 #endif
155  return fGammaCumProbability[idx];
156 }
G4float G4NucLevel::GammaProbability ( size_t  idx) const
inline

Definition at line 142 of file G4NucLevel.hh.

143 {
144 #ifdef G4VERBOSE
145  if(idx >= length) { PrintError(idx, "GammaProbability"); }
146 #endif
147  return fGammaProbability[idx];
148 }
G4float G4NucLevel::GetTimeGamma ( ) const
inline

Definition at line 129 of file G4NucLevel.hh.

130 {
131  return fTimeGamma;
132 }
G4float G4NucLevel::MixingRatio ( size_t  idx) const
inline

Definition at line 134 of file G4NucLevel.hh.

135 {
136 #ifdef G4VERBOSE
137  if(idx >= length) { PrintError(idx, "MixingRatio"); }
138 #endif
139  return fMpRatio[idx];
140 }
G4float G4NucLevel::MultipolarityRatio ( size_t  idx) const
inline

Definition at line 158 of file G4NucLevel.hh.

159 {
160 #ifdef G4VERBOSE
161  if(idx >= length) { PrintError(idx, "GammaProbability"); }
162 #endif
163  return fMpRatio[idx];
164 }
size_t G4NucLevel::NumberOfTransitions ( ) const
inline

Definition at line 108 of file G4NucLevel.hh.

109 {
110  return length;
111 }
size_t G4NucLevel::SampleGammaTransition ( G4double  rndm) const
inline

Definition at line 166 of file G4NucLevel.hh.

167 {
168  G4float x = (G4float)rndm;
169  size_t idx = 0;
170  for(; idx<length; ++idx) {
171  if(x <= fGammaCumProbability[idx]) { break; }
172  }
173  return idx;
174 }
float G4float
Definition: G4Types.hh:77
G4int G4NucLevel::SampleShell ( size_t  idx,
G4double  rndm 
) const
inline

Definition at line 176 of file G4NucLevel.hh.

177 {
178 #ifdef G4VERBOSE
179  if(idx >= length) { PrintError(idx, "SampleShell"); }
180 #endif
181  const std::vector<G4float>* prob = fShellProbability[idx];
182  G4int i(-1);
183  if(prob) {
184  G4int nn = prob->size();
185  G4float x = (G4float)rndm;
186  for(i=0; i<nn; ++i) { if(x <= (*prob)[i]) { break; } }
187  }
188  return i;
189 }
float G4float
Definition: G4Types.hh:77
int G4int
Definition: G4Types.hh:78
const std::vector< G4float > * G4NucLevel::ShellProbabilty ( size_t  idx) const
inline

Definition at line 192 of file G4NucLevel.hh.

193 {
194 #ifdef G4VERBOSE
195  if(idx >= length) { PrintError(idx, "ShellProbability"); }
196 #endif
197  return fShellProbability[idx];
198 }
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"); }
125 #endif
126  return fTrans[idx]%10000;
127 }

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