Skip to content

Commit 7024892

Browse files
Merge release-next into ornl-next
2 parents 15b5051 + 74d457e commit 7024892

File tree

3 files changed

+13
-14
lines changed

3 files changed

+13
-14
lines changed

Framework/Algorithms/src/PolarizationCorrections/PolarizerEfficiency.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ void PolarizerEfficiency::calculatePolarizerEfficiency() {
168168

169169
const MatrixWorkspace_sptr effCell = getProperty(PropertyNames::ANALYSER_EFFICIENCY);
170170

171-
auto &&effPolarizer = (t00Ws - t01Ws) / (4 * (2 * effCell - 1) * (t00Ws + t01Ws)) + 0.5;
171+
auto &&effPolarizer = (t00Ws - t01Ws) / (2 * (2 * effCell - 1) * (t00Ws + t01Ws)) + 0.5;
172172

173173
calculateErrors(t00Ws, t01Ws, effCell, effPolarizer);
174174

@@ -199,9 +199,9 @@ void PolarizerEfficiency::calculateErrors(const MatrixWorkspace_sptr &t00Ws, con
199199
const auto &twoCellEffMinusOne = 2 * effCellY[i] - 1;
200200
const auto &t00PlusT01 = t00Y[i] + t01Y[i];
201201

202-
const auto &delta00 = (t01Y[i]) / (2 * (twoCellEffMinusOne)*pow(t00PlusT01, 2));
203-
const auto &delta01 = (-1 * t00Y[i]) / (2 * (twoCellEffMinusOne)*pow(t00PlusT01, 2));
204-
const auto &deltaEffCell = (t01Y[i] - t00Y[i]) / (2 * pow(twoCellEffMinusOne, 2) * (t00PlusT01));
202+
const auto &delta00 = (t01Y[i]) / ((twoCellEffMinusOne)*pow(t00PlusT01, 2));
203+
const auto &delta01 = (-1 * t00Y[i]) / ((twoCellEffMinusOne)*pow(t00PlusT01, 2));
204+
const auto &deltaEffCell = (t01Y[i] - t00Y[i]) / (pow(twoCellEffMinusOne, 2) * (t00PlusT01));
205205
effPolarizerE[i] = sqrt(pow(delta00 * t00E[i], 2) + pow(delta01 * t01E[i], 2) + pow(deltaEffCell * effCellE[i], 2));
206206
}
207207
}

Framework/Algorithms/test/PolarizationCorrections/PolarizerEfficiencyTest.h

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ class PolarizerEfficiencyTest : public CxxTest::TestSuite {
132132
polariserEfficiency->getProperty("OutputWorkspace"));
133133

134134
// The T_para and T_anti curves are 4 and 2 (constant wrt wavelength) respectively, and the analyser
135-
// efficiency is 1 for all wavelengths, which should give us a polarizer efficiency of 7/12
135+
// efficiency is 1 for all wavelengths, which should give us a polarizer efficiency of 2/3
136136
for (const double &y : calculatedPolariserEfficiency->dataY(0)) {
137-
TS_ASSERT_DELTA(7.0 / 12.0, y, 1e-8);
137+
TS_ASSERT_DELTA(2.0 / 3.0, y, 1e-8);
138138
}
139139
}
140140

@@ -151,9 +151,9 @@ class PolarizerEfficiencyTest : public CxxTest::TestSuite {
151151
polariserEfficiency->getProperty("OutputWorkspace"));
152152

153153
// The T_para and T_anti curves are 4 and 2 (constant wrt wavelength) respectively, and the analyser
154-
// efficiency is 1 for all wavelengths, which should give us a polarizer efficiency of 7/12
154+
// efficiency is 1 for all wavelengths, which should give us a polarizer efficiency of 2/3
155155
for (const double &y : calculatedPolariserEfficiency->dataY(0)) {
156-
TS_ASSERT_DELTA(7.0 / 12.0, y, 1e-8);
156+
TS_ASSERT_DELTA(2.0 / 3.0, y, 1e-8);
157157
}
158158
}
159159

@@ -164,8 +164,7 @@ class PolarizerEfficiencyTest : public CxxTest::TestSuite {
164164
polarizerEfficiency->getProperty("OutputWorkspace"));
165165
const auto &errors = eff->dataE(0);
166166
// Skip the first error because with this toy data it'll be NaN
167-
const std::vector<double> expectedErrors{44.194173824159222, 19.641855032959654, 11.048543456039805,
168-
7.0710678118654755};
167+
const std::vector<double> expectedErrors{88.3883476283, 39.2837100613, 22.0970869124, 14.1421356255};
169168
for (size_t i = 0; i < expectedErrors.size(); ++i) {
170169
TS_ASSERT_DELTA(expectedErrors[i], errors[i + 1], 1e-7);
171170
}

docs/source/algorithms/PolarizerEfficiency-v1.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ The polarization of the polarizer, :math:`P_{SM}`, is given by [#KRYCKA]_
2222
Since the efficiency, :math:`\epsilon_{SM}`, is given by :math:`\frac{1 + P_{SM}}{2}`, we have that
2323

2424
.. math::
25-
\epsilon_{SM} = \frac{1}{2} + \frac{T_{00} - T_{01}}{4(2\epsilon_{cell} - 1)(T_{00} + T_{01})}
25+
\epsilon_{SM} = \frac{1}{2} + \frac{T_{00} - T_{01}}{2(2\epsilon_{cell} - 1)(T_{00} + T_{01})}
2626
2727
The error in the calculation can then be determined thus:
2828

@@ -34,13 +34,13 @@ The error in the calculation can then be determined thus:
3434
where:
3535

3636
.. math::
37-
\frac{\delta \epsilon_{SM}}{\delta T_{00}} = \frac{T_{01}}{2(2\epsilon_{cell} - 1)(T_{00} + T_{01})^2}
37+
\frac{\delta \epsilon_{SM}}{\delta T_{00}} = \frac{T_{01}}{(2\epsilon_{cell} - 1)(T_{00} + T_{01})^2}
3838
3939
.. math::
40-
\frac{\delta \epsilon_{SM}}{\delta T_{01}} = \frac{-T_{00}}{2(2\epsilon_{cell} - 1)(T_{00} + T_{01})^2}
40+
\frac{\delta \epsilon_{SM}}{\delta T_{01}} = \frac{-T_{00}}{(2\epsilon_{cell} - 1)(T_{00} + T_{01})^2}
4141
4242
.. math::
43-
\frac{\delta \epsilon_{SM}}{\delta \epsilon_{cell}} = \frac{T_{01} - T_{00}}{2(2\epsilon_{cell} - 1)^2(T_{00} + T_{01})}
43+
\frac{\delta \epsilon_{SM}}{\delta \epsilon_{cell}} = \frac{T_{01} - T_{00}}{(2\epsilon_{cell} - 1)^2(T_{00} + T_{01})}
4444
4545
Usage
4646
-----

0 commit comments

Comments
 (0)