diff --git a/Framework/Crystal/src/LoadHKL.cpp b/Framework/Crystal/src/LoadHKL.cpp index 07a9ba69940a1007e9303ab8f24bbe4b25d567ed..8bbd385ec9cc4d68a25a1f00428bec799fa73050 100644 --- a/Framework/Crystal/src/LoadHKL.cpp +++ b/Framework/Crystal/src/LoadHKL.cpp @@ -27,7 +27,7 @@ void LoadHKL::init() { FileProperty::Load, ".hkl"), "Path to an hkl file to save."); - declareProperty(make_unique<WorkspaceProperty<PeaksWorkspace> >( + declareProperty(make_unique<WorkspaceProperty<PeaksWorkspace>>( "OutputWorkspace", "", Direction::Output), "Name of the output workspace."); } @@ -158,8 +158,9 @@ void LoadHKL::exec() { radius1 = x1; else if (x2 > 0) radius1 = x2; - double frac = theta - static_cast<double>(static_cast<int>(theta / 5.)) * - 5.; // theta%5. + double frac = + theta - + static_cast<double>(static_cast<int>(theta / 5.)) * 5.; // theta%5. frac = frac / 5.; radius = radius * (1 - frac) + radius1 * frac; radius /= mu1; diff --git a/Framework/Crystal/src/SortHKL.cpp b/Framework/Crystal/src/SortHKL.cpp index 7fe77bd1ecf69b283ad1bd45d65a60ddc32e7368..71064a51886008eafffcb1e6323ecdd928299c53 100644 --- a/Framework/Crystal/src/SortHKL.cpp +++ b/Framework/Crystal/src/SortHKL.cpp @@ -38,7 +38,7 @@ SortHKL::SortHKL() { SortHKL::~SortHKL() = default; void SortHKL::init() { - declareProperty(make_unique<WorkspaceProperty<PeaksWorkspace> >( + declareProperty(make_unique<WorkspaceProperty<PeaksWorkspace>>( "InputWorkspace", "", Direction::Input), "An input PeaksWorkspace with an instrument."); @@ -60,31 +60,31 @@ void SortHKL::init() { boost::make_shared<StringListValidator>(centeringOptions), "Appropriate lattice centering for the peaks."); - declareProperty(make_unique<WorkspaceProperty<PeaksWorkspace> >( + declareProperty(make_unique<WorkspaceProperty<PeaksWorkspace>>( "OutputWorkspace", "", Direction::Output), "Output PeaksWorkspace"); declareProperty("OutputChi2", 0.0, "Chi-square is available as output", Direction::Output); - declareProperty(make_unique<WorkspaceProperty<ITableWorkspace> >( + declareProperty(make_unique<WorkspaceProperty<ITableWorkspace>>( "StatisticsTable", "StatisticsTable", Direction::Output), "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), "name of row"); declareProperty("Append", false, "Append to output table workspace if true.\n" "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], boost::make_shared<StringListValidator>(equivTypes), "Replace intensities by mean(default), " "or median."); - declareProperty(Kernel::make_unique<PropertyWithValue<double> >( + declareProperty(Kernel::make_unique<PropertyWithValue<double>>( "SigmaCritical", 3.0, Direction::Input), "Removes peaks whose intensity deviates more than " "SigmaCritical from the mean (or median)."); declareProperty( - make_unique<WorkspaceProperty<MatrixWorkspace> >( + make_unique<WorkspaceProperty<MatrixWorkspace>>( "EquivalentsWorkspace", "EquivalentIntensities", Direction::Output), "Output Equivalent Intensities"); } @@ -229,9 +229,10 @@ SortHKL::getNonZeroPeaks(const std::vector<Peak> &inputPeaks) const { std::remove_copy_if(inputPeaks.begin(), inputPeaks.end(), std::back_inserter(peaks), [](const Peak &peak) { - return peak.getIntensity() <= 0.0 || peak.getSigmaIntensity() <= 0.0 || - peak.getHKL() == V3D(0, 0, 0); - }); + return peak.getIntensity() <= 0.0 || + peak.getSigmaIntensity() <= 0.0 || + peak.getHKL() == V3D(0, 0, 0); + }); return peaks; } @@ -330,9 +331,9 @@ SortHKL::getStatisticsTable(const std::string &name) const { /// Inserts statistics the supplied PeaksStatistics-objects into the supplied /// TableWorkspace. -void -SortHKL::insertStatisticsIntoTable(const ITableWorkspace_sptr &table, - const PeaksStatistics &statistics) const { +void SortHKL::insertStatisticsIntoTable( + const ITableWorkspace_sptr &table, + const PeaksStatistics &statistics) const { if (!table) { throw std::runtime_error("Can't store statistics into Null-table."); } @@ -366,9 +367,8 @@ PeaksWorkspace_sptr SortHKL::getOutputPeaksWorkspace( /// Sorts the peaks in the workspace by H, K and L. void SortHKL::sortOutputPeaksByHKL(IPeaksWorkspace_sptr outputPeaksWorkspace) { // Sort by HKL - std::vector<std::pair<std::string, bool> > criteria{ { "H", true }, - { "K", true }, - { "L", true } }; + std::vector<std::pair<std::string, bool>> criteria{ + {"H", true}, {"K", true}, {"L", true}}; outputPeaksWorkspace->sort(criteria); } diff --git a/Framework/DataObjects/inc/MantidDataObjects/Peak.h b/Framework/DataObjects/inc/MantidDataObjects/Peak.h index c489bac4a55c8fa76e74cd7d776caf28791f1ed7..e5c79d11ae6a16e35421293baa7095828ffb1b85 100644 --- a/Framework/DataObjects/inc/MantidDataObjects/Peak.h +++ b/Framework/DataObjects/inc/MantidDataObjects/Peak.h @@ -111,12 +111,12 @@ public: Mantid::Kernel::V3D getDetectorPosition() const override; Mantid::Kernel::V3D getDetectorPositionNoCheck() const override; - void setQSampleFrame(const Mantid::Kernel::V3D &QSampleFrame, - boost::optional<double> detectorDistance = - boost::none) override; - void setQLabFrame(const Mantid::Kernel::V3D &QLabFrame, - boost::optional<double> detectorDistance = - boost::none) override; + void setQSampleFrame( + const Mantid::Kernel::V3D &QSampleFrame, + boost::optional<double> detectorDistance = boost::none) override; + void + setQLabFrame(const Mantid::Kernel::V3D &QLabFrame, + boost::optional<double> detectorDistance = boost::none) override; void setWavelength(double wavelength) override; double getWavelength() const override; diff --git a/Framework/DataObjects/src/PeakColumn.cpp b/Framework/DataObjects/src/PeakColumn.cpp index 5647f46c59698f00c4097433c8f2a6d091bfebaa..891e199908ab275e30a2c6c570e9b6ddc761bbf9 100644 --- a/Framework/DataObjects/src/PeakColumn.cpp +++ b/Framework/DataObjects/src/PeakColumn.cpp @@ -194,8 +194,7 @@ void PeakColumn::read(const size_t index, std::istringstream &in) { double val; try { in >> val; - } - catch (std::exception &e) { + } catch (std::exception &e) { g_log.error() << "Could not convert input to a number. " << e.what() << '\n'; return;