BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
A flat rectangular detector with axes and resolution function.
Public Types | |
using | const_iterator = const SimulationAreaIterator & |
enum | EDetectorArrangement { GENERIC , PERPENDICULAR_TO_SAMPLE , PERPENDICULAR_TO_DIRECT_BEAM , PERPENDICULAR_TO_REFLECTED_BEAM , PERPENDICULAR_TO_REFLECTED_BEAM_DPOS } |
Public Member Functions | |
RectangularDetector (const RectangularDetector &other) | |
RectangularDetector (size_t nxbins, double width, size_t nybins, double height) | |
Rectangular detector constructor. More... | |
~RectangularDetector () override | |
std::vector< size_t > | active_indices () const |
Returns vector of unmasked detector indices. More... | |
void | addDetAxis (const IAxis &axis) |
void | addMask (const IShape2D &shape, bool mask_value=true) |
Adds mask of given shape to the stack of detector masks. The mask value 'true' means that the channel will be excluded from the simulation. The mask which is added last has priority. More... | |
void | applyDetectorResolution (Datafield *p_intensity_map) const |
Applies the detector resolution to the given intensity maps. More... | |
OwningVector< IAxis > | axesClippedToRegionOfInterest () const |
Returns the axes clipped to the region of interest. If no region of interest is explicitly defined, then the whole detector is taken as "region of interest". More... | |
const IAxis & | axis (size_t index) const |
One axis of the complete detector. Any region of interest is not taken into account. More... | |
size_t | axisBinIndex (size_t index, size_t selected_axis) const |
Calculate axis index for given global index. More... | |
std::string | className () const final |
RectangularDetector * | clone () const override |
Datafield * | createDetectorIntensity (const std::vector< std::unique_ptr< DiffuseElement >> &elements) const |
Returns new intensity map with resolution applied, and cropped to ROI if applicable. More... | |
Coords | defaultCoords () const override |
Returns default axes units. More... | |
size_t | detectorIndexToRegionOfInterestIndex (size_t detectorIndex) const |
const DetectorMask * | detectorMask () const |
const IDetectorResolution * | detectorResolution () const |
Returns a pointer to detector resolution object. More... | |
EDetectorArrangement | getDetectorArrangment () const |
double | getDirectBeamU0 () const |
double | getDirectBeamV0 () const |
R3 | getDirectionVector () const |
double | getDistance () const |
R3 | getNormalVector () const |
double | getU0 () const |
double | getV0 () const |
bool | hasExplicitRegionOfInterest () const |
True if a region of interest is explicitly set. More... | |
double | height () const |
void | iterateOverNonMaskedPoints (std::function< void(const_iterator)> func) const |
Iterate over all non-masked points within "region of interest". If no region of interest is explicitly defined, then the whole detector is taken as "region of interest". More... | |
void | iterateOverRegionOfInterest (std::function< void(const_iterator)> func) const |
Iterate over all points within "region of interest", no matter whether they are masked or not. If no region of interest is explicitly defined, then the whole detector is taken as "region of interest". More... | |
void | maskAll () |
Put the mask for all detector channels (i.e. exclude whole detector from the analysis) More... | |
std::vector< const INode * > | nodeChildren () const override |
size_t | numberOfElements () const |
Returns number of simulation elements. More... | |
ICoordSystem * | offspecCoords (IAxis *beamAxis, const Direction &beamDirection) const override |
size_t | rank () const |
Returns number of defined axes. More... | |
std::pair< double, double > | regionOfInterestBounds (size_t iAxis) const |
The lower and upper bound of the region of interest. If no region of interest is explicitly defined, then the whole detector is taken as "region of interest". More... | |
size_t | regionOfInterestIndexToDetectorIndex (size_t regionOfInterestIndex) const |
Convert an index of the region of interest to an index of the detector. If no region of interest is set, then the index stays unmodified (since ROI == detector area). More... | |
RectangularPixel * | regionOfInterestPixel () const |
void | resetRegionOfInterest () |
Resets region of interest making whole detector plane available for the simulation. More... | |
CoordSystem2D * | scatteringCoords (const Beam &beam) const override |
void | setAnalyzer (R3 direction, double efficiency, double total_transmission) |
Sets the polarization analyzer characteristics of the detector. More... | |
void | setDetectorNormal (const Direction &direction) override |
Inits detector with the beam settings. More... | |
void | setDetectorParameters (size_t n_x, double x_min, double x_max, size_t n_y, double y_min, double y_max) |
Sets equidistant axes. More... | |
void | setDetectorPosition (R3 normal_to_detector, double u0, double v0, R3 direction=R3(0.0, -1.0, 0.0)) |
void | setDetectorResolution (const IDetectorResolution &p_detector_resolution) |
Sets the detector resolution. More... | |
void | setDirectBeamPosition (double u0, double v0) |
void | setPerpendicularToDirectBeam (double distance, double u0, double v0) |
void | setPerpendicularToReflectedBeam (double distance, double u0=0.0, double v0=0.0) |
void | setPerpendicularToSampleX (double distance, double u0, double v0) |
void | setRegionOfInterest (double xlow, double ylow, double xup, double yup) |
Sets rectangular region of interest with lower left and upper right corners defined. More... | |
void | setResolutionFunction (const IResolutionFunction2D &resFunc) |
size_t | sizeOfRegionOfInterest () const |
The size of the "Region of Interest". Same as totalSize() if no region of interest has been explicitly set. More... | |
size_t | totalSize () const |
Returns total number of pixels. Any region of interest is not taken into account. More... | |
double | width () const |
size_t | xSize () const |
size_t | ySize () const |
Protected Member Functions | |
virtual std::pair< double, double > | boundsOfExplicitRegionOfInterest (size_t iAxis) const |
Lower and upper bound of one axis of an explicitly set ROI. Return 0/0 if no ROI has been explicitly set. More... | |
void | clear () |
size_t | getGlobalIndex (size_t x, size_t y) const |
Calculate global index from two axis indices. More... | |
virtual size_t | sizeOfExplicitRegionOfInterest () const |
Return 0 if no ROI has been explicitly set. Size means number of data points. More... | |
|
inherited |
RectangularDetector::RectangularDetector | ( | size_t | nxbins, |
double | width, | ||
size_t | nybins, | ||
double | height | ||
) |
Rectangular detector constructor.
nxbins | Number of bins (pixels) in x-direction |
width | Width of the detector in mm along x-direction |
nybins | Number of bins (pixels) in y-direction |
height | Height of the detector in mm along y-direction |
RectangularDetector::RectangularDetector | ( | const RectangularDetector & | other | ) |
|
override |
|
inherited |
Returns vector of unmasked detector indices.
|
inherited |
|
inherited |
|
inherited |
Applies the detector resolution to the given intensity maps.
|
inherited |
Returns the axes clipped to the region of interest. If no region of interest is explicitly defined, then the whole detector is taken as "region of interest".
|
inherited |
One axis of the complete detector. Any region of interest is not taken into account.
|
inherited |
Calculate axis index for given global index.
|
protectedvirtualinherited |
Lower and upper bound of one axis of an explicitly set ROI. Return 0/0 if no ROI has been explicitly set.
|
final |
|
protectedinherited |
|
overridevirtual |
Implements IDetector.
|
inherited |
Returns new intensity map with resolution applied, and cropped to ROI if applicable.
|
overridevirtual |
Returns default axes units.
Implements IDetector.
|
inherited |
|
inherited |
|
inherited |
Returns a pointer to detector resolution object.
EDetectorArrangement RectangularDetector::getDetectorArrangment | ( | ) | const |
double RectangularDetector::getDirectBeamU0 | ( | ) | const |
double RectangularDetector::getDirectBeamV0 | ( | ) | const |
R3 RectangularDetector::getDirectionVector | ( | ) | const |
double RectangularDetector::getDistance | ( | ) | const |
|
protectedinherited |
Calculate global index from two axis indices.
R3 RectangularDetector::getNormalVector | ( | ) | const |
double RectangularDetector::getU0 | ( | ) | const |
double RectangularDetector::getV0 | ( | ) | const |
|
inherited |
True if a region of interest is explicitly set.
double RectangularDetector::height | ( | ) | const |
|
inherited |
Iterate over all non-masked points within "region of interest". If no region of interest is explicitly defined, then the whole detector is taken as "region of interest".
|
inherited |
Iterate over all points within "region of interest", no matter whether they are masked or not. If no region of interest is explicitly defined, then the whole detector is taken as "region of interest".
|
inherited |
Put the mask for all detector channels (i.e. exclude whole detector from the analysis)
|
overrideinherited |
|
inherited |
Returns number of simulation elements.
|
overridevirtual |
Implements IDetector.
|
inherited |
Returns number of defined axes.
|
inherited |
The lower and upper bound of the region of interest. If no region of interest is explicitly defined, then the whole detector is taken as "region of interest".
|
inherited |
Convert an index of the region of interest to an index of the detector. If no region of interest is set, then the index stays unmodified (since ROI == detector area).
RectangularPixel* RectangularDetector::regionOfInterestPixel | ( | ) | const |
|
inherited |
Resets region of interest making whole detector plane available for the simulation.
|
overridevirtual |
Implements IDetector.
|
inherited |
Sets the polarization analyzer characteristics of the detector.
|
overridevirtual |
Inits detector with the beam settings.
Reimplemented from IDetector.
|
inherited |
Sets equidistant axes.
void RectangularDetector::setDetectorPosition | ( | R3 | normal_to_detector, |
double | u0, | ||
double | v0, | ||
R3 | direction = R3(0.0, -1.0, 0.0) |
||
) |
|
inherited |
Sets the detector resolution.
void RectangularDetector::setDirectBeamPosition | ( | double | u0, |
double | v0 | ||
) |
void RectangularDetector::setPerpendicularToDirectBeam | ( | double | distance, |
double | u0, | ||
double | v0 | ||
) |
void RectangularDetector::setPerpendicularToReflectedBeam | ( | double | distance, |
double | u0 = 0.0 , |
||
double | v0 = 0.0 |
||
) |
void RectangularDetector::setPerpendicularToSampleX | ( | double | distance, |
double | u0, | ||
double | v0 | ||
) |
|
inherited |
Sets rectangular region of interest with lower left and upper right corners defined.
|
inherited |
|
protectedvirtualinherited |
Return 0 if no ROI has been explicitly set. Size means number of data points.
|
inherited |
The size of the "Region of Interest". Same as totalSize() if no region of interest has been explicitly set.
|
inherited |
Returns total number of pixels. Any region of interest is not taken into account.
double RectangularDetector::width | ( | ) | const |
size_t RectangularDetector::xSize | ( | ) | const |
size_t RectangularDetector::ySize | ( | ) | const |