/// \brief TODOCUMENT
quad_criteria_result check_scan_on_final_alignment::criteria_result_of(const quad_criteria            &arg_criteria,   ///< TODOCUMENT
                                                                       const multi_struc_res_rep_pair &arg_query_pair, ///< TODOCUMENT
                                                                       const multi_struc_res_rep_pair &arg_index_pair  ///< TODOCUMENT
                                                                       ) {
	if ( ! are_not_violated_by( arg_criteria, arg_query_pair ) ) {
		return quad_criteria_result::QUERY_FAILS_SINGLE_CHECKS;
	}
	if ( ! are_not_violated_by( arg_criteria, arg_index_pair ) ) {
		return quad_criteria_result::INDEX_FAILS_SINGLE_CHECKS;
	}

	const auto &query_core = arg_query_pair.get_res_pair_core();
	const auto &index_core = arg_index_pair.get_res_pair_core();

	if ( squared_distance         ( query_core, index_core ) > arg_criteria.get_maximum_squared_distance()       ) {
		return quad_criteria_result::FAILS_VIEW_CHECK;
	}
	if ( max_phi_angle_difference ( query_core, index_core ) > arg_criteria.get_maximum_phi_angle_difference()   ) {
		return quad_criteria_result::FAILS_PHI_CHECK;
	}
	if ( max_psi_angle_difference ( query_core, index_core ) > arg_criteria.get_maximum_psi_angle_difference()   ) {
		return quad_criteria_result::FAILS_PSI_CHECK;
	}
	if ( distance_1_between_frames( query_core, index_core ) > arg_criteria.get_maximum_frame_angle_distance_1() ) {
		return quad_criteria_result::FAILS_FRAME_CHECK;
	}
	if ( ! are_met_by         ( arg_criteria, arg_query_pair, arg_index_pair ) ) {
		return quad_criteria_result::FAILS_QUAD_CHECKS;
	}
	return quad_criteria_result::PASS;
}
				/// \brief Extract the relevant value from the specified res_pair
				static angle_type get_value(const multi_struc_res_rep_pair &arg_res_pair ///< The res_pair from which the relevant value should be extracted
				                            ) {
					return arg_res_pair.get_res_pair_core().get_to_phi_angle();
				}
				/// \brief Extract the relevant value from the specified res_pair
				view_base_type get_value(const multi_struc_res_rep_pair &arg_res_pair ///< The res_pair from which the relevant value should be extracted
				                         ) const {
					BOOST_THROW_EXCEPTION(common::not_implemented_exception("!!!!!!!!! THIS CLASS IS ALMOST CERTAINLY HALF-WRITTEN !!!!!!!!!"));
					return get_view_x( arg_res_pair.get_res_pair_core() );
				}