Skip to content

Commit

Permalink
Merge pull request #718 from gundam-organization/lts/feature/updateCh…
Browse files Browse the repository at this point in the history
…angelog

Lts/feature/update changelog
  • Loading branch information
ClarkMcGrew authored Dec 11, 2024
2 parents e943c00 + 6e06cf7 commit a1b586f
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 14 deletions.
12 changes: 12 additions & 0 deletions ChangeLog-1.8.x
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
Fixes relative to 1.8.6

Propagation: Make sure that the event breakdown includes the effect of masking.

JointProbabilty: Flag both infinite and negative chi-squared values. This is an informational message, but is a better check for problems during the fit.

CalculateGraph: On the CPU only, add careful check of the CalculateGraph inputs and stop if there are invalid inputs. If bad inputs are found, it will indicate a problem elsewhere, so a lot of diagnostics are printed and then GUNDAM exits.

Extended Tests: Add more detailed tests for the interpolation/extrapolation code.

Build Fixes: Don't require ROOT to declare MINUIT2. It's not the default modern ROOT. Always build tests, but disable developer tests by default. Use CMAKE_DL_LIBS so that libdl gets included if it is needed.

Fixes relative to 1.8.5

Fix (Merge #681): Handle over sized graphs and splines. The number of points that can be handled in a spline/graph has been increased, but that needs to be used carefully since large splines and graphs will make fits run more slowly. Note: Using linear interpolation with more than two knots is explicitly forbidden by MINUIT since it introduces a discontinuous derivative. MINUIT may still run, but the results are undefined (that means the answer could be useful, or could start a thermonuclear war. Both outcomes are formally correct).
Expand Down
2 changes: 1 addition & 1 deletion src/DatasetManager/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ target_link_libraries( ${LIB_NAME}
GundamSamplesManager
GundamDialDictionary
${ROOT_LIBRARIES}
dl
${CMAKE_DL_LIBS}
)

#set_target_properties(${LIB_NAME} PROPERTIES VERSION "${GUNDAM_VERSION_STRING}")
Expand Down
35 changes: 22 additions & 13 deletions src/SamplesManager/src/JointProbability.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,27 +211,35 @@ namespace JointProbability{
if (not usePoissonLikelihood) chisq += 2.0 * penalty;

// Warn when the expected value for a bin is going to zero.
if (predVal == 0.0
if (predVal <= 0.0
and dataVal < std::numeric_limits<double>::epsilon()) [[unlikely]] {
if( allowZeroMcWhenZeroData ) {
// Need to warn the user something is wrong with the binning
// definition. This might indicate that more MC stat would be needed,
// or the binning needs to be reconsidered..
// definition, but they've asked to continue anyway. This might
// indicate that more MC stat would be needed, or the binning needs to
// be reconsidered..
LogErrorOnce
<< "Sample bin with no events in the data and MC bin."
<< "This is an ill conditioned problem. Please check your inputs."
<< std::endl;
}
else {
LogWarningIf(verboseLevel > 0)
<< "Infinite statistical LLH --"
<< " Data: " << dataVal
<< " / MC: " << predVal
<< " Adjusted MC: " << newmc
<< " / Stat: " << stat
<< " Penalty: " << penalty
<< " Truncated ChiSq: " << chisq
<< std::endl;
static int messageBrake = 1000;
if (messageBrake > 0) {
--messageBrake;
LogError
<< "Ill conditioned statistical LLH --"
<< " Data: " << dataVal
<< " / MC: " << predVal
<< " Adjusted MC: " << newmc
<< " / Stat: " << stat
<< " Penalty: " << penalty
<< " Total ChiSq: " << chisq
<< std::endl;
LogErrorOnce
<< "Define allowZeroMcWhenZeroData in config to mute message"
<< std::endl;
}
}
}

Expand All @@ -247,7 +255,8 @@ namespace JointProbability{
<< GET_VAR_NAME_VALUE(nomMC->GetBinContent(bin_)) << std::endl
<< GET_VAR_NAME_VALUE(nomMC->GetBinError(bin_)) << std::endl
<< GET_VAR_NAME_VALUE(predMC->GetBinError(bin_)) << std::endl
<< GET_VAR_NAME_VALUE(predMC->GetBinContent(bin_)) << std::endl;
<< GET_VAR_NAME_VALUE(predMC->GetBinContent(bin_)) << std::endl
<< "Note: Very small negative values from roundoff are OK" << std::endl;
}

if(verboseLevel>=3){
Expand Down

0 comments on commit a1b586f

Please sign in to comment.