Commit beffd505 authored by Nick Draper's avatar Nick Draper
Browse files

refs #6194 sub-alg to child alg name change

parent 3236df97
......@@ -48,11 +48,11 @@ class AlgorithmHistory;
The base class provides utility methods for accessing
standard services (event data service etc.); for declaring
properties which may be configured by the job options
service; and for creating sub algorithms.
service; and for creating Child Algorithms.
The only base class functionality which may be used in the
constructor of a concrete algorithm is the declaration of
member variables as properties. All other functionality,
i.e. the use of services and the creation of sub-algorithms,
i.e. the use of services and the creation of Child Algorithms,
may be used only in initialise() and afterwards (see the
Gaudi user guide).
......@@ -186,7 +186,7 @@ public:
/** @name IAlgorithm methods */
void initialize();
bool execute();
void executeAsSubAlg();
void executeAsChildAlg();
virtual std::map<std::string, std::string> validateInputs();
virtual bool isInitialized() const;
virtual bool isExecuted() const;
......@@ -257,7 +257,7 @@ public:
static IAlgorithm_sptr fromHistory(const AlgorithmHistory & history);
//@}
boost::shared_ptr<Algorithm> createSubAlgorithm(const std::string& name, const double startProgress = -1.,
boost::shared_ptr<Algorithm> createChildAlgorithm(const std::string& name, const double startProgress = -1.,
const double endProgress = -1., const bool enableLogging=true, const int& version = -1);
protected:
......@@ -352,8 +352,8 @@ private:
bool m_runningAsync; ///< Algorithm is running asynchronously
bool m_running; ///< Algorithm is running
bool m_rethrow; ///< Algorithm should rethrow exceptions while executing
mutable double m_startChildProgress; ///< Keeps value for algorithm's progress at start of an sub-algorithm
mutable double m_endChildProgress; ///< Keeps value for algorithm's progress at sub-algorithm's finish
mutable double m_startChildProgress; ///< Keeps value for algorithm's progress at start of an Child Algorithm
mutable double m_endChildProgress; ///< Keeps value for algorithm's progress at Child Algorithm's finish
AlgorithmID m_algorithmID; ///< Algorithm ID for managed algorithms
std::string m_OptionalMessage; ///< An optional message string to be displayed in the GUI.
std::string m_WikiSummary; ///< A summary line for the wiki page.
......
......@@ -88,7 +88,7 @@ namespace Mantid
void initialize();
std::map<std::string, std::string> validateInputs();
bool execute();
void executeAsSubAlg() { throw std::runtime_error("Not implemented."); }
void executeAsChildAlg() { throw std::runtime_error("Not implemented."); }
Poco::ActiveResult<bool> executeAsync();
bool isInitialized() const;
bool isExecuted() const;
......
......@@ -94,7 +94,7 @@ public:
/** Initialization method invoked by the framework. This method is responsible
* for any bookkeeping of initialization required by the framework itself.
* It will in turn invoke the init() method of the derived algorithm,
* and of any sub-algorithms which it creates.
* and of any Child Algorithms which it creates.
*/
virtual void initialize() = 0;
......@@ -107,8 +107,8 @@ public:
/// Asynchronous execution of the algorithm.
virtual Poco::ActiveResult<bool> executeAsync() = 0;
/// Execute as a sub-algorithm, with try/catch
virtual void executeAsSubAlg() = 0;
/// Execute as a Child Algorithm, with try/catch
virtual void executeAsChildAlg() = 0;
/// Check whether the algorithm is initialized properly
virtual bool isInitialized() const = 0;
......
......@@ -226,8 +226,8 @@ namespace Mantid
/** Initialization method invoked by the framework. This method is responsible
* for any bookkeeping of initialization required by the framework itself.
* It will in turn invoke the init() method of the derived algorithm,
* and of any sub-algorithms which it creates.
* @throw runtime_error Thrown if algorithm or sub-algorithm cannot be initialised
* and of any Child Algorithms which it creates.
* @throw runtime_error Thrown if algorithm or Child Algorithm cannot be initialised
*
*/
void Algorithm::initialize()
......@@ -416,10 +416,10 @@ namespace Mantid
/** The actions to be performed by the algorithm on a dataset. This method is
* invoked for top level algorithms by the application manager.
* This method invokes exec() method.
* For sub-algorithms either the execute() method or exec() method
* For Child Algorithms either the execute() method or exec() method
* must be EXPLICITLY invoked by the parent algorithm.
*
* @throw runtime_error Thrown if algorithm or sub-algorithm cannot be executed
* @throw runtime_error Thrown if algorithm or Child Algorithm cannot be executed
* @return true if executed successfully.
*/
bool Algorithm::execute()
......@@ -634,11 +634,11 @@ namespace Mantid
}
//---------------------------------------------------------------------------------------------
/** Execute as a sub-algorithm.
/** Execute as a Child Algorithm.
* This runs execute() but catches errors so as to log the name
* of the failed sub-algorithm, if it fails.
* of the failed Child Algorithm, if it fails.
*/
void Algorithm::executeAsSubAlg()
void Algorithm::executeAsChildAlg()
{
bool executed = false;
try
......@@ -647,14 +647,14 @@ namespace Mantid
}
catch (std::runtime_error&)
{
g_log.error() << "Unable to successfully run subAlgorithm " << this->name() << std::endl;
g_log.error() << "Unable to successfully run ChildAlgorithm " << this->name() << std::endl;
throw;
}
if ( ! executed )
{
g_log.error() << "Unable to successfully run subAlgorithm " << this->name() << std::endl;
throw std::runtime_error("Unable to successfully run subAlgorithm " + this->name());
g_log.error() << "Unable to successfully run ChildAlgorithm " << this->name() << std::endl;
throw std::runtime_error("Unable to successfully run ChildAlgorithm " + this->name());
}
}
......@@ -684,19 +684,19 @@ namespace Mantid
}
//---------------------------------------------------------------------------------------------
/** Create a sub algorithm. A call to this method creates a child algorithm object.
/** Create a Child Algorithm. A call to this method creates a child algorithm object.
* Using this mechanism instead of creating daughter
* algorithms directly via the new operator is prefered since then
* the framework can take care of all of the necessary book-keeping.
*
* @param name :: The concrete algorithm class of the sub algorithm
* @param name :: The concrete algorithm class of the Child Algorithm
* @param startProgress :: The percentage progress value of the overall algorithm where this child algorithm starts
* @param endProgress :: The percentage progress value of the overall algorithm where this child algorithm ends
* @param enableLogging :: Set to false to disable logging from the child algorithm
* @param version :: The version of the child algorithm to create. By default gives the latest version.
* @return shared pointer to the newly created algorithm object
*/
Algorithm_sptr Algorithm::createSubAlgorithm(const std::string& name, const double startProgress, const double endProgress,
Algorithm_sptr Algorithm::createChildAlgorithm(const std::string& name, const double startProgress, const double endProgress,
const bool enableLogging, const int& version)
{
Algorithm_sptr alg = AlgorithmManager::Instance().createUnmanaged(name,version);
......@@ -704,14 +704,14 @@ namespace Mantid
alg->setChild(true);
alg->setLogging(enableLogging);
// Initialise the sub-algorithm
// Initialise the Child Algorithm
try
{
alg->initialize();
}
catch (std::runtime_error& exc)
{
g_log.error() << "Unable to initialise sub-algorithm " << name << std::endl;
g_log.error() << "Unable to initialise Child Algorithm " << name << std::endl;
g_log.error() << exc.what() << "\n";
}
......@@ -734,7 +734,7 @@ namespace Mantid
// Before we return the shared pointer, use it to create a weak pointer and keep that in a vector.
// It will be used this to pass on cancellation requests
// It must be protected by a critical block so that sub algorithms can run in parallel safely.
// It must be protected by a critical block so that Child Algorithms can run in parallel safely.
IAlgorithm_wptr weakPtr(alg);
PARALLEL_CRITICAL(Algorithm_StoreWeakPtr)
{
......@@ -1120,8 +1120,8 @@ namespace Mantid
// Go through each entry in the input group(s)
for (size_t entry=0; entry<m_groupSize; entry++)
{
// use create sub algorithm that look like this one
Algorithm_sptr alg_sptr = this->createSubAlgorithm(this->name(),-1,-1,this->isLogging(),this->version());
// use create Child Algorithm that look like this one
Algorithm_sptr alg_sptr = this->createChildAlgorithm(this->name(),-1,-1,this->isLogging(),this->version());
// Don't make the new algorithm a child so that it's workspaces are stored correctly
alg_sptr->setChild(false);
......
......@@ -69,10 +69,10 @@ namespace Mantid
/** The actions to be performed by the AlgorithmProxy on a dataset. This method is
* invoked for top level AlgorithmProxys by the application manager.
* This method invokes exec() method.
* For sub-AlgorithmProxys either the execute() method or exec() method
* For Child AlgorithmProxys either the execute() method or exec() method
* must be EXPLICITLY invoked by the parent AlgorithmProxy.
*
* @throw runtime_error Thrown if AlgorithmProxy or sub-AlgorithmProxy cannot be executed
* @throw runtime_error Thrown if AlgorithmProxy or Child AlgorithmProxy cannot be executed
*/
bool AlgorithmProxy::execute()
{
......
......@@ -86,7 +86,7 @@ namespace API
std::string threadOutput = partialWSName;
#ifdef MPI_BUILD
Workspace_sptr partialWS = AnalysisDataService::Instance().retrieve(partialWSName);
IAlgorithm_sptr gatherAlg = createSubAlgorithm("GatherWorkspaces");
IAlgorithm_sptr gatherAlg = createChildAlgorithm("GatherWorkspaces");
gatherAlg->setLogging(true);
gatherAlg->setAlwaysStoreInADS(true);
gatherAlg->setProperty("InputWorkspace", partialWS);
......@@ -118,7 +118,7 @@ namespace API
if (saveOutput && outputFile.size() > 0)
{
IAlgorithm_sptr saveAlg = createSubAlgorithm("SaveNexus");
IAlgorithm_sptr saveAlg = createChildAlgorithm("SaveNexus");
saveAlg->setPropertyValue("Filename", outputFile);
saveAlg->setPropertyValue("InputWorkspace", outputWSName);
saveAlg->execute();
......@@ -175,7 +175,7 @@ namespace API
Poco::Path p(foundFile);
const std::string outputWSName = p.getBaseName();
IAlgorithm_sptr loadAlg = createSubAlgorithm(m_loadAlg);
IAlgorithm_sptr loadAlg = createChildAlgorithm(m_loadAlg);
loadAlg->setProperty(m_loadAlgFileProp, foundFile);
if (!loadQuiet)
{
......
......@@ -90,7 +90,7 @@ namespace OperatorOverloads
throw std::runtime_error(message);
}
throw Kernel::Exception::NotFoundError("Required output workspace property not found on sub algorithm" ,"OutputWorkspace");
throw Kernel::Exception::NotFoundError("Required output workspace property not found on Child Algorithm" ,"OutputWorkspace");
//Horendous code inclusion to satisfy compilers that all code paths return a value
// in reality the above code should either throw or return successfully.
......
......@@ -88,7 +88,7 @@ private:
/// Convert the workspace units using TOF as an intermediate step in the conversion
void convertViaTOF(Kernel::Unit_const_sptr fromUnit, API::MatrixWorkspace_sptr outputWS);
// Calls Rebin as a sub-algorithm to align the bins of the output workspace
// Calls Rebin as a Child Algorithm to align the bins of the output workspace
API::MatrixWorkspace_sptr alignBins(const API::MatrixWorkspace_sptr workspace);
const std::vector<double> calculateRebinParams(const API::MatrixWorkspace_const_sptr workspace) const;
......
......@@ -53,7 +53,7 @@ public:
virtual int version() const { return 1; }
/// Algorithm's category for identification overriding a virtual method
virtual const std::string category() const { return "Diffraction"; }
/// Call Gaussian as a sub-algorithm to fit the peak in a spectrum
/// Call Gaussian as a Child Algorithm to fit the peak in a spectrum
void fitSpectra(const int64_t s, API::MatrixWorkspace_sptr inputW, const std::vector<double> &peakPositions, const std::vector<double> &fitWindows, size_t &nparams,
double &minD, double &maxD,
std::vector<double>&peakPosToFit, std::vector<double> &peakPosFitted, std::vector<double> &chisq);
......
......@@ -56,7 +56,7 @@ private:
// Overridden Algorithm methods
void init();
void exec();
/// Call Gaussian as a sub-algorithm to fit the peak in a spectrum
/// Call Gaussian as a Child Algorithm to fit the peak in a spectrum
double fitSpectra(const int64_t s);
/// Create a function string from the given parameters and the algorithm inputs
API::IFunction_sptr createFunction(const double peakHeight, const double peakLoc);
......
......@@ -100,7 +100,7 @@ private:
void readGroupingFile(const std::string& filename);
/// Read an XML Grouping File
void readXMLGroupingFile(const std::string& filename);
/// Sub-algorithm to Load the associated empty instrument
/// Child Algorithm to Load the associated empty instrument
/// @param instrument_xml_name :: The instrument xml name including extension(.xml or .XML) but no path
/// this is determine by the mantid instrument.directory
/// @return Shared pointer to the 2D workspace
......
......@@ -11,7 +11,7 @@ namespace Mantid
{
namespace Algorithms
{
/** This algorithm calls FindPeaks as a subalgorithm and then subtracts
/** This algorithm calls FindPeaks as a ChildAlgorithm and then subtracts
all the peaks found from the data, leaving just the 'background'.
*** IT IS ASSUMED THAT THE FITTING FUNCTION WAS A GAUSSIAN ***
......@@ -24,8 +24,8 @@ namespace Algorithms
Optional Properties:
<UL>
<LI> fwhm - passed to the FindPeaks subalgorithm</LI>
<LI> Tolerance - passed to the FindPeaks subalgorithm</LI>
<LI> fwhm - passed to the FindPeaks ChildAlgorithm</LI>
<LI> Tolerance - passed to the FindPeaks ChildAlgorithm</LI>
<LI> WorkspaceIndex - The spectrum from which to remove peaks. Will search all spectra if absent.</LI>
</UL>
......
......@@ -198,14 +198,14 @@ void AlignDetectors::exec()
if (!calFileName.empty())
{
// Load the .cal file
IAlgorithm_sptr alg = createSubAlgorithm("LoadCalFile");
IAlgorithm_sptr alg = createChildAlgorithm("LoadCalFile");
alg->setPropertyValue("CalFilename", calFileName);
alg->setProperty("InputWorkspace", inputWS);
alg->setProperty<bool>("MakeGroupingWorkspace", false);
alg->setProperty<bool>("MakeOffsetsWorkspace", true);
alg->setProperty<bool>("MakeMaskWorkspace", false);
alg->setPropertyValue("WorkspaceName", "temp");
alg->executeAsSubAlg();
alg->executeAsChildAlg();
offsetsWS = alg->getProperty("OutputOffsetsWorkspace");
}
......
......@@ -83,7 +83,7 @@ void AlphaCalc::exec()
// first step is to create two workspaces which groups all forward and
// backward spectra
API::IAlgorithm_sptr groupForward = createSubAlgorithm("GroupDetectors");
API::IAlgorithm_sptr groupForward = createChildAlgorithm("GroupDetectors");
groupForward->setProperty("InputWorkspace", inputWS);
groupForward->setProperty("OutputWorkspace", "tmp");
groupForward->setProperty("SpectraList", forwardSpectraList);
......@@ -91,7 +91,7 @@ void AlphaCalc::exec()
groupForward->execute();
API::MatrixWorkspace_sptr forwardWS = groupForward->getProperty("OutputWorkspace");
API::IAlgorithm_sptr groupBackward = createSubAlgorithm("GroupDetectors");
API::IAlgorithm_sptr groupBackward = createChildAlgorithm("GroupDetectors");
groupBackward->setProperty("InputWorkspace", inputWS);
groupBackward->setProperty("OutputWorkspace", "tmp");
groupBackward->setProperty("SpectraList", backwardSpectraList);
......@@ -105,7 +105,7 @@ void AlphaCalc::exec()
double firstGoodvalue = getProperty("FirstGoodValue");
double lastGoodvalue = getProperty("LastGoodValue");
API::IAlgorithm_sptr integr = createSubAlgorithm("Integration");
API::IAlgorithm_sptr integr = createChildAlgorithm("Integration");
integr->setProperty("InputWorkspace", forwardWS);
integr->setPropertyValue("OutputWorkspace","tmp");
if (firstGoodvalue != EMPTY_DBL())
......@@ -128,7 +128,7 @@ void AlphaCalc::exec()
// calculate sum of backward counts
API::IAlgorithm_sptr integrB = createSubAlgorithm("Integration");
API::IAlgorithm_sptr integrB = createChildAlgorithm("Integration");
integrB->setProperty("InputWorkspace", backwardWS);
integrB->setPropertyValue("OutputWorkspace","tmp");
if (firstGoodvalue != EMPTY_DBL())
......
......@@ -67,7 +67,7 @@ void ApplyDeadTimeCorr::exec()
numGoodFrames = boost::lexical_cast<double>(run.getProperty("goodfrm")->value());
// Duplicate the input workspace. Only need to change Y values based on dead time corrections
IAlgorithm_sptr duplicate = createSubAlgorithm("CloneWorkspace");
IAlgorithm_sptr duplicate = createChildAlgorithm("CloneWorkspace");
duplicate->initialize();
duplicate->setProperty<Workspace_sptr>("InputWorkspace", boost::dynamic_pointer_cast<Workspace>(inputWs));
duplicate->execute();
......
......@@ -102,13 +102,13 @@ namespace Algorithms
double oneOverT=PhysicalConstants::meVtoKelvin/Temp;
// Run the exponential correction algorithm explicitly to enable progress reporting
IAlgorithm_sptr expcor = createSubAlgorithm("OneMinusExponentialCor",0.0,1.0);
IAlgorithm_sptr expcor = createChildAlgorithm("OneMinusExponentialCor",0.0,1.0);
expcor->setProperty<MatrixWorkspace_sptr>("InputWorkspace", inputWS);
expcor->setProperty<MatrixWorkspace_sptr>("OutputWorkspace", outputWS);
expcor->setProperty<double>("C1", M_PI);
expcor->setProperty<double>("C", oneOverT);
expcor->setPropertyValue("Operation","Multiply");
expcor->executeAsSubAlg();
expcor->executeAsChildAlg();
// Get back the result
outputWS = expcor->getProperty("OutputWorkspace");
......
......@@ -77,7 +77,7 @@ namespace Algorithms
outputws->copyFrom(inputws1);
}
// 3. Call Sub Algorithm
// 3. Call Child Algorithm
if (op == "NOT"){
// Unary operation
......
......@@ -75,19 +75,19 @@ namespace Mantid
std::cout << "Special DIVIDE of " << this->getPropertyValue(inputPropName2()) << " by " << this->getPropertyValue(inputPropName1()) << "\n";
// x / workspace = Power(workspace, -1) * x
// workspace ^ -1
IAlgorithm_sptr pow = this->createSubAlgorithm("Power", 0.0, 0.5, true);
IAlgorithm_sptr pow = this->createChildAlgorithm("Power", 0.0, 0.5, true);
pow->setProperty("InputWorkspace", boost::const_pointer_cast<MatrixWorkspace>(m_rhs));
pow->setProperty("Exponent", -1.0);
pow->setPropertyValue("OutputWorkspace", this->getPropertyValue("OutputWorkspace"));
pow->executeAsSubAlg();
pow->executeAsChildAlg();
out = pow->getProperty("OutputWorkspace");
// Multiply by x
IAlgorithm_sptr mult = this->createSubAlgorithm("Multiply", 0.5, 1.0, true);
IAlgorithm_sptr mult = this->createChildAlgorithm("Multiply", 0.5, 1.0, true);
mult->setProperty(inputPropName1(), out); //(workspace^-1)
mult->setProperty(inputPropName2(), boost::const_pointer_cast<MatrixWorkspace>(m_lhs)); // (1.0) or other number
mult->setProperty(outputPropName(), out);
mult->executeAsSubAlg();
mult->executeAsChildAlg();
out = mult->getProperty("OutputWorkspace");
}
else if (this->name() == "Minus")
......@@ -99,19 +99,19 @@ namespace Mantid
minusOne->dataE(0)[0] = 0.0;
// workspace * -1
IAlgorithm_sptr mult = this->createSubAlgorithm("Multiply", 0.0, 0.5, true);
IAlgorithm_sptr mult = this->createChildAlgorithm("Multiply", 0.0, 0.5, true);
mult->setProperty(inputPropName1(), boost::const_pointer_cast<MatrixWorkspace>(m_rhs));
mult->setProperty(inputPropName2(), minusOne);
mult->setPropertyValue("OutputWorkspace", this->getPropertyValue("OutputWorkspace"));
mult->executeAsSubAlg();
mult->executeAsChildAlg();
out = mult->getProperty("OutputWorkspace");
// Multiply by x
IAlgorithm_sptr plus = this->createSubAlgorithm("Plus", 0.5, 1.0, true);
IAlgorithm_sptr plus = this->createChildAlgorithm("Plus", 0.5, 1.0, true);
plus->setProperty(inputPropName1(), out); //(workspace^-1)
plus->setProperty(inputPropName2(), boost::const_pointer_cast<MatrixWorkspace>(m_lhs)); // (1.0) or other number
plus->setProperty(outputPropName(), out);
plus->executeAsSubAlg();
plus->executeAsChildAlg();
out = plus->getProperty("OutputWorkspace");
}
......
......@@ -99,12 +99,12 @@ void CalMuonDeadTime::exec()
std::string wsName = "TempForMuonCalDeadTime";
API::IAlgorithm_sptr cropWS;
cropWS = createSubAlgorithm("CropWorkspace", -1, -1);
cropWS = createChildAlgorithm("CropWorkspace", -1, -1);
cropWS->setProperty("InputWorkspace", inputWS);
cropWS->setPropertyValue("OutputWorkspace", "croppedWS");
cropWS->setProperty("XMin", firstgooddata);
cropWS->setProperty("XMax", lastgooddata);
cropWS->executeAsSubAlg();
cropWS->executeAsChildAlg();
// get cropped input workspace
......@@ -119,10 +119,10 @@ void CalMuonDeadTime::exec()
// y-axis with measured counts * exp(t/t_mu)
API::IAlgorithm_sptr convertToPW;
convertToPW = createSubAlgorithm("ConvertToPointData", -1, -1);
convertToPW = createChildAlgorithm("ConvertToPointData", -1, -1);
convertToPW->setProperty("InputWorkspace", wsCrop);
convertToPW->setPropertyValue("OutputWorkspace", wsName);
convertToPW->executeAsSubAlg();
convertToPW->executeAsChildAlg();
// get pointworkspace
......@@ -176,7 +176,7 @@ void CalMuonDeadTime::exec()
const double in_bg1 = 0.0;
API::IAlgorithm_sptr fit;
fit = createSubAlgorithm("Fit", -1, -1, true);
fit = createChildAlgorithm("Fit", -1, -1, true);
std::stringstream ss;
ss << "name=LinearBackground,A0=" << in_bg0 << ",A1=" << in_bg1;
......@@ -188,7 +188,7 @@ void CalMuonDeadTime::exec()
fit->setProperty("WorkspaceIndex", wsindex);
fit->setPropertyValue("Minimizer", "Levenberg-MarquardtMD");
fit->executeAsSubAlg();
fit->executeAsChildAlg();
std::string fitStatus = fit->getProperty("OutputStatus");
//std::vector<double> params = fit->getProperty("Parameters");
......
......@@ -78,9 +78,9 @@ void CalculateEfficiency::exec()
DataObjects::EventWorkspace_const_sptr inputEventWS = boost::dynamic_pointer_cast<const EventWorkspace>(inputWS);
// Sum up all the wavelength bins
IAlgorithm_sptr childAlg = createSubAlgorithm("Integration", 0.0, 0.2);
IAlgorithm_sptr childAlg = createChildAlgorithm("Integration", 0.0, 0.2);
childAlg->setProperty<MatrixWorkspace_sptr>("InputWorkspace", inputWS);
childAlg->executeAsSubAlg();
childAlg->executeAsChildAlg();
rebinnedWS = childAlg->getProperty("OutputWorkspace");
outputWS = WorkspaceFactory::Instance().create(rebinnedWS);
......@@ -224,13 +224,13 @@ void CalculateEfficiency::normalizeDetectors(MatrixWorkspace_sptr rebinnedWS,
// Mask detectors that were found to be outside the acceptable efficiency band
try
{
IAlgorithm_sptr mask = createSubAlgorithm("MaskDetectors", 0.8, 0.9);
IAlgorithm_sptr mask = createChildAlgorithm("MaskDetectors", 0.8, 0.9);
// First we mask detectors in the output workspace
mask->setProperty<MatrixWorkspace_sptr>("Workspace", outputWS);
mask->setProperty< std::vector<size_t> >("WorkspaceIndexList", dets_to_mask);
mask->execute();
mask = createSubAlgorithm("MaskDetectors", 0.9, 1.0);
mask = createChildAlgorithm("MaskDetectors", 0.9, 1.0);
// Then we mask the same detectors in the input workspace
mask->setProperty<MatrixWorkspace_sptr>("Workspace", rebinnedWS);
mask->setProperty< std::vector<size_t> >("WorkspaceIndexList", dets_to_mask);
......@@ -238,12 +238,12 @@ void CalculateEfficiency::normalizeDetectors(MatrixWorkspace_sptr rebinnedWS,
} catch (std::invalid_argument& err)
{
std::stringstream e;
e << "Invalid argument to MaskDetectors sub-algorithm: " << err.what();
e << "Invalid argument to MaskDetectors Child Algorithm: " << err.what();
g_log.error(e.str());
} catch (std::runtime_error& err)
{
std::stringstream e;
e << "Unable to successfully run MaskDetectors sub-algorithm: " << err.what();
e << "Unable to successfully run MaskDetectors Child Algorithm: " << err.what();
g_log.error(e.str());
}
}
......
Markdown is supported
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