diff --git a/Code/Mantid/Framework/Algorithms/src/FilterEvents.cpp b/Code/Mantid/Framework/Algorithms/src/FilterEvents.cpp index 1bdb00f814e0..e0a3d8b71d33 100644 --- a/Code/Mantid/Framework/Algorithms/src/FilterEvents.cpp +++ b/Code/Mantid/Framework/Algorithms/src/FilterEvents.cpp @@ -285,8 +285,9 @@ namespace Algorithms // Generate one of the output workspaces & Copy geometry over. But we don't copy the data. DataObjects::EventWorkspace_sptr optws = boost::dynamic_pointer_cast( - API::WorkspaceFactory::Instance().create("EventWorkspace", m_eventWS->getNumberHistograms(), 2, 1)); + API::WorkspaceFactory::Instance().create("EventWorkspace", m_eventWS->getNumberHistograms(), 2, 1)); API::WorkspaceFactory::Instance().initializeFromParent(m_eventWS, optws, false); + m_outputWS.insert(std::make_pair(wsgroup, optws)); // Add information, including title and comment, to output workspace if (mWithInfo) @@ -321,7 +322,6 @@ namespace Algorithms propertyname << "OutputWorkspace_" << wsgroup; // Inserted this pair to map - m_outputWS.insert(std::make_pair(wsgroup, optws)); m_wsNames.push_back(wsname.str()); // Set (property) to output workspace and set to ADS @@ -453,7 +453,7 @@ namespace Algorithms std::map::iterator wsiter; // Loop over the histograms (detector spectra) to do split from 1 event list to N event list - g_log.information() << "[FilterEvents F1206] Number of spectra = " << numberOfSpectra << ".\n"; + g_log.debug() << "Number of spectra in input/source EventWorkspace = " << numberOfSpectra << ".\n"; // FIXME Make it parallel // PARALLEL_FOR_NO_WSP_CHECK() diff --git a/Code/Mantid/Framework/Algorithms/test/FilterEventsTest.h b/Code/Mantid/Framework/Algorithms/test/FilterEventsTest.h index cb4442ebd2c8..64e99f45e06b 100644 --- a/Code/Mantid/Framework/Algorithms/test/FilterEventsTest.h +++ b/Code/Mantid/Framework/Algorithms/test/FilterEventsTest.h @@ -38,7 +38,7 @@ class FilterEventsTest : public CxxTest::TestSuite //---------------------------------------------------------------------------------------------- /** Test initialization */ - void Ptest_Initialization() + void test_Initialization() { FilterEvents alg; alg.initialize(); @@ -55,7 +55,7 @@ class FilterEventsTest : public CxxTest::TestSuite * (4) Within one pulse, two consecutive events/neutrons is apart for 10*1000*1000 seconds * (5) "Experiment": 5 pulse times. 10 events in each pulse */ - void Ptest_CreatedEventWorskpaceAndSplitter() + void test_CreatedEventWorskpaceAndSplitter() { int64_t runstart_i64 = 20000000000; int64_t pulsedt = 100*1000*1000; @@ -90,7 +90,7 @@ class FilterEventsTest : public CxxTest::TestSuite * (1) Leave correction table workspace empty * (2) Count events in each output including "-1", the excluded/unselected events */ - void Ptest_FilterWOCorrection() + void test_FilterWOCorrection() { // 1. Create EventWorkspace and SplittersWorkspace int64_t runstart_i64 = 20000000000; @@ -117,6 +117,9 @@ class FilterEventsTest : public CxxTest::TestSuite TS_ASSERT(filter.isExecuted()); // 4. Get output + int numsplittedws = filter.getProperty("NumberOutputWorkspace"); + TS_ASSERT_EQUALS(numsplittedws, 4); + // 4.1 Workspace group 0 DataObjects::EventWorkspace_sptr filteredws0 = boost::dynamic_pointer_cast (AnalysisDataService::Instance().retrieve("FilteredWS01_0")); @@ -150,6 +153,7 @@ class FilterEventsTest : public CxxTest::TestSuite // 5. Clean up AnalysisDataService::Instance().remove("Test02"); AnalysisDataService::Instance().remove("Splitter02"); + AnalysisDataService::Instance().remove("FilteredWS01_unfiltered"); AnalysisDataService::Instance().remove("FilteredWS01_0"); AnalysisDataService::Instance().remove("FilteredWS01_1"); AnalysisDataService::Instance().remove("FilteredWS01_2"); @@ -199,7 +203,7 @@ class FilterEventsTest : public CxxTest::TestSuite // Get output int numsplittedws = filter.getProperty("NumberOutputWorkspace"); - TS_ASSERT_EQUALS(numsplittedws, 0); + TS_ASSERT_EQUALS(numsplittedws, 3); // 4.1 Workspace group 0 DataObjects::EventWorkspace_sptr filteredws0 = boost::dynamic_pointer_cast @@ -244,7 +248,7 @@ class FilterEventsTest : public CxxTest::TestSuite //---------------------------------------------------------------------------------------------- /** Filter test with TOF correction */ - void Ptest_FilterWithCorrection() + void test_FilterWithCorrection() { // 1. Create EventWorkspace and SplittersWorkspace int64_t runstart_i64 = 20000000000;