518 {
519 std::vector<Axis> axes = read_axes(src);
520 std::vector<hsize_t> dims = read_dims(src);
521
522 H5::Group storage =
src.openGroup(
"storage");
523 std::string
type = read_str_attr(storage,
"type");
524
525 if (type == "double") {
526 return std::make_unique<SimpleHistogram<double>>(
527 std::move(axes), std::move(dims));
528 }
529 if (type == "int") {
530 return std::make_unique<SimpleHistogram<int64_t>>(
531 std::move(axes), std::move(dims));
532 }
533 if (type == "weighted") {
534 return std::make_unique<WeightedHistogram>(
535 std::move(axes), std::move(dims));
536 }
537 if (type == "mean") {
538 return std::make_unique<MeanHistogram>(
539 std::move(axes), std::move(dims));
540 }
541 if (type == "weighted_mean") {
542 return std::make_unique<WeightedMeanHistogram>(
543 std::move(axes), std::move(dims));
544 }
545 throw std::runtime_error("HistogramMerger: unknown UHI storage type: " + type);
546}