2#ifndef RIVET_RivetHDF5_HH
3#define RIVET_RivetHDF5_HH
4#include "Rivet/Config/RivetCommon.hh"
5#include "Rivet/Tools/RivetPaths.hh"
6#include "highfive/H5File.hpp"
12 using namespace HighFive;
16 inline HighFive::File readFile(
const string& filename) {
18 if (filepath.empty())
throw IOError(
"Failed to load HDF5 file " + filename);
20 return HighFive::File(filepath, HighFive::File::ReadOnly);
22 throw IOError(
"Failed to load HDF5 file " + filename);
29 inline bool readData(
const string& filename,
const string& dsname, T& rtndata) {
31 HighFive::File h5file = readFile(filename);
32 DataSet dataset = h5file.getDataSet(dsname);
33 dataset.read(rtndata);
43 inline T readData(
const string& filename,
const string& dsname) {
45 readData(filename, dsname, rtn);
std::string findAnalysisDataFile(const std::string &filename, const std::vector< std::string > &pathprepend=std::vector< std::string >(), const std::vector< std::string > &pathappend=std::vector< std::string >())
Find the first file of the given name in the general data file search dirs.
Definition MC_CENT_PPB_Projections.hh:10