Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
Mantid::Algorithms::DetectorGridDefinition Class Reference

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
 

Detailed Description

DetectorGridDefinition is a helper class for building the sparse instrument in MonteCarloAbsorption.

Definition at line 20 of file DetectorGridDefinition.h.

Constructor & Destructor Documentation

◆ DetectorGridDefinition()

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.

Parameters
minLatitudeStart of the latitude range.
maxLatitudeEnd of the latitude range.
latitudePointsNumber of rows.
minLongitudeStart of the longitude range.
maxLongitudeEnd of the longitude range.
longitudePointsNumber of columns.
Exceptions
std::runtime_errorIf 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.

Member Function Documentation

◆ getDetectorIndex()

size_t Mantid::Algorithms::DetectorGridDefinition::getDetectorIndex ( size_t  row,
size_t  col 
)

Return the indices of the detector described by a row and col.

Parameters
rowZero-based integer describing a row of detector grid
colZero-based integer describing a column of detector grid
Returns
Indices of the detector

Definition at line 93 of file DetectorGridDefinition.cpp.

References m_latitudePoints, and m_longitudePoints.

◆ getNearestVertex()

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.

Parameters
latitudeLatitude of a point.
longitudeLongitude of a point.
Returns
Indices to nearest detector

Definition at line 107 of file DetectorGridDefinition.cpp.

References m_latitudePoints, m_latitudeStep, m_longitudePoints, m_longitudeStep, m_minLatitude, and m_minLongitude.

◆ latitudeAt()

double Mantid::Algorithms::DetectorGridDefinition::latitudeAt ( const size_t  row) const

Return the latitude of the given row.

Parameters
rowNumber of a row.
Returns
A latitude.

Definition at line 52 of file DetectorGridDefinition.cpp.

References m_latitudeStep, and m_minLatitude.

◆ longitudeAt()

double Mantid::Algorithms::DetectorGridDefinition::longitudeAt ( const size_t  column) const

Return the longitude of the given column.

Parameters
columnNumber of a column.
Returns
A longitude.

Definition at line 60 of file DetectorGridDefinition.cpp.

References m_longitudeStep, and m_minLongitude.

◆ nearestNeighbourIndices()

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.

Parameters
latitudeLatitude of a point.
longitudeLongitude of a point.
Returns
Indices to four nearby detectors.

Definition at line 69 of file DetectorGridDefinition.cpp.

References m_latitudePoints, m_latitudeStep, m_longitudePoints, m_longitudeStep, m_minLatitude, and m_minLongitude.

◆ numberColumns()

size_t Mantid::Algorithms::DetectorGridDefinition::numberColumns ( ) const

Return the number of columns in the grid.

Returns
Number of columns.

Definition at line 124 of file DetectorGridDefinition.cpp.

References m_longitudePoints.

◆ numberRows()

size_t Mantid::Algorithms::DetectorGridDefinition::numberRows ( ) const

Return the number of rows in the grid.

Returns
Number of rows.

Definition at line 129 of file DetectorGridDefinition.cpp.

References m_latitudePoints.

Member Data Documentation

◆ m_latitudePoints

size_t Mantid::Algorithms::DetectorGridDefinition::m_latitudePoints
private

◆ m_latitudeStep

double Mantid::Algorithms::DetectorGridDefinition::m_latitudeStep
private

◆ m_longitudePoints

size_t Mantid::Algorithms::DetectorGridDefinition::m_longitudePoints
private

◆ m_longitudeStep

double Mantid::Algorithms::DetectorGridDefinition::m_longitudeStep
private

◆ m_maxLatitude

double Mantid::Algorithms::DetectorGridDefinition::m_maxLatitude
private

Definition at line 35 of file DetectorGridDefinition.h.

Referenced by DetectorGridDefinition().

◆ m_maxLongitude

double Mantid::Algorithms::DetectorGridDefinition::m_maxLongitude
private

Definition at line 39 of file DetectorGridDefinition.h.

Referenced by DetectorGridDefinition().

◆ m_minLatitude

double Mantid::Algorithms::DetectorGridDefinition::m_minLatitude
private

◆ m_minLongitude

double Mantid::Algorithms::DetectorGridDefinition::m_minLongitude
private

The documentation for this class was generated from the following files: