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

#include <G4ParticleHPLevel.hh>

Public Member Functions

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

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 }

◆ ~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

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()

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 }

◆ 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)

Referenced by G4ParticleHPDeExGammas::Init().

◆ SetLevelEnergy()

void G4ParticleHPLevel::SetLevelEnergy ( G4double  anEnergy)
inline

Definition at line 59 of file G4ParticleHPLevel.hh.

60 {
61 levelEnergy = anEnergy;
62 }

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;
52 theGammas = new G4ParticleHPGamma * [nGammas];
53 }

Referenced by G4ParticleHPDeExGammas::Init().


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