Mantid
Loading...
Searching...
No Matches
LoadFullprofResolution.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2013 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 "MantidDataHandling/DllConfig.h"
12
13namespace Poco {
14namespace XML {
15class Document;
16class Element;
17} // namespace XML
18} // namespace Poco
19
20namespace Mantid {
21namespace DataHandling {
22
26class MANTID_DATAHANDLING_DLL LoadFullprofResolution final : public API::Algorithm {
27public:
29 const std::string name() const override { return "LoadFullprofResolution"; }
30
32 int version() const override { return 1; }
33 const std::vector<std::string> seeAlso() const override { return {"LoadFullprofFile"}; }
34
36 const std::string category() const override { return "Diffraction\\DataHandling"; }
38 const std::string summary() const override {
39 return "Load Fullprof's resolution (.irf) file to one or multiple "
40 "TableWorkspace(s) and/or where this is supported."
41 " See description section, translate fullprof resolution fitting "
42 "parameter into Mantid equivalent fitting parameters.";
43 }
44
46 static void getTableRowNumbers(const API::ITableWorkspace_sptr &tablews, std::map<std::string, size_t> &parammap);
47
49 static void putParametersIntoWorkspace(const API::Column_const_sptr &, const API::MatrixWorkspace_sptr &ws, int nProf,
50 std::string &parameterXMLString);
51
53 static void addALFBEParameter(const API::Column_const_sptr &, Poco::XML::Document *mDoc, Poco::XML::Element *parent,
54 const std::string &paramName);
55
57 static void addSigmaParameters(const API::Column_const_sptr &, Poco::XML::Document *mDoc, Poco::XML::Element *parent);
58
60 static void addGammaParameters(const API::Column_const_sptr &, Poco::XML::Document *mDoc, Poco::XML::Element *parent);
61
63 static void addBBX_S_Parameters(const API::Column_const_sptr &, Poco::XML::Document *mDoc,
64 Poco::XML::Element *parent);
65
67 static void addBBX_A_Parameters(const API::Column_const_sptr &, Poco::XML::Document *mDoc,
68 Poco::XML::Element *parent);
69
71 static void addBBX_B_Parameters(const API::Column_const_sptr &, Poco::XML::Document *mDoc,
72 Poco::XML::Element *parent);
73
75 static std::string getXMLEqValue(const API::Column_const_sptr &, const std::string &name);
76
78 static std::string getXMLSquaredEqValue(const API::Column_const_sptr &column, const std::string &name);
79
80 // Translate a parameter name from as it appears in the table workspace to its
81 // name in the XML file
82 static std::string getXMLParameterName(const std::string &name);
83
85 static void createBankToWorkspaceMap(const std::vector<int> &banks, const std::vector<int> &workspaces,
86 std::map<int, size_t> &workspaceOfBank);
87
89 static std::map<std::string, size_t> m_rowNumbers;
90
91private:
93 void init() override;
95 void exec() override;
96
98 void loadFile(const std::string &filename, std::vector<std::string> &lines);
99
101 int getProfNumber(const std::vector<std::string> &lines);
102
104 void scanBanks(const std::vector<std::string> &lines, const bool useFileBankIDs, std::vector<int> &banks,
105 std::map<int, int> &bankstartindexmap, std::map<int, int> &bankendindexmap);
106
108 void parseResolutionStrings(std::map<std::string, double> &parammap, const std::vector<std::string> &lines,
109 const bool useFileBankIDs, int bankid, int startlineindex, int endlineindex,
110 int profNumber);
111
112 void parseBankLine(std::string line, double &cwl, int &bankid);
113
116
119
122
124 double parseDoubleValue(const std::string &value, const std::string &label = std::string());
125
127 DataObjects::TableWorkspace_sptr genTableWorkspace(std::map<int, std::map<std::string, double>> bankparammap);
128
130 // DataObjects::TableWorkspace_sptr
131 // genInfoTableWorkspace(std::vector<int> banks);
132 // const std::vector<int> &workspaces,
133 // std::map<int, size_t> &WorkpsaceOfBank);
134};
135
136} // namespace DataHandling
137} // namespace Mantid
double value
The value of the point.
Definition: FitMW.cpp:51
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
LoadFullprofResolution : Load Fullprof resolution (.irf) file to TableWorkspace(s)
const std::string summary() const override
Summary of algorithms purpose.
void parseProfile9()
Parse 1 bank of lines of profile 9.
const std::string name() const override
Algorithm's name for identification overriding a virtual method.
void parseProfile10()
Parse 1 bank of lines of profile 10.
const std::string category() const override
Algorithm's category for identification overriding a virtual method.
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 searchProfile()
Search token for profile number.
int version() const override
Algorithm's version for identification overriding a virtual method.
static std::map< std::string, size_t > m_rowNumbers
Place to store the row numbers.
std::shared_ptr< ITableWorkspace > ITableWorkspace_sptr
shared pointer to Mantid::API::ITableWorkspace
std::shared_ptr< const Column > Column_const_sptr
Definition: Column.h:229
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< TableWorkspace > TableWorkspace_sptr
shared pointer to Mantid::DataObjects::TableWorkspace
Helper class which provides the Collimation Length for SANS instruments.
Definition: Algorithm.h:30