diff --git a/image_analysis/rotation_indexer/RotationIndexer.cpp b/image_analysis/rotation_indexer/RotationIndexer.cpp index 6720f93d2..fa6c7e111 100644 --- a/image_analysis/rotation_indexer/RotationIndexer.cpp +++ b/image_analysis/rotation_indexer/RotationIndexer.cpp @@ -333,7 +333,14 @@ void RotationIndexer::RunIndexingLocked() { // promotion of the same kind, so it is not applied here. if (demote_class && ClassImposesLengthEquality(ls.system)) return LatticeSearch(cand, /*dist_tolerance=*/0.0); - if (!IsHexagonalSystem(ls.system) && IsMetricallyHexagonal(ls.primitive_reduced)) { + // A primitive hexagonal lattice is written in ONE setting, the one derived from its reduced + // cell, whichever route named the class. Its twelve equivalent settings are the same + // lattice, but the run is not indifferent to which it gets: the fractional-index gates of + // the refinement and the axial-row count of the two-pass quality guard are not invariant + // under them, so a setting chosen afresh from each pass's strained cell lets the two + // passes differ in setting and the guard compare rows that are not the same rows. + if ((ls.system == gemmi::CrystalSystem::Hexagonal && ls.centering == 'P') + || (!IsHexagonalSystem(ls.system) && IsMetricallyHexagonal(ls.primitive_reduced))) { ls.conventional = HexagonalConventional(ls.primitive_reduced); ls.system = gemmi::CrystalSystem::Hexagonal; ls.centering = 'P';