diff --git a/Code/Mantid/Framework/DataHandling/src/LoadRaw3.cpp b/Code/Mantid/Framework/DataHandling/src/LoadRaw3.cpp index 9d95242111e22c35c71091919e346fafd473602f..497552418704deff22aa657bd16e2c918d8cb115 100644 --- a/Code/Mantid/Framework/DataHandling/src/LoadRaw3.cpp +++ b/Code/Mantid/Framework/DataHandling/src/LoadRaw3.cpp @@ -204,6 +204,7 @@ void LoadRaw3::exec() { // Loop over the number of periods in the raw file, putting each period in a // separate workspace + for (int period = 0; period < m_numberOfPeriods; ++period) { // skipping the first spectra in each period skipData(file, static_cast<int>(period * (m_numberOfSpectra + 1))); @@ -218,6 +219,22 @@ void LoadRaw3::exec() { if (localWorkspace) { localWorkspace = createWorkspace(localWorkspace); } + if (bseparateMonitors) { + try { + monitorWorkspace = createWorkspace(monitorWorkspace, monitorwsSpecs, + m_lengthIn, m_lengthIn - 1); + } catch (std::out_of_range &) { + g_log.information() << "Separate Monitors option is selected and no " + "monitors in the selected specra range." + << std::endl; + g_log.information() + << "Error in creating one of the output workspaces" << std::endl; + } catch (std::runtime_error &) { + g_log.information() << "Separate Monitors option is selected,Error " + "in creating one of the output workspaces" + << std::endl; + } + } // end of separate Monitors if (bLoadlogFiles) { const int period_number = period + 1; @@ -239,22 +256,6 @@ void LoadRaw3::exec() { createPeriodLogs(period_number, monitorWorkspace); } } // end of if loop for loadlogfiles - if (bseparateMonitors) { - try { - monitorWorkspace = createWorkspace(monitorWorkspace, monitorwsSpecs, - m_lengthIn, m_lengthIn - 1); - } catch (std::out_of_range &) { - g_log.information() << "Separate Monitors option is selected and no " - "monitors in the selected specra range." - << std::endl; - g_log.information() - << "Error in creating one of the output workspaces" << std::endl; - } catch (std::runtime_error &) { - g_log.information() << "Separate Monitors option is selected,Error " - "in creating one of the output workspaces" - << std::endl; - } - } // end of separate Monitors } if (bexcludeMonitors) { diff --git a/Code/Mantid/Framework/DataHandling/test/LoadRaw3Test.h b/Code/Mantid/Framework/DataHandling/test/LoadRaw3Test.h index 30aea2518a58723a9fa055aa22734f8b4750273f..9db6077bfe752a0ae3999728775d0b67e4db25ed 100644 --- a/Code/Mantid/Framework/DataHandling/test/LoadRaw3Test.h +++ b/Code/Mantid/Framework/DataHandling/test/LoadRaw3Test.h @@ -584,8 +584,13 @@ public: // But the data should be different TS_ASSERT_DIFFERS( monoutsptr1->dataY(1)[555], monoutsptr2->dataY(1)[555] ) - TS_ASSERT_EQUALS( &(monoutsptr1->run()), &(monoutsptr2->run()) ) - + // Same number of logs + const auto & monPeriod1Run = monoutsptr1->run(); + const auto & monPeriod2Run = monoutsptr2->run(); + TS_ASSERT_EQUALS(monPeriod1Run.getLogData().size(), monPeriod2Run.getLogData().size() ); + TS_ASSERT(monPeriod1Run.hasProperty("period 1")) + TS_ASSERT(monPeriod2Run.hasProperty("period 2")) + Workspace_sptr wsSptr=AnalysisDataService::Instance().retrieve("multiperiod"); WorkspaceGroup_sptr sptrWSGrp=boost::dynamic_pointer_cast<WorkspaceGroup>(wsSptr);