IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 2dbbff20 authored by Remy Prechelt's avatar Remy Prechelt Committed by ralfulrich
Browse files

Remove Setup from HistoryObservationPlane.

parent 62331c1a
No related branches found
No related tags found
2 merge requests!365Ci improve,!356Remove Setup and setup:: from framework
......@@ -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};
......
......@@ -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_;
......
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