Mantid
|
DetectorGridDefinition is a helper class for building the sparse instrument in MonteCarloAbsorption. More...
#include <DetectorGridDefinition.h>
Public Member Functions | |
DetectorGridDefinition (const double minLatitude, const double maxLatitude, const size_t latitudePoints, const double minLongitude, const double maxLongitude, const size_t longitudeStep) | |
Initializes a DetectorGridDefinition object. More... | |
size_t | getDetectorIndex (size_t row, size_t col) |
Return the indices of the detector described by a row and col. More... | |
std::pair< size_t, size_t > | getNearestVertex (const double latitude, const double longitude) const |
Return the indices to the detector that is immediate neighbour of the supplied lat/long and has lat/long <= supplied values. More... | |
double | latitudeAt (const size_t row) const |
Return the latitude of the given row. More... | |
double | longitudeAt (const size_t column) const |
Return the longitude of the given column. More... | |
std::array< size_t, 4 > | nearestNeighbourIndices (const double latitude, const double longitude) const |
Return the indices to detector surrounding the given point. More... | |
size_t | numberColumns () const |
Return the number of columns in the grid. More... | |
size_t | numberRows () const |
Return the number of rows in the grid. More... | |
Private Attributes | |
size_t | m_latitudePoints |
double | m_latitudeStep |
size_t | m_longitudePoints |
double | m_longitudeStep |
double | m_maxLatitude |
double | m_maxLongitude |
double | m_minLatitude |
double | m_minLongitude |
DetectorGridDefinition is a helper class for building the sparse instrument in MonteCarloAbsorption.
Definition at line 20 of file DetectorGridDefinition.h.
Mantid::Algorithms::DetectorGridDefinition::DetectorGridDefinition | ( | const double | minLatitude, |
const double | maxLatitude, | ||
const size_t | latitudePoints, | ||
const double | minLongitude, | ||
const double | maxLongitude, | ||
const size_t | longitudePoints | ||
) |
Initializes a DetectorGridDefinition object.
minLatitude | Start of the latitude range. |
maxLatitude | End of the latitude range. |
latitudePoints | Number of rows. |
minLongitude | Start of the longitude range. |
maxLongitude | End of the longitude range. |
longitudePoints | Number of columns. |
std::runtime_error | If invalid parameters are given |
Definition at line 23 of file DetectorGridDefinition.cpp.
References m_latitudePoints, m_latitudeStep, m_longitudePoints, m_longitudeStep, m_maxLatitude, m_maxLongitude, m_minLatitude, and m_minLongitude.
size_t Mantid::Algorithms::DetectorGridDefinition::getDetectorIndex | ( | size_t | row, |
size_t | col | ||
) |
Return the indices of the detector described by a row and col.
row | Zero-based integer describing a row of detector grid |
col | Zero-based integer describing a column of detector grid |
Definition at line 93 of file DetectorGridDefinition.cpp.
References m_latitudePoints, and m_longitudePoints.
std::pair< size_t, size_t > Mantid::Algorithms::DetectorGridDefinition::getNearestVertex | ( | const double | latitude, |
const double | longitude | ||
) | const |
Return the indices to the detector that is immediate neighbour of the supplied lat/long and has lat/long <= supplied values.
latitude | Latitude of a point. |
longitude | Longitude of a point. |
Definition at line 107 of file DetectorGridDefinition.cpp.
References m_latitudePoints, m_latitudeStep, m_longitudePoints, m_longitudeStep, m_minLatitude, and m_minLongitude.
double Mantid::Algorithms::DetectorGridDefinition::latitudeAt | ( | const size_t | row | ) | const |
Return the latitude of the given row.
row | Number of a row. |
Definition at line 52 of file DetectorGridDefinition.cpp.
References m_latitudeStep, and m_minLatitude.
double Mantid::Algorithms::DetectorGridDefinition::longitudeAt | ( | const size_t | column | ) | const |
Return the longitude of the given column.
column | Number of a column. |
Definition at line 60 of file DetectorGridDefinition.cpp.
References m_longitudeStep, and m_minLongitude.
std::array< size_t, 4 > Mantid::Algorithms::DetectorGridDefinition::nearestNeighbourIndices | ( | const double | latitude, |
const double | longitude | ||
) | const |
Return the indices to detector surrounding the given point.
latitude | Latitude of a point. |
longitude | Longitude of a point. |
Definition at line 69 of file DetectorGridDefinition.cpp.
References m_latitudePoints, m_latitudeStep, m_longitudePoints, m_longitudeStep, m_minLatitude, and m_minLongitude.
size_t Mantid::Algorithms::DetectorGridDefinition::numberColumns | ( | ) | const |
Return the number of columns in the grid.
Definition at line 124 of file DetectorGridDefinition.cpp.
References m_longitudePoints.
size_t Mantid::Algorithms::DetectorGridDefinition::numberRows | ( | ) | const |
Return the number of rows in the grid.
Definition at line 129 of file DetectorGridDefinition.cpp.
References m_latitudePoints.
|
private |
Definition at line 36 of file DetectorGridDefinition.h.
Referenced by DetectorGridDefinition(), getDetectorIndex(), getNearestVertex(), nearestNeighbourIndices(), and numberRows().
|
private |
Definition at line 37 of file DetectorGridDefinition.h.
Referenced by DetectorGridDefinition(), getNearestVertex(), latitudeAt(), and nearestNeighbourIndices().
|
private |
Definition at line 40 of file DetectorGridDefinition.h.
Referenced by DetectorGridDefinition(), getDetectorIndex(), getNearestVertex(), nearestNeighbourIndices(), and numberColumns().
|
private |
Definition at line 41 of file DetectorGridDefinition.h.
Referenced by DetectorGridDefinition(), getNearestVertex(), longitudeAt(), and nearestNeighbourIndices().
|
private |
Definition at line 35 of file DetectorGridDefinition.h.
Referenced by DetectorGridDefinition().
|
private |
Definition at line 39 of file DetectorGridDefinition.h.
Referenced by DetectorGridDefinition().
|
private |
Definition at line 34 of file DetectorGridDefinition.h.
Referenced by DetectorGridDefinition(), getNearestVertex(), latitudeAt(), and nearestNeighbourIndices().
|
private |
Definition at line 38 of file DetectorGridDefinition.h.
Referenced by DetectorGridDefinition(), getNearestVertex(), longitudeAt(), and nearestNeighbourIndices().