105 vEnergy.resize(1,0.0f);
107 vLevel.resize(1,
nullptr);
110 vGammaCumProbability.clear();
111 vGammaProbability.clear();
112 vShellProbability.clear();
115 std::ifstream infile(filename, std::ios::in);
118 if (!infile.is_open()) {
120 G4cout <<
" G4LevelReader: fail open file for Z= "
122 <<
" <" << filename <<
">" <<
G4endl;
129 G4cout <<
"G4LevelReader: open file for Z= "
131 <<
" <" << filename <<
">" <<
G4endl;
143 G4bool isOK = (ReadDataItem(infile,fEnergy) &&
144 ReadDataItem(infile,fTrEnergy) &&
145 ReadDataItem(infile,fProb) &&
146 ReadDataItem(infile,fPol) &&
147 ReadDataItem(infile,fTime) &&
148 ReadDataItem(infile,fSpin) &&
149 ReadDataItem(infile,fAlpha));
159 for(
G4int i=0; i<10; ++i) {
160 isOK = (isOK && (ReadDataItem(infile,fICC[i])));
168 G4cout <<
"#Line " << nline <<
" " << fEnergy <<
" " << fTrEnergy
169 <<
" " << fProb <<
" " << fPol <<
" " << fTime <<
" "
170 << fSpin <<
" " << fAlpha <<
G4endl;
172 for(
G4int i=0; i<10; ++i) {
G4cout << fICC[i] <<
" "; }
176 if(end || fEnergy > fCurrEnergy) {
177 size_t nn = vTrans.size();
181 G4cout <<
"Reader: new level E= " << fEnergy
182 <<
" Ntransitions= " << nn+1 <<
" fNorm1= " << fNorm1
186 fNorm1 = 1.0f/fNorm1;
187 for(
size_t i=0; i<
nn; ++i) {
188 vGammaCumProbability[i] *= fNorm1;
190 G4cout <<
"Probabilities[" << i
191 <<
"]= " << vGammaCumProbability[i]
192 <<
" idxTrans= " << index
196 vGammaCumProbability[
nn] = 1.0f;
198 G4cout <<
"Probabilities[" << nn <<
"]= "
199 << vGammaCumProbability[
nn]
200 <<
" IdxTrans= " << index
203 vLevel.push_back(
new G4NucLevel(vTrans.size(), fTime,
205 vGammaCumProbability,
213 vLevel.push_back(
nullptr);
216 vLevel.push_back(
nullptr);
218 vSpin.push_back(spin);
220 vGammaCumProbability.clear();
221 vGammaProbability.clear();
222 vShellProbability.clear();
224 if(!end) { next =
true; }
230 G4cout <<
"== Reader: begin of new level E= " << fEnergy
231 <<
" Prob= " << fProb <<
G4endl;
234 size_t nn = vEnergy.size();
235 if(0 < nn && vEnergy[nn-1] > ener) {
236 ener = vEnergy[nn-1];
238 vEnergy.push_back(ener);
239 fCurrEnergy = fEnergy;
240 fTime *= fTimeFactor;
241 if(fSpin > 20.0f) { fSpin = 0.0; }
242 spin = (
G4int)(fSpin+fSpin);
255 size_t nn = vEnergy.size();
259 for(
size_t i=0; i<nn-1; ++i) {
260 G4float ediff = std::abs(efinal - vEnergy[i]);
267 if(ediff < ediffMin) {
271 if(ediff <= x_energy) {
break; }
274 if(std::abs(vEnergy[nn-1] - elevel) < x_energy) { tnum = 1; }
278 vGammaCumProbability.push_back(fNorm1);
279 vGammaProbability.push_back(1.0f/x);
280 vMpRatio.push_back(0.0f);
281 vTrans.push_back(tnum + idxLevel*10000);
282 if(allLevels && fAlpha > 0.0f) {
283 vShellProbability.push_back(NormalizedICCProbability(
Z));
285 vShellProbability.push_back(
nullptr);
290 G4cout <<
"G4LevelReader: Line #" << nline <<
" Z= " <<
Z <<
" A= "
291 <<
" this file is too long - stop loading" <<
G4endl;
300 if(vEnergy.size() >= 2) {
303 G4cout <<
"=== Reader: new manager for Z= " <<
Z <<
" A= " <<
A
304 <<
" Nlevels= " << vEnergy.size() <<
" E[0]= "
307 <<
" S: " << vEnergy.size()
308 <<
" " << vSpin.size() <<
" " << vLevel.size()
static constexpr double keV
G4GLOB_DLL std::ostream G4cout
double A(double temperature)
static constexpr double MeV
G4bool StoreAllLevels() const
static constexpr double eV
T max(const T t1, const T t2)
brief Return the largest of the two arguments
G4float MaxLevelEnergy() const