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

#include <G4NuclearLevelManager.hh>

Public Member Functions

 G4NuclearLevelManager (G4int Z, G4int A, const G4String &filename)
 
 G4NuclearLevelManager (const G4NuclearLevelManager &right)
 
 ~G4NuclearLevelManager ()
 
void SetNucleus (G4int Z, G4int A, const G4String &filename)
 
G4bool IsValid () const
 
G4int NumberOfLevels () const
 
const G4NuclearLevelGetLevel (G4int i) const
 
const G4NuclearLevelNearestLevel (G4double energy, G4double eDiffMax=9999.*CLHEP::GeV) const
 
const G4NuclearLevelLowestLevel () const
 
const G4NuclearLevelHighestLevel () const
 
G4double MinLevelEnergy () const
 
G4double MaxLevelEnergy () const
 
void PrintAll ()
 

Detailed Description

Definition at line 65 of file G4NuclearLevelManager.hh.

Constructor & Destructor Documentation

◆ G4NuclearLevelManager() [1/2]

G4NuclearLevelManager::G4NuclearLevelManager ( G4int  Z,
G4int  A,
const G4String filename 
)

Definition at line 67 of file G4NuclearLevelManager.cc.

67 :
68 _nucleusA(A), _nucleusZ(Z), _fileName(filename), _validity(false),
69 _levels(0), _levelEnergy(0), _gammaEnergy(0), _probability(0)
70{
71 if (A <= 0 || Z <= 0 || Z > A )
72 throw G4HadronicException(__FILE__, __LINE__, "==== G4NuclearLevelManager ==== (Z,A) <0, or Z>A");
73
74 MakeLevels();
75}

◆ G4NuclearLevelManager() [2/2]

G4NuclearLevelManager::G4NuclearLevelManager ( const G4NuclearLevelManager right)

Definition at line 367 of file G4NuclearLevelManager.cc.

368{
369 _levelEnergy = right._levelEnergy;
370 _gammaEnergy = right._gammaEnergy;
371 _probability = right._probability;
372 _polarity = right._polarity;
373 _halfLife = right._halfLife;
374 _angularMomentum = right._angularMomentum;
375 _kCC = right._kCC;
376 _l1CC = right._l1CC;
377 _l2CC = right._l2CC;
378 _l3CC = right._l3CC;
379 _m1CC = right._m1CC;
380 _m2CC = right._m2CC;
381 _m3CC = right._m3CC;
382 _m4CC = right._m4CC;
383 _m5CC = right._m5CC;
384 _nPlusCC = right._nPlusCC;
385 _totalCC = right._totalCC;
386 _nucleusA = right._nucleusA;
387 _nucleusZ = right._nucleusZ;
388 _fileName = right._fileName;
389 _validity = right._validity;
390
391 if (right._levels != 0)
392 {
393 _levels = new G4PtrLevelVector;
394 G4int n = right._levels->size();
395 G4int i;
396 for (i=0; i<n; ++i)
397 {
398 _levels->push_back(new G4NuclearLevel(*(right.GetLevel(i))));
399 }
400
401 G4PtrSort<G4NuclearLevel>(_levels);
402 }
403 else
404 {
405 _levels = 0;
406 }
407 for (G4int i=0; i<30; ++i) {
408 buffer[i] = right.buffer[i];
409 }
410}
std::vector< G4NuclearLevel * > G4PtrLevelVector
int G4int
Definition: G4Types.hh:66
const G4NuclearLevel * GetLevel(G4int i) const

◆ ~G4NuclearLevelManager()

G4NuclearLevelManager::~G4NuclearLevelManager ( )

Definition at line 77 of file G4NuclearLevelManager.cc.

78{
79 ClearLevels();
80}

Member Function Documentation

◆ GetLevel()

const G4NuclearLevel * G4NuclearLevelManager::GetLevel ( G4int  i) const

Definition at line 96 of file G4NuclearLevelManager.cc.

96 {
97 return (i>=0 && i<NumberOfLevels()) ? (*_levels)[i] : 0;
98}

Referenced by G4ContinuumGammaTransition::G4ContinuumGammaTransition(), G4NuclearLevelManager(), NearestLevel(), and PrintAll().

◆ HighestLevel()

const G4NuclearLevel * G4NuclearLevelManager::HighestLevel ( ) const

Definition at line 141 of file G4NuclearLevelManager.cc.

142{
143 return (NumberOfLevels() > 0) ? _levels->front() : 0;
144}

◆ IsValid()

G4bool G4NuclearLevelManager::IsValid ( ) const
inline

Definition at line 78 of file G4NuclearLevelManager.hh.

78{ return _validity; }

Referenced by G4DiscreteGammaDeexcitation::CreateTransition().

◆ LowestLevel()

const G4NuclearLevel * G4NuclearLevelManager::LowestLevel ( ) const

Definition at line 147 of file G4NuclearLevelManager.cc.

148{
149 return (NumberOfLevels() > 0) ? _levels->back() : 0;
150}

◆ MaxLevelEnergy()

G4double G4NuclearLevelManager::MaxLevelEnergy ( ) const

◆ MinLevelEnergy()

G4double G4NuclearLevelManager::MinLevelEnergy ( ) const

Definition at line 129 of file G4NuclearLevelManager.cc.

130{
131 return (NumberOfLevels() > 0) ? _levels->front()->Energy() : 9999.*GeV;
132}

Referenced by G4DiscreteGammaDeexcitation::CanDoTransition(), G4ContinuumGammaTransition::G4ContinuumGammaTransition(), and PrintAll().

◆ NearestLevel()

const G4NuclearLevel * G4NuclearLevelManager::NearestLevel ( G4double  energy,
G4double  eDiffMax = 9999.*CLHEP::GeV 
) const

Definition at line 102 of file G4NuclearLevelManager.cc.

104{
105 if (NumberOfLevels() <= 0) return 0;
106
107 G4int iNear = -1;
108
109 //G4cout << "G4NuclearLevelManager::NearestLevel E(MeV)= "
110 // << energy/MeV << " dEmax(MeV)= " << eDiffMax/MeV << G4endl;
111
112 G4double diff = 9999. * GeV;
113 for (unsigned int i=0; i<_levels->size(); i++)
114 {
115 G4double e = GetLevel(i)->Energy();
116 G4double eDiff = std::abs(e - energy);
117 //G4cout << i << ". eDiff(MeV)= " << eDiff/MeV << G4endl;
118 if (eDiff < diff && eDiff <= eDiffMax)
119 {
120 diff = eDiff;
121 iNear = i;
122 }
123 }
124
125 return GetLevel(iNear); // Includes range checking on iNear
126}
double G4double
Definition: G4Types.hh:64
G4double Energy() const

Referenced by G4RadioactiveDecay::AddDecayRateTable(), G4DiscreteGammaDeexcitation::CanDoTransition(), G4DiscreteGammaDeexcitation::CreateTransition(), and G4ContinuumGammaTransition::SelectGamma().

◆ NumberOfLevels()

G4int G4NuclearLevelManager::NumberOfLevels ( ) const
inline

◆ PrintAll()

void G4NuclearLevelManager::PrintAll ( )

Definition at line 353 of file G4NuclearLevelManager.cc.

354{
355 G4int nLevels = NumberOfLevels();
356
357 G4cout << " ==== G4NuclearLevelManager ==== (" << _nucleusZ << ", " << _nucleusA
358 << ") has " << nLevels << " levels" << G4endl
359 << "Highest level is at energy " << MaxLevelEnergy() << " MeV "
360 << G4endl << "Lowest level is at energy " << MinLevelEnergy()
361 << " MeV " << G4endl;
362
363 for (G4int i=0; i<nLevels; i++)
364 GetLevel(i)->PrintAll();
365}
#define G4endl
Definition: G4ios.hh:52
G4DLLIMPORT std::ostream G4cout
void PrintAll() const

◆ SetNucleus()

void G4NuclearLevelManager::SetNucleus ( G4int  Z,
G4int  A,
const G4String filename 
)

Definition at line 82 of file G4NuclearLevelManager.cc.

83{
84 if (A <= 0 || Z <= 0 || Z > A )
85 throw G4HadronicException(__FILE__, __LINE__, "==== G4NuclearLevelManager ==== (Z,A) <0, or Z>A");
86
87 if (_nucleusZ != Z || _nucleusA != A)
88 {
89 _nucleusA = A;
90 _nucleusZ = Z;
91 _fileName = filename;
92 MakeLevels();
93 }
94}

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