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

#include <G4LevelManager.hh>

Public Member Functions

 G4LevelManager (G4int Z, G4int A, G4LevelReader &reader, const G4String &filename)
 
 ~G4LevelManager ()
 
G4int NumberOfLevels () const
 
const G4NucLevelGetLevel (G4int i) const
 
const G4NucLevelNearestLevel (G4double energy) const
 

Detailed Description

Definition at line 56 of file G4LevelManager.hh.

Constructor & Destructor Documentation

◆ G4LevelManager()

G4LevelManager::G4LevelManager ( G4int  Z,
G4int  A,
G4LevelReader reader,
const G4String filename 
)

Definition at line 46 of file G4LevelManager.cc.

48 : theZ(Z),theA(A),fEdiffMax(100*keV)
49{
50 reader.FillLevels(Z, A, &fLevel, filename);
51 nLevels = fLevel.size();
52}
void FillLevels(G4int Z, G4int A, std::vector< G4NucLevel * > *levels, const G4String &filename)

◆ ~G4LevelManager()

G4LevelManager::~G4LevelManager ( )

Definition at line 54 of file G4LevelManager.cc.

55{
56 if(nLevels > 0) {
57 for(G4int i=0; i<nLevels; ++i) { delete fLevel[i]; }
58 }
59}
int G4int
Definition: G4Types.hh:66

Member Function Documentation

◆ GetLevel()

const G4NucLevel * G4LevelManager::GetLevel ( G4int  i) const
inline

Definition at line 91 of file G4LevelManager.hh.

92{
93 return fLevel[i];
94}

◆ NearestLevel()

const G4NucLevel * G4LevelManager::NearestLevel ( G4double  energy) const
inline

Definition at line 97 of file G4LevelManager.hh.

98{
99 const G4NucLevel* p = 0;
100 if(energy < fLevel[nLevels-1]->LevelEnergy() + fEdiffMax) {
101 for(G4int i=nLevels-1; i>=0; --i) {
102 p = fLevel[i];
103 G4double lEnergy = p->LevelEnergy();
104 if(0 == i || energy > lEnergy) { break; }
105 if(lEnergy - energy <= 0.5*(lEnergy - fLevel[i-1]->LevelEnergy()))
106 { break; }
107 }
108 }
109 return p;
110}
double G4double
Definition: G4Types.hh:64
G4double LevelEnergy() const
Definition: G4NucLevel.hh:85

◆ NumberOfLevels()

G4int G4LevelManager::NumberOfLevels ( ) const
inline

Definition at line 86 of file G4LevelManager.hh.

87{
88 return nLevels;
89}

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