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

WorkspaceNearestNeighbourInfo provides easy access to nearest-neighbour information for a workspace. More...

#include <WorkspaceNearestNeighbourInfo.h>

Public Member Functions

std::map< specnum_t, Kernel::V3DgetNeighbours (const Geometry::IDetector *comp, const double radius=0.0) const
 Queries the WorkspaceNearestNeighbours object for the selected detector. More...
 
std::map< specnum_t, Kernel::V3DgetNeighbours (specnum_t spec, const double radius) const
 Queries the WorkspaceNearestNeighbours object for the selected spectrum number. More...
 
std::map< specnum_t, Kernel::V3DgetNeighboursExact (specnum_t spec) const
 Queries the WorkspaceNearestNeighbours object for the selected spectrum number. More...
 
 WorkspaceNearestNeighbourInfo (const MatrixWorkspace &workspace, const bool ignoreMaskedDetectors, const int nNeighbours=8)
 Creates WorkspaceNearestNeighbourInfo. More...
 
 ~WorkspaceNearestNeighbourInfo ()
 

Private Attributes

std::unique_ptr< WorkspaceNearestNeighboursm_nearestNeighbours
 
const MatrixWorkspacem_workspace
 

Detailed Description

WorkspaceNearestNeighbourInfo provides easy access to nearest-neighbour information for a workspace.

Definition at line 28 of file WorkspaceNearestNeighbourInfo.h.

Constructor & Destructor Documentation

◆ WorkspaceNearestNeighbourInfo()

Mantid::API::WorkspaceNearestNeighbourInfo::WorkspaceNearestNeighbourInfo ( const MatrixWorkspace workspace,
const bool  ignoreMaskedDetectors,
const int  nNeighbours = 8 
)

Creates WorkspaceNearestNeighbourInfo.

Parameters
workspace:: Reference to workspace providing instrument and spectrum-detector mapping
ignoreMaskedDetectors:: if true, masked detectors are ignored
nNeighbours:: number of neighbours to include

Definition at line 21 of file WorkspaceNearestNeighbourInfo.cpp.

References Mantid::API::MatrixWorkspace::getNumberHistograms(), Mantid::API::MatrixWorkspace::getSpectrum(), Mantid::API::ISpectrum::getSpectrumNo(), m_nearestNeighbours, m_workspace, and workspace.

◆ ~WorkspaceNearestNeighbourInfo()

Mantid::API::WorkspaceNearestNeighbourInfo::~WorkspaceNearestNeighbourInfo ( )
default

Member Function Documentation

◆ getNeighbours() [1/2]

std::map< specnum_t, Kernel::V3D > Mantid::API::WorkspaceNearestNeighbourInfo::getNeighbours ( const Geometry::IDetector comp,
const double  radius = 0.0 
) const

Queries the WorkspaceNearestNeighbours object for the selected detector.

NOTE! getNeighbours(spectrumNumber, radius) is MUCH faster.

Parameters
comp:: pointer to the querying detector
radius:: distance from detector on which to filter results
Returns
map of DetectorID to distance for the nearest neighbours

Definition at line 44 of file WorkspaceNearestNeighbourInfo.cpp.

References Mantid::Geometry::IDetector::getID(), Mantid::API::MatrixWorkspace::getSpectraFromDetectorIDs(), m_nearestNeighbours, m_workspace, and radius.

◆ getNeighbours() [2/2]

std::map< specnum_t, Kernel::V3D > Mantid::API::WorkspaceNearestNeighbourInfo::getNeighbours ( specnum_t  spec,
const double  radius 
) const

Queries the WorkspaceNearestNeighbours object for the selected spectrum number.

Parameters
spec:: spectrum number of the detector you are looking at
radius:: distance from detector on which to filter results
Returns
map of DetectorID to distance for the nearest neighbours

Definition at line 64 of file WorkspaceNearestNeighbourInfo.cpp.

References m_nearestNeighbours, and radius.

◆ getNeighboursExact()

std::map< specnum_t, Kernel::V3D > Mantid::API::WorkspaceNearestNeighbourInfo::getNeighboursExact ( specnum_t  spec) const

Queries the WorkspaceNearestNeighbours object for the selected spectrum number.

Parameters
spec:: spectrum number of the detector you are looking at
Returns
map of DetectorID to distance for the nearest neighbours

Definition at line 75 of file WorkspaceNearestNeighbourInfo.cpp.

References m_nearestNeighbours.

Referenced by Mantid::Algorithms::SmoothNeighbours::findNeighboursUbiquitous(), and Mantid::Algorithms::SofQWNormalisedPolygon::initAngularCachesPSD().

Member Data Documentation

◆ m_nearestNeighbours

std::unique_ptr<WorkspaceNearestNeighbours> Mantid::API::WorkspaceNearestNeighbourInfo::m_nearestNeighbours
private

◆ m_workspace

const MatrixWorkspace& Mantid::API::WorkspaceNearestNeighbourInfo::m_workspace
private

Definition at line 39 of file WorkspaceNearestNeighbourInfo.h.

Referenced by getNeighbours(), and WorkspaceNearestNeighbourInfo().


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