diff --git a/corsika/detail/stack/history/HistoryObservationPlane.inl b/corsika/detail/stack/history/HistoryObservationPlane.inl index 66b0f11e450e83b422ce4d0f4d6a5340e86ebf9f..6cd65c060190f7bae58771d82465193a34828c2d 100644 --- a/corsika/detail/stack/history/HistoryObservationPlane.inl +++ b/corsika/detail/stack/history/HistoryObservationPlane.inl @@ -13,15 +13,18 @@ namespace corsika::history { - inline HistoryObservationPlane::HistoryObservationPlane(setup::Stack const& stack, - Plane const& obsPlane, - bool deleteOnHit) + template <typename TStack> + inline HistoryObservationPlane<TStack> HistoryObservationPlane(TStack const& stack, + Plane const& obsPlane, + bool deleteOnHit) : stack_{stack} , plane_{obsPlane} , deleteOnHit_{deleteOnHit} {} - inline ProcessReturn HistoryObservationPlane::DoContinuous( - setup::Stack::ParticleType const& particle, setup::Trajectory const& trajectory) { + template <typename TStack> + template <typename TParticle, typename TTrajectory> + inline ProcessReturn HistoryObservationPlane<TStack> DoContinuous( + TParticle const& particle, TTrajectory const& trajectory) { TimeType const timeOfIntersection = (plane_.getCenter() - trajectory.getR0()).dot(plane_.getNormal()) / trajectory.getV0().dot(plane_.getNormal()); @@ -45,8 +48,10 @@ namespace corsika::history { } } - inline LengthType HistoryObservationPlane::MaxStepLength( - setup::Stack::ParticleType const&, setup::Trajectory const& trajectory) { + template <typename TStack> + template <typename TParticle, typename TTrajectory> + inline LengthType HistoryObservationPlane<TStack> MaxStepLength( + TParticle const&, TTrajectory const& trajectory) { TimeType const timeOfIntersection = (plane_.getCenter() - trajectory.getR0()).dot(plane_.getNormal()) / trajectory.getV0().dot(plane_.getNormal()); @@ -59,8 +64,10 @@ namespace corsika::history { return (trajectory.getR0() - pointOfIntersection).norm() * 1.0001; } - inline void HistoryObservationPlane::fillHistoryHistogram( - setup::Stack::ParticleType const& muon) { + template <typename TStack> + template <typename TParticle> + inline void HistoryObservationPlane<TStack> fillHistoryHistogram( + TParticle const& muon) { double const muon_energy = muon.getEnergy() / 1_GeV; int genctr{0}; diff --git a/corsika/stack/history/HistoryObservationPlane.hpp b/corsika/stack/history/HistoryObservationPlane.hpp index 9c97f8722218f24449ef32538be81ea2ac5c1056..11a76dc071703981d08af4cf84dcc48ef5751876 100644 --- a/corsika/stack/history/HistoryObservationPlane.hpp +++ b/corsika/stack/history/HistoryObservationPlane.hpp @@ -10,8 +10,6 @@ #include <corsika/geometry/Plane.h> #include <corsika/process/ContinuousProcess.h> -#include <corsika/setup/SetupStack.h> -#include <corsika/setup/SetupTrajectory.h> #include <corsika/units/PhysicalUnits.h> #include <boost/histogram.hpp> @@ -24,22 +22,26 @@ namespace corsika::history { - class HistoryObservationPlane : public ContinuousProcess<HistoryObservationPlane> { + template <typename TStack> + class HistoryObservationPlane + : public ContinuousProcess<HistoryObservationPlane<TStack>> { public: - HistoryObservationPlane(setup::Stack const&, Plane const&, bool = true); + HistoryObservationPlane(TStack const&, Plane const&, bool = true); - LengthType getMaxStepLength(setup::Stack::particle_type const&, - setup::Trajectory const& vTrajectory); + template <typename TParticle, typename TTrajectory> + LengthType getMaxStepLength(TParticle const&, TTrajectory const& vTrajectory); - ProcessReturn doContinuous(setup::Stack::particle_type const& vParticle, - setup::Trajectory const& vTrajectory); + template <typename TParticle, typename TTrajectory> + ProcessReturn doContinuous(TParticle const& vParticle, + TTrajectory const& vTrajectory); auto const& histogram() const { return histogram_; } private: - void fillHistoryHistogram(setup::Stack::particle_type const&); + template <typename TParticle> + void fillHistoryHistogram(TParticle const&); - setup::Stack const& stack_; + TStack const& stack_; Plane const plane_; bool const deleteOnHit_;