Mantid
Loading...
Searching...
No Matches
GroupingLoader.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2016 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 "MantidAPI/DllConfig.h"
12
13namespace Mantid {
14namespace API {
15
17class MANTID_API_DLL Grouping {
18public:
19 std::vector<std::string> groupNames;
20 std::vector<std::string> groups; // Range strings, e.g. "1-32"
21
22 std::vector<std::string> pairNames;
23 std::vector<std::pair<size_t, size_t>> pairs; // Pairs of group ids
24 std::vector<double> pairAlphas;
25
26 std::string description;
27 std::string defaultName; // Not storing id because can be either group or pair
28
30 Grouping() = default;
31
34
36 Grouping(const ITableWorkspace_sptr &table);
37
39 ITableWorkspace_sptr toTable() const;
40};
41
44class MANTID_API_DLL GroupingLoader {
45public:
47 GroupingLoader(Geometry::Instrument_const_sptr instrument, std::string mainFieldDirection);
48 virtual ~GroupingLoader();
50 std::shared_ptr<Grouping> getGroupingFromIDF() const;
52 static void loadGroupingFromXML(const std::string &filename, Grouping &grouping);
54 std::shared_ptr<Grouping> getDummyGrouping();
55
56private:
60 const std::string m_mainFieldDirection;
61};
62
63} // namespace API
64} // namespace Mantid
GroupingLoader : Loads instrument grouping from IDF file.
const std::string m_mainFieldDirection
Orientation of instrument (e.g. for MUSR)
const Geometry::Instrument_const_sptr m_instrument
Instrument to load grouping from.
virtual ~GroupingLoader()
Destructor.
Structure to represent grouping information.
Grouping()=default
Default constructor.
std::vector< std::pair< size_t, size_t > > pairs
std::vector< std::string > groupNames
~Grouping()
Destructor.
std::vector< double > pairAlphas
std::vector< std::string > pairNames
std::vector< std::string > groups
std::shared_ptr< ITableWorkspace > ITableWorkspace_sptr
shared pointer to Mantid::API::ITableWorkspace
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.