"git@code.ornl.gov:mantidproject/mantid.git" did not exist on "13a49ac1467c073de144160b4e3d05f3fec771f0"
Newer
Older
Janik Zikovsky
committed
#ifndef MANTID_ALGORITHMS_ALIGNDETECTORS_H_
#define MANTID_ALGORITHMS_ALIGNDETECTORS_H_
Russell Taylor
committed
#include "MantidAPI/Algorithm.h"
#include "MantidAPI/ITableWorkspace_fwd.h"
Janik Zikovsky
committed
#include "MantidDataObjects/OffsetsWorkspace.h"
#include "MantidKernel/System.h"
Russell Taylor
committed
Janik Zikovsky
committed
namespace DataObjects {
class EventWorkspace;
}
Janik Zikovsky
committed
namespace {
class ConversionFactors;
}
/** Performs a unit change from TOF to dSpacing, correcting the X values to
account for small
Russell Taylor
committed
errors in the detector positions.
Required Properties:
<UL>
<LI> InputWorkspace - The name of the Workspace whose detectors are to be
aligned </LI>
<LI> OutputWorkspace - The name of the Workspace in which the result of the
algorithm will be stored </LI>
Russell Taylor
committed
<LI> CalibrationFile - The file containing the detector offsets </LI>
</UL>
@author Russell Taylor, Tessella Support Services plc
@date 18/08/2008
Copyright © 2008 ISIS Rutherford Appleton Laboratory, NScD Oak Ridge
National Laboratory & European Spallation Source
Russell Taylor
committed
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>.
Russell Taylor
committed
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class DLLExport AlignDetectors : public API::Algorithm {
Russell Taylor
committed
public:
AlignDetectors();
~AlignDetectors() override;
Russell Taylor
committed
/// Algorithms name for identification. @see Algorithm::name
const std::string name() const override;
/// Algorithm's summary for use in the GUI and help. @see Algorithm::summary
const std::string summary() const override;
/// Algorithm's version for identification. @see Algorithm::version
int version() const override;
/// Algorithm's category for identification. @see Algorithm::category
const std::string category() const override;
/// Cross-check properties with each other @see IAlgorithm::validateInputs
std::map<std::string, std::string> validateInputs() override;
Janik Zikovsky
committed
protected:
Parallel::ExecutionMode getParallelExecutionMode(
const std::map<std::string, Parallel::StorageMode> &storageModes)
const override;
Russell Taylor
committed
private:
// Implement abstract Algorithm methods
void init() override;
void exec() override;
Russell Taylor
committed
void align(const ConversionFactors &converter, API::Progress &progress,
API::MatrixWorkspace &outputWS);
void align(const ConversionFactors &converter, API::Progress &progress,
DataObjects::EventWorkspace &outputWS);
void loadCalFile(API::MatrixWorkspace_sptr inputWS,
const std::string &filename);
void getCalibrationWS(API::MatrixWorkspace_sptr inputWS);
Mantid::API::ITableWorkspace_sptr m_calibrationWS;
/// number of spectra in input workspace
int64_t m_numberOfSpectra;

Zhou, Wenduo
committed
/// Map of conversion factors for TOF to d-Spacing conversion
std::map<detid_t, double> *tofToDmap;
Russell Taylor
committed
};
Janik Zikovsky
committed
} // namespace Algorithms
Russell Taylor
committed
} // namespace Mantid
Janik Zikovsky
committed
#endif /* MANTID_ALGORITHMS_ALIGNDETECTORS_H_ */