From 417901e271a322ad6b4dbae7d8faa8b5d11d2933 Mon Sep 17 00:00:00 2001 From: Andreas Suter Date: Tue, 3 Feb 2026 16:17:06 +0100 Subject: [PATCH] HDF4 handling completed. --- src/classes/PRunDataHandler.cpp | 68 ++++++++++----------------------- 1 file changed, 20 insertions(+), 48 deletions(-) diff --git a/src/classes/PRunDataHandler.cpp b/src/classes/PRunDataHandler.cpp index 93fbc401..6c92899e 100644 --- a/src/classes/PRunDataHandler.cpp +++ b/src/classes/PRunDataHandler.cpp @@ -2373,7 +2373,26 @@ Bool_t PRunDataHandler::ReadNexusFile() std::cerr << std::endl << "**ERROR** nxH4::PNeXus data size error! count.size()=" << count.size() << ", #histos=" << noOfHistos << ", length=" << histoLength << "." << std::endl; return false; } - // fill dataSet - STILL MISSING + // fill dataSet + PDoubleVector data; + for (unsigned int i=0; iGetIdfVersion() == 1) { - // get/set t0, firstGoodBin, lastGoodBin - std::vector *t0 = nxs_file->GetEntryIdf1()->GetData()->GetT0s(); - std::vector *fgb = nxs_file->GetEntryIdf1()->GetData()->GetFirstGoodBins(); - std::vector *lgb = nxs_file->GetEntryIdf1()->GetData()->GetLastGoodBins(); - - // get/set data - std::vector *pdata; - unsigned int max=0, binMax=0; - PDoubleVector data; - for (UInt_t i=0; iGetEntryIdf1()->GetData()->GetNoOfHistos(); i++) { - pdata = nxs_file->GetEntryIdf1()->GetData()->GetHisto(i); - for (UInt_t j=0; jsize(); j++) { - data.push_back(pdata->at(j)); - if (pdata->at(j) > max) { - max = pdata->at(j); - binMax = j; - } - } - - // fill data set - dataSet.Clear(); - dataSet.SetHistoNo(i+1); // i.e. histo numbers start with 1 - // set time zero bin - if (isize()) - dataSet.SetTimeZeroBin(t0->at(i)); - else - dataSet.SetTimeZeroBin(t0->at(0)); - // set time zero bin estimate - dataSet.SetTimeZeroBinEstimated(binMax); - // set first good bin - if (isize()) - dataSet.SetFirstGoodBin(fgb->at(i)); - else - dataSet.SetFirstGoodBin(fgb->at(0)); - // set last good bin - if (isize()) - dataSet.SetFirstGoodBin(lgb->at(i)); - else - dataSet.SetFirstGoodBin(lgb->at(0)); - dataSet.SetData(data); - - runData.SetDataSet(dataSet); - data.clear(); - } - - // keep run name from the msr-file - runData.SetRunName(fRunName); // keep the information fData.push_back(runData);