Mantid
Loading...
Searching...
No Matches
GroupingWorkspace.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
12
13namespace Mantid {
14namespace DataObjects {
15
25class MANTID_DATAOBJECTS_DLL GroupingWorkspace : public SpecialWorkspace2D {
26public:
28 GroupingWorkspace() = default;
29 GroupingWorkspace(size_t numvectors);
31
33 std::unique_ptr<GroupingWorkspace> clone() const { return std::unique_ptr<GroupingWorkspace>(doClone()); }
34
36 std::unique_ptr<GroupingWorkspace> cloneEmpty() const { return std::unique_ptr<GroupingWorkspace>(doCloneEmpty()); }
37
40 const std::string id() const override { return "GroupingWorkspace"; }
41
42 void makeDetectorIDToGroupMap(std::map<detid_t, int> &detIDToGroup, int64_t &ngroups) const;
43 void makeDetectorIDToGroupVector(std::vector<int> &detIDToGroup, int64_t &ngroups) const;
44
45protected:
48
49private:
50 GroupingWorkspace *doClone() const override { return new GroupingWorkspace(*this); }
51 GroupingWorkspace *doCloneEmpty() const override { return new GroupingWorkspace(); }
52};
53
55using GroupingWorkspace_sptr = std::shared_ptr<GroupingWorkspace>;
56
58using GroupingWorkspace_const_sptr = std::shared_ptr<const GroupingWorkspace>;
59
60} // namespace DataObjects
61} // namespace Mantid
A GroupingWorkspace is a subclass of Workspace2D where each spectrum has a single number entry,...
GroupingWorkspace(const GroupingWorkspace &)=default
Protected copy constructor. May be used by childs for cloning.
std::unique_ptr< GroupingWorkspace > cloneEmpty() const
Returns a default-initialized clone of the workspace.
std::unique_ptr< GroupingWorkspace > clone() const
Returns a clone of the workspace.
GroupingWorkspace * doCloneEmpty() const override
Virtual cloneEmpty method.
GroupingWorkspace & operator=(const GroupingWorkspace &)=delete
const std::string id() const override
Gets the name of the workspace type.
GroupingWorkspace * doClone() const override
Virtual clone method. Not implemented to force implementation in children.
std::shared_ptr< const GroupingWorkspace > GroupingWorkspace_const_sptr
shared pointer to a const GroupingWorkspace
std::shared_ptr< GroupingWorkspace > GroupingWorkspace_sptr
shared pointer to the GroupingWorkspace class
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.