Commit 483c041a authored by Hahn, Steven's avatar Hahn, Steven
Browse files

Merge remote-tracking branch 'origin/master' into clang-tidy_modernize-use-default

parents 5c04f977 f659a809
......@@ -251,7 +251,7 @@ if ( ENABLE_CPACK )
message ( STATUS " CPACK_PACKAGE_FILE_NAME = ${CPACK_PACKAGE_FILE_NAME}" )
# rhel requirements
set ( CPACK_RPM_PACKAGE_REQUIRES "boost >= 1.34.1,qt4 >= 4.2,nexus >= 4.3.1,nexus-python >= 4.3.1,gsl,glibc,qwtplot3d-qt4,muParser,numpy" )
set ( CPACK_RPM_PACKAGE_REQUIRES "qt4 >= 4.2,nexus >= 4.3.1,nexus-python >= 4.3.1,gsl,glibc,qwtplot3d-qt4,muParser,numpy" )
# OCE
set( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},OCE-draw,OCE-foundation,OCE-modeling,OCE-ocaf,OCE-visualization")
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},poco-crypto,poco-data,poco-mysql,poco-sqlite,poco-odbc,poco-util,poco-xml,poco-zip,poco-net,poco-netssl,poco-foundation,PyQt4,sip" )
......@@ -262,11 +262,11 @@ if ( ENABLE_CPACK )
if( "${UNIX_CODENAME}" MATCHES "Santiago" )
# On RHEL6 we have to use an updated qscintilla to fix an auto complete bug
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES} qscintilla >= 2.4.6" )
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES} qscintilla >= 2.4.6, boost148" )
# On RHEL6 we are using SCL packages for Qt
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},scl-utils,mantidlibs34,mantidlibs34-runtime,mantidlibs34-qt,mantidlibs34-qt-x11,mantidlibs34-qt-webkit,mantidlibs34-qwt5-qt4" )
else()
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES} qscintilla,qwt5-qt4,python-matplotlib-qt4" )
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES} qscintilla,qwt5-qt4,python-matplotlib-qt4,boost >= 1.48.0" )
endif()
# Add software collections for RHEL
......
......@@ -1230,7 +1230,7 @@ bool Algorithm::processGroups() {
for (auto &pureOutputWorkspaceProp : m_pureOutputWorkspaceProps) {
Property *prop = dynamic_cast<Property *>(pureOutputWorkspaceProp);
if (prop) {
WorkspaceGroup_sptr outWSGrp = WorkspaceGroup_sptr(new WorkspaceGroup());
auto outWSGrp = boost::make_shared<WorkspaceGroup>();
outGroups.push_back(outWSGrp);
// Put the GROUP in the ADS
AnalysisDataService::Instance().addOrReplace(prop->value(), outWSGrp);
......
......@@ -44,13 +44,9 @@ ImplicitFunctionParserFactoryImpl::createImplicitFunctionParserFromXML(
functionElement->getElementsByTagName("Function");
ImplicitFunctionParser *childParser = nullptr;
for (unsigned long i = 0; i < childFunctions->length(); i++) {
Poco::XML::Node *childFunctionNode = childFunctions->item(i);
// Recursive call to handle nested parameters.
Poco::XML::Element *childFunctionElement =
(Poco::XML::Element *)childFunctionNode;
ImplicitFunctionParser *tempParser =
createImplicitFunctionParserFromXML(childFunctionElement);
ImplicitFunctionParser *tempParser = createImplicitFunctionParserFromXML(
dynamic_cast<Poco::XML::Element *>(childFunctions->item(i)));
if (i == 0) {
childParser = tempParser;
// Add the first child function parser to the parent (composite) directly.
......
......@@ -4,6 +4,7 @@
#include "MantidGeometry/MDGeometry/MDGeometryXMLBuilder.h"
#include "MantidGeometry/MDGeometry/IMDDimension.h"
#include "MantidGeometry/MDGeometry/MDHistoDimension.h"
#include <boost/make_shared.hpp>
using namespace Mantid::Kernel;
using namespace Mantid::API;
......@@ -34,8 +35,8 @@ MDGeometry::MDGeometry(const MDGeometry &other)
std::vector<Mantid::Geometry::IMDDimension_sptr> dimensions;
for (size_t d = 0; d < other.getNumDims(); d++) {
// Copy the dimension
MDHistoDimension_sptr dim(
new MDHistoDimension(other.getDimension(d).get()));
auto dim =
boost::make_shared<MDHistoDimension>(other.getDimension(d).get());
dimensions.push_back(dim);
}
this->initGeometry(dimensions);
......
......@@ -95,7 +95,7 @@ void MultipleExperimentInfos::copyExperimentInfos(
m_expInfos.reserve(other.m_expInfos.size());
// Do a deep copy of ExperimentInfo's
for (const auto &expInfo : other.m_expInfos) {
ExperimentInfo_sptr copy(new ExperimentInfo(*expInfo));
auto copy(boost::make_shared<ExperimentInfo>(*expInfo));
m_expInfos.push_back(copy);
}
}
......
......@@ -130,55 +130,16 @@ void NotebookWriter::headerCode() {
Json::Value import_mantid(Json::arrayValue);
import_mantid.append(
Json::Value("import sys\n"
"import os\n"
"\n"
"#Find where Mantid is installed and tell python.\n"
"def find_path():\n"
" for r,d,f in os.walk(os.path.abspath(os.sep)):\n"
" for files in f:\n"
" if files == 'MantidPlot.exe' or files == "
"'MantidPlot' or files == 'MantidPlot.app':\n"
" return r\n"
"\n"
"mantidPath = 'C://MantidInstall/bin'\n"
"if os.path.isdir(mantidPath): sys.path.append(mantidPath)\n"
"else: sys.path.append(find_path())\n"
"\n"
"#We can now import Mantid's Python API\n"
"from mantid.simpleapi import *\n"
"#If import fails then replace path on line \"mantidPath = "
"...\" with correct path to the MantidPlot executable"));
import_mantid.append(Json::Value(
"#Import Mantid's Python API and IPython plotting tools\n"
"from mantid.simpleapi import *\n"
"from MantidIPython import *\n"
"\n"
"#Some magic to tell matplotlib how to behave in IPython Notebook. Use "
"'%matplotlib nbagg' for interactive plots, if available.\n"
"%matplotlib inline"));
codeCell(import_mantid);
Json::Value check_version(Json::arrayValue);
check_version.append(Json::Value("import warnings"));
check_version.append(Json::Value("import mantid.kernel"));
check_version.append(
Json::Value("# Check if the version of Mantid being used matches"
" the version which created the notebook."));
check_version.append(Json::Value(
std::string("if \"") + Mantid::Kernel::MantidVersion::version() +
"\" != mantid.kernel.version_str(): warnings.warn(\"Version of Mantid"
" being used does not match version which created the notebook.\")"));
codeCell(check_version);
Json::Value import_matplotlib(Json::arrayValue);
import_matplotlib.append(Json::Value(
"#Import matplotlib's pyplot interface under the name 'plt'\n"));
import_matplotlib.append(Json::Value("import matplotlib.pyplot as plt\n\n"));
import_matplotlib.append(Json::Value(
"#Some magic to tell matplotlib how to behave in IPython Notebook. "
"Use '%matplotlib nbagg' for interactive plots, if available.\n"));
import_matplotlib.append(Json::Value("%matplotlib inline"));
codeCell(import_matplotlib);
}
/**
......
......@@ -12,7 +12,6 @@
#include <Poco/Path.h>
#include <Poco/File.h>
#include <boost/assign/list_of.hpp>
#include <boost/algorithm/string/join.hpp>
using namespace Mantid;
......@@ -105,35 +104,34 @@ public:
m_tempDirs.insert(m_dummyFilesDir);
m_tempDirs.insert(m_dirWithWhitespace);
std::set<std::string> dummyFilenames = boost::assign::list_of
std::set<std::string> dummyFilenames = {
// Standard raw file runs.
("TSC00001.raw")("TSC00002.raw")("TSC00003.raw")("TSC00004.raw")(
"TSC00005.raw")
"TSC00001.raw", "TSC00002.raw", "TSC00003.raw", "TSC00004.raw",
"TSC00005.raw",
// Duplicates, but in NeXuS format.
("TSC00001.nxs")("TSC00002.nxs")("TSC00003.nxs")("TSC00004.nxs")(
"TSC00005.nxs")
"TSC00001.nxs", "TSC00002.nxs", "TSC00003.nxs", "TSC00004.nxs",
"TSC00005.nxs",
// Standard NeXuS runs for another instrument.
("IRS00001.raw")("IRS00002.raw")("IRS00003.raw")("IRS00004.raw")(
"IRS00005.raw")
"IRS00001.raw", "IRS00002.raw", "IRS00003.raw", "IRS00004.raw",
"IRS00005.raw",
// Duplicates, but in NeXuS format.
("IRS00001.nxs")("IRS00002.nxs")("IRS00003.nxs")("IRS00004.nxs")(
"IRS00005.nxs")
"IRS00001.nxs", "IRS00002.nxs", "IRS00003.nxs", "IRS00004.nxs",
"IRS00005.nxs",
// "Incorrect" zero padding file.
("TSC9999999.raw")
"TSC9999999.raw",
// "Non-run" files.
("IRS10001_graphite002_info.nxs")("IRS10002_graphite002_info.nxs")(
"IRS10003_graphite002_info.nxs")("IRS10004_graphite002_info.nxs")(
"IRS10005_graphite002_info.nxs")
"IRS10001_graphite002_info.nxs", "IRS10002_graphite002_info.nxs",
"IRS10003_graphite002_info.nxs", "IRS10004_graphite002_info.nxs",
"IRS10005_graphite002_info.nxs",
// File with no extension.
("bl6_flux_at_sample")
"bl6_flux_at_sample",
// A single "non-run" file, that we should be able to load.
("IRS10001-10005_graphite002_info.nxs")
"IRS10001-10005_graphite002_info.nxs",
// A file with a "+" and "," in the name, to see if it can be loaded
// when multifileloading is turned off via the preferences file.
("_test_multiFileLoadingSwitchedOff_tempFileWithA+AndA,InTheName.txt");
"_test_multiFileLoadingSwitchedOff_tempFileWithA+AndA,InTheName.txt"};
std::set<std::string> whiteSpaceDirFilenames =
boost::assign::list_of("file with whitespace.txt");
std::set<std::string> whiteSpaceDirFilenames = {"file with whitespace.txt"};
createFilesInDirectory(dummyFilenames, m_dummyFilesDir);
createFilesInDirectory(whiteSpaceDirFilenames, m_dummyFilesDir);
......
......@@ -2,6 +2,7 @@
#define MANTID_NOTEBOOKBUILDERTEST_H_
#include <cxxtest/TestSuite.h>
#include <algorithm>
#include "MantidAPI/AnalysisDataService.h"
#include "MantidAPI/DataProcessorAlgorithm.h"
......@@ -192,8 +193,9 @@ public:
while (std::getline(buffer, line))
notebookLines.push_back(line);
// Compare line with expected result
TS_ASSERT_EQUALS(notebookLines[64], result)
// Check that the expected line does appear in the output
TS_ASSERT(std::find(notebookLines.cbegin(), notebookLines.cend(), result) !=
notebookLines.cend())
AnalysisDataService::Instance().remove("test_output_workspace");
AnalysisDataService::Instance().remove("test_input_workspace");
......@@ -232,8 +234,11 @@ public:
while (std::getline(buffer, line))
notebookLines.push_back(line);
TS_ASSERT_EQUALS(notebookLines[64], result_markdown)
TS_ASSERT_EQUALS(notebookLines[100], result_code)
// Check that the expected lines do appear in the output
TS_ASSERT(std::find(notebookLines.cbegin(), notebookLines.cend(),
result_markdown) != notebookLines.cend())
TS_ASSERT(std::find(notebookLines.cbegin(), notebookLines.cend(),
result_code) != notebookLines.cend())
AnalysisDataService::Instance().remove("test_output_workspace");
AnalysisDataService::Instance().remove("test_input_workspace");
......@@ -281,8 +286,11 @@ public:
while (std::getline(buffer, line))
notebookLines.push_back(line);
TS_ASSERT_EQUALS(notebookLines[64], result_markdown)
TS_ASSERT_EQUALS(notebookLines[74], result_code)
// Check that the expected lines do appear in the output
TS_ASSERT(std::find(notebookLines.cbegin(), notebookLines.cend(),
result_markdown) != notebookLines.cend())
TS_ASSERT(std::find(notebookLines.cbegin(), notebookLines.cend(),
result_code) != notebookLines.cend())
AnalysisDataService::Instance().remove("test_output_workspace");
AnalysisDataService::Instance().remove("test_input_workspace");
......@@ -321,7 +329,9 @@ public:
while (std::getline(buffer, line))
notebookLines.push_back(line);
TS_ASSERT_EQUALS(notebookLines[64], result)
// Check that the expected line does appear in the output
TS_ASSERT(std::find(notebookLines.cbegin(), notebookLines.cend(), result) !=
notebookLines.cend())
AnalysisDataService::Instance().remove("test_output_workspace");
AnalysisDataService::Instance().remove("test_inp\\ut_workspace");
......
......@@ -94,10 +94,6 @@ private:
template <class T>
void correctKiKfEventHelper(std::vector<T> &events, double efixed,
const std::string emodeStr);
/// The user selected (input) workspace
API::MatrixWorkspace_const_sptr inputWS;
/// The output workspace, maybe the same as the input one
API::MatrixWorkspace_sptr outputWS;
};
} // namespace Algorithm
......
......@@ -166,7 +166,6 @@ AlignDetectors::AlignDetectors() : m_numberOfSpectra(0) {
/// Destructor
AlignDetectors::~AlignDetectors() { delete this->tofToDmap; }
//-----------------------------------------------------------------------
void AlignDetectors::init() {
auto wsValidator = boost::make_shared<CompositeValidator>();
// Workspace unit must be TOF.
......@@ -285,7 +284,6 @@ void setXAxisUnits(API::MatrixWorkspace_sptr outputWS) {
outputWS->getAxis(0)->unit() = UnitFactory::Instance().create("dSpacing");
}
//-----------------------------------------------------------------------
/** Executes the algorithm
* @throw Exception::FileError If the calibration file cannot be opened and
* read successfully
......@@ -360,42 +358,22 @@ void AlignDetectors::exec() {
PARALLEL_CHECK_INTERUPT_REGION
}
//-----------------------------------------------------------------------
/**
* Execute the align detectors algorithm for an event workspace.
*/
void AlignDetectors::execEvent() {
// g_log.information("Processing event workspace");
// the calibration information is already read in at this point
// convert the input workspace into the event workspace we already know it is
const MatrixWorkspace_const_sptr matrixInputWS =
this->getProperty("InputWorkspace");
EventWorkspace_const_sptr inputWS =
boost::dynamic_pointer_cast<const EventWorkspace>(matrixInputWS);
getProperty("InputWorkspace");
// generate the output workspace pointer
API::MatrixWorkspace_sptr matrixOutputWS =
this->getProperty("OutputWorkspace");
EventWorkspace_sptr outputWS;
if (matrixOutputWS == matrixInputWS)
outputWS = boost::dynamic_pointer_cast<EventWorkspace>(matrixOutputWS);
else {
// Make a brand new EventWorkspace
outputWS = boost::dynamic_pointer_cast<EventWorkspace>(
API::WorkspaceFactory::Instance().create(
"EventWorkspace", inputWS->getNumberHistograms(), 2, 1));
// Copy geometry over.
API::WorkspaceFactory::Instance().initializeFromParent(inputWS, outputWS,
false);
// You need to copy over the data as well.
outputWS->copyDataFrom((*inputWS));
// Cast to the matrixOutputWS and save it
matrixOutputWS = boost::dynamic_pointer_cast<MatrixWorkspace>(outputWS);
API::MatrixWorkspace_sptr matrixOutputWS = getProperty("OutputWorkspace");
if (matrixOutputWS != matrixInputWS) {
matrixOutputWS = MatrixWorkspace_sptr(matrixInputWS->clone().release());
this->setProperty("OutputWorkspace", matrixOutputWS);
}
auto outputWS = boost::dynamic_pointer_cast<EventWorkspace>(matrixOutputWS);
// Set the final unit that our output workspace will have
setXAxisUnits(outputWS);
......@@ -409,7 +387,7 @@ void AlignDetectors::execEvent() {
PARALLEL_START_INTERUPT_REGION
auto toDspacing = converter.getConversionFunc(
inputWS->getSpectrum(size_t(i))->getDetectorIDs());
outputWS->getSpectrum(size_t(i))->getDetectorIDs());
outputWS->getEventList(i).convertTof(toDspacing);
progress.report();
......
......@@ -225,18 +225,9 @@ void BinaryOperation::exec() {
"Contact the developers.");
} else {
// You HAVE to copy the data from lhs to to the output!
// Create a copy of the lhs workspace
m_eout = boost::dynamic_pointer_cast<EventWorkspace>(
API::WorkspaceFactory::Instance().create(
"EventWorkspace", m_elhs->getNumberHistograms(), 2, 1));
// Copy geometry, spectra map, etc. over.
API::WorkspaceFactory::Instance().initializeFromParent(m_elhs, m_eout,
false);
// And we copy all the events from the lhs
m_eout->copyDataFrom(*m_elhs);
// Make sure m_out still points to the same as m_eout;
m_out = boost::dynamic_pointer_cast<API::MatrixWorkspace>(m_eout);
m_out = MatrixWorkspace_sptr(m_lhs->clone().release());
// Make sure m_eout still points to the same as m_out;
m_eout = boost::dynamic_pointer_cast<EventWorkspace>(m_out);
}
// Always clear the MRUs.
......
......@@ -21,7 +21,6 @@
#include <cmath>
#include <boost/algorithm/string/join.hpp>
#include <boost/assign/list_of.hpp>
#include <boost/foreach.hpp>
#include <boost/lexical_cast.hpp>
......@@ -47,7 +46,7 @@ const detid_t LOQ_TRANSMISSION_MONITOR_UDET = 3;
* @returns workspace index corresponding to the given detector ID
*/
size_t getIndexFromDetectorID(MatrixWorkspace_sptr ws, detid_t detid) {
const std::vector<detid_t> input = boost::assign::list_of(detid);
const std::vector<detid_t> input = {detid};
std::vector<size_t> result;
ws->getIndicesFromDetectorIDs(input, result);
......@@ -275,8 +274,9 @@ CalculateTransmission::extractSpectra(API::MatrixWorkspace_sptr ws,
// lexical_cast function
typedef std::string (*from_size_t)(const size_t &);
std::transform(indices.begin(), indices.end(), indexStrings.begin(),
(from_size_t)boost::lexical_cast<std::string, size_t>);
std::transform(
indices.begin(), indices.end(), indexStrings.begin(),
static_cast<from_size_t>(boost::lexical_cast<std::string, size_t>));
const std::string commaIndexList = boost::algorithm::join(indexStrings, ",");
double start = m_done;
......
......@@ -149,33 +149,17 @@ void ChangeBinOffset::execEvent() {
g_log.information("Processing event workspace");
const MatrixWorkspace_const_sptr matrixInputWS =
this->getProperty("InputWorkspace");
EventWorkspace_const_sptr inputWS =
boost::dynamic_pointer_cast<const EventWorkspace>(matrixInputWS);
getProperty("InputWorkspace");
// generate the output workspace pointer
API::MatrixWorkspace_sptr matrixOutputWS =
this->getProperty("OutputWorkspace");
EventWorkspace_sptr outputWS;
if (matrixOutputWS == matrixInputWS)
outputWS = boost::dynamic_pointer_cast<EventWorkspace>(matrixOutputWS);
else {
// Make a brand new EventWorkspace
outputWS = boost::dynamic_pointer_cast<EventWorkspace>(
API::WorkspaceFactory::Instance().create(
"EventWorkspace", inputWS->getNumberHistograms(), 2, 1));
// Copy geometry over.
API::WorkspaceFactory::Instance().initializeFromParent(inputWS, outputWS,
false);
// You need to copy over the data as well.
outputWS->copyDataFrom((*inputWS));
// Cast to the matrixOutputWS and save it
matrixOutputWS = boost::dynamic_pointer_cast<MatrixWorkspace>(outputWS);
API::MatrixWorkspace_sptr matrixOutputWS = getProperty("OutputWorkspace");
if (matrixOutputWS != matrixInputWS) {
matrixOutputWS = MatrixWorkspace_sptr(matrixInputWS->clone().release());
this->setProperty("OutputWorkspace", matrixOutputWS);
}
auto outputWS = boost::dynamic_pointer_cast<EventWorkspace>(matrixOutputWS);
int64_t numHistograms = static_cast<int64_t>(inputWS->getNumberHistograms());
int64_t numHistograms = static_cast<int64_t>(outputWS->getNumberHistograms());
PARALLEL_FOR1(outputWS)
for (int64_t i = 0; i < numHistograms; ++i) {
PARALLEL_START_INTERUPT_REGION
......
......@@ -52,15 +52,7 @@ void ChangePulsetime::exec() {
EventWorkspace_const_sptr in_ws = getProperty("InputWorkspace");
EventWorkspace_sptr out_ws = getProperty("OutputWorkspace");
if (!out_ws) {
// Make a brand new EventWorkspace
out_ws = boost::dynamic_pointer_cast<EventWorkspace>(
API::WorkspaceFactory::Instance().create(
"EventWorkspace", in_ws->getNumberHistograms(), 2, 1));
// Copy geometry over.
API::WorkspaceFactory::Instance().initializeFromParent(in_ws, out_ws,
false);
// You need to copy over the data as well.
out_ws->copyDataFrom((*in_ws));
out_ws = EventWorkspace_sptr(in_ws->clone().release());
}
// Either use the given list or use all spectra
......
......@@ -162,7 +162,7 @@ void ChopData::exec() {
}
// Create workspace group that holds output workspaces
WorkspaceGroup_sptr wsgroup = WorkspaceGroup_sptr(new WorkspaceGroup());
auto wsgroup = boost::make_shared<WorkspaceGroup>();
for (auto &workspace : workspaces) {
wsgroup->addWorkspace(workspace);
......
......@@ -271,7 +271,7 @@ void ConvertAxesToRealSpace::exec() {
for (int i = 0; i < nOutputHist; ++i) {
MantidVec &errorVec = outputWs->dataE(i);
std::transform(errorVec.begin(), errorVec.end(), errorVec.begin(),
(double (*)(double))sqrt);
static_cast<double (*)(double)>(sqrt));
progress.report("Completing Error Calculation");
}
......
......@@ -376,13 +376,7 @@ bool ConvertEmptyToTof::doFitGaussianPeak(int workspaceindex, double &center,
center = gaussianpeak->centre();
height = gaussianpeak->height();
double fwhm = gaussianpeak->fwhm();
if (fwhm <= 0.0) {
return false;
}
// sigma = fwhm*2;
// sigma = fwhm/2.35;
return true;
return fwhm > 0.0;
}
/**
......
......@@ -213,18 +213,7 @@ API::MatrixWorkspace_sptr ConvertUnits::setupOutputWorkspace(
// the output
if (outputWS != inputWS) {
if (m_inputEvents) {
// Need to create by name as WorkspaceFactory otherwise spits out
// Workspace2D when EventWS passed in
outputWS = WorkspaceFactory::Instance().create(
"EventWorkspace", inputWS->getNumberHistograms(), 2, 1);
// Copy geometry etc. over
WorkspaceFactory::Instance().initializeFromParent(inputWS, outputWS,
false);
// Need to copy over the data as well
EventWorkspace_const_sptr inputEventWS =
boost::dynamic_pointer_cast<const EventWorkspace>(inputWS);
boost::dynamic_pointer_cast<EventWorkspace>(outputWS)
->copyDataFrom(*inputEventWS);
outputWS = MatrixWorkspace_sptr(inputWS->clone().release());
} else {
// Create the output workspace
outputWS = WorkspaceFactory::Instance().create(inputWS);
......
......@@ -227,18 +227,7 @@ API::MatrixWorkspace_sptr ConvertUnitsUsingDetectorTable::setupOutputWorkspace(
// the output
if (outputWS != inputWS) {
if (m_inputEvents) {
// Need to create by name as WorkspaceFactory otherwise spits out
// Workspace2D when EventWS passed in
outputWS = WorkspaceFactory::Instance().create(
"EventWorkspace", inputWS->getNumberHistograms(), 2, 1);
// Copy geometry etc. over
WorkspaceFactory::Instance().initializeFromParent(inputWS, outputWS,
false);
// Need to copy over the data as well
EventWorkspace_const_sptr inputEventWS =
boost::dynamic_pointer_cast<const EventWorkspace>(inputWS);
boost::dynamic_pointer_cast<EventWorkspace>(outputWS)
->copyDataFrom(*inputEventWS);
outputWS = MatrixWorkspace_sptr(inputWS->clone().release());
} else {
// Create the output workspace
outputWS = WorkspaceFactory::Instance().create(inputWS);
......
......@@ -111,15 +111,7 @@ void CorelliCrossCorrelate::exec() {
outputWS = getProperty("OutputWorkspace");
if (outputWS != inputWS) {
// Make a brand new EventWorkspace
outputWS = boost::dynamic_pointer_cast<EventWorkspace>(
API::WorkspaceFactory::Instance().create(
"EventWorkspace", inputWS->getNumberHistograms(), 2, 1));
// Copy geometry over.
API::WorkspaceFactory::Instance().initializeFromParent(inputWS, outputWS,
false);
// You need to copy over the data as well.
outputWS->copyDataFrom((*inputWS));
outputWS = EventWorkspace_sptr(inputWS->clone().release());
}
// Read in chopper sequence from IDF.
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment