Skip to content
Snippets Groups Projects
Commit 21ead1a1 authored by Beerwerth, Randolf's avatar Beerwerth, Randolf
Browse files

update SpecularSimulationTest

parent 83715415
No related branches found
No related tags found
No related merge requests found
...@@ -132,7 +132,7 @@ TEST_F(SpecularSimulationTest, SetAngularScan) ...@@ -132,7 +132,7 @@ TEST_F(SpecularSimulationTest, SetAngularScan)
SpecularSimulation sim4; SpecularSimulation sim4;
AngularSpecScan scan4(1.0, 10, .0 * Units::deg, 2.0 * Units::deg); AngularSpecScan scan4(1.0, 10, .0 * Units::deg, 2.0 * Units::deg);
const auto polarization = kvector_t({0., 0., 1.}); const auto polarization = kvector_t({0., 0., 0.876});
const auto analyzer = kvector_t({0., 0., 1.}); const auto analyzer = kvector_t({0., 0., 1.});
sim4.beam().setPolarization(polarization); sim4.beam().setPolarization(polarization);
sim4.detector().setAnalyzerProperties(analyzer, 0.33, 0.22); sim4.detector().setAnalyzerProperties(analyzer, 0.33, 0.22);
...@@ -149,9 +149,8 @@ TEST_F(SpecularSimulationTest, SetAngularScan) ...@@ -149,9 +149,8 @@ TEST_F(SpecularSimulationTest, SetAngularScan)
EXPECT_EQ(sim4.beam().getBlochVector(), polarization); EXPECT_EQ(sim4.beam().getBlochVector(), polarization);
EXPECT_EQ(sim4.detector().detectionProperties().analyzerDirection(), analyzer); EXPECT_EQ(sim4.detector().detectionProperties().analyzerDirection(), analyzer);
EXPECT_EQ(sim4.detector().detectionProperties().analyzerEfficiency(), 0.33);
sim3.setInstrument(Instrument()); EXPECT_EQ(sim4.detector().detectionProperties().analyzerTotalTransmission(), 0.22);
checkBeamState(sim3);
} }
TEST_F(SpecularSimulationTest, SetQScan) TEST_F(SpecularSimulationTest, SetQScan)
...@@ -219,6 +218,11 @@ TEST_F(SpecularSimulationTest, SimulationClone) ...@@ -219,6 +218,11 @@ TEST_F(SpecularSimulationTest, SimulationClone)
{ {
auto sim = defaultSimulation(); auto sim = defaultSimulation();
const auto polarization = kvector_t({0., 0., 0.876});
const auto analyzer = kvector_t({0., 0., 1.});
sim->beam().setPolarization(polarization);
sim->detector().setAnalyzerProperties(analyzer, 0.33, 0.22);
std::unique_ptr<SpecularSimulation> clone(sim->clone()); std::unique_ptr<SpecularSimulation> clone(sim->clone());
EXPECT_EQ(3u, clone->sample()->numberOfLayers()); EXPECT_EQ(3u, clone->sample()->numberOfLayers());
...@@ -227,6 +231,13 @@ TEST_F(SpecularSimulationTest, SimulationClone) ...@@ -227,6 +231,13 @@ TEST_F(SpecularSimulationTest, SimulationClone)
auto data = clone_result.data(); auto data = clone_result.data();
EXPECT_EQ(data->getAllocatedSize(), 10u); EXPECT_EQ(data->getAllocatedSize(), 10u);
EXPECT_EQ(data->totalSum(), 0.0); EXPECT_EQ(data->totalSum(), 0.0);
EXPECT_EQ(0.0 * Units::deg, clone->coordinateAxis()->lowerBound());
EXPECT_EQ(2.0 * Units::deg, clone->coordinateAxis()->upperBound());
EXPECT_EQ(clone->beam().getBlochVector(), polarization);
EXPECT_EQ(clone->detector().detectionProperties().analyzerDirection(), analyzer);
EXPECT_EQ(clone->detector().detectionProperties().analyzerEfficiency(), 0.33);
EXPECT_EQ(clone->detector().detectionProperties().analyzerTotalTransmission(), 0.22);
checkBeamState(*clone); checkBeamState(*clone);
......
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