IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 3471b6cd authored by Maximilian Reininghaus's avatar Maximilian Reininghaus :vulcan: Committed by Ralf Ulrich
Browse files

renamed to InteractionLengthModifier

parent a45b4c22
No related branches found
No related tags found
1 merge request!351Adding wrapper process to modify interaction lengths
......@@ -16,22 +16,22 @@
namespace corsika {
template <class TUnderlyingProcess>
inline IntLengthModifyingProcess<TUnderlyingProcess>::IntLengthModifyingProcess(
inline InteractionLengthModifier<TUnderlyingProcess>::InteractionLengthModifier(
TUnderlyingProcess&& process,
std::function<IntLengthModifyingProcess::functor_signature> modifier)
std::function<InteractionLengthModifier::functor_signature> modifier)
: process_{std::move(process)}
, modifier_{std::move(modifier)} {}
template <class TUnderlyingProcess>
template <typename TSecondaryView>
inline void IntLengthModifyingProcess<TUnderlyingProcess>::doInteraction(
inline void InteractionLengthModifier<TUnderlyingProcess>::doInteraction(
TSecondaryView& view) {
process_.doInteraction(view);
}
template <class TUnderlyingProcess>
template <typename TParticle>
inline GrammageType IntLengthModifyingProcess<TUnderlyingProcess>::getInteractionLength(
inline GrammageType InteractionLengthModifier<TUnderlyingProcess>::getInteractionLength(
TParticle const& particle) {
GrammageType const original = process_.getInteractionLength(particle);
Code const pid = particle.getPID();
......@@ -42,12 +42,12 @@ namespace corsika {
template <class TUnderlyingProcess>
inline TUnderlyingProcess const&
IntLengthModifyingProcess<TUnderlyingProcess>::getProcess() const {
InteractionLengthModifier<TUnderlyingProcess>::getProcess() const {
return process_;
}
template <class TUnderlyingProcess>
inline TUnderlyingProcess& IntLengthModifyingProcess<TUnderlyingProcess>::getProcess() {
inline TUnderlyingProcess& InteractionLengthModifier<TUnderlyingProcess>::getProcess() {
return process_;
}
......
......@@ -23,8 +23,8 @@ namespace corsika {
* length returned by the underlying process in a user-defined way. *
*/
template <class TUnderlyingProcess>
class IntLengthModifyingProcess
: public InteractionProcess<IntLengthModifyingProcess<TUnderlyingProcess>> {
class InteractionLengthModifier
: public InteractionProcess<InteractionLengthModifier<TUnderlyingProcess>> {
//! identity function as default modifier
static auto constexpr non_modifying_functor = [](GrammageType original, corsika::Code,
......@@ -39,7 +39,7 @@ namespace corsika {
* Create wrapper around InteractionProcess. Note that the passed process object
* itself may no longer be used, only through this class.
*/
IntLengthModifyingProcess(TUnderlyingProcess&& process,
InteractionLengthModifier(TUnderlyingProcess&& process,
std::function<functor_signature> modifier);
//! wrapper around internal process doInteraction
......@@ -63,4 +63,4 @@ namespace corsika {
} // namespace corsika
#include <corsika/detail/framework/process/IntLengthModifyingProcess.inl>
#include <corsika/detail/framework/process/InteractionLengthModifier.inl>
......@@ -6,7 +6,7 @@
* the license.
*/
#include <corsika/framework/process/IntLengthModifyingProcess.hpp>
#include <corsika/framework/process/InteractionLengthModifier.hpp>
#include <corsika/framework/core/PhysicalUnits.hpp>
#include <catch2/catch.hpp>
......@@ -40,7 +40,7 @@ struct DummyParticle {
Code getPID() const { return Code::MuPlus; }
};
TEST_CASE("IntLengthModifyingProcess", "[process]") {
TEST_CASE("InteractionLengthModifier", "[process]") {
DummyProcess u;
u.id = 38;
......@@ -48,8 +48,8 @@ TEST_CASE("IntLengthModifyingProcess", "[process]") {
return orig * 2;
};
IntLengthModifyingProcess mod{std::move(u), modifier};
REQUIRE(std::is_same_v<decltype(mod), IntLengthModifyingProcess<DummyProcess>>);
InteractionLengthModifier mod{std::move(u), modifier};
REQUIRE(std::is_same_v<decltype(mod), InteractionLengthModifier<DummyProcess>>);
SECTION("getInteractionLength") {
DummyParticle const p;
......
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