Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4LevelReader Class Reference

#include <G4LevelReader.hh>

Public Member Functions

 G4LevelReader (G4NuclearLevelData *)
 
const G4LevelManagerCreateLevelManager (G4int Z, G4int A)
 
const G4LevelManagerMakeLevelManager (G4int Z, G4int A, const G4String &filename)
 
void SetVerbose (G4int val)
 
 G4LevelReader (const G4LevelReader &right)=delete
 
const G4LevelReaderoperator= (const G4LevelReader &right)=delete
 
G4bool operator== (const G4LevelReader &right) const =delete
 
G4bool operator!= (const G4LevelReader &right) const =delete
 

Detailed Description

Definition at line 54 of file G4LevelReader.hh.

Constructor & Destructor Documentation

◆ G4LevelReader() [1/2]

G4LevelReader::G4LevelReader ( G4NuclearLevelData * ptr)
explicit

Definition at line 58 of file G4LevelReader.cc.

59 : fData(ptr)
60{
61 fAlphaMax = (G4float)1.e15;
62 fTimeFactor = CLHEP::second/G4Pow::GetInstance()->logZ(2);
63 fDirectory = G4String(G4FindDataDir("G4LEVELGAMMADATA"));
64
65 vTrans.resize(fTransMax,0);
66 vRatio.resize(fTransMax,0.0f);
67 vGammaCumProbability.resize(fTransMax,0.0f);
68 vGammaProbability.resize(fTransMax,0.0f);
69 vShellProbability.resize(fTransMax,nullptr);
70
71 vEnergy.resize(fLevelMax,0.0);
72 vSpin.resize(fLevelMax,0);
73 vLevel.resize(fLevelMax,nullptr);
74}
const char * G4FindDataDir(const char *)
float G4float
Definition G4Types.hh:84
static G4Pow * GetInstance()
Definition G4Pow.cc:41
G4double logZ(G4int Z) const
Definition G4Pow.hh:137

◆ G4LevelReader() [2/2]

G4LevelReader::G4LevelReader ( const G4LevelReader & right)
delete

Member Function Documentation

◆ CreateLevelManager()

const G4LevelManager * G4LevelReader::CreateLevelManager ( G4int Z,
G4int A )

Definition at line 181 of file G4LevelReader.cc.

182{
183 std::ostringstream ss;
184 ss << fDirectory << "/z" << Z << ".a" << A;
185 std::ifstream infile(ss.str(), std::ios::in);
186
187 // file is not opened
188 if (!infile.is_open()) {
189 if(fVerbose > 1) {
191 ed << "Regular file " << ss.str() << " is not opened! Z="
192 << Z << " A=" << A;
193 G4Exception("G4LevelReader::LevelManager(..)","had014",
194 JustWarning, ed, "Check file path");
195 }
196 return nullptr;
197 }
198 // file is opened
199 if (fVerbose > 1) {
200 G4cout << "G4LevelReader: open file " << ss.str() << " for Z= "
201 << Z << " A= " << A << G4endl;
202 }
203 return LevelManager(Z, A, infile);
204}
@ JustWarning
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
const G4double A[17]
#define G4endl
Definition G4ios.hh:67
G4GLOB_DLL std::ostream G4cout

Referenced by G4NuclearLevelData::GetLevelManager(), and G4NuclearLevelData::UploadNuclearLevelData().

◆ MakeLevelManager()

const G4LevelManager * G4LevelReader::MakeLevelManager ( G4int Z,
G4int A,
const G4String & filename )

Definition at line 207 of file G4LevelReader.cc.

208{
209 std::ifstream infile(filename, std::ios::in);
210
211 // file is not opened
212 if (!infile.is_open()) {
213 if(fVerbose > 1) {
215 ed << "External file " << filename << " is not opened! Z="
216 << Z << " A=" << A;
217 G4Exception("G4LevelReader::LevelManager(..)","had014",
218 FatalException, ed, "Check file path");
219 }
220 return nullptr;
221 }
222 // file is opened
223 if (fVerbose > 1) {
224 G4cout << "G4LevelReader: open external file " << filename
225 << " for Z= " << Z << " A= " << A << G4endl;
226 }
227 return LevelManager(Z, A, infile);
228}
@ FatalException

Referenced by G4NuclearLevelData::AddPrivateData().

◆ operator!=()

G4bool G4LevelReader::operator!= ( const G4LevelReader & right) const
delete

◆ operator=()

const G4LevelReader & G4LevelReader::operator= ( const G4LevelReader & right)
delete

◆ operator==()

G4bool G4LevelReader::operator== ( const G4LevelReader & right) const
delete

◆ SetVerbose()

void G4LevelReader::SetVerbose ( G4int val)
inline

Definition at line 137 of file G4LevelReader.hh.

138{
139 fVerbose = val;
140}

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