Commit 868fca56 authored by Hahn, Steven's avatar Hahn, Steven
Browse files

clang-format

parent 256f387f
......@@ -524,8 +524,8 @@ std::vector<size_t> MatrixWorkspace::getDetectorIDToWorkspaceIndexVector(
int index = det + offset;
if (index < 0 || index >= outSize) {
g_log.debug() << "MatrixWorkspace::getDetectorIDToWorkspaceIndexVector("
"): detector ID found ("
<< det << " at workspace index " << workspaceIndex
"): detector ID found (" << det
<< " at workspace index " << workspaceIndex
<< ") is invalid.\n";
} else
// Save it at that point.
......
......@@ -96,8 +96,8 @@ void ApplyDeadTimeCorr::exec() {
outputWs->dataY(index)[j] = inputWs->dataY(index)[j] / temp;
} else {
g_log.error() << "1 - MeasuredCount * (Deadtime/TimeBin width "
"is currently ("
<< temp << "). Can't divide by this amount.\n";
"is currently (" << temp
<< "). Can't divide by this amount.\n";
throw std::invalid_argument("Can't divide by 0");
}
......
......@@ -299,9 +299,8 @@ void CorrectKiKf::execEvent() {
if (inputWS->getNumberEvents() != outputWS->getNumberEvents()) {
g_log.information() << "Ef <= 0 or Ei <= 0 for "
<< inputWS->getNumberEvents() -
outputWS->getNumberEvents()
<< " events, out of " << inputWS->getNumberEvents()
<< '\n';
outputWS->getNumberEvents() << " events, out of "
<< inputWS->getNumberEvents() << '\n';
if (efixedProp == EMPTY_DBL())
g_log.information() << "Try to set fixed energy\n";
}
......
......@@ -182,8 +182,7 @@ void CreateSampleWorkspace::exec() {
// down
binWidth = xMax - xMin;
g_log.warning() << "The bin width is so large that there is less than one "
"bin - it has been changed to "
<< binWidth << '\n';
"bin - it has been changed to " << binWidth << '\n';
}
std::string functionString = "";
......
......@@ -562,8 +562,7 @@ bool GetAllEi::peakGuess(const API::MatrixWorkspace_sptr &inputWS, size_t index,
boost::lexical_cast<std::string>(
stay_still_count) +
" Wrong energy or noisy peak at Ei=" +
boost::lexical_cast<std::string>(Ei)
<< '\n';
boost::lexical_cast<std::string>(Ei) << '\n';
}
g_log.debug() << "*Performed: " + boost::lexical_cast<std::string>(ic) +
" averages for spectra " +
......@@ -661,8 +660,7 @@ bool GetAllEi::findMonitorPeak(const API::MatrixWorkspace_sptr &inputWS,
boost::lexical_cast<std::string>(peak1TwoSigma) +
"\n and Peak at mon2: Ei= " +
boost::lexical_cast<std::string>(peak2Pos) + "and height: " +
boost::lexical_cast<std::string>(peak1Height)
<< '\n';
boost::lexical_cast<std::string>(peak1Height) << '\n';
return false;
}
......
......@@ -1328,8 +1328,7 @@ void GetDetOffsetsMultiPeaks::makeFitSummary() {
if (0 == numunmasked) {
g_log.warning()
<< "Found 0 unmasked rows in the spectra info table. "
"Cannot calculate Chi-sq sensibly. it's value will be NaN"
<< '\n';
"Cannot calculate Chi-sq sensibly. it's value will be NaN" << '\n';
avgchi2 = NAN;
} else {
avgchi2 = sumchi2 / static_cast<double>(numunmasked);
......
......@@ -226,24 +226,20 @@ std::vector<size_t> GetEi::getMonitorWsIndexs(
auto wsInds = WS->getIndicesFromSpectra(specNumTemp);
if (wsInds.size() != 1) { // the monitor spectrum isn't present in the
// workspace, we can't continue from here
g_log.error() << "Couldn't find the first monitor "
"spectrum, number "
<< specNum1 << '\n';
throw Exception::NotFoundError(
"GetEi::getMonitorWsIndexs()", specNum1);
// workspace, we can't continue from here
g_log.error() << "Couldn't find the first monitor "
"spectrum, number " << specNum1 << '\n';
throw Exception::NotFoundError("GetEi::getMonitorWsIndexs()", specNum1);
}
// nowe the second monitor
specNumTemp[0] = specNum2;
auto wsIndexTemp = WS->getIndicesFromSpectra(specNumTemp);
if (wsIndexTemp.size() != 1) { // the monitor spectrum isn't present in the
// workspace, we can't continue from here
g_log.error() << "Couldn't find the second "
"monitor spectrum, number "
<< specNum2 << '\n';
throw Exception::NotFoundError(
"GetEi::getMonitorWsIndexs()", specNum2);
// workspace, we can't continue from here
g_log.error() << "Couldn't find the second "
"monitor spectrum, number " << specNum2 << '\n';
throw Exception::NotFoundError("GetEi::getMonitorWsIndexs()", specNum2);
}
wsInds.push_back(wsIndexTemp[0]);
......
......@@ -532,8 +532,7 @@ void RadiusSum::numBinsIsReasonable() {
"resolution (detector size). "
<< "A resonable number is smaller than "
<< static_cast<int>((max_radius - min_radius) /
min_bin_size)
<< '\n';
min_bin_size) << '\n';
}
double RadiusSum::getMinBinSizeForInstrument(API::MatrixWorkspace_sptr inWS) {
......
......@@ -447,8 +447,7 @@ void ReflectometryReductionOneAuto::exec() {
} catch (std::runtime_error &e) {
g_log.warning() << "Could not autodetect polynomial correction method. "
"Polynomial correction will not be performed. "
"Reason for failure: "
<< e.what() << '\n';
"Reason for failure: " << e.what() << '\n';
refRedOne->setProperty("CorrectionAlgorithm", "None");
}
......
......@@ -127,8 +127,8 @@ void TOFSANSResolutionByPixel::exec() {
auto collimationLengthEstimator = SANSCollimationLengthEstimator();
LCollim = collimationLengthEstimator.provideCollimationLength(inWS);
g_log.information() << "No collimation length was specified. A default "
"collimation length was estimated to be "
<< LCollim << '\n';
"collimation length was estimated to be " << LCollim
<< '\n';
} else {
g_log.information() << "The collimation length is " << LCollim << '\n';
}
......
......@@ -2259,8 +2259,7 @@ bool IntegratePeakTimeSlices::isGoodFit(std::vector<double> const &params,
g_log.debug() << " Bad Slice. Negative Counts= "
<< m_AttributeValues->StatBaseVals(IIntensities) -
params[Ibk] * ncells
<< '\n';
params[Ibk] * ncells << '\n';
;
return false;
}
......@@ -2275,8 +2274,7 @@ bool IntegratePeakTimeSlices::isGoodFit(std::vector<double> const &params,
// background
{
g_log.debug() << " Bad Slice. Fitted Intensity & Observed "
"Intensity(-back) too different. ratio="
<< x << '\n';
"Intensity(-back) too different. ratio=" << x << '\n';
return false;
}
......
......@@ -140,8 +140,7 @@ void PredictPeaks::exec() {
} catch (std::runtime_error &e) {
// If there is no goniometer matrix, use identity matrix instead.
g_log.error() << "Error getting the goniometer rotation matrix from the "
"InputWorkspace."
<< std::endl
"InputWorkspace." << std::endl
<< e.what() << '\n';
g_log.warning() << "Using identity goniometer rotation matrix instead."
<< '\n';
......@@ -186,8 +185,7 @@ void PredictPeaks::exec() {
g_log.error()
<< "Error getting the goniometer rotation matrix from the "
"InputWorkspace."
<< std::endl
"InputWorkspace." << std::endl
<< e.what() << '\n';
g_log.warning() << "Using identity goniometer rotation matrix instead."
<< '\n';
......
......@@ -143,7 +143,8 @@ void SaveIsawUB::exec() {
<< lattice.errorgamma() << setw(12) << setprecision(4) << ErrorVolume
<< " \n";
out << endl << '\n';
out << endl
<< '\n';
out << "The above matrix is the Transpose of the UB Matrix. ";
out << "The UB matrix maps the column\n";
......
......@@ -1743,7 +1743,8 @@ bool FitPowderDiffPeaks::doFit1PeakSimple(
// Debug information output
API::ITableWorkspace_sptr paramws = fitalg->getProperty("OutputParameters");
std::string infofit = parseFitParameterWorkspace(paramws);
g_log.information() << "Fitted Parameters: " << endl << infofit << '\n';
g_log.information() << "Fitted Parameters: " << endl
<< infofit << '\n';
} else {
g_log.error() << "[DBx128B] Failed to execute fitting peak @ "
<< peakfunction->centre() << '\n';
......@@ -1880,8 +1881,7 @@ bool FitPowderDiffPeaks::doFitGaussianPeak(DataObjects::Workspace2D_sptr dataws,
bool fitsuccess;
std::string fitresult = parseFitResult(fitalg, chi2, fitsuccess);
g_log.information() << "[Fit Gaussian Peak] Successful = " << fitsuccess
<< ", Result:\n"
<< fitresult << '\n';
<< ", Result:\n" << fitresult << '\n';
// 4. Get result
center = gaussianpeak->centre();
......
......@@ -90,7 +90,8 @@ bool DampingMinimizer::iterate(size_t) {
for (size_t j = 0; j < n; ++j) {
std::cerr << dx.get(j) << ' ';
}
std::cerr << std::endl << '\n';
std::cerr << std::endl
<< '\n';
}
// Update the parameters of the cost function.
......
......@@ -94,7 +94,8 @@ bool LevenbergMarquardtMDMinimizer::iterate(size_t) {
g_log.warning()
<< "==========================================================="
<< '\n';
g_log.warning() << "mu=" << m_mu << std::endl << '\n';
g_log.warning() << "mu=" << m_mu << std::endl
<< '\n';
}
if (m_D.empty()) {
......@@ -164,7 +165,8 @@ bool LevenbergMarquardtMDMinimizer::iterate(size_t) {
for (size_t j = 0; j < n; ++j) {
g_log.warning() << dx.get(j) << ' ';
}
g_log.warning() << std::endl << '\n';
g_log.warning() << std::endl
<< '\n';
}
// restore scaling
......
......@@ -154,7 +154,8 @@ void BivariateNormal::function1D(double *out, const double *xValues,
inf << i << "=" << constr->check() << ";";
}
inf << '\n';
inf << std::endl << " chiSq =" << chiSq << " nData " << nData << '\n';
inf << std::endl
<< " chiSq =" << chiSq << " nData " << nData << '\n';
g_log.debug(inf.str());
}
......
......@@ -113,8 +113,8 @@ void CheckMantidVersion::exec() {
// formatting issues like missing quotes or brackets.
g_log.warning() << "Error found when parsing version information "
"retrieved from GitHub as a JSON string. "
"Error trying to parse this JSON string: "
<< json << std::endl
"Error trying to parse this JSON string: " << json
<< std::endl
<< ". Parsing error details: "
<< r.getFormattedErrorMessages() << '\n';
}
......
......@@ -282,8 +282,7 @@ size_t DownloadInstrument::removeOrphanedFiles(
if (filenamesToKeep.find(entryPath.getFileName()) ==
filenamesToKeep.end()) {
g_log.debug() << "File not found in remote instrument repository, will "
"be deleted: "
<< entryPath.getFileName() << '\n';
"be deleted: " << entryPath.getFileName() << '\n';
filesToDelete.push_back(it->path());
}
}
......
......@@ -347,8 +347,7 @@ void FindDetectorsPar::calcDetPar(const Geometry::IDetector_const_sptr &spDet,
boost::dynamic_pointer_cast<const Geometry::DetectorGroup>(spDet);
if (!spDetGroup) {
g_log.error() << "calc_cylDetPar: can not downcast IDetector_sptr to "
"detector group for det->ID: "
<< spDet->getID() << '\n';
"detector group for det->ID: " << spDet->getID() << '\n';
throw(std::bad_cast());
}
auto detectors = spDetGroup->getDetectors();
......
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