7constexpr int HISTOGRAM_INDEX{0};
12 throw std::runtime_error(
"This object only works with integrated workspaces");
26 throw std::runtime_error(
"SpectrumInfo object is not initialized");
67 throw std::runtime_error(
"SpectrumInfo object is not initialized");
69 g_log.
warning() <<
"Workspace index " <<
index <<
" has no detector assigned to it - discarding\n";
77 const auto YIn = this->
yValue(index);
79 if (std::isnan(YIn) || std::isinf(YIn))
91 for (i = 0; i < numSpec; ++i) {
105 const auto YIn = this->
yValue(index);
142 if (dx * dx + dy * dy < beamRadius * beamRadius)
151 return sqrt(xExtent * xExtent + yExtent * yExtent);
164 this->x /= std::fabs(
x);
165 this->y /= std::fabs(
y);
175 return (x <= this->
xMax &&
x >= this->
xMin && y <= yMax && y >=
yMin);
IPeaksWorkspace_sptr workspace
std::map< DeltaEMode::Type, std::string > index
bool isMonitor(const size_t index) const
Returns true if the detector(s) associated with the spectrum are monitors.
bool hasDetectors(const size_t index) const
Returns true if the spectrum is associated with detectors in the instrument.
Kernel::V3D position(const size_t index) const
Returns the position of the spectrum with given index.
bool isValidWs(int index) const
Performs checks on the spectrum located at index to determine if it is acceptable to be operated on.
int m_cachedHistogramYIndex
API::MatrixWorkspace_const_sptr m_workspace
double calculateDistance() const
Kernel::V3D m_cachedPosition
void setPosition(double x, double y)
double calculateRadiusY() const
void setCenter(double x, double y)
void updateMinMax(int index)
Compare current mins and maxs to the coordinates of the spectrum at index expnd mins and maxs to incl...
bool isOutOfBoundsOfNonDirectBeam(const double beamRadius, int index, const bool directBeam)
Checks to see if spectrum at index is within the diameter of the given beamRadius.
double yValue(const int index) const
void setBounds(double xMin, double xMax, double yMin, double yMax)
void normalizePosition(double x, double y)
Perform normalization on x/y coords over given values.
double updatePositionAndReturnCount(int index)
Sets member variables x/y to new x/y based on spectrum info and historgram data at the given index.
double calculateRadiusX() const
bool containsPoint(double x, double y)
Checks if a given x/y coord is within the bounding box.
int findFirstValidWs(const int numSpec) const
Searches for the first valid spectrum info in member variable workspace
const API::SpectrumInfo * m_spectrumInfo
int m_cachedPositionIndex
Kernel::V3D & position(int index) const
void warning(const std::string &msg)
Logs at warning level.
Kernel::Logger g_log("ExperimentInfo")
static logger object
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)