50 auto group =
static_cast<int>(this->
readY(wi)[0]);
54 for (
auto detID : detIDs) {
55 detIDToGroup[detID] = group;
75 auto group =
static_cast<int>(this->
y(wi).front());
79 for (
auto detID : detIDs) {
83 if (detIDToGroup.size() <
static_cast<size_t>(detID + 1))
84 detIDToGroup.resize(detID + 1);
85 detIDToGroup[detID] = group;
100IPropertyManager::getValue<Mantid::DataObjects::GroupingWorkspace_sptr>(
const std::string &name)
const {
106 std::string message =
107 "Attempt to assign property " + name +
" to incorrect type. Expected shared_ptr<GroupingWorkspace>.";
108 throw std::runtime_error(message);
114IPropertyManager::getValue<Mantid::DataObjects::GroupingWorkspace_const_sptr>(
const std::string &name)
const {
118 return prop->operator()();
120 std::string message =
121 "Attempt to assign property " + name +
" to incorrect type. Expected const shared_ptr<GroupingWorkspace>.";
122 throw std::runtime_error(message);
#define DLLExport
Definitions of the DLLImport compiler directives for MSVC.
#define DECLARE_WORKSPACE(classname)
const MantidVec & readY(std::size_t const index) const
Deprecated, use y() instead.
A GroupingWorkspace is a subclass of Workspace2D where each spectrum has a single number entry,...
void makeDetectorIDToGroupVector(std::vector< int > &detIDToGroup, int64_t &ngroups) const
Fill a map where the index is detector ID and the value is the group number by using the values in Y.
void makeDetectorIDToGroupMap(std::map< detid_t, int > &detIDToGroup, int64_t &ngroups) const
Fill a map with key = detector ID, value = group number by using the values in Y.
GroupingWorkspace()=default
std::set< detid_t > getDetectorIDs(const std::size_t workspaceIndex) const
Return the detector ID at the given workspace index (i.e., spectrum/histogram index)
std::size_t getNumberHistograms() const override
Returns the histogram number.
The concrete, templated class for properties.
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.