HDF4 handling completed.

This commit is contained in:
2026-02-03 16:17:06 +01:00
parent 8d1dcef2de
commit 417901e271

View File

@@ -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; i<noOfHistos; i++) {
dataSet.Clear();
dataSet.SetHistoNo(i+1); // i.e. histo numbers start with 1
dataSet.SetTimeZeroBin(t0_bin);
dataSet.SetFirstGoodBin(fgb);
dataSet.SetLastGoodBin(lgb);
for (unsigned j=0; j<histoLength; j++)
data.push_back(count[i*histoLength+j]);
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);
} else { // no data found
std::cerr << std::endl << "**ERROR** nxH4::PNeXus couldn't obtain data: '/run/histogram_data_1/counts' is missing." << std::endl;
return false;
@@ -2390,53 +2409,6 @@ Bool_t PRunDataHandler::ReadNexusFile()
/* //as35
if (nxs_file->GetIdfVersion() == 1) {
// get/set t0, firstGoodBin, lastGoodBin
std::vector<unsigned int> *t0 = nxs_file->GetEntryIdf1()->GetData()->GetT0s();
std::vector<unsigned int> *fgb = nxs_file->GetEntryIdf1()->GetData()->GetFirstGoodBins();
std::vector<unsigned int> *lgb = nxs_file->GetEntryIdf1()->GetData()->GetLastGoodBins();
// get/set data
std::vector<unsigned int> *pdata;
unsigned int max=0, binMax=0;
PDoubleVector data;
for (UInt_t i=0; i<nxs_file->GetEntryIdf1()->GetData()->GetNoOfHistos(); i++) {
pdata = nxs_file->GetEntryIdf1()->GetData()->GetHisto(i);
for (UInt_t j=0; j<pdata->size(); 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 (i<t0->size())
dataSet.SetTimeZeroBin(t0->at(i));
else
dataSet.SetTimeZeroBin(t0->at(0));
// set time zero bin estimate
dataSet.SetTimeZeroBinEstimated(binMax);
// set first good bin
if (i<fgb->size())
dataSet.SetFirstGoodBin(fgb->at(i));
else
dataSet.SetFirstGoodBin(fgb->at(0));
// set last good bin
if (i<lgb->size())
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);