Mantid
Loading...
Searching...
No Matches
ParameterInfo.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2026 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
9#include "MantidGeometry/DllConfig.h"
12
13#include <cstddef>
14#include <map>
15#include <memory>
16#include <set>
17#include <string>
18#include <utility>
19
20namespace Mantid {
21namespace Geometry {
22
23class ComponentInfo;
24class XMLInstrumentParameter;
25
35class MANTID_GEOMETRY_DLL ParameterInfo {
36public:
47 std::multimap<std::string, std::shared_ptr<Parameter>, Kernel::CaseInsensitiveStringComparator>;
48
54 using LogfileParameters = std::map<std::pair<size_t, std::string>, std::shared_ptr<const XMLInstrumentParameter>>;
55
58 void add(size_t const componentIndex, std::shared_ptr<Parameter> const &parameter);
59
63 bool addFittingParameter(size_t const componentIndex, std::shared_ptr<Parameter> const &parameter,
64 std::string const &fittingFunction);
65
70 void insert(size_t const componentIndex, std::shared_ptr<Parameter> const &parameter);
71
73 bool contains(size_t const componentIndex, std::string const &name, std::string const &type = "") const;
74
76 std::shared_ptr<Parameter> get(size_t const componentIndex, std::string const &name,
77 std::string const &type = "") const;
78
80 std::shared_ptr<Parameter> getByType(size_t const componentIndex, std::string const &type) const;
81
83 std::shared_ptr<Parameter> getRecursive(ComponentInfo const &componentInfo, size_t const componentIndex,
84 std::string const &name, std::string const &type = "") const;
85
87 std::shared_ptr<Parameter> getRecursiveByType(ComponentInfo const &componentInfo, size_t const componentIndex,
88 std::string const &type) const;
89
92 std::shared_ptr<Parameter> getRecursiveFittingParameter(ComponentInfo const &componentInfo,
93 size_t const componentIndex, std::string const &name,
94 std::string const &fittingFunction) const;
95
98 std::set<std::string> names(size_t const componentIndex) const;
99
102 ComponentParameters const &parameters(size_t const componentIndex) const;
103
105 void clearParametersByName(std::string const &name);
106
108 void clearParametersByName(size_t const componentIndex, std::string const &name);
109
112 void clear();
113
115 void addLogfileParameter(size_t const componentIndex, std::string const &cacheKey,
116 std::shared_ptr<const XMLInstrumentParameter> const &parameter);
117
119 LogfileParameters const &logfileParameters() const;
120
121 bool empty() const;
122
124 size_t size() const;
125
126 size_t getMemorySize() const;
127
130 auto begin() const { return m_store.begin(); }
131 auto end() const { return m_store.end(); }
132
133private:
134 std::map<size_t, ComponentParameters> m_store;
136};
137
138} // namespace Geometry
139} // namespace Mantid
std::string name
Definition Run.cpp:60
ComponentInfo : Provides a component centric view on to the instrument.
ParameterInfo : the named parameters of an instrument, addressed by component index.
auto begin() const
Iteration over (component index, parameters) pairs, in ascending component-index order.
LogfileParameters m_logfileParameters
std::multimap< std::string, std::shared_ptr< Parameter >, Kernel::CaseInsensitiveStringComparator > ComponentParameters
Parameters of a single component, ordered by name.
std::map< std::pair< size_t, std::string >, std::shared_ptr< const XMLInstrumentParameter > > LogfileParameters
Parameters whose values are taken from the sample logs when ExperimentInfo::populateInstrumentParamet...
std::map< size_t, ComponentParameters > m_store
Helper class which provides the Collimation Length for SANS instruments.
Functor to provide a case insensitive string comparator.