17 SimulationElement::SimulationElement(
double wavelength,
double alpha_i,
double phi_i,
18 std::unique_ptr<IPixel> pixel)
19 : m_wavelength(wavelength), m_alpha_i(alpha_i), m_phi_i(phi_i),
21 m_mean_kf(pixel->getK(0.5, 0.5, m_wavelength)), m_intensity(0.0), mP_pixel(std::move(pixel)),
27 : m_polarization(other.m_polarization), m_wavelength(other.m_wavelength),
28 m_alpha_i(other.m_alpha_i), m_phi_i(other.m_phi_i), m_k_i(other.m_k_i),
29 m_mean_kf(other.m_mean_kf), m_intensity(other.m_intensity), m_is_specular(other.isSpecular())
31 mP_pixel.reset(other.mP_pixel->clone());
35 : m_polarization(other.m_polarization), m_wavelength(other.m_wavelength),
36 m_alpha_i(other.m_alpha_i), m_phi_i(other.m_phi_i), m_k_i(other.m_k_i),
37 m_mean_kf(other.m_mean_kf), m_intensity(other.m_intensity), m_is_specular(other.isSpecular())
39 mP_pixel.reset(other.mP_pixel->createZeroSizePixel(x, y));
40 m_mean_kf = mP_pixel->getK(0.5, 0.5, m_wavelength);
44 : m_polarization(std::move(other.m_polarization)), m_wavelength(other.m_wavelength),
45 m_alpha_i(other.m_alpha_i), m_phi_i(other.m_phi_i), m_k_i(std::move(other.m_k_i)),
46 m_mean_kf(other.m_mean_kf), m_intensity(other.m_intensity),
47 mP_pixel(std::move(other.mP_pixel)), m_is_specular(other.
isSpecular())
51 SimulationElement::~SimulationElement() =
default;
57 tmp.swapContent(*
this);
62 kvector_t SimulationElement::getKi()
const
67 kvector_t SimulationElement::getMeanKf()
const
74 kvector_t SimulationElement::getKf(
double x,
double y)
const
76 return mP_pixel->getK(x, y, m_wavelength);
79 kvector_t SimulationElement::getMeanQ()
const
81 return getKi() - getMeanKf();
88 return getKi() - mP_pixel->getK(x, y, m_wavelength);
93 m_polarization.swapContent(other.m_polarization);
94 std::swap(m_wavelength, other.m_wavelength);
99 std::swap(m_intensity, other.m_intensity);
101 std::swap(m_is_specular, other.m_is_specular);
104 double SimulationElement::getAlpha(
double x,
double y)
const
106 return M_PI_2 - getKf(x, y).
theta();
109 double SimulationElement::getPhi(
double x,
double y)
const
111 return getKf(x, y).
phi();
114 double SimulationElement::getIntegrationFactor(
double x,
double y)
const
116 return mP_pixel->getIntegrationFactor(x, y);
119 double SimulationElement::getSolidAngle()
const
121 return mP_pixel->getSolidAngle();
BasicVector3D< double > vecOfLambdaAlphaPhi(double _lambda, double _alpha, double _phi)
Creates a vector<double> as a wavevector with given wavelength and angles.
void swap(OutputDataIterator< TValue, TContainer > &left, OutputDataIterator< TValue, TContainer > &right)
make Swappable
Defines class SimulationElement.
double theta() const
Returns polar angle.
double phi() const
Returns azimuth angle.
Data stucture containing both input and output of a single detector cell.
kvector_t getQ(double x, double y) const
Returns scattering vector Q, with Kf determined from in-pixel coordinates x,y.
bool isSpecular() const
Tells if simulation element corresponds to a specular peak.