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