Mantid
Loading...
Searching...
No Matches
LoadIsawPeaks.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
10#include "MantidCrystal/DllConfig.h"
15
16namespace Mantid {
17namespace Crystal {
18
26class MANTID_CRYSTAL_DLL LoadIsawPeaks : public API::IFileLoader<Kernel::FileDescriptor> {
27public:
29 const std::string name() const override { return "LoadIsawPeaks"; }
30
32 const std::string summary() const override { return "Load an ISAW-style .peaks file into a PeaksWorkspace."; }
33
35 int version() const override { return 1; }
36 const std::vector<std::string> seeAlso() const override { return {"SaveIsawPeaks"}; }
37
39 const std::string category() const override { return "Crystal\\DataHandling;DataHandling\\Isaw"; }
40
42 int confidence(Kernel::FileDescriptor &descriptor) const override;
43
44private:
47 std::vector<double> m_offset1 = {0.0, 0.0, 0.0};
48 std::vector<double> m_offset2 = {0.0, 0.0, 0.0};
49 std::vector<double> m_offset3 = {0.0, 0.0, 0.0};
50
52 void init() override;
53
55 void exec() override;
56
58 std::string readHeader(const Mantid::DataObjects::PeaksWorkspace_sptr &outWS, std::ifstream &in, double &T0);
59
61 DataObjects::Peak readPeak(const DataObjects::PeaksWorkspace_sptr &outWS, std::string &lastStr, std::ifstream &in,
62 int &seqNum, const std::string &bankName, double qSign);
63
64 int findPixelID(const DataObjects::PeaksWorkspace_sptr &ws, const std::string &bankName, int col, int row);
65
67 std::string readPeakBlockHeader(std::string lastStr, std::ifstream &in, int &run, int &detName, double &chi,
68 double &phi, double &omega, double &monCount);
69
71 void appendFile(const Mantid::DataObjects::PeaksWorkspace_sptr &outWS, const std::string &filename);
72
75 void checkNumberPeaks(const Mantid::DataObjects::PeaksWorkspace_sptr &outWS, const std::string &filename);
76
78 std::map<std::string, size_t> m_bankIndices;
79
82 size_t getCachedBankIndex(std::string const &bankname, Geometry::ComponentInfo const &componentInfo);
83};
84
85} // namespace Crystal
86} // namespace Mantid
Defines an interface to an algorithm that loads a file so that it can take part in the automatic sele...
Definition IFileLoader.h:19
Load an ISAW-style .peaks or .integrate file into a PeaksWorkspace.
std::map< std::string, size_t > m_bankIndices
Local cache of bank component indices used in file.
const std::string category() const override
Algorithm's category for identification.
const std::string name() const override
Algorithm's name for identification.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
int version() const override
Algorithm's version for identification.
bool m_isModulatedStructure
Flag for reading modulated structures.
const std::string summary() const override
Summary of algorithms purpose.
Structure describing a single-crystal peak.
Definition Peak.h:34
ComponentInfo : Provides a component centric view on to the instrument.
Defines a wrapper around an open file.
std::shared_ptr< PeaksWorkspace > PeaksWorkspace_sptr
Typedef for a shared pointer to a peaks workspace.
Helper class which provides the Collimation Length for SANS instruments.