From 1cb9ea847ad20d8d84c7afbdb128d3f14fd32237 Mon Sep 17 00:00:00 2001 From: Maximilian Reininghaus <maximilian.reininghaus@tu-dortmund.de> Date: Fri, 9 Oct 2020 21:49:44 +0200 Subject: [PATCH] adapted testInteractionCounter --- .../testInteractionCounter.cc | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/Processes/InteractionCounter/testInteractionCounter.cc b/Processes/InteractionCounter/testInteractionCounter.cc index 08fc95113..af43fe63e 100644 --- a/Processes/InteractionCounter/testInteractionCounter.cc +++ b/Processes/InteractionCounter/testInteractionCounter.cc @@ -126,12 +126,13 @@ TEST_CASE("InteractionCounter") { auto const ret = countedProcess.DoInteraction(*secViewPtr); REQUIRE(ret == nullptr); - auto const& h = countedProcess.GetHistogram().labHists().second.at(1'000'070'140); - REQUIRE(h.at(50) == 1); + auto const& h = countedProcess.GetHistogram().labHist(); + REQUIRE(h.at(h.axis(0).index(1'000'070'140), h.axis(1).index(1.05e14)) == 1); REQUIRE(std::accumulate(h.cbegin(), h.cend(), 0) == 1); - auto const& h2 = countedProcess.GetHistogram().CMSHists().second.at(1'000'070'140); - REQUIRE(h2.at(32) == 1); // bin 1.584 .. 1.995 TeV √s + auto const& h2 = countedProcess.GetHistogram().CMSHist(); + REQUIRE(h2.at(h2.axis(0).index(1'000'070'140), h2.axis(1).index(1.6e12)) == 1); + // REQUIRE(h2.at(1'000'070'140, 92) == 1); // bin 1.584 .. 1.995 TeV √s REQUIRE(std::accumulate(h2.cbegin(), h2.cend(), 0) == 1); } @@ -145,12 +146,12 @@ TEST_CASE("InteractionCounter") { auto const ret = countedProcess.DoInteraction(*secViewPtr); REQUIRE(ret == nullptr); - auto const& h = countedProcess.GetHistogram().labHists().first; - REQUIRE(h.at(codeInt, 50) == 1); + auto const& h = countedProcess.GetHistogram().labHist(); + REQUIRE(h.at(h.axis(0).index(3122), h.axis(1).index(1.05e14)) == 1); REQUIRE(std::accumulate(h.cbegin(), h.cend(), 0) == 1); - auto const& h2 = countedProcess.GetHistogram().CMSHists().first; - REQUIRE(h2.at(codeInt, 32) == 1); // bin 1.584 .. 1.995 TeV √s + auto const& h2 = countedProcess.GetHistogram().CMSHist(); + REQUIRE(h2.at(h2.axis(0).index(3122), h2.axis(1).index(1.6e12)) == 1); REQUIRE(std::accumulate(h2.cbegin(), h2.cend(), 0) == 1); } } -- GitLab