Skip to content
Snippets Groups Projects
Commit 29d735e5 authored by McDonnell, Marshall's avatar McDonnell, Marshall
Browse files

Clang formatting

parent b93dcf64
No related merge requests found
......@@ -55,9 +55,9 @@ public:
/// Algorithm's version for identification overriding a virtual method
int version() const override;
const std::vector<std::string> seeAlso() const override {
return { "CarpenterSampleCorrection", "CylinderAbsorption",
"MonteCarloAbsorption", "MayersSampleCorrection",
"PearlMCAbsorption", "VesuvioCalculateMS" };
return {"CarpenterSampleCorrection", "CylinderAbsorption",
"MonteCarloAbsorption", "MayersSampleCorrection",
"PearlMCAbsorption", "VesuvioCalculateMS"};
}
/// Algorithm's category for identification overriding a virtual method
......
......@@ -54,9 +54,9 @@ public:
/// Algorithm's version for identification overriding a virtual method
int version() const override;
const std::vector<std::string> seeAlso() const override {
return { "CalculateCarpenterSampleCorrection", "CylinderAbsorption",
"MonteCarloAbsorption", "MayersSampleCorrection",
"PearlMCAbsorption", "VesuvioCalculateMS" };
return {"CalculateCarpenterSampleCorrection", "CylinderAbsorption",
"MonteCarloAbsorption", "MayersSampleCorrection",
"PearlMCAbsorption", "VesuvioCalculateMS"};
}
/// Algorithm's category for identification overriding a virtual method
......
......@@ -50,8 +50,8 @@ public:
/// Algorithm's version
int version() const override { return 1; }
const std::vector<std::string> seeAlso() const override {
return { "MayersSampleCorrection", "CarpenterSampleCorrection",
"PearlMCAbsorption", "VesuvioCalculateMS" };
return {"MayersSampleCorrection", "CarpenterSampleCorrection",
"PearlMCAbsorption", "VesuvioCalculateMS"};
}
/// Algorithm's category for identification
const std::string category() const override {
......
......@@ -42,36 +42,51 @@ using namespace Geometry;
// Chebyshev expansion coefficients copied directly from Carpenter 1969 Table 1
namespace { // anonymous
static const double CHEBYSHEV[] = {
// l= 0 1 2 3 4 5 // (m,n)
0.730284, -0.249987, 0.019448, -0.000006, 0.000249, -0.000004, // (1,1)
0.848859, -0.452690, 0.056557, -0.000009, 0.000000, -0.000006, // (1,2)
1.133129, -0.749962, 0.118245, -0.000018, -0.001345, -0.000012, // (1,3)
1.641112, -1.241639, 0.226247, -0.000045, -0.004821, -0.000030, // (1,4)
0.848859, -0.452690, 0.056557, -0.000009, 0.000000, -0.000006, // (2,1)
1.000006, -0.821100, 0.166645, -0.012096, 0.000008, -0.000126, // (2,2)
1.358113, -1.358076, 0.348199, -0.038817, 0.000022, -0.000021, // (2,3)
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, // (2,4)
1.133129, -0.749962, 0.118245, -0.000018, -0.001345, -0.000012, // (3,1)
1.358113, -1.358076, 0.348199, -0.038817, 0.000022, -0.000021, // (3,2)
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, // (3,3)
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, // (3,4)
1.641112, -1.241639, 0.226247, -0.000045, -0.004821, -0.000030, // (4,1)
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, // (4,2)
0.0, 0.0, 0.0, 0.0, 0.0, 0.0, // (4,3)
0.0, 0.0, 0.0, 0.0, 0.0, 0.0 // (4,4)
// l= 0 1 2 3 4 5 // (m,n)
0.730284, -0.249987, 0.019448, -0.000006,
0.000249, -0.000004, // (1,1)
0.848859, -0.452690, 0.056557, -0.000009,
0.000000, -0.000006, // (1,2)
1.133129, -0.749962, 0.118245, -0.000018,
-0.001345, -0.000012, // (1,3)
1.641112, -1.241639, 0.226247, -0.000045,
-0.004821, -0.000030, // (1,4)
0.848859, -0.452690, 0.056557, -0.000009,
0.000000, -0.000006, // (2,1)
1.000006, -0.821100, 0.166645, -0.012096,
0.000008, -0.000126, // (2,2)
1.358113, -1.358076, 0.348199, -0.038817,
0.000022, -0.000021, // (2,3)
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, // (2,4)
1.133129, -0.749962, 0.118245, -0.000018,
-0.001345, -0.000012, // (3,1)
1.358113, -1.358076, 0.348199, -0.038817,
0.000022, -0.000021, // (3,2)
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, // (3,3)
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, // (3,4)
1.641112, -1.241639, 0.226247, -0.000045,
-0.004821, -0.000030, // (4,1)
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, // (4,2)
0.0, 0.0, 0.0, 0.0,
0.0, 0.0, // (4,3)
0.0, 0.0, 0.0, 0.0,
0.0, 0.0 // (4,4)
};
static const int Z_size = 36; // Caution, this must be updated if the
// algorithm is changed to use a different
// size Z array.
static const double Z_initial[] = {
1.0, 0.8488263632, 1.0, 1.358122181, 2.0, 3.104279270,
0.8488263632, 0.0, 0.0, 0.0, 0.0, 0.0,
1.0, 0.0, 0.0, 0.0, 0.0, 0.0,
1.358122181, 0.0, 0.0, 0.0, 0.0, 0.0,
2.0, 0.0, 0.0, 0.0, 0.0, 0.0,
3.104279270, 0.0, 0.0, 0.0, 0.0, 0.0
};
1.0, 0.8488263632, 1.0, 1.358122181, 2.0, 3.104279270,
0.8488263632, 0.0, 0.0, 0.0, 0.0, 0.0,
1.0, 0.0, 0.0, 0.0, 0.0, 0.0,
1.358122181, 0.0, 0.0, 0.0, 0.0, 0.0,
2.0, 0.0, 0.0, 0.0, 0.0, 0.0,
3.104279270, 0.0, 0.0, 0.0, 0.0, 0.0};
static const double LAMBDA_REF =
1.81; ///< Wavelength that the calculations are based on
......@@ -101,10 +116,10 @@ void CalculateCarpenterSampleCorrection::init() {
wsValidator->add<WorkspaceUnitValidator>("Wavelength");
wsValidator->add<InstrumentValidator>();
declareProperty(make_unique<WorkspaceProperty<MatrixWorkspace> >(
declareProperty(make_unique<WorkspaceProperty<MatrixWorkspace>>(
"InputWorkspace", "", Direction::Input, wsValidator),
"The name of the input workspace.");
declareProperty(make_unique<WorkspaceProperty<API::WorkspaceGroup> >(
declareProperty(make_unique<WorkspaceProperty<API::WorkspaceGroup>>(
"OutputWorkspaceBaseName", "", Direction::Output),
"Basename of the output workspace group for corrections."
"Absorption suffix = '_abs'. "
......
......@@ -128,10 +128,9 @@ public:
// Check absorption correction
const size_t size = 16;
std::array<double, size> abs_corr_expected = {
{ 0.786608, 0.764593, 0.743221, 0.722473, 0.702329, 0.682772,
0.663783, 0.645345, 0.627442, 0.610057, 0.593173, 0.576775,
0.560848, 0.545376, 0.530345, 0.515739 }
};
{0.786608, 0.764593, 0.743221, 0.722473, 0.702329, 0.682772, 0.663783,
0.645345, 0.627442, 0.610057, 0.593173, 0.576775, 0.560848, 0.545376,
0.530345, 0.515739}};
auto &abs_corr_actual = absWksp->y(0);
for (size_t i = 0; i < size; i++)
......@@ -149,19 +148,18 @@ public:
AnalysisDataService::Instance().retrieveWS<API::MatrixWorkspace>(
"TestAbsWS");
std::array<double, size> abs_ws_expected = {
{ 2.54256, 2.61577, 2.69099, 2.76827, 2.84767, 2.92924, 3.01303, 3.09912,
3.18754, 3.27838, 3.37170, 3.46756, 3.56603, 3.66720, 3.77113, 3.87793 }
};
{2.54256, 2.61577, 2.69099, 2.76827, 2.84767, 2.92924, 3.01303, 3.09912,
3.18754, 3.27838, 3.37170, 3.46756, 3.56603, 3.66720, 3.77113,
3.87793}};
auto &abs_ws_actual = absCorrectedWksp->y(0);
for (size_t i = 0; i < size; i++)
TS_ASSERT_DELTA(abs_ws_actual[i], abs_ws_expected[i], 0.00001);
// Check multiple scattering correction
std::array<double, size> ms_corr_expected = {
{ 0.159334, 0.161684, 0.164032, 0.166376, 0.168712, 0.171039,
0.173355, 0.175658, 0.177944, 0.180211, 0.182457, 0.184678,
0.186873, 0.189038, 0.191171, 0.193268 }
};
{0.159334, 0.161684, 0.164032, 0.166376, 0.168712, 0.171039, 0.173355,
0.175658, 0.177944, 0.180211, 0.182457, 0.184678, 0.186873, 0.189038,
0.191171, 0.193268}};
auto &ms_corr_actual = msWksp->y(0);
for (size_t i = 0; i < size; i++)
TS_ASSERT_DELTA(ms_corr_actual[i], ms_corr_expected[i], 0.00001);
......@@ -178,10 +176,9 @@ public:
AnalysisDataService::Instance().retrieveWS<API::MatrixWorkspace>(
"TestMultScatWS");
std::array<double, size> ms_ws_expected = {
{ 0.318668, 0.323369, 0.328065, 0.332751, 0.337424, 0.342079,
0.346711, 0.351315, 0.355887, 0.360422, 0.364913, 0.369356,
0.373746, 0.378076, 0.382341, 0.386535 }
};
{0.318668, 0.323369, 0.328065, 0.332751, 0.337424, 0.342079, 0.346711,
0.351315, 0.355887, 0.360422, 0.364913, 0.369356, 0.373746, 0.378076,
0.382341, 0.386535}};
auto &ms_ws_actual = msCorrectedWksp->y(0);
for (size_t i = 0; i < size; i++)
......@@ -199,9 +196,9 @@ public:
AnalysisDataService::Instance().retrieveWS<API::MatrixWorkspace>(
"TestOutputWS");
std::array<double, size> test_ws_expected = {
{ 2.22389, 2.2924, 2.36292, 2.43552, 2.51024, 2.58716, 2.66632, 2.7478,
2.83166, 2.91796, 3.00678, 3.09820, 3.19228, 3.28912, 3.38879, 3.49139 }
};
{2.22389, 2.2924, 2.36292, 2.43552, 2.51024, 2.58716, 2.66632, 2.7478,
2.83166, 2.91796, 3.00678, 3.09820, 3.19228, 3.28912, 3.38879,
3.49139}};
auto &test_ws_actual = outputWksp->y(0);
for (size_t i = 0; i < size; i++)
......@@ -258,10 +255,9 @@ public:
// Check absorption correction
const size_t size = 16;
std::array<double, size> abs_corr_expected = {
{ 0.733553, 0.726500, 0.719519, 0.712607, 0.705765, 0.698992,
0.692286, 0.685648, 0.679076, 0.672570, 0.666129, 0.659753,
0.65344, 0.647191, 0.641004, 0.634878 }
};
{0.733553, 0.726500, 0.719519, 0.712607, 0.705765, 0.698992, 0.692286,
0.685648, 0.679076, 0.672570, 0.666129, 0.659753, 0.65344, 0.647191,
0.641004, 0.634878}};
const auto &abs_corr_actual = absWksp->histogram(0).y();
for (size_t i = 0; i < size; i++)
TS_ASSERT_DELTA(abs_corr_actual[i], abs_corr_expected[i], 0.00001);
......@@ -272,10 +268,9 @@ public:
// Check multiple scattering correction
std::array<double, size> ms_corr_expected = {
{ 0.165116, 0.165916, 0.166714, 0.167512, 0.168309, 0.169105,
0.169900, 0.170693, 0.171486, 0.172277, 0.173066, 0.173854,
0.17464, 0.175425, 0.176207, 0.176988 }
};
{0.165116, 0.165916, 0.166714, 0.167512, 0.168309, 0.169105, 0.169900,
0.170693, 0.171486, 0.172277, 0.173066, 0.173854, 0.17464, 0.175425,
0.176207, 0.176988}};
auto &ms_corr_actual = msWksp->y(0);
for (size_t i = 0; i < size; i++)
TS_ASSERT_DELTA(ms_corr_actual[i], ms_corr_expected[i], 0.00001);
......
......@@ -112,9 +112,9 @@ public:
// setup expected values
const size_t size = 16;
std::array<double, size> y_expected = {
{ 2.22389, 2.2924, 2.36292, 2.43552, 2.51024, 2.58716, 2.66632, 2.7478,
2.83166, 2.91796, 3.00678, 3.0982, 3.19228, 3.28912, 3.38879, 3.49139 }
};
{2.22389, 2.2924, 2.36292, 2.43552, 2.51024, 2.58716, 2.66632, 2.7478,
2.83166, 2.91796, 3.00678, 3.0982, 3.19228, 3.28912, 3.38879,
3.49139}};
// do the final comparison
auto &y_actual = test_output_WS->y(0);
......
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