Geant4 9.6.0
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 ()
 
 ~G4LevelReader ()
 
void FillLevels (G4int Z, G4int A, std::vector< G4NucLevel * > *levels, const G4String &filename)
 
void SetVerbose (G4int val)
 

Detailed Description

Definition at line 54 of file G4LevelReader.hh.

Constructor & Destructor Documentation

◆ G4LevelReader()

G4LevelReader::G4LevelReader ( )

Definition at line 46 of file G4LevelReader.cc.

47 : nLevels(0),nLevelMax(50),fVerbose(0),fMinProbability(1.e-10)
48{
49 fLevelEnergy = fNewEnergy = fDeltaEnergy = fNewTime
50 = fHalfLifeTime = fProbability = fICC = fx = 0.0;
51 eGamma.resize(nLevelMax,0.0);
52 wGamma.resize(nLevelMax,0.0);
53 kICC.resize(nLevelMax,0.0);
54 for(G4int i=0; i<30; ++i) { buffer[i] = 0; }
55}
int G4int
Definition: G4Types.hh:66

◆ ~G4LevelReader()

G4LevelReader::~G4LevelReader ( )

Definition at line 57 of file G4LevelReader.cc.

58{}

Member Function Documentation

◆ FillLevels()

void G4LevelReader::FillLevels ( G4int  Z,
G4int  A,
std::vector< G4NucLevel * > *  levels,
const G4String filename 
)

Definition at line 60 of file G4LevelReader.cc.

63{
64 std::ifstream inFile(filename);
65 if (!inFile.is_open()) {
66 if (fVerbose > 0) {
67 G4cout << " G4LevelReader: nuclide ("
68 << Z << "," << A
69 << ") does not have a gamma levels file" << G4endl;
70 }
71 return;
72 }
73
74 // Read file with gamma data and fill levels
75 fLevelEnergy = 0.0;
76 nLevels = 0;
77
78 // read next line
79 while(Read(inFile)) {
80
81 // create new level and start fill the next
82 if(fNewEnergy != fLevelEnergy) {
83 if(0 < nLevels) { MakeNewLevel(levels); }
84 fLevelEnergy = fNewEnergy;
85 fHalfLifeTime = fNewTime;
86 nLevels = 0;
87 }
88
89 // fill data on a new daughter level
90 eGamma[nLevels] = fDeltaEnergy*keV;
91 wGamma[nLevels] = std::max(fProbability*0.01,fMinProbability);
92 kICC[nLevels] = fICC;
93 ++nLevels;
94
95 // check buffer size - should never happen
96 if(nLevels > nLevelMax) {
97 nLevelMax += 10;
98 eGamma.resize(nLevelMax);
99 wGamma.resize(nLevelMax);
100 kICC.resize(nLevelMax);
101 }
102 }
103 // end of reading
104 if(0 < nLevels) {
105 MakeNewLevel(levels);
106 inFile.close();
107 }
108}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout

Referenced by G4LevelManager::G4LevelManager().

◆ SetVerbose()

void G4LevelReader::SetVerbose ( G4int  val)
inline

Definition at line 104 of file G4LevelReader.hh.

105{
106 fVerbose = val;
107}

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