1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73
|
// ************************************************************************************************
//
// BornAgain: simulate and fit reflection and scattering
//
//! @file Sim/Scan/QzScan.h
//! @brief Declares class QzScan.
//!
//! @homepage http://www.bornagainproject.org
//! @license GNU General Public License v3 or higher (see COPYING)
//! @copyright Forschungszentrum Jülich GmbH 2018
//! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
//
// ************************************************************************************************
#ifndef BORNAGAIN_SIM_SCAN_QZSCAN_H
#define BORNAGAIN_SIM_SCAN_QZSCAN_H
#include "Sim/Scan/BeamScan.h"
#include <memory>
class IDistribution1D;
//! Scan type with z-components of scattering vector as coordinate values.
//! Wavelength and incident angles are not accessible separately.
class QzScan : public BeamScan {
public:
//! Accepts qz-value vector (in inverse nm)
QzScan(std::vector<double> qs_nm);
QzScan(const Scale& qs_nm);
//! Sets q-defined specular scan. Accepts either numpy array of q-values sorted in ascending
//! order or an Scale object with q-values. Alternatively an axis can be defined in-place, then
//! the first passed parameter is the number of bins, second - minimum on-axis q-value,
//! third - maximum on-axis q_value.
QzScan(int nbins, double qz_min, double qz_max);
~QzScan() override;
std::string className() const final { return "QzScan"; }
void setRelativeQResolution(const IDistribution1D& distr, double rel_dev);
void setAbsoluteQResolution(const IDistribution1D& distr, double std_dev);
//! Sets qz resolution function and list of standard deviations.
void setVectorResolution(const IDistribution1D& distr, const std::vector<double>& std_devs);
void setOffset(double offset) { m_offset = offset; }
#ifndef SWIG
QzScan* clone() const override;
std::vector<const INode*> nodeChildren() const override;
const IDistribution1D* qzDistribution() const { return m_qz_distrib.get(); }
//! Generates simulation elements for specular simulations
std::vector<ScanElement> generateElements() const override;
size_t nDistributionSamples() const override;
bool resolution_is_relative() const { return m_relative_resolution; }
const std::vector<double>& resolution_widths() const { return m_resol_width_factor; }
private:
std::unique_ptr<const IDistribution1D> m_qz_distrib;
std::vector<double> m_resol_width_factor;
bool m_relative_resolution{false};
double m_offset = 0.;
#endif // SWIG
};
#endif // BORNAGAIN_SIM_SCAN_QZSCAN_H
|