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

BROKEN

parent 981db81b
No related branches found
No related tags found
1 merge request!1454rm Beam from Dp|Offsp-Sim
...@@ -58,6 +58,7 @@ AlphaScan* AlphaScan::clone() const ...@@ -58,6 +58,7 @@ AlphaScan* AlphaScan::clone() const
auto* result = new AlphaScan(*m_axis); auto* result = new AlphaScan(*m_axis);
result->setIntensity(intensity()); result->setIntensity(intensity());
result->setFootprint(m_footprint.get()); result->setFootprint(m_footprint.get());
result->setAlphaOffset(alphaOffset());
if (m_lambda_distrib) if (m_lambda_distrib)
result->m_lambda_distrib.reset(m_lambda_distrib->clone()); result->m_lambda_distrib.reset(m_lambda_distrib->clone());
......
...@@ -56,6 +56,8 @@ public: ...@@ -56,6 +56,8 @@ public:
return m_alpha_distrib.get(); return m_alpha_distrib.get();
} }
double alphaOffset() const { return m_alpha_offset; }
private: private:
void checkInitialization(); void checkInitialization();
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "Resample/Element/DepthprobeElement.h" #include "Resample/Element/DepthprobeElement.h"
#include "Sim/Computation/DepthprobeComputation.h" #include "Sim/Computation/DepthprobeComputation.h"
#include "Sim/Scan/AlphaScan.h" #include "Sim/Scan/AlphaScan.h"
#include <iostream>
DepthprobeSimulation::DepthprobeSimulation(const IBeamScan& scan, const MultiLayer& sample) DepthprobeSimulation::DepthprobeSimulation(const IBeamScan& scan, const MultiLayer& sample)
: ISimulation(sample) : ISimulation(sample)
...@@ -69,9 +70,15 @@ void DepthprobeSimulation::initDistributionHandler() ...@@ -69,9 +70,15 @@ void DepthprobeSimulation::initDistributionHandler()
switch (distribution.whichParameter()) { switch (distribution.whichParameter()) {
case ParameterDistribution::BeamInclinationAngle: case ParameterDistribution::BeamInclinationAngle:
{
auto* s = dynamic_cast<AlphaScan*>(m_scan.get());
if (!s)
throw std::runtime_error("Alpha distribution not compatible with non-alpha scan");
distributionHandler().defineCallbackForDistribution( distributionHandler().defineCallbackForDistribution(
&distribution, [&](double d) { m_beam->setInclination(d); }); &distribution, [&](double d) { m_beam->setInclination(d);s->setAlphaOffset(d);
ASSERT( s->alphaOffset() == m_beam->alpha_i());});
break; break;
}
case ParameterDistribution::BeamWavelength: case ParameterDistribution::BeamWavelength:
distributionHandler().defineCallbackForDistribution( distributionHandler().defineCallbackForDistribution(
&distribution, [&](double d) { m_scan->setWavelength(d); }); &distribution, [&](double d) { m_scan->setWavelength(d); });
...@@ -84,7 +91,12 @@ void DepthprobeSimulation::initDistributionHandler() ...@@ -84,7 +91,12 @@ void DepthprobeSimulation::initDistributionHandler()
void DepthprobeSimulation::runComputation(const ReSample& re_sample, size_t i, double weight) void DepthprobeSimulation::runComputation(const ReSample& re_sample, size_t i, double weight)
{ {
const double result_angle = m_alpha_axis->bin(i).center() + m_beam->alpha_i(); const auto* s = dynamic_cast<AlphaScan*>(m_scan.get());
if (!s)
throw std::runtime_error("Alpha distribution not compatible with non-alpha scan");
std::cout << s->alphaOffset() << " vs " << m_beam->alpha_i() << std::endl;
ASSERT( s->alphaOffset() == m_beam->alpha_i());
const double result_angle = m_alpha_axis->bin(i).center() + s->alphaOffset();
DepthprobeElement ele(m_scan->wavelength(), -result_angle, m_z_axis.get(), DepthprobeElement ele(m_scan->wavelength(), -result_angle, m_z_axis.get(),
0 < result_angle && result_angle < M_PI_2); 0 < result_angle && result_angle < M_PI_2);
......
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