#include <G4ParticleHPNucLevel.hh>
Definition at line 40 of file G4ParticleHPNucLevel.hh.
◆ G4ParticleHPNucLevel() [1/2]
G4ParticleHPNucLevel::G4ParticleHPNucLevel |
( |
G4double | e | ) |
|
|
explicit |
◆ ~G4ParticleHPNucLevel()
G4ParticleHPNucLevel::~G4ParticleHPNucLevel |
( |
| ) |
|
|
default |
◆ G4ParticleHPNucLevel() [2/2]
◆ AddGamma()
Definition at line 37 of file G4ParticleHPNucLevel.cc.
38{
39 gammaData x;
40 x.gammaEnergy = e;
41 x.cumProbability = w;
42 x.next = idx;
43 gammas.push_back(x);
44 ++nGammas;
45}
◆ GetDecayGamma()
Definition at line 69 of file G4ParticleHPNucLevel.cc.
70{
71 if (gammas.empty()) {
72 return nullptr;
73 }
76 for (auto& gam : gammas) {
77 if (q <=
gam.cumProbability) {
80 break;
81 }
82 }
83 if (e <= 0.0) {
84 return nullptr;
85 }
87 p *= e;
89 res->SetMomentum(p);
90 res->SetKineticEnergy(e);
91 return res;
92}
G4ThreeVector G4RandomDirection()
◆ GetGammaEnergy()
Definition at line 56 of file G4ParticleHPNucLevel.hh.
57 {
58 return (idx < nGammas && idx >= 0) ? gammas[idx].gammaEnergy : 0.0;
59 }
◆ GetLevelEnergy()
G4double G4ParticleHPNucLevel::GetLevelEnergy |
( |
| ) |
const |
|
inline |
◆ GetNumberOfGammas()
G4double G4ParticleHPNucLevel::GetNumberOfGammas |
( |
| ) |
const |
|
inline |
◆ Normalize()
void G4ParticleHPNucLevel::Normalize |
( |
| ) |
|
Definition at line 47 of file G4ParticleHPNucLevel.cc.
48{
49 if (gammas.empty()) {
50 return;
51 }
53 for (auto& gam : gammas) {
54 sum +=
gam.cumProbability;
55 }
56 if (sum <= 0.0) {
57 return;
58 }
59
61 sum = 0;
62 for (auto& gam : gammas) {
63 sum += norm *
gam.cumProbability;
64 gam.cumProbability = sum;
65 }
66 gammas[nGammas - 1].cumProbability = 1.0;
67}
◆ operator=()
The documentation for this class was generated from the following files: