first test to read hdf4/hdf5 directly.

This commit is contained in:
2026-01-25 16:20:10 +01:00
parent 83c8f6630c
commit 65efb389c3

View File

@@ -2139,18 +2139,32 @@ Bool_t PRunDataHandler::ReadNexusFile()
#ifdef PNEXUS_ENABLED #ifdef PNEXUS_ENABLED
std::cout << std::endl << ">> PRunDataHandler::ReadNexusFile(): Will read nexus file " << fRunPathName.Data() << " ..."; std::cout << std::endl << ">> PRunDataHandler::ReadNexusFile(): Will read nexus file " << fRunPathName.Data() << " ...";
nxs::HDFType type = nxs::checkHDFType(fRunPathName.Data()); nxs::HDFType type = nxs::checkHDFType(fRunPathName.Data());
switch (type) {
case nxs::HDFType::HDF4: // check for type errors, missing enabled HDF4
std::cout << std::endl << ">> PRunDataHandler::ReadNexusFile(): HDF4 file." << std::endl; switch (type) {
break; case nxs::HDFType::HDF4:
case nxs::HDFType::HDF5: std::cout << std::endl << ">> PRunDataHandler::ReadNexusFile(): HDF4 file." << std::endl;
std::cout << std::endl << ">> PRunDataHandler::ReadNexusFile(): HDF5 file." << std::endl; #ifndef HAVE_HDF4
break; std::cerr << std::endl << ">> PRunDataHandler::ReadNexusFile(): **ERROR**, HDF4 is not enabled." << std::endl;
case nxs::HDFType::Unknown: return false;
std::cerr << std::endl << ">> PRunDataHandler::ReadNexusFile(): Not a valid NeXus file." << std::endl; #endif
return false; break;
} case nxs::HDFType::HDF5:
std::cout << std::endl << ">> PRunDataHandler::ReadNexusFile(): HDF5 file." << std::endl;
break;
case nxs::HDFType::Unknown:
std::cerr << std::endl << ">> PRunDataHandler::ReadNexusFile(): Not a valid NeXus file." << std::endl;
return false;
}
if (type == nxs::HDFType::HDF4) {
#ifdef HAVE_HDF4
std::unique_ptr<nxH4::PNeXus> nxs_file = std::make_unique<nxH4::PNeXus>(fRunPathName.Data());
#endif
} else { // HDF5
std::unique_ptr<nxH5::PNeXus> nxs_file = std::make_unique<nxH5::PNeXus>(fRunPathName.Data());
}
/* //as35 /* //as35
PDoubleVector histoData; PDoubleVector histoData;
@@ -2159,7 +2173,7 @@ Bool_t PRunDataHandler::ReadNexusFile()
TString str; TString str;
std::string sstr; std::string sstr;
Double_t dval; Double_t dval;
bool ok; bool ok;
std::unique_ptr<PNeXus> nxs_file = std::make_unique<PNeXus>(fRunPathName.Data()); std::unique_ptr<PNeXus> nxs_file = std::make_unique<PNeXus>(fRunPathName.Data());
if (!nxs_file->IsValid()) { if (!nxs_file->IsValid()) {