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"
14
15namespace Mantid {
16namespace Crystal {
17
25class MANTID_CRYSTAL_DLL LoadIsawPeaks : public API::IFileLoader<Kernel::FileDescriptor> {
26public:
28 const std::string name() const override { return "LoadIsawPeaks"; }
29
31 const std::string summary() const override { return "Load an ISAW-style .peaks file into a PeaksWorkspace."; }
32
34 int version() const override { return 1; }
35 const std::vector<std::string> seeAlso() const override { return {"SaveIsawPeaks"}; }
36
38 const std::string category() const override { return "Crystal\\DataHandling;DataHandling\\Isaw"; }
39
41 int confidence(Kernel::FileDescriptor &descriptor) const override;
42
43private:
46 std::vector<double> m_offset1 = {0.0, 0.0, 0.0};
47 std::vector<double> m_offset2 = {0.0, 0.0, 0.0};
48 std::vector<double> m_offset3 = {0.0, 0.0, 0.0};
49
51 void init() override;
52
54 void exec() override;
55
57 std::string readHeader(const Mantid::DataObjects::PeaksWorkspace_sptr &outWS, std::ifstream &in, double &T0);
58
60 DataObjects::Peak readPeak(const DataObjects::PeaksWorkspace_sptr &outWS, std::string &lastStr, std::ifstream &in,
61 int &seqNum, const std::string &bankName, double qSign);
62
63 int findPixelID(const Geometry::Instrument_const_sptr &inst, const std::string &bankName, int col, int row);
64
66 std::string readPeakBlockHeader(std::string lastStr, std::ifstream &in, int &run, int &detName, double &chi,
67 double &phi, double &omega, double &monCount);
68
70 void appendFile(const Mantid::DataObjects::PeaksWorkspace_sptr &outWS, const std::string &filename);
71
74 void checkNumberPeaks(const Mantid::DataObjects::PeaksWorkspace_sptr &outWS, const std::string &filename);
75
77 std::map<std::string, std::shared_ptr<const Geometry::IComponent>> m_banks;
78
80 std::shared_ptr<const Geometry::IComponent>
81 getCachedBankByName(const std::string &bankname, const std::shared_ptr<const Geometry::Instrument> &inst);
82};
83
84} // namespace Crystal
85} // 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.
Definition: LoadIsawPeaks.h:25
const std::string category() const override
Algorithm's category for identification.
Definition: LoadIsawPeaks.h:38
const std::string name() const override
Algorithm's name for identification.
Definition: LoadIsawPeaks.h:28
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
Definition: LoadIsawPeaks.h:35
int version() const override
Algorithm's version for identification.
Definition: LoadIsawPeaks.h:34
bool m_isModulatedStructure
Flag for reading modulated structures.
Definition: LoadIsawPeaks.h:45
const std::string summary() const override
Summary of algorithms purpose.
Definition: LoadIsawPeaks.h:31
std::map< std::string, std::shared_ptr< const Geometry::IComponent > > m_banks
Local cache of bank IComponents used in file.
Definition: LoadIsawPeaks.h:77
Structure describing a single-crystal peak.
Definition: Peak.h:34
Defines a wrapper around an open file.
std::shared_ptr< PeaksWorkspace > PeaksWorkspace_sptr
Typedef for a shared pointer to a peaks workspace.
std::shared_ptr< const Instrument > Instrument_const_sptr
Shared pointer to an const instrument object.
Helper class which provides the Collimation Length for SANS instruments.