Skip to content

Commit

Permalink
Refs #11674. Adding 2theta - 2theta_0 to 2DHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Wedel committed May 22, 2015
1 parent f977fb7 commit 638dbee
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Expand Up @@ -41,8 +41,8 @@ namespace Poldi {
struct MANTID_SINQ_DLL Poldi2DHelper {
/// Default constructor
Poldi2DHelper()
: dFractionalOffsets(), dOffsets(), domain(), values(), factors(), deltaD(),
minTOFN() {}
: dFractionalOffsets(), dOffsets(), domain(), values(), factors(),
deltaD(), deltaTwoTheta(), minTOFN() {}

/// Transforms the chopper slit offsets for a given 2theta/distance pair.
void setChopperSlitOffsets(double distance, double sinTheta, double deltaD,
Expand Down Expand Up @@ -95,6 +95,7 @@ struct MANTID_SINQ_DLL Poldi2DHelper {
std::vector<double> factors;

double deltaD;
double deltaTwoTheta;
int minTOFN;
};

Expand Down
Expand Up @@ -229,6 +229,8 @@ void PoldiSpectrumDomainFunction::initializeInstrumentParameters(
double dMin = Conversions::qToD(qLimits.second);
double dMax = Conversions::dToQ(qLimits.first);

double centreTwoTheta = detector->twoTheta(detector->centralElement());

for (int i = 0; i < static_cast<int>(detector->elementCount()); ++i) {
double sinTheta = sin(detector->twoTheta(i) / 2.0);
double distance =
Expand All @@ -239,6 +241,7 @@ void PoldiSpectrumDomainFunction::initializeInstrumentParameters(
curr->setChopperSlitOffsets(distance, sinTheta, deltaD,
m_chopperSlitOffsets);
curr->setDomain(dMin, dMax, deltaD);
curr->deltaTwoTheta = (detector->twoTheta(i) - centreTwoTheta);
curr->deltaD = deltaD;
curr->minTOFN = static_cast<int>(
Conversions::dtoTOF(dMin, distance, sinTheta) / m_deltaT);
Expand Down

0 comments on commit 638dbee

Please sign in to comment.