#include <G4NeutronHPLevel.hh>
Public Member Functions | |
G4NeutronHPLevel () | |
~G4NeutronHPLevel () | |
void | SetNumberOfGammas (G4int aGammas) |
void | SetGamma (G4int i, G4NeutronHPGamma *aGamma) |
G4DynamicParticleVector * | GetDecayGammas () |
void | SetLevelEnergy (G4double anEnergy) |
G4double | GetLevelEnergy () |
G4double | GetGammaEnergy (G4int i) |
Definition at line 40 of file G4NeutronHPLevel.hh.
G4NeutronHPLevel::G4NeutronHPLevel | ( | ) | [inline] |
G4NeutronHPLevel::~G4NeutronHPLevel | ( | ) |
Definition at line 33 of file G4NeutronHPLevel.cc.
00034 { 00035 if(theGammas != 0) 00036 { 00037 for(G4int i=0; i<nGammas; i++) delete theGammas[i]; 00038 } 00039 delete [] theGammas; 00040 }
G4DynamicParticleVector * G4NeutronHPLevel::GetDecayGammas | ( | ) |
Definition at line 64 of file G4NeutronHPLevel.cc.
References G4UniformRand, G4NeutronHPGamma::GetDecayGammas(), and G4NeutronHPGamma::GetWeight().
Referenced by G4NeutronHPGamma::GetDecayGammas().
00065 { 00066 G4DynamicParticleVector * theResult; 00067 G4double sum = 0; 00068 G4double * running = new G4double[nGammas]; 00069 running[0] = 0; 00070 G4int i; 00071 for(i=0; i<nGammas; i++) 00072 { 00073 if(i!=0) running[i]=running[i-1]; 00074 running[i]+=theGammas[i]->GetWeight(); 00075 } 00076 sum = running[nGammas-1]; 00077 G4int it(0); 00078 G4double random = G4UniformRand(); 00079 for(i=0; i<nGammas; i++) 00080 { 00081 it = i; 00082 if(random*sum < running[i]) break; 00083 } 00084 delete [] running; 00085 theResult = theGammas[it]->GetDecayGammas(); 00086 return theResult; 00087 }
Definition at line 59 of file G4NeutronHPLevel.cc.
References G4NeutronHPGamma::GetGammaEnergy().
00060 { 00061 return theGammas[i]->GetGammaEnergy(); 00062 }
G4double G4NeutronHPLevel::GetLevelEnergy | ( | ) | [inline] |
Definition at line 63 of file G4NeutronHPLevel.hh.
Referenced by G4NeutronHPInelasticCompFS::CompositeApply(), and G4NeutronHPDeExGammas::GetLevelEnergy().
void G4NeutronHPLevel::SetGamma | ( | G4int | i, | |
G4NeutronHPGamma * | aGamma | |||
) |
Definition at line 53 of file G4NeutronHPLevel.cc.
References G4NeutronHPGamma::GetLevelEnergy(), and SetLevelEnergy().
00054 { 00055 theGammas[i] = aGamma; 00056 SetLevelEnergy(aGamma->GetLevelEnergy()); 00057 }
void G4NeutronHPLevel::SetLevelEnergy | ( | G4double | anEnergy | ) | [inline] |
void G4NeutronHPLevel::SetNumberOfGammas | ( | G4int | aGammas | ) |
Definition at line 42 of file G4NeutronHPLevel.cc.
00043 { 00044 nGammas = aGammas; 00045 if(theGammas != 0) 00046 { 00047 for(G4int i=0; i<nGammas; i++) delete theGammas[i]; 00048 } 00049 delete [] theGammas; 00050 theGammas = new G4NeutronHPGamma * [nGammas]; 00051 }