diff --git a/image_analysis/scale_merge/SearchSpaceGroup.cpp b/image_analysis/scale_merge/SearchSpaceGroup.cpp index fe61e95e..a355c281 100644 --- a/image_analysis/scale_merge/SearchSpaceGroup.cpp +++ b/image_analysis/scale_merge/SearchSpaceGroup.cpp @@ -517,7 +517,6 @@ SearchSpaceGroupResult SearchSpaceGroup( // (imperfectly scaled data) and VETOES a twin whose chi^2 now looks self-consistent but whose b // balloons - the chi^2 ratio alone no longer separates them. double parent_b = -1.0; - const PointGroupInfo *parent_pg = nullptr; // Every confirmed subgroup of the largest order below this candidate. There can be more than one // - 422 has both 4 and 222 - and on a twinned crystal the rival is not a harmless alternative: a // P4 crystal twinned by 2[100] has its two twin 2-folds confirmed, so 222 is CC-confirmed too and @@ -535,8 +534,13 @@ SearchSpaceGroupResult SearchSpaceGroup( if (s.order > parent_order) { parent_order = s.order; parent_b = s.b_extra; - parent_pg = s.pg; parents.clear(); + } else { + // Tied parent. The b tests answer to the most damning of them, exactly as the H + // test below does: the SMALLEST parent b is the one that makes the veto easiest to + // trip and the rescue hardest to pass, and a rival subgroup that already contains + // the twin laws has its own b ballooned - taking it would hide the twin. + parent_b = std::min(parent_b, s.b_extra); } parents.push_back(s.pg); } @@ -611,8 +615,11 @@ SearchSpaceGroupResult SearchSpaceGroup( + "x the parent's (bound " + FormatDouble(opt.max_operator_h_ratio, 2) + ") - the added operator relates unequal intensities, as a twin law does"; else if (b_refused) + // Against the FLOORED parent b, which is what the test compared - quoting the raw + // parent b reads as a far bigger balloon than the one that actually tripped the veto. refused_why = "its merge's systematic error b is " + FormatDouble(c.b_extra, 3) - + " against the subgroup's " + FormatDouble(parent_b, 3) + + " against the subgroup's " + + FormatDouble(std::max(parent_b, opt.min_systematic_b_for_veto), 3) + " (bound " + FormatDouble(opt.max_systematic_b_veto, 2) + "x) - the added operator forces unequal intensities together"; else if (std::isfinite(c.chi2) && std::isfinite(chi2_ref))