Skip to content
Snippets Groups Projects
Commit 47b4a962 authored by Wuttke, Joachim's avatar Wuttke, Joachim
Browse files

transmit intensity in clone fcts; add test

parent 39406bb4
No related branches found
No related tags found
No related merge requests found
Pipeline #89306 failed
This commit is part of merge request !1350. Comments created here will be created in the context of that merge request.
......@@ -54,6 +54,7 @@ AlphaScan::AlphaScan(int nbins, double alpha_i_min, double alpha_i_max)
AlphaScan* AlphaScan::clone() const
{
auto* result = new AlphaScan(*m_axis);
result->setIntensity(intensity());
result->setFootprintFactor(m_footprint.get());
if (m_lambda_distrib)
......
......@@ -56,6 +56,7 @@ QzScan::~QzScan() = default;
QzScan* QzScan::clone() const
{
auto* result = new QzScan(*m_axis);
result->setIntensity(intensity());
if (m_qz_distrib) {
result->m_qz_distrib.reset(m_qz_distrib->clone());
result->m_resol_width = m_resol_width;
......
No preview for this file type
No preview for this file type
......@@ -359,9 +359,10 @@ ISpecularScan* test::makeSimulation::BasicSpecularScan(bool vsQ)
}
std::unique_ptr<SpecularSimulation> test::makeSimulation::BasicSpecular(const MultiLayer& sample,
bool vsQ)
bool vsQ, double intensity)
{
std::unique_ptr<ISpecularScan> scan(BasicSpecularScan(vsQ));
scan->setIntensity(intensity);
auto result = std::make_unique<SpecularSimulation>(*scan, sample);
result->options().setUseAvgMaterials(true);
......
......@@ -57,7 +57,8 @@ std::unique_ptr<ScatteringSimulation> ExtraLongWavelengthGISAS(const MultiLayer&
std::unique_ptr<OffspecSimulation> MiniOffspec(const MultiLayer& sample);
ISpecularScan* BasicSpecularScan(bool vsQ);
std::unique_ptr<SpecularSimulation> BasicSpecular(const MultiLayer& sample, bool vsQ);
std::unique_ptr<SpecularSimulation> BasicSpecular(const MultiLayer& sample, bool vsQ,
double intensity = 1.);
std::unique_ptr<SpecularSimulation> BasicYPolarizedSpecular(const MultiLayer& sample,
const std::string& polCase, bool vsQ);
std::unique_ptr<SpecularSimulation> SpecularWithGaussianBeam(const MultiLayer& sample);
......
......@@ -690,11 +690,12 @@ TEST(TESTNAME, SpecularWithSlicing3)
}
TEST(TESTNAME, InstrumentDefinitionComparison)
// also tests persistent result for the intensity fudge parameter
{
auto* sample = ExemplarySamples::createPlainMultiLayerBySLD();
auto sim = test::makeSimulation::BasicSpecular(*sample, false);
auto sim = test::makeSimulation::BasicSpecular(*sample, false, 1.05);
EXPECT_TRUE(runTest("InstrumentDefinitionComparison_0", *sim, 1e-10));
auto simQ = test::makeSimulation::BasicSpecular(*sample, true);
auto simQ = test::makeSimulation::BasicSpecular(*sample, true, .95);
EXPECT_TRUE(runTest("InstrumentDefinitionComparison_Q", *simQ, 1e-10));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment