Skip to content
Snippets Groups Projects
Commit e765afca authored by Anton Piccardo-Selg's avatar Anton Piccardo-Selg
Browse files

Refs #13213 Make gravity correction more efficient

parent d65e1e51
No related branches found
No related tags found
No related merge requests found
...@@ -158,6 +158,12 @@ void TOFSANSResolutionByPixel::exec() { ...@@ -158,6 +158,12 @@ void TOFSANSResolutionByPixel::exec() {
const MantidVec &xIn = inWS->readX(i); const MantidVec &xIn = inWS->readX(i);
const size_t xLength = xIn.size(); const size_t xLength = xIn.size();
// Gravity correction
boost::shared_ptr<GravitySANSHelper> grav;
if (doGravity) {
grav = boost::make_shared<GravitySANSHelper>(inWS, det, getProperty("ExtraLength"));
}
// Get handles on the outputWorkspace // Get handles on the outputWorkspace
MantidVec &yOut = outWS->dataY(i); MantidVec &yOut = outWS->dataY(i);
// for each wavelenght bin of each pixel calculate a q-resolution // for each wavelenght bin of each pixel calculate a q-resolution
...@@ -168,8 +174,7 @@ void TOFSANSResolutionByPixel::exec() { ...@@ -168,8 +174,7 @@ void TOFSANSResolutionByPixel::exec() {
// If we include a gravity correction we need to adjust sinTheta // If we include a gravity correction we need to adjust sinTheta
// for each wavelength (in Angstrom) // for each wavelength (in Angstrom)
if (doGravity) { if (doGravity) {
GravitySANSHelper grav(inWS, det, getProperty("ExtraLength")); double sinThetaGrav = grav->calcSinTheta(wl);
double sinThetaGrav = grav.calcSinTheta(wl);
factor = 4.0 * M_PI * sinThetaGrav; factor = 4.0 * M_PI * sinThetaGrav;
} }
const double q = factor / wl; const double q = factor / wl;
......
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