diff --git a/Framework/ProcessSequence/ProcessSequence.h b/Framework/ProcessSequence/ProcessSequence.h index adffdd9ebfe443cbcc590c472b18c2ed1f4ecdcd..ddbf5e9bc3634f68195558cf8ecb609cb6e2ddf4 100644 --- a/Framework/ProcessSequence/ProcessSequence.h +++ b/Framework/ProcessSequence/ProcessSequence.h @@ -50,8 +50,13 @@ namespace corsika::process { static bool constexpr t1ProcSeq = is_process_sequence_v<TProcess1type>; static bool constexpr t2ProcSeq = is_process_sequence_v<TProcess2type>; - static bool constexpr t1SwitchProcSeq = is_switch_process_sequence_v<TProcess1type>; - static bool constexpr t2SwitchProcSeq = is_switch_process_sequence_v<TProcess2type>; + // make sure only BaseProcess types TProcess1/2 are passed + static_assert(std::is_base_of_v<BaseProcess<TProcess11ype>, TProcess11ype>, + "can only use process derived from BaseProcess in " + "ProcessSequence, for Process 1"); + static_assert(std::is_base_of_v<BaseProcess<TProcess2type>, TProcess2type>, + "can only use process derived from BaseProcess in " + "ProcessSequence, for Process 2"); TProcess1 A_; // this is a reference, if possible TProcess2 B_; // this is a reference, if possible diff --git a/Processes/InteractionCounter/InteractionCounter.hpp b/Processes/InteractionCounter/InteractionCounter.hpp index 83bc130011b1f77e8101143af4cdb2684e46b18b..c565eb6a106f13877b96511b7de7918cd16e4d8d 100644 --- a/Processes/InteractionCounter/InteractionCounter.hpp +++ b/Processes/InteractionCounter/InteractionCounter.hpp @@ -56,7 +56,7 @@ namespace corsika::process::interaction_counter { return process_.GetInteractionLength(particle); } - auto const& GetHistogram() const { return histogram_; } + InteractionHistogram const& GetHistogram() const { return histogram_; } }; } // namespace corsika::process::interaction_counter diff --git a/Processes/InteractionCounter/testInteractionCounter.cc b/Processes/InteractionCounter/testInteractionCounter.cc index 762c615cda24a6be108c0bb186539daa17c3515f..95b8925cc9ca4fce1160b188568b59cc8f559e09 100644 --- a/Processes/InteractionCounter/testInteractionCounter.cc +++ b/Processes/InteractionCounter/testInteractionCounter.cc @@ -71,11 +71,15 @@ TEST_CASE("InteractionCounter") { 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); + + countedProcess.GetHistogram().saveLab("testInteractionCounter_file1.npz"); + countedProcess.GetHistogram().saveCMS("testInteractionCounter_file2.npz"); } + SECTION("check saving") {} + SECTION("DoInteraction Lambda") { auto constexpr code = particles::Code::Lambda0; - auto constexpr codeInt = static_cast<particles::CodeIntType>(code); auto [stackPtr, secViewPtr] = setup::testing::setupStack(code, 0, 0, 105_TeV, nodePtr, *csPtr); REQUIRE(stackPtr->getEntries() == 1);