BornAgain
1.19.79
Open-source research software to simulate and fit neutron and x-ray reflectometry and grazing-incidence small-angle scattering
|
Convolutes the intensity in 1 or 2 dimensions with a resolution function.
Limitation: this class assumes that the data points are evenly distributed on each axis
Definition at line 31 of file ConvolutionDetectorResolution.h.
Public Types | |
using | cumulative_DF_1d = double(*)(double) |
Public Member Functions | |
ConvolutionDetectorResolution (const IResolutionFunction2D &p_res_function_2d) | |
Constructor taking a 2 dimensional resolution function as argument. More... | |
ConvolutionDetectorResolution (cumulative_DF_1d res_function_1d) | |
Constructor taking a 1 dimensional resolution function as argument. More... | |
~ConvolutionDetectorResolution () override | |
void | applyDetectorResolution (Datafield *p_intensity_map) const override |
Convolve given intensities with the encapsulated resolution. More... | |
void | checkNodeArgs () const |
Raises exception if a parameter value is invalid. More... | |
std::string | className () const final |
Returns the class name, to be hard-coded in each leaf class that inherits from INode. More... | |
ConvolutionDetectorResolution * | clone () const override |
const IResolutionFunction2D * | getResolutionFunction2D () const |
std::vector< const INode * > | nodeChildren () const override |
Returns all children. More... | |
std::vector< const INode * > | nodeOffspring () const |
Returns all descendants. More... | |
virtual std::vector< ParaMeta > | parDefs () const |
Returns the parameter definitions, to be hard-coded in each leaf class. More... | |
virtual void | transferToCPP () |
Used for Python overriding of clone (see swig/tweaks.py) More... | |
Protected Member Functions | |
ConvolutionDetectorResolution (const ConvolutionDetectorResolution &other) | |
Protected Attributes | |
std::vector< double > | m_P |
Private Member Functions | |
void | apply1dConvolution (Datafield *p_intensity_map) const |
void | apply2dConvolution (Datafield *p_intensity_map) const |
double | getIntegratedPDF1d (double x, double step) const |
double | getIntegratedPDF2d (double x, double step_x, double y, double step_y) const |
void | setResolutionFunction (const IResolutionFunction2D &resFunc) |
Private Attributes | |
size_t | m_rank |
cumulative_DF_1d | m_res_function_1d |
std::unique_ptr< IResolutionFunction2D > | m_res_function_2d |
using ConvolutionDetectorResolution::cumulative_DF_1d = double (*)(double) |
Definition at line 33 of file ConvolutionDetectorResolution.h.
ConvolutionDetectorResolution::ConvolutionDetectorResolution | ( | cumulative_DF_1d | res_function_1d | ) |
Constructor taking a 1 dimensional resolution function as argument.
Definition at line 22 of file ConvolutionDetectorResolution.cpp.
Referenced by clone().
ConvolutionDetectorResolution::ConvolutionDetectorResolution | ( | const IResolutionFunction2D & | p_res_function_2d | ) |
Constructor taking a 2 dimensional resolution function as argument.
Definition at line 28 of file ConvolutionDetectorResolution.cpp.
References setResolutionFunction().
|
overridedefault |
|
protected |
Definition at line 38 of file ConvolutionDetectorResolution.cpp.
References m_rank, m_res_function_1d, m_res_function_2d, and setResolutionFunction().
|
private |
Definition at line 83 of file ConvolutionDetectorResolution.cpp.
References ASSERT, Datafield::axis(), Convolve::fftconvolve(), Datafield::flatVector(), getIntegratedPDF1d(), m_res_function_1d, Datafield::rank(), Datafield::setVector(), and IAxis::size().
Referenced by applyDetectorResolution().
|
private |
Definition at line 116 of file ConvolutionDetectorResolution.cpp.
References ASSERT, Datafield::axis(), Convolve::fftconvolve(), Datafield::flatVector(), Datafield::frame(), getIntegratedPDF2d(), m_res_function_2d, Frame::projectedIndex(), Datafield::rank(), Datafield::size(), and IAxis::size().
Referenced by applyDetectorResolution().
|
overridevirtual |
Convolve given intensities with the encapsulated resolution.
Implements IDetectorResolution.
Definition at line 57 of file ConvolutionDetectorResolution.cpp.
References apply1dConvolution(), apply2dConvolution(), m_rank, and Datafield::rank().
|
inherited |
Raises exception if a parameter value is invalid.
Definition at line 27 of file INode.cpp.
References ASSERT, RealLimits::check(), INode::className(), INF, RealLimits::limited(), RealLimits::limitless(), INode::m_P, ParaMeta::name, RealLimits::nonnegative(), INode::parDefs(), ParaMeta::vMax, and ParaMeta::vMin.
Referenced by BarGauss::BarGauss(), BarLorentz::BarLorentz(), Bipyramid4::Bipyramid4(), Box::Box(), CantellatedCube::CantellatedCube(), Cone::Cone(), ConstantBackground::ConstantBackground(), CosineRippleBox::CosineRippleBox(), CosineRippleGauss::CosineRippleGauss(), CosineRippleLorentz::CosineRippleLorentz(), Cylinder::Cylinder(), DistributionCosine::DistributionCosine(), DistributionGate::DistributionGate(), DistributionGaussian::DistributionGaussian(), DistributionLogNormal::DistributionLogNormal(), DistributionLorentz::DistributionLorentz(), DistributionTrapezoid::DistributionTrapezoid(), Dodecahedron::Dodecahedron(), EllipsoidalCylinder::EllipsoidalCylinder(), FootprintGauss::FootprintGauss(), FootprintSquare::FootprintSquare(), FuzzySphere::FuzzySphere(), GaussSphere::GaussSphere(), HemiEllipsoid::HemiEllipsoid(), HollowSphere::HollowSphere(), HorizontalCylinder::HorizontalCylinder(), Icosahedron::Icosahedron(), LongBoxGauss::LongBoxGauss(), LongBoxLorentz::LongBoxLorentz(), PlatonicOctahedron::PlatonicOctahedron(), PlatonicTetrahedron::PlatonicTetrahedron(), Prism3::Prism3(), Prism6::Prism6(), Profile1DCauchy::Profile1DCauchy(), Profile1DCosine::Profile1DCosine(), Profile1DGate::Profile1DGate(), Profile1DGauss::Profile1DGauss(), Profile1DTriangle::Profile1DTriangle(), Profile1DVoigt::Profile1DVoigt(), Profile2DCauchy::Profile2DCauchy(), Profile2DCone::Profile2DCone(), Profile2DGate::Profile2DGate(), Profile2DGauss::Profile2DGauss(), Profile2DVoigt::Profile2DVoigt(), Pyramid2::Pyramid2(), Pyramid3::Pyramid3(), Pyramid4::Pyramid4(), Pyramid6::Pyramid6(), RotationEuler::RotationEuler(), RotationX::RotationX(), RotationY::RotationY(), RotationZ::RotationZ(), SawtoothRippleBox::SawtoothRippleBox(), SawtoothRippleGauss::SawtoothRippleGauss(), SawtoothRippleLorentz::SawtoothRippleLorentz(), Sphere::Sphere(), Spheroid::Spheroid(), TruncatedCube::TruncatedCube(), TruncatedSphere::TruncatedSphere(), and TruncatedSpheroid::TruncatedSpheroid().
|
inlinefinalvirtual |
Returns the class name, to be hard-coded in each leaf class that inherits from INode.
Implements INode.
Definition at line 44 of file ConvolutionDetectorResolution.h.
|
overridevirtual |
Implements IDetectorResolution.
Definition at line 47 of file ConvolutionDetectorResolution.cpp.
References ConvolutionDetectorResolution().
|
private |
Definition at line 178 of file ConvolutionDetectorResolution.cpp.
References ASSERT, and m_res_function_1d.
Referenced by apply1dConvolution().
|
private |
Definition at line 187 of file ConvolutionDetectorResolution.cpp.
References m_res_function_2d.
Referenced by apply2dConvolution().
|
inline |
Definition at line 68 of file ConvolutionDetectorResolution.h.
References m_res_function_2d.
|
overridevirtual |
Returns all children.
Reimplemented from INode.
Definition at line 52 of file ConvolutionDetectorResolution.cpp.
References m_res_function_2d.
|
inherited |
Returns all descendants.
Definition at line 61 of file INode.cpp.
References INode::nodeChildren().
|
inlinevirtualinherited |
Returns the parameter definitions, to be hard-coded in each leaf class.
Reimplemented in ConstantBackground, GaussSphere, FuzzySphere, RotationEuler, RotationZ, RotationY, RotationX, Crystal, Layer, HexagonalLattice2D, SquareLattice2D, BasicLattice2D, LayerRoughness, TruncatedSpheroid, TruncatedSphere, TruncatedCube, Spheroid, Sphere, SawtoothRippleLorentz, SawtoothRippleGauss, SawtoothRippleBox, Pyramid6, Pyramid4, Pyramid3, Pyramid2, Prism6, Prism3, PlatonicTetrahedron, PlatonicOctahedron, LongBoxLorentz, LongBoxGauss, Icosahedron, HorizontalCylinder, HollowSphere, HemiEllipsoid, EllipsoidalCylinder, Dodecahedron, Cylinder, CosineRippleLorentz, CosineRippleGauss, CosineRippleBox, Cone, CantellatedCube, Box, Bipyramid4, BarLorentz, BarGauss, Profile2DVoigt, Profile2DCone, Profile2DGate, Profile2DGauss, Profile2DCauchy, Profile1DVoigt, Profile1DCosine, Profile1DTriangle, Profile1DGate, Profile1DGauss, Profile1DCauchy, MisesGaussPeakShape, MisesFisherGaussPeakShape, LorentzFisherPeakShape, GaussFisherPeakShape, IsotropicLorentzPeakShape, IsotropicGaussPeakShape, ParticleLayout, InterferenceTwin, InterferenceRadialParaCrystal, InterferenceHardDisk, Interference2DSuperLattice, Interference2DParaCrystal, Interference1DLattice, DistributionTrapezoid, DistributionCosine, DistributionLogNormal, DistributionGaussian, DistributionLorentz, DistributionGate, ResolutionFunction2DGaussian, PolFilter, FootprintSquare, and FootprintGauss.
Definition at line 51 of file INode.h.
Referenced by INode::checkNodeArgs(), and IFormFactor::pythonConstructor().
|
private |
Definition at line 78 of file ConvolutionDetectorResolution.cpp.
References IResolutionFunction2D::clone(), and m_res_function_2d.
Referenced by ConvolutionDetectorResolution().
|
inlinevirtualinherited |
Used for Python overriding of clone (see swig/tweaks.py)
Definition at line 32 of file ICloneable.h.
|
protectedinherited |
Definition at line 63 of file INode.h.
Referenced by IFootprintFactor::IFootprintFactor(), INode::checkNodeArgs(), IProfile1D::pythonConstructor(), IProfile2D::pythonConstructor(), IFormFactor::pythonConstructor(), Profile1DVoigt::pythonConstructor(), and Profile2DVoigt::pythonConstructor().
|
private |
Definition at line 63 of file ConvolutionDetectorResolution.h.
Referenced by ConvolutionDetectorResolution(), and applyDetectorResolution().
|
private |
Definition at line 64 of file ConvolutionDetectorResolution.h.
Referenced by ConvolutionDetectorResolution(), apply1dConvolution(), and getIntegratedPDF1d().
|
private |
Definition at line 65 of file ConvolutionDetectorResolution.h.
Referenced by ConvolutionDetectorResolution(), apply2dConvolution(), getIntegratedPDF2d(), getResolutionFunction2D(), nodeChildren(), and setResolutionFunction().