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

#include <G4NeutronHPLevel.hh>

Public Member Functions

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

Detailed Description

Definition at line 40 of file G4NeutronHPLevel.hh.

Constructor & Destructor Documentation

◆ G4NeutronHPLevel()

G4NeutronHPLevel::G4NeutronHPLevel ( )
inline

Definition at line 44 of file G4NeutronHPLevel.hh.

45 {
46 nGammas = 0;
47 theGammas = 0;
48 }

◆ ~G4NeutronHPLevel()

G4NeutronHPLevel::~G4NeutronHPLevel ( )

Definition at line 33 of file G4NeutronHPLevel.cc.

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

Member Function Documentation

◆ GetDecayGammas()

G4DynamicParticleVector * G4NeutronHPLevel::GetDecayGammas ( )

Definition at line 64 of file G4NeutronHPLevel.cc.

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

Referenced by G4NeutronHPGamma::GetDecayGammas().

◆ GetGammaEnergy()

G4double G4NeutronHPLevel::GetGammaEnergy ( G4int  i)

Definition at line 59 of file G4NeutronHPLevel.cc.

60 {
61 return theGammas[i]->GetGammaEnergy();
62 }
G4double GetGammaEnergy()

◆ GetLevelEnergy()

G4double G4NeutronHPLevel::GetLevelEnergy ( )
inline

◆ SetGamma()

void G4NeutronHPLevel::SetGamma ( G4int  i,
G4NeutronHPGamma aGamma 
)

Definition at line 53 of file G4NeutronHPLevel.cc.

54 {
55 theGammas[i] = aGamma;
57 }
G4double GetLevelEnergy()
void SetLevelEnergy(G4double anEnergy)

Referenced by G4NeutronHPDeExGammas::Init().

◆ SetLevelEnergy()

void G4NeutronHPLevel::SetLevelEnergy ( G4double  anEnergy)
inline

Definition at line 58 of file G4NeutronHPLevel.hh.

59 {
60 levelEnergy = anEnergy;
61 }

Referenced by SetGamma().

◆ SetNumberOfGammas()

void G4NeutronHPLevel::SetNumberOfGammas ( G4int  aGammas)

Definition at line 42 of file G4NeutronHPLevel.cc.

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

Referenced by G4NeutronHPDeExGammas::Init().


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