Skip to content

Commit

Permalink
Small changes to reaction line handling.
Browse files Browse the repository at this point in the history
Fixed mouse-over info on reactions a bit, and removed the nuclide suggestion from showing duplicate reaction entries.
  • Loading branch information
wcjohns committed Jun 18, 2024
1 parent 2a0e526 commit fc1ffdf
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 47 deletions.
44 changes: 22 additions & 22 deletions data/sandia.reactiongamma.xml
Original file line number Diff line number Diff line change
Expand Up @@ -139,8 +139,8 @@
<energy remark="DB, Strong">2312.59</energy>
</energies>
<yields>
<yield remark="yield not specified, using 100% as a placeholder">100</yield>
<yield remark="yield not specified, using 100% as a placeholder">100</yield>
<yield remark="Yield not specified, using 100% as a placeholder">100</yield>
<yield remark="Yield not specified, using 100% as a placeholder">100</yield>
</yields>
</target>

Expand All @@ -164,7 +164,7 @@
<yield>21.20</yield>
<yield>0.20</yield>
<yield>5.20</yield>
<yield remark="yield not specified, using 100% as a placeholder">100</yield>
<yield remark="Yield not specified, using 100% as a placeholder">100</yield>
<yield>0.40</yield>
<yield>0.10</yield>
<yield>1.10</yield>
Expand All @@ -191,11 +191,11 @@
<yields>
<yield>58.60</yield>
<yield>8.30</yield>
<yield remark="yield not specified, using 1% as a placeholder">1</yield>
<yield remark="yield not specified, using 1% as a placeholder">1</yield>
<yield remark="Yield not specified, using 1% as a placeholder">1</yield>
<yield remark="Yield not specified, using 1% as a placeholder">1</yield>
<yield>9.00</yield>
<yield>100.00</yield>
<yield remark="yield not specified, using 100% as a placeholder">100</yield>
<yield remark="Yield not specified, using 100% as a placeholder">100</yield>
<yield>5.50</yield>
<yield>10.70</yield>
<yield>12.40</yield>
Expand Down Expand Up @@ -244,7 +244,7 @@
<yield>100.00</yield>
<yield>5.70</yield>
<yield>1.00</yield>
<yield remark="yield not specified, using 100% as a placeholder">100</yield>
<yield remark="Yield not specified, using 100% as a placeholder">100</yield>
</yields>
</target>

Expand Down Expand Up @@ -484,14 +484,14 @@
<yield>1332.48</yield>
<yield>4.9</yield>
<yield>2.1</yield>
<yield remark="yield not specified, using 100% as a placeholder">100</yield>
<yield remark="Yield not specified, using 100% as a placeholder">100</yield>
<yield>100.0</yield>
<yield>0.4</yield>
<yield>7.1</yield>
<yield remark="yield not specified, using 100% as a placeholder">100</yield>
<yield remark="Yield not specified, using 100% as a placeholder">100</yield>
<yield>11.4</yield>
<yield>2.9</yield>
<yield remark="yield not specified, using 100% as a placeholder">100</yield>
<yield remark="Yield not specified, using 100% as a placeholder">100</yield>
</yields>
</target>

Expand All @@ -509,7 +509,7 @@
</energies>
<yields>
<yield>100.00</yield>
<yield remark="yield not specified, using 1% as a placeholder">1</yield>
<yield remark="Yield not specified, using 1% as a placeholder">1</yield>
<yield>0.80</yield>
<yield>4.90</yield>
<yield>27.70</yield>
Expand Down Expand Up @@ -86443,14 +86443,14 @@ https://arxiv.org/abs/2001.11140
<energies>
<energy remark="Narrow">843.76</energy>
<energy remark="">1014.52</energy>
<energy remark="ENSDF, Doppler Broadened, on 2236 keV SE shoulder">1720.3</energy>
<energy remark="ENSDF, Doppler Broadened">2212.01</energy>
<energy remark="from ENSDF, Doppler Broadened, on 2236 keV SE shoulder">1720.3</energy>
<energy remark="from ENSDF, Doppler Broadened">2212.01</energy>
</energies>
<yields>
<yield remark="actual value 6.5%">100</yield>
<yield remark="actual value 5.5">100</yield>
<yield remark="yield not specified, using 100% as a placeholder">100</yield>
<yield remark="yield not specified, using 100% as a placeholder">100</yield>
<yield remark="Actual yield 6.5%, but using 100% as placeholder">100</yield>
<yield remark="Actual yield 5.5%, but using 100% as placeholder">100</yield>
<yield remark="Yield not specified, using 100% as a placeholder">100</yield>
<yield remark="Yield not specified, using 100% as a placeholder">100</yield>
</yields>
</target>

Expand All @@ -86474,7 +86474,7 @@ https://arxiv.org/abs/2001.11140
<energy>4439.82</energy>
</energies>
<yields>
<yield remark="yield not specified, using 100% as a placeholder">100</yield>
<yield remark="Yield not specified, using 100% as a placeholder">100</yield>
</yields>
</target>

Expand All @@ -86498,7 +86498,7 @@ https://arxiv.org/abs/2001.11140
<energy remark="Giles did not observe">1434.068</energy>
</energies>
<yields>
<yield remark="yield not specified, using 100% as a placeholder">100</yield>
<yield remark="Yield not specified, using 100% as a placeholder">100</yield>
</yields>
</target>

Expand Down Expand Up @@ -86543,7 +86543,7 @@ https://arxiv.org/abs/2001.11140
<yield>56.50</yield>
<yield>100.00</yield>
<yield>1.40</yield>
<yield remark="yield not specified, using 100% as a placeholder">100</yield>
<yield remark="Yield not specified, using 100% as a placeholder">100</yield>
<yield>1.30</yield>
<yield>0.30</yield>
<yield>0.30</yield>
Expand All @@ -86560,7 +86560,7 @@ https://arxiv.org/abs/2001.11140
</energies>
<yields>
<yield>84.30</yield>
<yield remark="yield not specified, using 100% as a placeholder">100</yield>
<yield remark="Yield not specified, using 100% as a placeholder">100</yield>
</yields>
</target>

Expand Down Expand Up @@ -86706,7 +86706,7 @@ https://arxiv.org/abs/2001.11140
<energy remark="Doppler Broadened, 28Si(a,p) similar E">2235.322</energy>
</energies>
<yields>
<yield remark="yield not specified, using 100% as a placeholder">100</yield>
<yield remark="Yield not specified, using 100% as a placeholder">100</yield>
</yields>
</target>

Expand Down
7 changes: 5 additions & 2 deletions src/IsotopeNameFilterModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -638,11 +638,14 @@ std::vector<const ReactionGamma::Reaction *>
for( const SandiaDecay::Nuclide *nuc : suggestions )
reactionDb->reactions( nuc, suggest_reactions );

//make all rections uniqe and sorted (in not the most effiecient manor...)
//make all reactions unique and sorted (in not the most efficient manor...)
vector<const ReactionGamma::Reaction *>::iterator new_end;
std::sort( suggest_reactions.begin(), suggest_reactions.end(),
&less_than_by_name );
new_end = std::unique( suggest_reactions.begin(), suggest_reactions.end() );
new_end = std::unique( suggest_reactions.begin(), suggest_reactions.end(),
[]( const ReactionGamma::Reaction *lhs, const ReactionGamma::Reaction *rhs) -> bool {
return ((lhs == rhs) || (lhs && rhs && (lhs->name() == rhs->name())));
} );
suggest_reactions.erase( new_end, suggest_reactions.end() );

//Now make sure if the user has specified particle types, only show those
Expand Down
2 changes: 1 addition & 1 deletion src/ReactionGamma.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -637,7 +637,7 @@ void ReactionGamma::populate_reaction( const rapidxml::xml_node<char> *parent,
if( remark && remark->value_size() )
{
if( !rctn.gammas[yeild_num].remark.empty() )
rctn.gammas[yeild_num].remark += " ";
rctn.gammas[yeild_num].remark += ". ";
rctn.gammas[yeild_num].remark.append( remark->value(), remark->value_size() );
}//if( remark && remark->value_size() )

Expand Down
49 changes: 27 additions & 22 deletions src/ReferenceLineInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2620,7 +2620,33 @@ std::shared_ptr<ReferenceLineInfo> ReferenceLineInfo::generateRefLineInfo( RefLi


// Now lets fill out line.m_decaystr
if( line.m_decaystr.empty() )
if( line.m_reaction )
{
// TODO: we can probably come up with a better way to describe reactions
if( line.m_reaction->targetNuclide && line.m_reaction->targetElement )
{
const string orig_deacystr = line.m_decaystr;
switch( line.m_reaction->type )
{
case AlphaNeutron: line.m_decaystr = "Alphas on "; break;
case NeutronAlpha: line.m_decaystr = "Neutrons on "; break;
case AlphaProton: line.m_decaystr = "Alphas on "; break;
case NeutronCapture: line.m_decaystr = "Neutron capture by "; break;
case NeutronInelasticScatter: line.m_decaystr = "Neutron inelastic scatter on "; break;
case AlphaInelasticScatter: line.m_decaystr = "Alpha inelastic scatter on "; break;
case AnnihilationReaction: line.m_decaystr = ""; break;
case NumReactionType: line.m_decaystr = ""; break;
}//switch( line.m_reaction->type )

line.m_decaystr += line.m_reaction->targetNuclide->symbol;

if( !orig_deacystr.empty() )
line.m_decaystr += ". " + orig_deacystr;

//if( line.m_reaction->productNuclide )
// line.m_decaystr += " to give " + line.m_reaction->productNuclide->symbol;
}//
}else if( line.m_decaystr.empty() )
{
if( line.m_transition )
{
Expand Down Expand Up @@ -2648,27 +2674,6 @@ std::shared_ptr<ReferenceLineInfo> ReferenceLineInfo::generateRefLineInfo( RefLi
default:
break;
}//switch( line.m_transition->mode )
}else if( line.m_reaction )
{
// TODO: we can probably come up with a better way to describe reactions
if( line.m_reaction->targetNuclide && line.m_reaction->targetElement )
{
switch( line.m_reaction->type )
{
case AlphaNeutron: line.m_decaystr = "Alphas on "; break;
case NeutronAlpha: line.m_decaystr = "Neutrons on "; break;
case AlphaProton: line.m_decaystr = "Alphas on "; break;
case NeutronCapture: line.m_decaystr = "Neutron capture by "; break;
case NeutronInelasticScatter: line.m_decaystr = "Neutron inelastic scatter on "; break;
case AlphaInelasticScatter: line.m_decaystr = "Alpha inelastic scatter on "; break;
case AnnihilationReaction: break;
case NumReactionType: break;
}//switch( line.m_reaction->type )

line.m_decaystr += line.m_reaction->targetNuclide->symbol;
//if( line.m_reaction->productNuclide )
// line.m_decaystr += " to give " + line.m_reaction->productNuclide->symbol;
}
}else if( line.m_element )
{
line.m_decaystr = line.m_element->name + " fluorescence";
Expand Down

0 comments on commit fc1ffdf

Please sign in to comment.