13#include <boost/algorithm/string.hpp>
42 const int numPeaks = peakWorkspace->getNumberPeaks();
43 for (
int i = 0; i < numPeaks; ++i) {
44 const auto peak = peakWorkspace->getPeak(i);
45 if (peak.getIntHKL().norm2() > 0)
53 const int numPeaks = peakWorkspace->getNumberPeaks();
54 for (
int i = 0; i < numPeaks; ++i) {
55 const auto peak = peakWorkspace->getPeak(i);
56 if (peak.getIntMNP().norm2() > 0)
63 const bool isIntegrateInHKL =
getProperty(
"IntegrateInHKL");
64 const bool isGetUBFromPeaksWorkspace =
getProperty(
"GetUBFromPeaksWorkspace");
65 const bool shareBackground =
getProperty(
"ShareBackground");
75 if (isIntegrateInHKL || isGetUBFromPeaksWorkspace ||
76 (indexCount > 0 && satelliteIndexCount == 0 && !shareBackground)) {
78 alg = std::dynamic_pointer_cast<Algorithm>(
createChildAlgorithm(
"IntegrateEllipsoids", -1., -1.,
true, 1));
81 alg = std::dynamic_pointer_cast<Algorithm>(
createChildAlgorithm(
"IntegrateEllipsoids", -1., -1.,
true, 2));
85 alg->copyPropertiesFrom(*
this);
88 if (!alg->isExecuted())
89 throw std::runtime_error(
"IntegrateEllipsoids Algorithm has not executed successfully");
92 setProperty(
"OutputWorkspace", outputWorkspace);
#define DECLARE_ALGORITHM(classname)
std::shared_ptr< Algorithm > createChildAlgorithm(const std::string &name, const double startProgress=-1., const double endProgress=-1., const bool enableLogging=true, const int &version=-1) override
Create a Child Algorithm.
Kernel::IPropertyManager::TypedValue getProperty(const std::string &name) const override
Get the property held by this object.
static void initInstance(API::Algorithm &alg)
static void initInstance(API::Algorithm &alg)
const std::string category() const override
Algorithm's category for identification.
int version() const override
Algorithm's version for identification.
std::shared_ptr< Algorithm > Algorithm_sptr
Typedef for a shared pointer to an Algorithm.
std::shared_ptr< PeaksWorkspace > PeaksWorkspace_sptr
Typedef for a shared pointer to a peaks workspace.
int getSatelliteIndexCount(PeaksWorkspace_sptr peakWorkspace)
int getIndexCount(PeaksWorkspace_sptr peakWorkspace)