Skip to content
Snippets Groups Projects
Commit 1a4bf65f authored by Lynch, Vickie's avatar Lynch, Vickie
Browse files

Refs #21752 clang-format

parent 9e3713e9
No related merge requests found
...@@ -27,7 +27,7 @@ void LoadHKL::init() { ...@@ -27,7 +27,7 @@ void LoadHKL::init() {
FileProperty::Load, ".hkl"), FileProperty::Load, ".hkl"),
"Path to an hkl file to save."); "Path to an hkl file to save.");
declareProperty(make_unique<WorkspaceProperty<PeaksWorkspace> >( declareProperty(make_unique<WorkspaceProperty<PeaksWorkspace>>(
"OutputWorkspace", "", Direction::Output), "OutputWorkspace", "", Direction::Output),
"Name of the output workspace."); "Name of the output workspace.");
} }
...@@ -158,8 +158,9 @@ void LoadHKL::exec() { ...@@ -158,8 +158,9 @@ void LoadHKL::exec() {
radius1 = x1; radius1 = x1;
else if (x2 > 0) else if (x2 > 0)
radius1 = x2; radius1 = x2;
double frac = theta - static_cast<double>(static_cast<int>(theta / 5.)) * double frac =
5.; // theta%5. theta -
static_cast<double>(static_cast<int>(theta / 5.)) * 5.; // theta%5.
frac = frac / 5.; frac = frac / 5.;
radius = radius * (1 - frac) + radius1 * frac; radius = radius * (1 - frac) + radius1 * frac;
radius /= mu1; radius /= mu1;
......
...@@ -38,7 +38,7 @@ SortHKL::SortHKL() { ...@@ -38,7 +38,7 @@ SortHKL::SortHKL() {
SortHKL::~SortHKL() = default; SortHKL::~SortHKL() = default;
void SortHKL::init() { void SortHKL::init() {
declareProperty(make_unique<WorkspaceProperty<PeaksWorkspace> >( declareProperty(make_unique<WorkspaceProperty<PeaksWorkspace>>(
"InputWorkspace", "", Direction::Input), "InputWorkspace", "", Direction::Input),
"An input PeaksWorkspace with an instrument."); "An input PeaksWorkspace with an instrument.");
...@@ -60,31 +60,31 @@ void SortHKL::init() { ...@@ -60,31 +60,31 @@ void SortHKL::init() {
boost::make_shared<StringListValidator>(centeringOptions), boost::make_shared<StringListValidator>(centeringOptions),
"Appropriate lattice centering for the peaks."); "Appropriate lattice centering for the peaks.");
declareProperty(make_unique<WorkspaceProperty<PeaksWorkspace> >( declareProperty(make_unique<WorkspaceProperty<PeaksWorkspace>>(
"OutputWorkspace", "", Direction::Output), "OutputWorkspace", "", Direction::Output),
"Output PeaksWorkspace"); "Output PeaksWorkspace");
declareProperty("OutputChi2", 0.0, "Chi-square is available as output", declareProperty("OutputChi2", 0.0, "Chi-square is available as output",
Direction::Output); Direction::Output);
declareProperty(make_unique<WorkspaceProperty<ITableWorkspace> >( declareProperty(make_unique<WorkspaceProperty<ITableWorkspace>>(
"StatisticsTable", "StatisticsTable", Direction::Output), "StatisticsTable", "StatisticsTable", Direction::Output),
"An output table workspace for the statistics of the peaks."); "An output table workspace for the statistics of the peaks.");
declareProperty(make_unique<PropertyWithValue<std::string> >( declareProperty(make_unique<PropertyWithValue<std::string>>(
"RowName", "Overall", Direction::Input), "RowName", "Overall", Direction::Input),
"name of row"); "name of row");
declareProperty("Append", false, declareProperty("Append", false,
"Append to output table workspace if true.\n" "Append to output table workspace if true.\n"
"If false, new output table workspace (default)."); "If false, new output table workspace (default).");
std::vector<std::string> equivTypes{ "Mean", "Median" }; std::vector<std::string> equivTypes{"Mean", "Median"};
declareProperty("EquivalentIntensities", equivTypes[0], declareProperty("EquivalentIntensities", equivTypes[0],
boost::make_shared<StringListValidator>(equivTypes), boost::make_shared<StringListValidator>(equivTypes),
"Replace intensities by mean(default), " "Replace intensities by mean(default), "
"or median."); "or median.");
declareProperty(Kernel::make_unique<PropertyWithValue<double> >( declareProperty(Kernel::make_unique<PropertyWithValue<double>>(
"SigmaCritical", 3.0, Direction::Input), "SigmaCritical", 3.0, Direction::Input),
"Removes peaks whose intensity deviates more than " "Removes peaks whose intensity deviates more than "
"SigmaCritical from the mean (or median)."); "SigmaCritical from the mean (or median).");
declareProperty( declareProperty(
make_unique<WorkspaceProperty<MatrixWorkspace> >( make_unique<WorkspaceProperty<MatrixWorkspace>>(
"EquivalentsWorkspace", "EquivalentIntensities", Direction::Output), "EquivalentsWorkspace", "EquivalentIntensities", Direction::Output),
"Output Equivalent Intensities"); "Output Equivalent Intensities");
} }
...@@ -229,9 +229,10 @@ SortHKL::getNonZeroPeaks(const std::vector<Peak> &inputPeaks) const { ...@@ -229,9 +229,10 @@ SortHKL::getNonZeroPeaks(const std::vector<Peak> &inputPeaks) const {
std::remove_copy_if(inputPeaks.begin(), inputPeaks.end(), std::remove_copy_if(inputPeaks.begin(), inputPeaks.end(),
std::back_inserter(peaks), [](const Peak &peak) { std::back_inserter(peaks), [](const Peak &peak) {
return peak.getIntensity() <= 0.0 || peak.getSigmaIntensity() <= 0.0 || return peak.getIntensity() <= 0.0 ||
peak.getHKL() == V3D(0, 0, 0); peak.getSigmaIntensity() <= 0.0 ||
}); peak.getHKL() == V3D(0, 0, 0);
});
return peaks; return peaks;
} }
...@@ -330,9 +331,9 @@ SortHKL::getStatisticsTable(const std::string &name) const { ...@@ -330,9 +331,9 @@ SortHKL::getStatisticsTable(const std::string &name) const {
/// Inserts statistics the supplied PeaksStatistics-objects into the supplied /// Inserts statistics the supplied PeaksStatistics-objects into the supplied
/// TableWorkspace. /// TableWorkspace.
void void SortHKL::insertStatisticsIntoTable(
SortHKL::insertStatisticsIntoTable(const ITableWorkspace_sptr &table, const ITableWorkspace_sptr &table,
const PeaksStatistics &statistics) const { const PeaksStatistics &statistics) const {
if (!table) { if (!table) {
throw std::runtime_error("Can't store statistics into Null-table."); throw std::runtime_error("Can't store statistics into Null-table.");
} }
...@@ -366,9 +367,8 @@ PeaksWorkspace_sptr SortHKL::getOutputPeaksWorkspace( ...@@ -366,9 +367,8 @@ PeaksWorkspace_sptr SortHKL::getOutputPeaksWorkspace(
/// Sorts the peaks in the workspace by H, K and L. /// Sorts the peaks in the workspace by H, K and L.
void SortHKL::sortOutputPeaksByHKL(IPeaksWorkspace_sptr outputPeaksWorkspace) { void SortHKL::sortOutputPeaksByHKL(IPeaksWorkspace_sptr outputPeaksWorkspace) {
// Sort by HKL // Sort by HKL
std::vector<std::pair<std::string, bool> > criteria{ { "H", true }, std::vector<std::pair<std::string, bool>> criteria{
{ "K", true }, {"H", true}, {"K", true}, {"L", true}};
{ "L", true } };
outputPeaksWorkspace->sort(criteria); outputPeaksWorkspace->sort(criteria);
} }
......
...@@ -111,12 +111,12 @@ public: ...@@ -111,12 +111,12 @@ public:
Mantid::Kernel::V3D getDetectorPosition() const override; Mantid::Kernel::V3D getDetectorPosition() const override;
Mantid::Kernel::V3D getDetectorPositionNoCheck() const override; Mantid::Kernel::V3D getDetectorPositionNoCheck() const override;
void setQSampleFrame(const Mantid::Kernel::V3D &QSampleFrame, void setQSampleFrame(
boost::optional<double> detectorDistance = const Mantid::Kernel::V3D &QSampleFrame,
boost::none) override; boost::optional<double> detectorDistance = boost::none) override;
void setQLabFrame(const Mantid::Kernel::V3D &QLabFrame, void
boost::optional<double> detectorDistance = setQLabFrame(const Mantid::Kernel::V3D &QLabFrame,
boost::none) override; boost::optional<double> detectorDistance = boost::none) override;
void setWavelength(double wavelength) override; void setWavelength(double wavelength) override;
double getWavelength() const override; double getWavelength() const override;
......
...@@ -194,8 +194,7 @@ void PeakColumn::read(const size_t index, std::istringstream &in) { ...@@ -194,8 +194,7 @@ void PeakColumn::read(const size_t index, std::istringstream &in) {
double val; double val;
try { try {
in >> val; in >> val;
} } catch (std::exception &e) {
catch (std::exception &e) {
g_log.error() << "Could not convert input to a number. " << e.what() g_log.error() << "Could not convert input to a number. " << e.what()
<< '\n'; << '\n';
return; return;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment