Skip to content

Commit

Permalink
Revert "Remove Q1D2 and its unit test re #8237"
Browse files Browse the repository at this point in the history
This reverts commit 54a9275.
  • Loading branch information
martyngigg committed Nov 12, 2013
1 parent 54a9275 commit 549d099
Show file tree
Hide file tree
Showing 4 changed files with 1,226 additions and 0 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 @@ -153,6 +153,7 @@ set ( SRC_FILES
src/PolynomialCorrection.cpp
src/Power.cpp
src/PowerLawCorrection.cpp
src/Q1D2.cpp
src/Q1DWeighted.cpp
src/Qhelper.cpp
src/Qxy.cpp
Expand Down Expand Up @@ -373,6 +374,7 @@ set ( INC_FILES
inc/MantidAlgorithms/PolynomialCorrection.h
inc/MantidAlgorithms/Power.h
inc/MantidAlgorithms/PowerLawCorrection.h
inc/MantidAlgorithms/Q1D2.h
inc/MantidAlgorithms/Q1DWeighted.h
inc/MantidAlgorithms/Qhelper.h
inc/MantidAlgorithms/Qxy.h
Expand Down Expand Up @@ -590,6 +592,7 @@ set ( TEST_FILES
PolynomialCorrectionTest.h
PowerLawCorrectionTest.h
PowerTest.h
Q1D2Test.h
Q1DWeightedTest.h
QxyTest.h
RadiusSumTest.h
Expand Down
81 changes: 81 additions & 0 deletions Code/Mantid/Framework/Algorithms/inc/MantidAlgorithms/Q1D2.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
#ifndef MANTID_ALGORITHMS_Q1D2_H_
#define MANTID_ALGORITHMS_Q1D2_H_

//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidAPI/Algorithm.h"
#include "MantidAlgorithms/GravitySANSHelper.h"

namespace Mantid
{
namespace Algorithms
{
/** Takes account of the effects of gravity for instruments where the y-axis points upwards, for
example SANS instruments
@author Steve Williams ISIS Rutherford Appleton Laboratory
@date 10/12/2010
Copyright © 2010 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 Q1D2 : public API::Algorithm
{
public:
/// (Empty) Constructor
Q1D2() : API::Algorithm() {}
/// Virtual destructor
virtual ~Q1D2() {}
/// Algorithm's name
virtual const std::string name() const { return "Q1D"; }
/// Algorithm's version
virtual int version() const { return (2); }
/// Algorithm's category for identification
virtual const std::string category() const { return "SANS"; }

private:
/// the experimental workspace with counts across the detector
API::MatrixWorkspace_const_sptr m_dataWS;
bool m_doSolidAngle;

/// Sets documentation strings for this algorithm
virtual void initDocs();
/// Initialisation code
void init();
/// Execution code
void exec();

API::MatrixWorkspace_sptr setUpOutputWorkspace(const std::vector<double> & binParams) const;
//these are the steps that are run on each individual spectrum
void calculateNormalization(const size_t wavStart, const size_t specInd, API::MatrixWorkspace_const_sptr pixelAdj, API::MatrixWorkspace_const_sptr wavePixelAdj, double const * const binNorms, double const * const binNormEs, const MantidVec::iterator norm, const MantidVec::iterator normETo2) const;
void pixelWeight(API::MatrixWorkspace_const_sptr pixelAdj, const size_t specIndex, double & weight, double & error) const;
void addWaveAdj(const double * c, const double * Dc, MantidVec::iterator bInOut, MantidVec::iterator e2InOut) const;
void addWaveAdj(const double * c, const double * Dc, MantidVec::iterator bInOut, MantidVec::iterator e2InOut, MantidVec::const_iterator, MantidVec::const_iterator) const;
void normToMask(const size_t offSet, const size_t specIndex, const MantidVec::iterator theNorms, const MantidVec::iterator errorSquared) const;
void convertWavetoQ(const size_t specInd, const bool doGravity, const size_t offset, MantidVec::iterator Qs) const;
void getQBinPlus1(const MantidVec & OutQs, const double QToFind, MantidVec::const_iterator & loc) const;
void normalize(const MantidVec & normSum, const MantidVec & normError2, MantidVec & YOut, MantidVec & errors) const;
};

} // namespace Algorithms
} // namespace Mantid

#endif /*MANTID_ALGORITHMS_Q1D2_H_*/

0 comments on commit 549d099

Please sign in to comment.