BornAgain
1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
|
Public Member Functions | |
DetectorMask () | |
DetectorMask (const DetectorMask &other) | |
DetectorMask & | operator= (const DetectorMask &other) |
void | addMask (const IShape2D &shape, bool mask_value) |
void | initMaskData (const IDetector2D &detector) |
void | initMaskData (const OutputData< double > &data) |
bool | isMasked (size_t index) const |
const OutputData< bool > * | getMaskData () const |
Histogram2D * | createHistogram () const |
void | removeMasks () |
bool | hasMasks () const |
int | numberOfMaskedChannels () const |
size_t | numberOfMasks () const |
const IShape2D * | getMaskShape (size_t mask_index, bool &mask_value) const |
Private Member Functions | |
void | process_masks () |
Private Attributes | |
SafePointerVector< IShape2D > | m_shapes |
std::vector< bool > | m_mask_of_shape |
OutputData< bool > | m_mask_data |
int | m_number_of_masked_channels |
Collection of detector masks.
Definition at line 28 of file DetectorMask.h.
DetectorMask::DetectorMask | ( | ) |
Definition at line 19 of file DetectorMask.cpp.
DetectorMask::DetectorMask | ( | const DetectorMask & | other | ) |
Definition at line 21 of file DetectorMask.cpp.
References OutputData< T >::copyFrom(), and m_mask_data.
DetectorMask & DetectorMask::operator= | ( | const DetectorMask & | other | ) |
Definition at line 28 of file DetectorMask.cpp.
References OutputData< T >::copyFrom(), m_mask_data, m_mask_of_shape, m_number_of_masked_channels, and m_shapes.
void DetectorMask::addMask | ( | const IShape2D & | shape, |
bool | mask_value | ||
) |
Add mask to the stack of detector masks.
The value "true" means that the area will be excluded from the analysis.
shape | The shape of mask. |
mask_value | The value of mask |
Definition at line 41 of file DetectorMask.cpp.
References OutputData< T >::clear(), IShape2D::clone(), m_mask_data, m_mask_of_shape, m_number_of_masked_channels, m_shapes, and SafePointerVector< T >::push_back().
Referenced by IDetector2D::addMask().
void DetectorMask::initMaskData | ( | const IDetector2D & | detector | ) |
Init the map of masks for the given detector plane.
Definition at line 49 of file DetectorMask.cpp.
References OutputData< T >::addAxis(), ASSERT, OutputData< T >::clear(), IDetector::dimension(), IDetector::getAxis(), m_mask_data, m_mask_of_shape, m_shapes, process_masks(), and SafePointerVector< T >::size().
Referenced by IDetector2D::addMask(), IDetector2D::resetRegionOfInterest(), and IDetector2D::setRegionOfInterest().
void DetectorMask::initMaskData | ( | const OutputData< double > & | data | ) |
Definition at line 66 of file DetectorMask.cpp.
References OutputData< T >::addAxis(), ASSERT, OutputData< T >::clear(), OutputData< T >::getAxis(), OutputData< T >::getRank(), m_mask_data, m_mask_of_shape, m_shapes, process_masks(), and SafePointerVector< T >::size().
bool DetectorMask::isMasked | ( | size_t | index | ) | const |
Definition at line 77 of file DetectorMask.cpp.
References m_mask_data, and m_number_of_masked_channels.
|
inline |
Histogram2D * DetectorMask::createHistogram | ( | ) | const |
Definition at line 82 of file DetectorMask.cpp.
References OutputData< T >::copyShapeFrom(), IHistogram::createHistogram(), OutputData< T >::getAllocatedSize(), and m_mask_data.
void DetectorMask::removeMasks | ( | ) |
remove all masks and return object to initial state
Definition at line 91 of file DetectorMask.cpp.
References SafePointerVector< T >::clear(), OutputData< T >::clear(), m_mask_data, m_mask_of_shape, and m_shapes.
Referenced by IDetector2D::maskAll(), and IDetector2D::removeMasks().
|
inline |
returns true if has masks
Definition at line 56 of file DetectorMask.h.
References SafePointerVector< T >::empty(), and m_shapes.
|
inline |
size_t DetectorMask::numberOfMasks | ( | ) | const |
Definition at line 98 of file DetectorMask.cpp.
References m_shapes, and SafePointerVector< T >::size().
Referenced by SimulationToPython::defineMasks(), and getMaskShape().
const IShape2D * DetectorMask::getMaskShape | ( | size_t | mask_index, |
bool & | mask_value | ||
) | const |
Definition at line 103 of file DetectorMask.cpp.
References m_mask_of_shape, m_shapes, and numberOfMasks().
Referenced by SimulationToPython::defineMasks().
|
private |
Definition at line 111 of file DetectorMask.cpp.
References IShape2D::contains(), SafePointerVector< T >::empty(), OutputData< T >::getAllocatedSize(), OutputData< T >::getAxisBin(), m_mask_data, m_mask_of_shape, m_number_of_masked_channels, m_shapes, OutputData< T >::setAllTo(), and SafePointerVector< T >::size().
Referenced by initMaskData().
|
private |
Definition at line 67 of file DetectorMask.h.
Referenced by addMask(), getMaskShape(), hasMasks(), initMaskData(), numberOfMasks(), operator=(), process_masks(), and removeMasks().
|
private |
Definition at line 68 of file DetectorMask.h.
Referenced by addMask(), getMaskShape(), initMaskData(), operator=(), process_masks(), and removeMasks().
|
private |
Definition at line 69 of file DetectorMask.h.
Referenced by addMask(), createHistogram(), DetectorMask(), getMaskData(), initMaskData(), isMasked(), operator=(), process_masks(), and removeMasks().
|
private |
Definition at line 70 of file DetectorMask.h.
Referenced by addMask(), isMasked(), numberOfMaskedChannels(), operator=(), and process_masks().