BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
RectangularDetector Class Reference

A flat rectangular detector with axes and resolution function. More...

+ Inheritance diagram for RectangularDetector:

Public Types

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...
 
void accept (INodeVisitor *visitor) const final
 
RectangularDetector * clone () const override
 
Axes::Units defaultAxesUnits () const override
 return default axes units
 
EDetectorArrangement getDetectorArrangment () const
 
double getDirectBeamU0 () const
 
double getDirectBeamV0 () const
 
kvector_t getDirectionVector () const
 
double getDistance () const
 
double getHeight () const
 
size_t getNbinsX () const
 
size_t getNbinsY () const
 
kvector_t getNormalVector () const
 
double getU0 () const
 
double getV0 () const
 
double getWidth () const
 
void init (const Beam &beam) override
 
RectangularPixel * regionOfInterestPixel () const
 
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 setPosition (const kvector_t normal_to_detector, double u0, double v0, const kvector_t direction=kvector_t(0.0, -1.0, 0.0))
 

Protected Member Functions

std::string axisName (size_t index) const override
 Returns the name for the axis with given index.
 
IPixel * createPixel (size_t index) const override
 Creates an IPixel for the given OutputData object and index.
 
size_t indexOfSpecular (const Beam &beam) const override
 Returns index of pixel that contains the specular wavevector. More...
 
void swapContent (RectangularDetector &other)
 swap function
 

Detailed Description

A flat rectangular detector with axes and resolution function.

Constructor & Destructor Documentation

◆ RectangularDetector()

RectangularDetector::RectangularDetector ( size_t  nxbins,
double  width,
size_t  nybins,
double  height 
)

Rectangular detector constructor.

Parameters
nxbinsNumber of bins (pixels) in x-direction
widthWidth of the detector in mm along x-direction
nybinsNumber of bins (pixels) in y-direction
heightHeight of the detector in mm along y-direction

Member Function Documentation

◆ indexOfSpecular()

size_t RectangularDetector::indexOfSpecular ( const Beam &  beam) const
overrideprotected

Returns index of pixel that contains the specular wavevector.

If no pixel contains this specular wavevector, the number of pixels is returned. This corresponds to an overflow index.