Skip to content

Commit 24b6fb4

Browse files
committed
Make error on fit atomic number more conservative for really low or really high ANs.
1 parent 765a477 commit 24b6fb4

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

src/ShieldingSourceDisplay.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9241,7 +9241,21 @@ void ShieldingSourceDisplay::doModelFittingWork( const std::string wtsession,
92419241
break;
92429242
}
92439243

9244-
fitParams.SetError( parname, std::max( 1.0, 0.5*(upper_an - lower_an) ) );
9244+
float error = 0.5*(upper_an - lower_an);
9245+
9246+
// If we are near the limits of atomic number, be a little more conservative since our
9247+
// naive estimation may not have been able to fully go to the atomic number.
9248+
if( ((best_an + error) >= MassAttenuation::sm_max_xs_atomic_number)
9249+
|| ((best_an - error) <= MassAttenuation::sm_min_xs_atomic_number) )
9250+
{
9251+
error = std::max( error, static_cast<float>(upper_an - best_an) );
9252+
error = std::max( error, static_cast<float>(best_an - lower_an) );
9253+
}
9254+
9255+
9256+
error = std::max( 1.0f, error );
9257+
9258+
fitParams.SetError( parname, error );
92459259
}// end lock on best_an_mutex
92469260

92479261
chi2Fcn->setSelfAttMultiThread( true ); //shouldnt affect anything, but JIC

0 commit comments

Comments
 (0)