Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/9389_correct_positions_r…
Browse files Browse the repository at this point in the history
…efl'
  • Loading branch information
PeterParker committed May 8, 2014
2 parents 9c1a438 + a147487 commit 47f57ae
Show file tree
Hide file tree
Showing 5 changed files with 840 additions and 2 deletions.
3 changes: 3 additions & 0 deletions Code/Mantid/Framework/Algorithms/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,7 @@ set ( SRC_FILES
src/SolidAngle.cpp
src/SortEvents.cpp
src/SpatialGrouping.cpp
src/SpecularReflectionPositionCorrect.cpp
src/SphericalAbsorption.cpp
src/StripPeaks.cpp
src/StripVanadiumPeaks.cpp
Expand Down Expand Up @@ -433,6 +434,7 @@ set ( INC_FILES
inc/MantidAlgorithms/SolidAngle.h
inc/MantidAlgorithms/SortEvents.h
inc/MantidAlgorithms/SpatialGrouping.h
inc/MantidAlgorithms/SpecularReflectionPositionCorrect.h
inc/MantidAlgorithms/SphericalAbsorption.h
inc/MantidAlgorithms/StripPeaks.h
inc/MantidAlgorithms/StripVanadiumPeaks.h
Expand Down Expand Up @@ -653,6 +655,7 @@ set ( TEST_FILES
SolidAngleTest.h
SortEventsTest.h
SpatialGroupingTest.h
SpecularReflectionPositionCorrectTest.h
SphericalAbsorptionTest.h
StripPeaksTest.h
StripVanadiumPeaks2Test.h
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#ifndef MANTID_ALGORITHMS_SPECULARREFLECTIONPOSITIONCORRECT_H_
#define MANTID_ALGORITHMS_SPECULARREFLECTIONPOSITIONCORRECT_H_

#include "MantidKernel/System.h"
#include "MantidAPI/Algorithm.h"
#include "MantidAPI/MatrixWorkspace.h"
#include "MantidGeometry/Instrument.h"
#include "MantidGeometry/IComponent.h"
#include "MantidGeometry/IDetector.h"

namespace Mantid
{
namespace Algorithms
{

/** SpecularReflectionPositionCorrect : Algorithm to perform vertical position corrections based on the specular reflection condition.
Copyright © 2014 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class DLLExport SpecularReflectionPositionCorrect: public API::Algorithm
{
public:
SpecularReflectionPositionCorrect();
virtual ~SpecularReflectionPositionCorrect();

virtual const std::string name() const;
virtual int version() const;
virtual const std::string category() const;

private:
virtual void initDocs();
void init();
void exec();

/// Get the surface sample component
Mantid::Geometry::IComponent_const_sptr getSurfaceSampleComponent(
Mantid::Geometry::Instrument_const_sptr inst);

/// Get the detector component
Mantid::Geometry::IComponent_const_sptr getDetectorComponent(
Mantid::API::MatrixWorkspace_sptr workspace, const bool isPointDetector);

/// Correct detector positions.
void correctPosition(API::MatrixWorkspace_sptr toCorrect, const double& twoThetaInDeg,
Geometry::IComponent_const_sptr sample, Geometry::IComponent_const_sptr detector);

/// Does the property have a default value.
bool isPropertyDefault(const std::string& propertyName) const;

/// Move detectors.
void moveDetectors(API::MatrixWorkspace_sptr toCorrect, Geometry::IComponent_const_sptr detector, Geometry::IComponent_const_sptr sample, const double& upOffset, const double& acrossOffset, const Mantid::Kernel::V3D& detectorPosition);
};

} // namespace Algorithms
} // namespace Mantid

#endif /* MANTID_ALGORITHMS_SPECULARREFLECTIONPOSITIONCORRECT_H_ */
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,6 @@ parameters will be needed.
#include "MantidAPI/WorkspaceValidators.h"
#include "MantidAPI/WorkspaceFactory.h"
#include "MantidKernel/ListValidator.h"
#include "MantidKernel/MandatoryValidator.h"
#include "MantidKernel/BoundedValidator.h"
#include "MantidKernel/ArrayProperty.h"
#include "MantidKernel/EnabledWhenProperty.h"
#include "MantidKernel/RebinParamsValidator.h"
Expand Down
Loading

0 comments on commit 47f57ae

Please sign in to comment.