Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::DataHandling::AlignAndFocusPowderSlim::BankCalibration Class Reference

Class that handles all the calibration constants for a bank of detectors. More...

#include <BankCalibration.h>

Public Member Functions

 BankCalibration (const double time_conversion, const std::set< detid_t > &det_in_group, const std::map< detid_t, double > &calibration_map, const std::map< detid_t, double > &scale_at_sample, const std::set< detid_t > &mask)
 Calibration of a subset of pixels as requested in the constructor.
 
bool empty () const
 
detid_t idmax () const
 
const detid_t & idmin () const
 
const double & value_calibration (const detid_t detid) const
 This assumes that everything is in range.
 
double value_scale_at_sample (const detid_t detid) const
 This returns a value with no bounds checking.
 

Private Member Functions

bool detidInRange (const detid_t detid) const
 

Private Attributes

std::vector< double > m_calibration
 
detid_t m_detid_offset
 
std::vector< double > m_scale_at_sample
 

Detailed Description

Class that handles all the calibration constants for a bank of detectors.

Accessing values DOES NO RANGE CHECKING so only request values within the range of detector IDs supplied to the constructor.

Definition at line 25 of file BankCalibration.h.

Constructor & Destructor Documentation

◆ BankCalibration()

Mantid::DataHandling::AlignAndFocusPowderSlim::BankCalibration::BankCalibration ( const double  time_conversion,
const std::set< detid_t > &  det_in_group,
const std::map< detid_t, double > &  calibration_map,
const std::map< detid_t, double > &  scale_at_sample,
const std::set< detid_t > &  mask 
)

Calibration of a subset of pixels as requested in the constructor.

This is used because a vector is faster lookup than a map for dense array of values.

Parameters
time_conversionValue to bundle into the calibration constant to account for converting the time-of-flight into microseconds. Applying it here is effectively the same as applying it to each event time-of-flight.
det_in_groupDetector-ids that are to be used in this group
calibration_mapCalibration for the entire instrument.
scale_at_sampleScalar factor to multiply the time-of-flight by to get the time-of-flight of the neutron back at the sample position.
maskdetector ids that exist in the map should not be included.

Definition at line 49 of file BankCalibration.cpp.

References Mantid::DataHandling::AlignAndFocusPowderSlim::IGNORE_PIXEL, m_calibration, m_detid_offset, m_scale_at_sample, and value.

Member Function Documentation

◆ detidInRange()

bool Mantid::DataHandling::AlignAndFocusPowderSlim::BankCalibration::detidInRange ( const detid_t  detid) const
private

Definition at line 88 of file BankCalibration.cpp.

References idmax(), and idmin().

Referenced by value_calibration(), and value_scale_at_sample().

◆ empty()

bool Mantid::DataHandling::AlignAndFocusPowderSlim::BankCalibration::empty ( ) const

◆ idmax()

detid_t Mantid::DataHandling::AlignAndFocusPowderSlim::BankCalibration::idmax ( ) const

Definition at line 111 of file BankCalibration.cpp.

References m_calibration, and m_detid_offset.

Referenced by detidInRange().

◆ idmin()

const detid_t & Mantid::DataHandling::AlignAndFocusPowderSlim::BankCalibration::idmin ( ) const

Definition at line 110 of file BankCalibration.cpp.

References m_detid_offset.

Referenced by detidInRange().

◆ value_calibration()

const double & Mantid::DataHandling::AlignAndFocusPowderSlim::BankCalibration::value_calibration ( const detid_t  detid) const

This assumes that everything is in range.

Values that weren't in the calibration map get set to 1. Values that are to be masked will be set to IGNORE_PIXEL.

Definition at line 96 of file BankCalibration.cpp.

References detidInRange(), Mantid::DataHandling::AlignAndFocusPowderSlim::IGNORE_PIXEL, m_calibration, and m_detid_offset.

Referenced by Mantid::DataHandling::AlignAndFocusPowderSlim::ProcessEventsTask< DetIDsVector, TofVector >::operator()().

◆ value_scale_at_sample()

double Mantid::DataHandling::AlignAndFocusPowderSlim::BankCalibration::value_scale_at_sample ( const detid_t  detid) const

This returns a value with no bounds checking.

If scale_at_sample is not provided, this will have undefined behavior. This value should not be used if the detector is masked.

Definition at line 103 of file BankCalibration.cpp.

References detidInRange(), Mantid::DataHandling::AlignAndFocusPowderSlim::IGNORE_PIXEL, m_detid_offset, and m_scale_at_sample.

Member Data Documentation

◆ m_calibration

std::vector<double> Mantid::DataHandling::AlignAndFocusPowderSlim::BankCalibration::m_calibration
private

Definition at line 44 of file BankCalibration.h.

Referenced by BankCalibration(), empty(), idmax(), and value_calibration().

◆ m_detid_offset

detid_t Mantid::DataHandling::AlignAndFocusPowderSlim::BankCalibration::m_detid_offset
private

◆ m_scale_at_sample

std::vector<double> Mantid::DataHandling::AlignAndFocusPowderSlim::BankCalibration::m_scale_at_sample
private

Definition at line 45 of file BankCalibration.h.

Referenced by BankCalibration(), and value_scale_at_sample().


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