Commit eac8e28c authored by Hahn, Steven's avatar Hahn, Steven
Browse files

Pass a const reference instead of a shared_ptr.

parent 170e4f0f
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
#include "MantidAPI/Run.h" #include "MantidAPI/Run.h"
#include "MantidAPI/Sample.h" #include "MantidAPI/Sample.h"
#include "MantidGeometry/Instrument_fwd.h"
#include "MantidGeometry/IDetector_fwd.h"
#include "MantidAPI/SpectraDetectorTypes.h" #include "MantidAPI/SpectraDetectorTypes.h"
#include "MantidGeometry/IDetector.h"
#include "MantidGeometry/Instrument_fwd.h"
#include "MantidKernel/DeltaEMode.h" #include "MantidKernel/DeltaEMode.h"
......
...@@ -92,8 +92,8 @@ public: ...@@ -92,8 +92,8 @@ public:
/**@name Instrument queries */ /**@name Instrument queries */
//@{ //@{
Geometry::IDetector_const_sptr getDetector(const size_t workspaceIndex) const; Geometry::IDetector_const_sptr getDetector(const size_t workspaceIndex) const;
double detectorTwoTheta(Geometry::IDetector_const_sptr det) const; double detectorTwoTheta(const Geometry::IDetector &det) const;
double detectorSignedTwoTheta(Geometry::IDetector_const_sptr det) const; double detectorSignedTwoTheta(const Geometry::IDetector &det) const;
//@} //@}
......
...@@ -945,7 +945,7 @@ void IFunction::convertValue(std::vector<double> &values, ...@@ -945,7 +945,7 @@ void IFunction::convertValue(std::vector<double> &values,
double l2(-1.0), twoTheta(0.0); double l2(-1.0), twoTheta(0.0);
if (!det->isMonitor()) { if (!det->isMonitor()) {
l2 = det->getDistance(*sample); l2 = det->getDistance(*sample);
twoTheta = ws->detectorTwoTheta(det); twoTheta = ws->detectorTwoTheta(*det);
} else // If this is a monitor then make l1+l2 = source-detector distance } else // If this is a monitor then make l1+l2 = source-detector distance
// and twoTheta=0 // and twoTheta=0
{ {
......
...@@ -32,6 +32,7 @@ using Kernel::V3D; ...@@ -32,6 +32,7 @@ using Kernel::V3D;
namespace { namespace {
/// static logger /// static logger
Kernel::Logger g_log("MatrixWorkspace"); Kernel::Logger g_log("MatrixWorkspace");
static constexpr double rad2deg = 180. / M_PI;
} }
const std::string MatrixWorkspace::xDimensionId = "xDimension"; const std::string MatrixWorkspace::xDimensionId = "xDimension";
...@@ -790,10 +791,10 @@ MatrixWorkspace::getDetector(const size_t workspaceIndex) const { ...@@ -790,10 +791,10 @@ MatrixWorkspace::getDetector(const size_t workspaceIndex) const {
* @throws InstrumentDefinitionError if source or sample is missing, or they are * @throws InstrumentDefinitionError if source or sample is missing, or they are
* in the same place * in the same place
*/ */
double MatrixWorkspace::detectorSignedTwoTheta( double
Geometry::IDetector_const_sptr det) const { MatrixWorkspace::detectorSignedTwoTheta(const Geometry::IDetector &det) const {
Instrument_const_sptr instrument = getInstrument();
Instrument_const_sptr instrument = getInstrument();
Geometry::IComponent_const_sptr source = instrument->getSource(); Geometry::IComponent_const_sptr source = instrument->getSource();
Geometry::IComponent_const_sptr sample = instrument->getSample(); Geometry::IComponent_const_sptr sample = instrument->getSample();
if (source == nullptr || sample == nullptr) { if (source == nullptr || sample == nullptr) {
...@@ -812,7 +813,7 @@ double MatrixWorkspace::detectorSignedTwoTheta( ...@@ -812,7 +813,7 @@ double MatrixWorkspace::detectorSignedTwoTheta(
// Get the instrument up axis. // Get the instrument up axis.
const V3D &instrumentUpAxis = const V3D &instrumentUpAxis =
instrument->getReferenceFrame()->vecPointingUp(); instrument->getReferenceFrame()->vecPointingUp();
return det->getSignedTwoTheta(samplePos, beamLine, instrumentUpAxis); return det.getSignedTwoTheta(samplePos, beamLine, instrumentUpAxis);
} }
/** Returns the 2Theta scattering angle for a detector /** Returns the 2Theta scattering angle for a detector
...@@ -822,10 +823,10 @@ double MatrixWorkspace::detectorSignedTwoTheta( ...@@ -822,10 +823,10 @@ double MatrixWorkspace::detectorSignedTwoTheta(
* @throws InstrumentDefinitionError if source or sample is missing, or they are * @throws InstrumentDefinitionError if source or sample is missing, or they are
* in the same place * in the same place
*/ */
double double MatrixWorkspace::detectorTwoTheta(const Geometry::IDetector &det) const {
MatrixWorkspace::detectorTwoTheta(Geometry::IDetector_const_sptr det) const { Instrument_const_sptr instrument = this->getInstrument();
Geometry::IComponent_const_sptr source = getInstrument()->getSource(); Geometry::IComponent_const_sptr source = instrument->getSource();
Geometry::IComponent_const_sptr sample = getInstrument()->getSample(); Geometry::IComponent_const_sptr sample = instrument->getSample();
if (source == nullptr || sample == nullptr) { if (source == nullptr || sample == nullptr) {
throw Kernel::Exception::InstrumentDefinitionError( throw Kernel::Exception::InstrumentDefinitionError(
"Instrument not sufficiently defined: failed to get source and/or " "Instrument not sufficiently defined: failed to get source and/or "
...@@ -840,7 +841,7 @@ MatrixWorkspace::detectorTwoTheta(Geometry::IDetector_const_sptr det) const { ...@@ -840,7 +841,7 @@ MatrixWorkspace::detectorTwoTheta(Geometry::IDetector_const_sptr det) const {
"Source and sample are at same position!"); "Source and sample are at same position!");
} }
return det->getTwoTheta(samplePos, beamLine); return det.getTwoTheta(samplePos, beamLine);
} }
//--------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------
...@@ -1693,7 +1694,7 @@ void MatrixWorkspace::saveSpectraMapNexus( ...@@ -1693,7 +1694,7 @@ void MatrixWorkspace::saveSpectraMapNexus(
Kernel::V3D pos = det->getPos() - sample_pos; Kernel::V3D pos = det->getPos() - sample_pos;
pos.getSpherical(R, Theta, Phi); pos.getSpherical(R, Theta, Phi);
R = det->getDistance(*sample); R = det->getDistance(*sample);
Theta = this->detectorTwoTheta(det) * 180.0 / M_PI; Theta = this->detectorTwoTheta(*det) * rad2deg;
} catch (...) { } catch (...) {
R = 0.; R = 0.;
Theta = 0.; Theta = 0.;
......
...@@ -123,8 +123,8 @@ public: ...@@ -123,8 +123,8 @@ public:
// removed at some point. // removed at some point.
void test_getTwoThetaLegacy() { void test_getTwoThetaLegacy() {
auto info = GeometryInfo(*m_factory, *(m_workspace.getSpectrum(2))); auto info = GeometryInfo(*m_factory, *(m_workspace.getSpectrum(2)));
TS_ASSERT_EQUALS(info.getTwoTheta(), auto det = info.getDetector();
m_workspace.detectorTwoTheta(info.getDetector())); TS_ASSERT_EQUALS(info.getTwoTheta(), m_workspace.detectorTwoTheta(*det));
} }
void test_getSignedTwoTheta() { void test_getSignedTwoTheta() {
...@@ -143,8 +143,9 @@ public: ...@@ -143,8 +143,9 @@ public:
// be removed at some point. // be removed at some point.
void test_getSignedTwoThetaLegacy() { void test_getSignedTwoThetaLegacy() {
auto info = GeometryInfo(*m_factory, *(m_workspace.getSpectrum(2))); auto info = GeometryInfo(*m_factory, *(m_workspace.getSpectrum(2)));
auto det = info.getDetector();
TS_ASSERT_EQUALS(info.getSignedTwoTheta(), TS_ASSERT_EQUALS(info.getSignedTwoTheta(),
m_workspace.detectorSignedTwoTheta(info.getDetector())); m_workspace.detectorSignedTwoTheta(*det));
} }
private: private:
......
...@@ -1339,7 +1339,7 @@ public: ...@@ -1339,7 +1339,7 @@ public:
auto detector = m_workspace.getDetector(i); auto detector = m_workspace.getDetector(i);
result += L1; result += L1;
result += detector->getDistance(*sample); result += detector->getDistance(*sample);
result += m_workspace.detectorTwoTheta(detector); result += m_workspace.detectorTwoTheta(*detector);
} }
// We are computing an using the result to fool the optimizer. // We are computing an using the result to fool the optimizer.
TS_ASSERT_DELTA(result, 5214709.740869, 1e-6); TS_ASSERT_DELTA(result, 5214709.740869, 1e-6);
......
...@@ -21,11 +21,11 @@ struct SofQCommon { ...@@ -21,11 +21,11 @@ struct SofQCommon {
// Constructor // Constructor
SofQCommon() : m_emode(0), m_efixedGiven(false), m_efixed(0.0) {} SofQCommon() : m_emode(0), m_efixedGiven(false), m_efixed(0.0) {}
// init the class parameters, defined above // init the class parameters, defined above
void initCachedValues(API::MatrixWorkspace_const_sptr workspace, void initCachedValues(const API::MatrixWorkspace &workspace,
API::Algorithm *const hostAlgorithm); API::Algorithm *const hostAlgorithm);
/// Get the efixed value for the given detector /// Get the efixed value for the given detector
double getEFixed(Geometry::IDetector_const_sptr det) const; double getEFixed(const Geometry::IDetector &det) const;
}; };
} }
} }
......
...@@ -88,7 +88,7 @@ private: ...@@ -88,7 +88,7 @@ private:
/// Init variables cache base on the given workspace /// Init variables cache base on the given workspace
void initCachedValues(API::MatrixWorkspace_const_sptr workspace); void initCachedValues(API::MatrixWorkspace_const_sptr workspace);
/// Init the theta index /// Init the theta index
void initThetaCache(API::MatrixWorkspace_const_sptr workspace); void initThetaCache(const API::MatrixWorkspace &workspace);
SofQCommon m_EmodeProperties; SofQCommon m_EmodeProperties;
//--------------------------------------------------------------------------------- //---------------------------------------------------------------------------------
......
...@@ -122,8 +122,7 @@ void ApplyTransmissionCorrection::exec() { ...@@ -122,8 +122,7 @@ void ApplyTransmissionCorrection::exec() {
MantidVec &YOut = corrWS->dataY(i); MantidVec &YOut = corrWS->dataY(i);
MantidVec &EOut = corrWS->dataE(i); MantidVec &EOut = corrWS->dataE(i);
const double exp_term = const double exp_term = 0.5 / cos(inputWS->detectorTwoTheta(*det)) + 0.5;
(1.0 / cos(inputWS->detectorTwoTheta(det)) + 1.0) / 2.0;
for (int j = 0; j < static_cast<int>(inputWS->readY(0).size()); j++) { for (int j = 0; j < static_cast<int>(inputWS->readY(0).size()); j++) {
if (!thetaDependent) { if (!thetaDependent) {
YOut[j] = 1.0 / TrIn[j]; YOut[j] = 1.0 / TrIn[j];
......
...@@ -152,9 +152,9 @@ void ConvertAxesToRealSpace::exec() { ...@@ -152,9 +152,9 @@ void ConvertAxesToRealSpace::exec() {
} else if (axisSelection == "phi") { } else if (axisSelection == "phi") {
axisValue = phi; axisValue = phi;
} else if (axisSelection == "2theta") { } else if (axisSelection == "2theta") {
axisValue = inputWs->detectorTwoTheta(det); axisValue = inputWs->detectorTwoTheta(*det);
} else if (axisSelection == "signed2theta") { } else if (axisSelection == "signed2theta") {
axisValue = inputWs->detectorSignedTwoTheta(det); axisValue = inputWs->detectorSignedTwoTheta(*det);
} }
if (axisIndex == 0) { if (axisIndex == 0) {
......
...@@ -27,6 +27,10 @@ using namespace Kernel; ...@@ -27,6 +27,10 @@ using namespace Kernel;
using namespace API; using namespace API;
using namespace Geometry; using namespace Geometry;
namespace {
constexpr double rad2deg = 180. / M_PI;
}
void ConvertSpectrumAxis::init() { void ConvertSpectrumAxis::init() {
// Validator for Input Workspace // Validator for Input Workspace
auto wsVal = boost::make_shared<CompositeValidator>(); auto wsVal = boost::make_shared<CompositeValidator>();
...@@ -101,7 +105,7 @@ void ConvertSpectrumAxis::exec() { ...@@ -101,7 +105,7 @@ void ConvertSpectrumAxis::exec() {
IDetector_const_sptr detector = inputWS->getDetector(i); IDetector_const_sptr detector = inputWS->getDetector(i);
double twoTheta, l1val, l2; double twoTheta, l1val, l2;
if (!detector->isMonitor()) { if (!detector->isMonitor()) {
twoTheta = inputWS->detectorTwoTheta(detector); twoTheta = inputWS->detectorTwoTheta(*detector);
l2 = detector->getDistance(*sample); l2 = detector->getDistance(*sample);
l1val = l1; l1val = l1;
efixed = getEfixed(detector, inputWS, emode); // get efixed efixed = getEfixed(detector, inputWS, emode); // get efixed
...@@ -121,7 +125,7 @@ void ConvertSpectrumAxis::exec() { ...@@ -121,7 +125,7 @@ void ConvertSpectrumAxis::exec() {
} else { } else {
// Set up binding to memeber funtion. Avoids condition as part of loop over // Set up binding to memeber funtion. Avoids condition as part of loop over
// nHistograms. // nHistograms.
boost::function<double(IDetector_const_sptr)> thetaFunction; boost::function<double(const IDetector &)> thetaFunction;
if (unitTarget.compare("signed_theta") == 0) { if (unitTarget.compare("signed_theta") == 0) {
thetaFunction = thetaFunction =
boost::bind(&MatrixWorkspace::detectorSignedTwoTheta, inputWS, _1); boost::bind(&MatrixWorkspace::detectorSignedTwoTheta, inputWS, _1);
...@@ -135,7 +139,7 @@ void ConvertSpectrumAxis::exec() { ...@@ -135,7 +139,7 @@ void ConvertSpectrumAxis::exec() {
try { try {
IDetector_const_sptr det = inputWS->getDetector(i); IDetector_const_sptr det = inputWS->getDetector(i);
// Invoke relevant member function. // Invoke relevant member function.
indexMap.emplace(thetaFunction(det) * 180.0 / M_PI, i); indexMap.emplace(thetaFunction(*det) * rad2deg, i);
} catch (Exception::NotFoundError &) { } catch (Exception::NotFoundError &) {
if (!warningGiven) if (!warningGiven)
g_log.warning("The instrument definition is incomplete - spectra " g_log.warning("The instrument definition is incomplete - spectra "
......
...@@ -115,7 +115,7 @@ void ConvertSpectrumAxis2::createThetaMap(API::Progress &progress, ...@@ -115,7 +115,7 @@ void ConvertSpectrumAxis2::createThetaMap(API::Progress &progress,
size_t nHist) { size_t nHist) {
// Set up binding to member funtion. Avoids condition as part of loop over // Set up binding to member funtion. Avoids condition as part of loop over
// nHistograms. // nHistograms.
boost::function<double(IDetector_const_sptr)> thetaFunction; boost::function<double(const IDetector &)> thetaFunction;
if (targetUnit.compare("signed_theta") == 0 || if (targetUnit.compare("signed_theta") == 0 ||
targetUnit.compare("SignedTheta") == 0) { targetUnit.compare("SignedTheta") == 0) {
thetaFunction = thetaFunction =
...@@ -131,7 +131,7 @@ void ConvertSpectrumAxis2::createThetaMap(API::Progress &progress, ...@@ -131,7 +131,7 @@ void ConvertSpectrumAxis2::createThetaMap(API::Progress &progress,
try { try {
IDetector_const_sptr det = inputWS->getDetector(i); IDetector_const_sptr det = inputWS->getDetector(i);
// Invoke relevant member function. // Invoke relevant member function.
m_indexMap.emplace(thetaFunction(det) * 180.0 / M_PI, i); m_indexMap.emplace(thetaFunction(*det) * rad2deg, i);
} catch (Exception::NotFoundError &) { } catch (Exception::NotFoundError &) {
if (!warningGiven) if (!warningGiven)
g_log.warning("The instrument definition is incomplete - spectra " g_log.warning("The instrument definition is incomplete - spectra "
...@@ -167,7 +167,7 @@ void ConvertSpectrumAxis2::createElasticQMap(API::Progress &progress, ...@@ -167,7 +167,7 @@ void ConvertSpectrumAxis2::createElasticQMap(API::Progress &progress,
IDetector_const_sptr detector = inputWS->getDetector(i); IDetector_const_sptr detector = inputWS->getDetector(i);
double twoTheta(0.0), efixed(0.0); double twoTheta(0.0), efixed(0.0);
if (!detector->isMonitor()) { if (!detector->isMonitor()) {
twoTheta = inputWS->detectorTwoTheta(detector) / 2.0; twoTheta = 0.5 * inputWS->detectorTwoTheta(*detector);
efixed = getEfixed(detector, inputWS, emode); // get efixed efixed = getEfixed(detector, inputWS, emode); // get efixed
} else { } else {
twoTheta = 0.0; twoTheta = 0.0;
......
...@@ -418,7 +418,7 @@ void ConvertUnits::convertViaTOF(Kernel::Unit_const_sptr fromUnit, ...@@ -418,7 +418,7 @@ void ConvertUnits::convertViaTOF(Kernel::Unit_const_sptr fromUnit,
bool bUseSignedVersion = bool bUseSignedVersion =
(!parameters.empty()) && (!parameters.empty()) &&
find(parameters.begin(), parameters.end(), "Always") != parameters.end(); find(parameters.begin(), parameters.end(), "Always") != parameters.end();
function<double(IDetector_const_sptr)> thetaFunction = function<double(const IDetector &)> thetaFunction =
bUseSignedVersion bUseSignedVersion
? bind(&MatrixWorkspace::detectorSignedTwoTheta, outputWS, _1) ? bind(&MatrixWorkspace::detectorSignedTwoTheta, outputWS, _1)
: bind(&MatrixWorkspace::detectorTwoTheta, outputWS, _1); : bind(&MatrixWorkspace::detectorTwoTheta, outputWS, _1);
...@@ -437,7 +437,7 @@ void ConvertUnits::convertViaTOF(Kernel::Unit_const_sptr fromUnit, ...@@ -437,7 +437,7 @@ void ConvertUnits::convertViaTOF(Kernel::Unit_const_sptr fromUnit,
if (!det->isMonitor()) { if (!det->isMonitor()) {
l2 = det->getDistance(*sample); l2 = det->getDistance(*sample);
// The scattering angle for this detector (in radians). // The scattering angle for this detector (in radians).
twoTheta = thetaFunction(det); twoTheta = thetaFunction(*det);
// If an indirect instrument, try getting Efixed from the geometry // If an indirect instrument, try getting Efixed from the geometry
if (emode == 2) // indirect if (emode == 2) // indirect
{ {
......
...@@ -226,7 +226,7 @@ void EstimateResolutionDiffraction::estimateDetectorResolution() { ...@@ -226,7 +226,7 @@ void EstimateResolutionDiffraction::estimateDetectorResolution() {
double centraltof = (m_L1 + l2) / m_centreVelocity; double centraltof = (m_L1 + l2) / m_centreVelocity;
// Angle // Angle
double twotheta = m_inputWS->detectorTwoTheta(det); double twotheta = m_inputWS->detectorTwoTheta(*det);
double theta = 0.5 * twotheta; double theta = 0.5 * twotheta;
// double solidangle = m_solidangleWS->readY(i)[0]; // double solidangle = m_solidangleWS->readY(i)[0];
......
...@@ -104,7 +104,7 @@ void LorentzCorrection::exec() { ...@@ -104,7 +104,7 @@ void LorentzCorrection::exec() {
if (!detector) if (!detector)
continue; continue;
const double twoTheta = inWS->detectorTwoTheta(detector); const double twoTheta = inWS->detectorTwoTheta(*detector);
const double sinTheta = std::sin(twoTheta / 2); const double sinTheta = std::sin(twoTheta / 2);
double sinThetaSq = sinTheta * sinTheta; double sinThetaSq = sinTheta * sinTheta;
......
...@@ -179,7 +179,7 @@ void MultipleScatteringCylinderAbsorption::exec() { ...@@ -179,7 +179,7 @@ void MultipleScatteringCylinderAbsorption::exec() {
throw std::runtime_error("Failed to find detector"); throw std::runtime_error("Failed to find detector");
if (det->isMasked()) if (det->isMasked())
continue; continue;
const double tth_rad = out_WSevent->detectorTwoTheta(det); const double tth_rad = out_WSevent->detectorTwoTheta(*det);
EventList &eventList = out_WSevent->getEventList(index); EventList &eventList = out_WSevent->getEventList(index);
vector<double> tof_vec, y_vec, err_vec; vector<double> tof_vec, y_vec, err_vec;
...@@ -214,7 +214,7 @@ void MultipleScatteringCylinderAbsorption::exec() { ...@@ -214,7 +214,7 @@ void MultipleScatteringCylinderAbsorption::exec() {
throw std::runtime_error("Failed to find detector"); throw std::runtime_error("Failed to find detector");
if (det->isMasked()) if (det->isMasked())
continue; continue;
const double tth_rad = in_WS->detectorTwoTheta(det); const double tth_rad = in_WS->detectorTwoTheta(*det);
MantidVec tof_vec = in_WS->readX(index); MantidVec tof_vec = in_WS->readX(index);
MantidVec y_vec = in_WS->readY(index); MantidVec y_vec = in_WS->readY(index);
......
...@@ -595,7 +595,7 @@ void Q1D2::convertWavetoQ(const size_t wsInd, const bool doGravity, ...@@ -595,7 +595,7 @@ void Q1D2::convertWavetoQ(const size_t wsInd, const bool doGravity,
// Calculate the Q values for the current spectrum, using Q = // Calculate the Q values for the current spectrum, using Q =
// 4*pi*sin(theta)/lambda // 4*pi*sin(theta)/lambda
const double factor = const double factor =
2.0 * FOUR_PI * sin(m_dataWS->detectorTwoTheta(det) / 2.0); 2.0 * FOUR_PI * sin(m_dataWS->detectorTwoTheta(*det) * 0.5);
for (; waves != end; ++Qs, ++waves) { for (; waves != end; ++Qs, ++waves) {
// the HistogramValidator at the start should ensure that we have one more // the HistogramValidator at the start should ensure that we have one more
// bin on the input wavelengths // bin on the input wavelengths
......
...@@ -218,7 +218,7 @@ void Q1DWeighted::exec() { ...@@ -218,7 +218,7 @@ void Q1DWeighted::exec() {
// Find the position of this sub-pixel in real space and compute Q // Find the position of this sub-pixel in real space and compute Q
// For reference - in the case where we don't use sub-pixels, simply // For reference - in the case where we don't use sub-pixels, simply
// use: // use:
// double sinTheta = sin( inputWS->detectorTwoTheta(det)/2.0 ); // double sinTheta = sin( inputWS->detectorTwoTheta(*det)/2.0 );
V3D pos = det->getPos() - V3D(sub_x, sub_y, 0.0); V3D pos = det->getPos() - V3D(sub_x, sub_y, 0.0);
double sinTheta = sin(pos.angle(beamLine) / 2.0); double sinTheta = sin(pos.angle(beamLine) / 2.0);
double factor = fmp * sinTheta; double factor = fmp * sinTheta;
......
...@@ -162,7 +162,7 @@ void Qxy::exec() { ...@@ -162,7 +162,7 @@ void Qxy::exec() {
double phi = atan2(detPos.Y(), detPos.X()); double phi = atan2(detPos.Y(), detPos.X());
double a = cos(phi); double a = cos(phi);
double b = sin(phi); double b = sin(phi);
double sinTheta = sin(inputWorkspace->detectorTwoTheta(det) / 2.0); double sinTheta = sin(inputWorkspace->detectorTwoTheta(*det) * 0.5);
// Get references to the data for this spectrum // Get references to the data for this spectrum
const MantidVec &X = inputWorkspace->readX(i); const MantidVec &X = inputWorkspace->readX(i);
......
...@@ -288,7 +288,7 @@ void RemoveBins::calculateDetectorPosition(const int &index, double &l1, ...@@ -288,7 +288,7 @@ void RemoveBins::calculateDetectorPosition(const int &index, double &l1,
if (!det->isMonitor()) { if (!det->isMonitor()) {
l2 = det->getDistance(*sample); l2 = det->getDistance(*sample);
// The scattering angle for this detector (in radians). // The scattering angle for this detector (in radians).
twoTheta = m_inputWorkspace->detectorTwoTheta(det); twoTheta = m_inputWorkspace->detectorTwoTheta(*det);
} else // If this is a monitor then make l1+l2 = source-detector distance and } else // If this is a monitor then make l1+l2 = source-detector distance and
// twoTheta=0 // twoTheta=0
{ {
......
Supports Markdown
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