Geant4-11
Public Member Functions | Private Attributes
G4ParticleHPLevel Class Reference

#include <G4ParticleHPLevel.hh>

Public Member Functions

 G4ParticleHPLevel ()
 
G4DynamicParticleVectorGetDecayGammas ()
 
G4double GetGammaEnergy (G4int i)
 
G4double GetLevelEnergy ()
 
void SetGamma (G4int i, G4ParticleHPGamma *aGamma)
 
void SetLevelEnergy (G4double anEnergy)
 
void SetNumberOfGammas (G4int aGammas)
 
 ~G4ParticleHPLevel ()
 

Private Attributes

G4double levelEnergy
 
G4int nGammas
 
G4ParticleHPGamma ** theGammas
 

Detailed Description

Definition at line 40 of file G4ParticleHPLevel.hh.

Constructor & Destructor Documentation

◆ G4ParticleHPLevel()

G4ParticleHPLevel::G4ParticleHPLevel ( )
inline

Definition at line 44 of file G4ParticleHPLevel.hh.

45 {
46 nGammas = 0;
47 theGammas = 0;
48 levelEnergy = 0.0;
49 }
G4ParticleHPGamma ** theGammas

References levelEnergy, nGammas, and theGammas.

◆ ~G4ParticleHPLevel()

G4ParticleHPLevel::~G4ParticleHPLevel ( )

Definition at line 35 of file G4ParticleHPLevel.cc.

36 {
37 if(theGammas != 0)
38 {
39 for(G4int i=0; i<nGammas; i++) delete theGammas[i];
40 }
41 delete [] theGammas;
42 }
int G4int
Definition: G4Types.hh:85

References nGammas, and theGammas.

Member Function Documentation

◆ GetDecayGammas()

G4DynamicParticleVector * G4ParticleHPLevel::GetDecayGammas ( )

Definition at line 66 of file G4ParticleHPLevel.cc.

67 {
68 G4DynamicParticleVector * theResult;
69 G4double sum = 0;
70 G4double * running = new G4double[nGammas];
71 running[0] = 0;
72 G4int i;
73 for(i=0; i<nGammas; i++)
74 {
75 if(i!=0) running[i]=running[i-1];
76 running[i]+=theGammas[i]->GetWeight();
77 }
78 sum = running[nGammas-1];
79 G4int it(0);
80 G4double random = G4UniformRand();
81 for(i=0; i<nGammas; i++)
82 {
83 it = i;
84 if(random*sum < running[i]) break;
85 }
86 delete [] running;
87 theResult = theGammas[it]->GetDecayGammas();
88 return theResult;
89 }
std::vector< G4DynamicParticle * > G4DynamicParticleVector
double G4double
Definition: G4Types.hh:83
#define G4UniformRand()
Definition: Randomize.hh:52
G4DynamicParticleVector * GetDecayGammas()

References G4UniformRand, G4ParticleHPGamma::GetDecayGammas(), G4ParticleHPGamma::GetWeight(), nGammas, and theGammas.

Referenced by G4ParticleHPGamma::GetDecayGammas().

◆ GetGammaEnergy()

G4double G4ParticleHPLevel::GetGammaEnergy ( G4int  i)

Definition at line 61 of file G4ParticleHPLevel.cc.

62 {
63 return theGammas[i]->GetGammaEnergy();
64 }

References G4ParticleHPGamma::GetGammaEnergy(), and theGammas.

◆ GetLevelEnergy()

G4double G4ParticleHPLevel::GetLevelEnergy ( )
inline

◆ SetGamma()

void G4ParticleHPLevel::SetGamma ( G4int  i,
G4ParticleHPGamma aGamma 
)

Definition at line 55 of file G4ParticleHPLevel.cc.

56 {
57 theGammas[i] = aGamma;
59 }
void SetLevelEnergy(G4double anEnergy)

References G4ParticleHPGamma::GetLevelEnergy(), SetLevelEnergy(), and theGammas.

Referenced by G4ParticleHPDeExGammas::Init().

◆ SetLevelEnergy()

void G4ParticleHPLevel::SetLevelEnergy ( G4double  anEnergy)
inline

Definition at line 59 of file G4ParticleHPLevel.hh.

60 {
61 levelEnergy = anEnergy;
62 }

References levelEnergy.

Referenced by SetGamma().

◆ SetNumberOfGammas()

void G4ParticleHPLevel::SetNumberOfGammas ( G4int  aGammas)

Definition at line 44 of file G4ParticleHPLevel.cc.

45 {
46 nGammas = aGammas;
47 if(theGammas != 0)
48 {
49 for(G4int i=0; i<nGammas; i++) delete theGammas[i];
50 }
51 delete [] theGammas;
53 }

References nGammas, and theGammas.

Referenced by G4ParticleHPDeExGammas::Init().

Field Documentation

◆ levelEnergy

G4double G4ParticleHPLevel::levelEnergy
private

Definition at line 73 of file G4ParticleHPLevel.hh.

Referenced by G4ParticleHPLevel(), GetLevelEnergy(), and SetLevelEnergy().

◆ nGammas

G4int G4ParticleHPLevel::nGammas
private

◆ theGammas

G4ParticleHPGamma** G4ParticleHPLevel::theGammas
private

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