Geant4 11.4.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
PoPI_nuclideGammaBranching.cc
Go to the documentation of this file.
1/*
2# <<BEGIN-copyright>>
3# Copyright 2019, Lawrence Livermore National Security, LLC.
4# This file is part of the gidiplus package (https://github.com/LLNL/gidiplus).
5# gidiplus is licensed under the MIT license (see https://opensource.org/licenses/MIT).
6# SPDX-License-Identifier: MIT
7# <<END-copyright>>
8*/
9
10#include "PoPI.hpp"
11
12namespace PoPI {
13
14/*! \class NuclideGammaBranchInfo
15 * Class storing information about the gamma (i.e., photon) decay of an excited nuclide state to a lower state.
16 */
17
18/* *********************************************************************************************************//**
19 * @param a_probability [in] The probability that the level decays to state *a_residualState*.
20 * @param a_photonEmissionProbability [in] The conditional probability the the decay emitted a photon.
21 * @param a_gammaEnergy [in] The energy of the emitted photon.
22 * @param a_residualState [in] The state the residual is left in after photon decay.
23 ***********************************************************************************************************/
24
25NuclideGammaBranchInfo::NuclideGammaBranchInfo( double a_probability, double a_photonEmissionProbability, double a_gammaEnergy,
26 std::string const &a_residualState ) :
27 m_probability( a_probability ),
28 m_photonEmissionProbability( a_photonEmissionProbability ),
29 m_gammaEnergy( a_gammaEnergy ),
30 m_residualState( a_residualState ) {
31
32}
33
34/* *********************************************************************************************************//**
35 * Copy constructor.
36
37 * @param a_nuclideGammaBranchInfo [in] The *NuclideGammaBranchInfo* instance to copy.
38 ***********************************************************************************************************/
39
41 m_probability( a_nuclideGammaBranchInfo.probability( ) ),
42 m_photonEmissionProbability( a_nuclideGammaBranchInfo.photonEmissionProbability( ) ),
43 m_gammaEnergy( a_nuclideGammaBranchInfo.gammaEnergy( ) ),
44 m_residualState( a_nuclideGammaBranchInfo.residualState( ) ) {
45
46}
47
48/*
49============================================================
50================= NuclideGammaBranchStateInfo ================
51============================================================
52*/
53NuclideGammaBranchStateInfo::NuclideGammaBranchStateInfo( std::string const &a_state, int a_intid, std::string const &a_kind,
54 double a_nuclearLevelEnergy ) :
55 m_state( a_state ),
56 m_intid( a_intid ),
57 m_kind( a_kind ),
58 m_nuclearLevelEnergy( a_nuclearLevelEnergy ),
59 m_nuclearLevelEnergyWidth( 0.0 ),
60 m_derivedCalculated( false ),
61 m_multiplicity( 0.0 ),
62 m_averageGammaEnergy( 0.0 ) {
63
64}
65/*
66=========================================================
67*/
68void NuclideGammaBranchStateInfo::add( NuclideGammaBranchInfo const &a_nuclideGammaBranchInfo ) {
69
70 m_branches.push_back( a_nuclideGammaBranchInfo );
71}
72/*
73=========================================================
74*/
76
77 if( m_derivedCalculated ) return;
78
79 for( std::size_t i1 = 0; i1 < m_branches.size( ); ++i1 ) {
80 NuclideGammaBranchInfo &nuclideGammaBranchInfo = m_branches[i1];
81
82 std::string const &residualState = nuclideGammaBranchInfo.residualState( );
83 NuclideGammaBranchStateInfo *nuclideGammaBranchStateInfo = a_nuclideGammaBranchStateInfos.find( residualState );
84
85 double chainedMultiplicity = 0.0;
86 double chainedAverageGammaEnergy = 0.0;
87 if( nuclideGammaBranchStateInfo != nullptr ) {
88 nuclideGammaBranchStateInfo->calculateDerivedData( a_nuclideGammaBranchStateInfos );
89 chainedMultiplicity = nuclideGammaBranchStateInfo->multiplicity( );
90 chainedAverageGammaEnergy = nuclideGammaBranchStateInfo->averageGammaEnergy( );
91 }
92
93 m_multiplicity += nuclideGammaBranchInfo.probability( ) * ( nuclideGammaBranchInfo.photonEmissionProbability( ) + chainedMultiplicity );
94 m_averageGammaEnergy += nuclideGammaBranchInfo.probability( ) *
95 ( nuclideGammaBranchInfo.photonEmissionProbability( ) * nuclideGammaBranchInfo.gammaEnergy( ) + chainedAverageGammaEnergy );
96 }
97
98 m_derivedCalculated = true;
99}
100
101/*
102============================================================
103================ NuclideGammaBranchStateInfos ================
104============================================================
105*/
109
110/* *********************************************************************************************************//**
111 ***********************************************************************************************************/
112
114
115 for( std::size_t i1 = 0; i1 < m_nuclideGammaBranchStateInfos.size( ); ++i1 ) delete m_nuclideGammaBranchStateInfos[i1];
116}
117/*
118=========================================================
119*/
121
122 m_nuclideGammaBranchStateInfos.push_back( a_nuclideGammaBranchStateInfo );
123}
124
125/* *********************************************************************************************************//**
126 * This method returns a pointer to the NuclideGammaBranchStateInfo instance for *a_state* or nullptr if not match is found.
127 *
128 * @param a_state [in] The PoPs id for the requested state (i.e., nuclide).
129 *
130 * @return A pointer to the requested NuclideGammaBranchStateInfo instance or nullptr if not match is found.
131 ***********************************************************************************************************/
132
134
135 for( std::size_t i1 = 0; i1 < m_nuclideGammaBranchStateInfos.size( ); ++i1 ) {
136 NuclideGammaBranchStateInfo *nuclideGammaBranchStateInfo = m_nuclideGammaBranchStateInfos[i1];
137
138 if( nuclideGammaBranchStateInfo->state( ) == a_state ) return( nuclideGammaBranchStateInfo );
139 }
140
141 return( nullptr );
142}
143
144/* *********************************************************************************************************//**
145 * This method returns a const pointer to the NuclideGammaBranchStateInfo instance for *a_state* or nullptr if not match is found.
146 *
147 * @param a_state [in] The PoPs id for the requested state (i.e., nuclide).
148 *
149 * @return A const pointer to the requested NuclideGammaBranchStateInfo instance or nullptr if not match is found.
150 ***********************************************************************************************************/
151
152NuclideGammaBranchStateInfo const *NuclideGammaBranchStateInfos::find( std::string const &a_state ) const {
153
154 for( std::size_t i1 = 0; i1 < m_nuclideGammaBranchStateInfos.size( ); ++i1 ) {
155 NuclideGammaBranchStateInfo *nuclideGammaBranchStateInfo = m_nuclideGammaBranchStateInfos[i1];
156
157 if( nuclideGammaBranchStateInfo->state( ) == a_state ) return( nuclideGammaBranchStateInfo );
158 }
159
160 return( nullptr );
161}
162
163}
double probability() const
Definition PoPI.hpp:560
NuclideGammaBranchInfo(double a_probability, double a_photonEmissionProbability, double a_gammaEnergy, std::string const &a_residualState)
double photonEmissionProbability() const
Definition PoPI.hpp:561
std::string const & residualState() const
Definition PoPI.hpp:564
double gammaEnergy() const
Definition PoPI.hpp:563
double averageGammaEnergy() const
Definition PoPI.hpp:599
void calculateDerivedData(NuclideGammaBranchStateInfos &a_nuclideGammaBranchStateInfos)
std::string const & state() const
Definition PoPI.hpp:589
void add(NuclideGammaBranchInfo const &a_nuclideGammaBranchInfo)
NuclideGammaBranchStateInfo(std::string const &a_state, int a_intid, std::string const &a_kind, double a_nuclearLevelEnergy)
NuclideGammaBranchStateInfo * find(std::string const &a_state)
void add(NuclideGammaBranchStateInfo *a_nuclideGammaBranchStateInfo)
Definition PoPI.hpp:28