Improve plotting

This commit is contained in:
2024-03-31 23:08:19 +02:00
parent 8cad89d649
commit 30e775d8a2
122 changed files with 4640 additions and 1149 deletions

View File

@@ -79,13 +79,14 @@ TEST_CASE("AzimuthalIntegrationProfile","[AzimuthalIntegration]") {
std::vector<float> sum_wr(mapping.GetBinNumber() - 1);
REQUIRE_THROWS(profile.Add(sum_wr, count));
Plot plot = profile.GetPlot();
auto plot = profile.GetPlot();
REQUIRE(plot.size() == 1);
REQUIRE(plot.x.size() == mapping.GetBinNumber());
REQUIRE(plot.y.size() == mapping.GetBinNumber());
REQUIRE(plot[0].x.size() == mapping.GetBinNumber());
REQUIRE(plot[0].y.size() == mapping.GetBinNumber());
for (int i = 0; i < mapping.GetBinNumber(); i++) {
REQUIRE(plot.x[i] == Approx(mapping.GetBinToQ()[i]));
REQUIRE(plot.y[i] == Approx(i * 4));
REQUIRE(plot[0].x[i] == Approx(mapping.GetBinToQ()[i]));
REQUIRE(plot[0].y[i] == Approx(i * 4));
}
}
@@ -110,11 +111,12 @@ TEST_CASE("AzimuthalIntegrationProfile_operatorAdd","[AzimuthalIntegration]") {
auto plot = profile1.GetPlot();
REQUIRE(plot.x.size() == mapping.GetBinNumber());
REQUIRE(plot.y.size() == mapping.GetBinNumber());
REQUIRE(plot.size() == 1);
REQUIRE(plot[0].x.size() == mapping.GetBinNumber());
REQUIRE(plot[0].y.size() == mapping.GetBinNumber());
for (int i = 0; i < mapping.GetBinNumber(); i++) {
REQUIRE(plot.x[i] == Approx(mapping.GetBinToQ()[i]));
REQUIRE(plot.y[i] == Approx(i * 4));
REQUIRE(plot[0].x[i] == Approx(mapping.GetBinToQ()[i]));
REQUIRE(plot[0].y[i] == Approx(i * 4));
}
}