26 : m_qs(std::move(qs_nm))
29 std::vector<double> axis_values =
m_qs->binCenters();
30 if (!std::is_sorted(axis_values.begin(), axis_values.end()))
31 throw std::runtime_error(
"Error in QzScan::checkInitialization: q-vector values shall "
32 "be sorted in ascending order.");
34 if (axis_values.front() < 0)
35 throw std::runtime_error(
"Error in QzScan::checkInitialization: q-vector values are out "
36 "of acceptable range.");
74 std::vector<SpecularElement> result;
75 result.reserve(qz.size());
76 for (
size_t i = 0, size = qz.size(); i < size; ++i)
86 throw std::runtime_error(
"Error in QzScan::footprint: given index exceeds the "
87 "number of simulation elements");
88 return std::vector<double>(n_elements, 1.0);
104 const size_t axis_size =
m_qs->size();
105 std::vector<double> result(axis_size, 0.0);
110 for (
size_t i = 0; i < axis_size; ++i) {
111 double& current = result[i];
112 for (
size_t j = 0, size = samples[i].size(); j < size; ++j) {
113 current += eles[elem_pos].intensity() * samples[i][j].weight;
133 const std::vector<double>& rel_dev)
148 const std::vector<double>& std_dev)
159 std::vector<double> result;
161 for (
size_t i = 0, size_out = samples.size(); i < size_out; ++i)
162 for (
size_t j = 0, size_in = samples[i].size(); j < size_in; ++j)
163 result.push_back(samples[i][j].value);
Defines CoordSystem1D class and derived classes.
Defines class FixedBinAxis.
Defines class PointwiseAxis.
Defines class DetectionProperties.
Defines classes representing ranged one-dimensional distributions.
Defines scan resolution class.
Declares the class SpecularElement.
Abstract base class to support coordinate transforms and axis labels for 1D scans....
Axis with fixed bin size.
Abstract base class for one-dimensional axes.
Interface for one-dimensional ranged distributions. All derived distributions allow for generating sa...
std::unique_ptr< R3 > m_beamPolarization
Bloch vector encoding the beam's polarization.
PolMatrices polMatrices() const
std::unique_ptr< PolFilter > m_polAnalyzer
Axis containing arbitrary (non-equidistant) coordinate values. Lower boundary of the first bin and up...
Detector properties (efficiency, transmission).
Scan type with z-components of scattering vector as coordinate values. Wavelength and incident angles...
void setRelativeQResolution(const IRangedDistribution &distr, double rel_dev)
std::vector< double > createIntensities(const std::vector< SpecularElement > &eles) const override
Returns intensity vector corresponding to convolution of given simulation elements.
QzScan(std::vector< double > qs_nm)
Accepts qz-value vector (in inverse nm)
void setQResolution(const ScanResolution &resolution)
Sets q resolution values via ScanResolution object.
const IAxis * coordinateAxis() const override
Returns coordinate axis assigned to the data holder.
void setAbsoluteQResolution(const IRangedDistribution &distr, double std_dev)
CoordSystem1D * createCoordSystem() const override
std::vector< SpecularElement > generateElements() const override
Generates simulation elements for specular simulations.
const std::unique_ptr< IAxis > m_qs
size_t numberOfElements() const override
Returns the number of simulation elements.
std::unique_ptr< ScanResolution > m_resolution
QzScan * clone() const override
const ScanResolution * resolution() const
std::vector< std::vector< ParameterSample > > applyQResolution() const
std::vector< double > generateQzVector() const
std::vector< double > footprint(size_t i, size_t n_elements) const override
Returns footprint correction factor for a range of simulation elements of size n_elements and startin...
Container for reflectivity resolution data.
static ScanResolution * scanAbsoluteResolution(const IRangedDistribution &distr, double stddev)
ScanResolution * clone() const override=0
static ScanResolution * scanRelativeResolution(const IRangedDistribution &distr, double stddev)
static SpecularElement FromQzScan(double kz, const PolMatrices &polMatrices, bool computable)
Conversion of axis units for the case of q-defined reflectometry.