Skip to content

Commit

Permalink
Re #8837 Handle properly single period datasets
Browse files Browse the repository at this point in the history
  • Loading branch information
raquelalvarezbanos committed Mar 6, 2015
1 parent c2bbb93 commit a95a653
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Code/Mantid/Framework/DataHandling/src/LoadMuonNexus1.cpp
Expand Up @@ -444,9 +444,19 @@ Workspace_sptr LoadMuonNexus1::loadDetectorGrouping(NXRoot &root) {
if ( m_numberOfPeriods==1 ) {
// Simpliest case - one grouping entry per spectra

for (auto it=specToLoad.begin(); it!=specToLoad.end(); ++it) {
int index = *it - 1 + static_cast<int>((m_entrynumber-1) * m_numberOfSpectra);
grouping.push_back(groupingData[index]);
if ( !m_entrynumber ) {
// m_entrynumber = 0 && m_numberOfPeriods = 1 means that user did not select
// any periods but there is only one in the dataset
for (auto it=specToLoad.begin(); it!=specToLoad.end(); ++it) {
int index = *it - 1;
grouping.push_back(groupingData[index]);
}
} else {
// User selected an entry number
for (auto it=specToLoad.begin(); it!=specToLoad.end(); ++it) {
int index = *it - 1 + static_cast<int>((m_entrynumber-1) * m_numberOfSpectra);
grouping.push_back(groupingData[index]);
}
}

TableWorkspace_sptr table =
Expand Down

0 comments on commit a95a653

Please sign in to comment.