Geant4  10.03.p03
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
G4LevelReader.cc
Go to the documentation of this file.
1 //
2 // ********************************************************************
3 // * License and Disclaimer *
4 // * *
5 // * The Geant4 software is copyright of the Copyright Holders of *
6 // * the Geant4 Collaboration. It is provided under the terms and *
7 // * conditions of the Geant4 Software License, included in the file *
8 // * LICENSE and available at http://cern.ch/geant4/license . These *
9 // * include a list of copyright holders. *
10 // * *
11 // * Neither the authors of this software system, nor their employing *
12 // * institutes,nor the agencies providing financial support for this *
13 // * work make any representation or warranty, express or implied, *
14 // * regarding this software system or assume any liability for its *
15 // * use. Please see the license in the file LICENSE and URL above *
16 // * for the full disclaimer and the limitation of liability. *
17 // * *
18 // * This code implementation is the result of the scientific and *
19 // * technical work of the GEANT4 collaboration. *
20 // * By using, copying, modifying or distributing the software (or *
21 // * any work based on the software) you agree to acknowledge its *
22 // * use in resulting scientific publications, and indicate your *
23 // * acceptance of all terms of the Geant4 Software license. *
24 // ********************************************************************
25 //
26 // $Id: G4LevelReader.cc 88407 2015-02-18 09:18:44Z vnivanch $
27 //
28 // -------------------------------------------------------------------
29 //
30 // GEANT4 header file
31 //
32 // File name: G4NucLevel
33 //
34 // Author: V.Ivanchenko (M.Kelsey reading method is used)
35 //
36 // Creation date: 4 January 2012
37 //
38 // Modifications:
39 //
40 // -------------------------------------------------------------------
41 
42 #include "G4LevelReader.hh"
43 #include "G4NucleiProperties.hh"
44 #include "G4NucLevel.hh"
45 #include "G4NuclearLevelData.hh"
46 #include "G4DeexPrecoParameters.hh"
47 #include "G4SystemOfUnits.hh"
48 #include "G4Pow.hh"
49 #include <vector>
50 #include <fstream>
51 #include <sstream>
52 
53 G4String G4LevelReader::fFloatingLevels[] = {
54  "-", "+X", "+Y", "+Z", "+U", "+V", "+W", "+R", "+S", "+T", "+A", "+B", "+C"};
55 
57  : fData(ptr),fAlphaMax(9.0e9f),fVerbose(0),fLevelMax(632),fTransMax(145)
58 {
59  fParam = fData->GetParameters();
60  fTimeFactor = (G4float)(CLHEP::second/G4Pow::GetInstance()->logZ(2));
61  char* directory = getenv("G4LEVELGAMMADATA");
62  if(directory) {
63  fDirectory = directory;
64  } else {
65  G4Exception("G4LevelReader()","had0707",FatalException,
66  "Environment variable G4LEVELGAMMADATA is not defined");
67  fDirectory = "";
68  }
69  fFile = fDirectory + "/z100.a200";
70  fPol = " ";
71  for(G4int i=0; i<10; ++i) { fICC[i] = 0.0f; }
72  for(G4int i=0; i<nbufmax; ++i) { buffer[i] = ' '; }
73  for(G4int i=0; i<nbuf1; ++i) { buff1[i] = ' '; }
74  for(G4int i=0; i<nbuf2; ++i) { buff2[i] = ' '; }
75  bufp[0] = bufp[1] = bufp[2] = ' ';
76 
77  fEnergy = fCurrEnergy = fTrEnergy = 0.0;
78  fTime = fProb = fSpin = fAlpha = fRatio = fNorm1 = 0.0f;
79 
80  vTrans.resize(fTransMax,0);
81  vRatio.resize(fTransMax,0.0f);
82  vGammaCumProbability.resize(fTransMax,0.0f);
83  vGammaProbability.resize(fTransMax,0.0f);
84  vShellProbability.resize(fTransMax,nullptr);
85  vMpRatio.resize(fTransMax,0.0f);
86 
87  vEnergy.resize(fLevelMax,0.0f);
88  vSpin.resize(fLevelMax,0);
89  vLevel.resize(fLevelMax,nullptr);
90 }
91 
92 const G4LevelManager*
94 {
95  std::ostringstream ss;
96  ss << "/z" << Z << ".a" << A;
97  G4String st = G4String(ss.str());
98  fFile = fDirectory + st;
99  return MakeLevelManager(Z, A, fFile);
100 }
101 
102 const G4LevelManager*
104 {
105  vEnergy.resize(1,0.0f);
106  vSpin.resize(1,0);
107  vLevel.resize(1,nullptr);
108 
109  vTrans.clear();
110  vGammaCumProbability.clear();
111  vGammaProbability.clear();
112  vShellProbability.clear();
113  vMpRatio.clear();
114 
115  std::ifstream infile(filename, std::ios::in);
116 
117  // file is not opened
118  if (!infile.is_open()) {
119  if (fVerbose > 0) {
120  G4cout << " G4LevelReader: fail open file for Z= "
121  << Z << " A= " << A
122  << " <" << filename << ">" << G4endl;
123  }
124 
125  } else {
126 
127  G4bool allLevels = fParam->StoreAllLevels();
128  if (fVerbose > 0) {
129  G4cout << "G4LevelReader: open file for Z= "
130  << Z << " A= " << A
131  << " <" << filename << ">" << G4endl;
132  }
133  // read line by line
134  G4bool end = false;
135  G4bool next = true;
136  G4int nline = -1;
137  G4int spin;
138  G4int index(0);
139  fCurrEnergy = DBL_MAX;
140  do {
141  fPol = " ";
142  ++nline;
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));
150  /*
151  G4cout << fEnergy << " " << fTrEnergy << " " << fProb << " "
152  << fPol << " " << fTime << " " << fSpin << " " << fAlpha
153  << " " << isOK << " " << fVerbose << G4endl;
154  */
155  fEnergy *= CLHEP::keV;
156  fTrEnergy *= CLHEP::keV;
157 
158  if(isOK) {
159  for(G4int i=0; i<10; ++i) {
160  isOK = (isOK && (ReadDataItem(infile,fICC[i])));
161  }
162  }
163  if(!isOK) {
164  end = true;
165  next = false;
166  }
167  if(fVerbose > 1) {
168  G4cout << "#Line " << nline << " " << fEnergy << " " << fTrEnergy
169  << " " << fProb << " " << fPol << " " << fTime << " "
170  << fSpin << " " << fAlpha << G4endl;
171  G4cout << " ";
172  for(G4int i=0; i<10; ++i) { G4cout << fICC[i] << " "; }
173  G4cout << G4endl;
174  }
175  // end of nuclear level data
176  if(end || fEnergy > fCurrEnergy) {
177  size_t nn = vTrans.size();
178  if(nn > 0) {
179  --nn;
180  if(fVerbose > 1) {
181  G4cout << "Reader: new level E= " << fEnergy
182  << " Ntransitions= " << nn+1 << " fNorm1= " << fNorm1
183  << G4endl;
184  }
185  if(fNorm1 > 0.0f) {
186  fNorm1 = 1.0f/fNorm1;
187  for(size_t i=0; i<nn; ++i) {
188  vGammaCumProbability[i] *= fNorm1;
189  if(fVerbose > 2) {
190  G4cout << "Probabilities[" << i
191  << "]= " << vGammaCumProbability[i]
192  << " idxTrans= " << index
193  << G4endl;
194  }
195  }
196  vGammaCumProbability[nn] = 1.0f;
197  if(fVerbose > 2) {
198  G4cout << "Probabilities[" << nn << "]= "
199  << vGammaCumProbability[nn]
200  << " IdxTrans= " << index
201  << G4endl;
202  }
203  vLevel.push_back(new G4NucLevel(vTrans.size(), fTime,
204  vTrans,
205  vGammaCumProbability,
206  vGammaProbability,
207  vMpRatio,
208  vShellProbability));
209  //case of X-level
210  } else {
211  spin += 100000;
212  fTime = 0.0f;
213  vLevel.push_back(nullptr);
214  }
215  } else {
216  vLevel.push_back(nullptr);
217  }
218  vSpin.push_back(spin);
219  vTrans.clear();
220  vGammaCumProbability.clear();
221  vGammaProbability.clear();
222  vShellProbability.clear();
223  vMpRatio.clear();
224  if(!end) { next = true; }
225  }
226  G4float ener = (G4float)fEnergy;
227  // begin nuclear level data
228  if(next) {
229  if(fVerbose > 1) {
230  G4cout << "== Reader: begin of new level E= " << fEnergy
231  << " Prob= " << fProb << G4endl;
232  }
233  // protection for bad level energy
234  size_t nn = vEnergy.size();
235  if(0 < nn && vEnergy[nn-1] > ener) {
236  ener = vEnergy[nn-1];
237  }
238  vEnergy.push_back(ener);
239  fCurrEnergy = fEnergy;
240  fTime *= fTimeFactor;
241  if(fSpin > 20.0f) { fSpin = 0.0; }
242  spin = (G4int)(fSpin+fSpin);
243  fNorm1 = 0.0f;
244  next = false;
245  }
246  // continue filling level data
247  if(!end) {
248  if(fProb > 0.0f) {
249  // by default transition to a ground state
250  G4float efinal = (G4float)std::max(fEnergy - fTrEnergy,0.0);
251  G4float elevel = 0.0f;
252  size_t idxLevel = 0;
253  G4int tnum = 0;
254  // do not check initial energy
255  size_t nn = vEnergy.size();
256  static const G4float x_energy = (G4float)(0.1*CLHEP::eV);
257  if(1 < nn) {
258  G4float ediffMin = (G4float)fEnergy;
259  for(size_t i=0; i<nn-1; ++i) {
260  G4float ediff = std::abs(efinal - vEnergy[i]);
261  /*
262  G4cout << "Elevel[" << i << "]= " << vEnergy[i]
263  << " Efinal= " << efinal
264  << " Ediff= " << ediff
265  << " EdiffMin= " << ediffMin << G4endl;
266  */
267  if(ediff < ediffMin) {
268  ediffMin = ediff;
269  elevel = vEnergy[i];
270  idxLevel = i;
271  if(ediff <= x_energy) { break; }
272  }
273  }
274  if(std::abs(vEnergy[nn-1] - elevel) < x_energy) { tnum = 1; }
275  }
276  G4float x = 1.0f + fAlpha;
277  fNorm1 += x*fProb;
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));
284  } else {
285  vShellProbability.push_back(nullptr);
286  }
287  }
288  }
289  if(nline > 10000) {
290  G4cout << "G4LevelReader: Line #" << nline << " Z= " << Z << " A= "
291  << " this file is too long - stop loading" << G4endl;
292  end = true;
293  }
294  // Loop checking, 05-Aug-2015, Vladimir Ivanchenko
295  } while (!end);
296  infile.close();
297  }
298 
299  G4LevelManager* man = nullptr;
300  if(vEnergy.size() >= 2) {
301  man = new G4LevelManager(vEnergy.size(),vEnergy,vSpin,vLevel);
302  if(fVerbose > 0) {
303  G4cout << "=== Reader: new manager for Z= " << Z << " A= " << A
304  << " Nlevels= " << vEnergy.size() << " E[0]= "
305  << vEnergy[0]/CLHEP::MeV << " MeV Emax= "
306  << man->MaxLevelEnergy()/CLHEP::MeV << " MeV "
307  << " S: " << vEnergy.size()
308  << " " << vSpin.size() << " " << vLevel.size()
309  << G4endl;
310  }
311  }
312  return man;
313 }
314 
315 G4bool G4LevelReader::ReadData(std::istringstream& stream, G4double& x)
316 {
317  stream >> x;
318  return stream.fail() ? false : true;
319 }
320 
321 G4bool G4LevelReader::ReadDataItem(std::istream& dataFile, G4double& x)
322 {
323  x = 0.0;
324  for(G4int i=0; i<nbufmax; ++i) { buffer[i] = ' '; }
325  G4bool okay = true;
326  dataFile >> buffer;
327  if(dataFile.fail()) { okay = false; }
328  else { x = strtod(buffer, 0); }
329 
330  return okay;
331 }
332 
333 G4bool G4LevelReader::ReadDataItem(std::istream& dataFile, G4float& x)
334 {
335  x = 0.0f;
336  for(G4int i=0; i<nbuf1; ++i) { buff1[i] = ' '; }
337  G4bool okay = true;
338  dataFile >> buff1;
339  if(dataFile.fail()) { okay = false; }
340  else { x = atof(buff1); }
341 
342  return okay;
343 }
344 
345 G4bool G4LevelReader::ReadDataItem(std::istream& dataFile, G4int& ix)
346 {
347  ix = 0;
348  for(G4int i=0; i<nbuf2; ++i) { buff2[i] = ' '; }
349  G4bool okay = true;
350  dataFile >> buff2;
351  if(dataFile.fail()) { okay = false; }
352  else { ix = atoi(buff2); }
353 
354  return okay;
355 }
356 
357 G4bool G4LevelReader::ReadDataItem(std::istream& dataFile, G4String& x)
358 {
359  G4bool okay = true;
360  bufp[0] = bufp[1] = ' ';
361  dataFile >> bufp;
362  if(dataFile.fail()) { okay = false; }
363  else { x = G4String(bufp, 2); }
364 
365  return okay;
366 }
367 
368 const std::vector<G4float>* G4LevelReader::NormalizedICCProbability(G4int Z)
369 {
370  std::vector<G4float>* vec = nullptr;
371  G4int LL = 3;
372  G4int M = 5;
373  G4int N = 1;
374  if(Z <= 27) {
375  M = N = 0;
376  if(Z <= 4) {
377  LL = 1;
378  } else if(Z <= 6) {
379  LL = 2;
380  } else if(Z <= 10) {
381  } else if(Z <= 12) {
382  M = 1;
383  } else if(Z <= 17) {
384  M = 2;
385  } else if(Z == 18) {
386  M = 3;
387  } else if(Z <= 20) {
388  M = 3;
389  N = 1;
390  } else {
391  M = 4;
392  N = 1;
393  }
394  if(LL < 3) { for(G4int i=LL+1; i<=4; ++i) { fICC[i] = 0.0f; } }
395  if(M < 5) { for(G4int i=M+4; i<=8; ++i) { fICC[i] = 0.0f; } }
396  if(N < 1) { fICC[9] = 0.0f; }
397  }
398  G4float norm = 0.0f;
399  for(G4int i=0; i<10; ++i) {
400  norm += fICC[i];
401  fICC[i] = norm;
402  }
403  if(norm == 0.0f && fAlpha > fAlphaMax) {
404  fICC[9] = norm = 1.0f;
405  }
406  if(norm > 0.0f) {
407  norm = 1.0f/norm;
408  vec = new std::vector<G4float>;
409  G4float x;
410  for(G4int i=0; i<10; ++i) {
411  x = fICC[i]*norm;
412  if(x > 0.995f || 9 == i) {
413  vec->push_back(1.0f);
414  break;
415  }
416  vec->push_back(x);
417  }
418  if (fVerbose > 2) {
419  G4int prec = G4cout.precision(3);
420  G4cout << "# InternalConv: ";
421  G4int nn = vec->size();
422  for(G4int i=0; i<nn; ++i) { G4cout << " " << (*vec)[i]; }
423  G4cout << G4endl;
424  G4cout.precision(prec);
425  }
426  }
427  return vec;
428 }
429 
430 const G4LevelManager*
432 {
433  std::ostringstream ss;
434  ss << "/correlated_gamma/z" << Z << ".a" << A;
435  G4String st = G4String(ss.str());
436  fFile = fDirectory + st;
437  std::ifstream infile(fFile, std::ios::in);
438 
439  // file is not opened
440  if (!infile.is_open()) {
441  if(fVerbose > 0) {
443  ed << " for Z= " << Z << " A= " << A
444  << " <" << fFile << "> is not opened!";
445  G4Exception("G4LevelReader::CreateLevelManagerNEW(..)","had014",
446  JustWarning, ed, "");
447  }
448  return nullptr;
449  }
450  if (fVerbose > 0) {
451  G4cout << "G4LevelReader: open file for Z= "
452  << Z << " A= " << A
453  << " <" << fFile << ">" << G4endl;
454  }
455  return LevelManager(Z, A, 0, infile);
456 }
457 
458 const G4LevelManager*
460  const G4String& filename)
461 {
462  std::ifstream infile(filename, std::ios::in);
463 
464  // file is not opened
465  if (!infile.is_open()) {
466  if(Z < 6 || fVerbose > 0) {
468  ed << " for Z= " << Z << " A= " << A
469  << " data file <" << filename << "> is not opened!";
470  G4Exception("G4LevelReader::MakeLevelManagerNEW(..)","had014",
471  FatalException, ed, "Check G4LEVELGAMMADATA");
472  }
473  return nullptr;
474  }
475  if (fVerbose > 0) {
476  G4cout << "G4LevelReader: open file for Z= "
477  << Z << " A= " << A
478  << " <" << filename << ">" << G4endl;
479  }
480  return LevelManager(Z, A, 0, infile);
481 }
482 
483 const G4LevelManager*
484 G4LevelReader::LevelManager(G4int Z, G4int A, G4int nlev,
485  std::ifstream& infile)
486 {
487  G4bool allLevels = fParam->StoreAllLevels();
488 
489  static const G4double fkev = CLHEP::keV;
490  G4int nlevels = (0 == nlev) ? fLevelMax : nlev;
491  if(fVerbose > 0) {
492  G4cout << "## New isotope Z= " << Z << " A= " << A;
493  if(nlevels < fLevelMax) { G4cout << " Nlevels= " << nlevels; }
494  G4cout << G4endl;
495  }
496  if(nlevels > fLevelMax) {
497  fLevelMax = nlevels;
498  vEnergy.resize(fLevelMax,0.0f);
499  vSpin.resize(fLevelMax,0);
500  vLevel.resize(fLevelMax,nullptr);
501  }
502  G4int ntrans(0), i1, i, k;
503  G4int i2; // Level number at which transition ends
504  G4int tnum; // Multipolarity index
505  G4String xf(" ");
506  G4float x, ener, tener;
507 
508  for(i=0; i<nlevels; ++i) {
509  infile >> i1 >> xf; // Level number and floating level
510  //G4cout << "New line: i1= " << i1 << " xf= <" << xf << "> " << G4endl;
511  if(infile.eof()) {
512  if(fVerbose > 1) {
513  G4cout << "### End of file Z= " << Z << " A= " << A
514  << " Nlevels= " << i << G4endl;
515  }
516  break;
517  }
518  if(i1 != i) {
520  ed << " G4LevelReader: wrong data file for Z= " << Z << " A= " << A
521  << " level #" << i << " has index " << i1 << G4endl;
522  G4Exception("G4LevelReader::LevelManager(..)","had014",
523  FatalException, ed, "Check G4LEVELGAMMADATA");
524  }
525 
526  if(!(ReadDataItem(infile,ener) &&
527  ReadDataItem(infile,fTime) &&
528  ReadDataItem(infile,fSpin) &&
529  ReadDataItem(infile,ntrans))) {
530  if(fVerbose > 1) {
531  G4cout << "### End of file Z= " << Z << " A= " << A
532  << " Nlevels= " << i << G4endl;
533  }
534  break;
535  }
536  ener *= fkev;
537  for(k=0; k<nfloting; ++k) {
538  if(xf == fFloatingLevels[k]) {
539  break;
540  }
541  }
542  // if a previous level has not transitions it may be ignored
543  if(0 < i) {
544  // protection
545  if(ener < vEnergy[i-1]) {
546  G4cout << "### G4LevelReader: broken level " << i
547  << " E(MeV)= " << ener << " < " << vEnergy[i-1]
548  << " for isotope Z= " << Z << " A= "
549  << A << " level energy increased" << G4endl;
550  ener = vEnergy[i-1];
551  }
552  }
553  vEnergy[i] = ener;
554  if(fTime > 0.0) { fTime *= fTimeFactor; }
555  if(fSpin > 20.0f) { fSpin = 0.0f; }
556  vSpin[i] = (G4int)(100 + fSpin + fSpin) + k*100000;
557  if(fVerbose > 1) {
558  G4cout << " Level #" << i1 << " E(MeV)= " << ener/CLHEP::MeV
559  << " LTime(s)= " << fTime << " 2S= " << vSpin[i]
560  << " meta= " << vSpin[i]/100000 << " idx= " << i
561  << " ntr= " << ntrans << G4endl;
562  }
563  vLevel[i] = nullptr;
564  if(ntrans == 0 && fTime < 0.0) {
565  vLevel[i] = new G4NucLevel(0, fTime,
566  vTrans,
567  vGammaCumProbability,
568  vGammaProbability,
569  vRatio,
570  vShellProbability);
571  } else if(ntrans > 0) {
572 
573  // there are transitions
574  if(ntrans > fTransMax) {
575  fTransMax = ntrans;
576  vTrans.resize(fTransMax);
577  vRatio.resize(fTransMax);
578  vGammaCumProbability.resize(fTransMax);
579  vGammaProbability.resize(fTransMax);
580  vShellProbability.resize(fTransMax);
581  vMpRatio.resize(fTransMax);
582  }
583  fNorm1 = 0.0f;
584  for(G4int j=0; j<ntrans; ++j) {
585 
586  if(!(ReadDataItem(infile,i2) &&
587  ReadDataItem(infile,tener) &&
588  ReadDataItem(infile,fProb) &&
589  ReadDataItem(infile,tnum) &&
590  ReadDataItem(infile,vRatio[j]) &&
591  ReadDataItem(infile,fAlpha))) {
592  //infile >>i2 >> tener >> fProb >> vTrans[j] >> fRatio >> fAlpha;
593  //if(infile.fail()) {
594  if(fVerbose > 0) {
595  G4cout << "### Fail to read transition j= " << j
596  << " Z= " << Z << " A= " << A << G4endl;
597  }
598  break;
599  }
600  if(i2 >= i) {
601  G4cout << "### G4LevelReader: broken transition " << j
602  << " from level " << i << " to " << i2
603  << " for isotope Z= " << Z << " A= "
604  << A << " - use ground level" << G4endl;
605  i2 = 0;
606  }
607  vTrans[j] = i2*10000 + tnum;
608  if(fAlpha < fAlphaMax) {
609  x = 1.0f + fAlpha;
610  fNorm1 += x*fProb;
611  vGammaCumProbability[j] = fNorm1;
612  vGammaProbability[j] = 1.0f/x;
613  } else {
614  // only internal conversion case - no gamma conversion at all
615  fNorm1 += fProb;
616  vGammaCumProbability[j] = fNorm1;
617  vGammaProbability[j] = 0.0f;
618  }
619  vShellProbability[j] = nullptr;
620  if(fVerbose > 1) {
621  G4int prec = G4cout.precision(4);
622  G4cout << "### Transition #" << j << " to level " << i2
623  << " i2= " << i2 << " Etrans(MeV)= " << tener*fkev
624  << " fProb= " << fProb << " MultiP= " << tnum
625  << " fMpRatio= " << fRatio << " fAlpha= " << fAlpha
626  << G4endl;
627  G4cout.precision(prec);
628  }
629  if(fAlpha > 0.0f) {
630  for(k=0; k<10; ++k) {
631  //infile >> fICC[k];
632  if(!ReadDataItem(infile,fICC[k])) {
633  //if(infile.fail()) {
634  if(fVerbose > 0) {
635  G4cout << "### Fail to read convertion coeff k= " << k
636  << " for transition j= " << j
637  << " Z= " << Z << " A= " << A << G4endl;
638  }
639  break;
640  }
641  }
642  if(allLevels) {
643  vShellProbability[j] = NormalizedICCProbability(Z);
644  if(!vShellProbability[j]) { vGammaProbability[j] = 1.0f; }
645  }
646  }
647  }
648  if(0.0f < fNorm1) { fNorm1 = 1.0f/fNorm1; }
649  G4int nt = ntrans - 1;
650  for(k=0; k<nt; ++k) {
651  vGammaCumProbability[k] *= fNorm1;
652  if(fVerbose > 2) {
653  G4cout << "Probabilities[" << k
654  << "]= " << vGammaCumProbability[k]
655  << " " << vGammaProbability[k]
656  << " idxTrans= " << vTrans[k]/10000
657  << G4endl;
658  }
659  }
660  vGammaCumProbability[nt] = 1.0f;
661  if(fVerbose > 2) {
662  G4cout << "Probabilities[" << nt << "]= "
663  << vGammaCumProbability[nt]
664  << " " << vGammaProbability[nt]
665  << " IdxTrans= " << vTrans[nt]/10000
666  << G4endl;
667  }
668  if(fVerbose > 1) {
669  G4cout << " New G4NucLevel: Ntrans= " << ntrans
670  << " Time(ns)= " << fTime << G4endl;
671  }
672  vLevel[i] = new G4NucLevel((size_t)ntrans, fTime,
673  vTrans,
674  vGammaCumProbability,
675  vGammaProbability,
676  vMpRatio,
677  vShellProbability);
678  }
679  }
680  G4LevelManager* lman = nullptr;
681  if(1 <= i) {
682  lman = new G4LevelManager((size_t)i,vEnergy,vSpin,vLevel);
683  if(fVerbose > 0) {
684  G4cout << "=== Reader: new manager for Z= " << Z << " A= " << A
685  << " Nlevels= " << i << " E[0]= "
686  << vEnergy[0]/CLHEP::MeV << " MeV E1= "
687  << vEnergy[i-1]/CLHEP::MeV << " MeV "
688  << G4endl;
689  }
690  }
691 
692  return lman;
693 }
static G4Pow * GetInstance()
Definition: G4Pow.cc:55
std::ostringstream G4ExceptionDescription
Definition: globals.hh:76
static constexpr double keV
float G4float
Definition: G4Types.hh:77
G4LevelReader(G4NuclearLevelData *)
const G4LevelManager * MakeLevelManager(G4int Z, G4int A, const G4String &filename)
tuple x
Definition: test.py:50
const G4LevelManager * CreateLevelManagerNEW(G4int Z, G4int A)
int G4int
Definition: G4Types.hh:78
G4double logZ(G4int Z) const
Definition: G4Pow.hh:166
static const double prec
Definition: RanecuEngine.cc:58
G4GLOB_DLL std::ostream G4cout
double A(double temperature)
bool G4bool
Definition: G4Types.hh:79
static constexpr double MeV
G4DeexPrecoParameters * GetParameters()
static constexpr double eV
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *comments)
Definition: G4Exception.cc:41
T max(const T t1, const T t2)
brief Return the largest of the two arguments
static const G4int LL[nN]
static constexpr double second
#define G4endl
Definition: G4ios.hh:61
**D E S C R I P T I O N
Definition: HEPEvtcom.cc:77
const G4LevelManager * MakeLevelManagerNEW(G4int Z, G4int A, const G4String &filename)
const G4LevelManager * CreateLevelManager(G4int Z, G4int A)
double G4double
Definition: G4Types.hh:76
#define DBL_MAX
Definition: templates.hh:83
G4float MaxLevelEnergy() const