From b4d74c695bb8f6a46f2795816563714e493bc664 Mon Sep 17 00:00:00 2001
From: Fan <fan_hu@pku.edu.cn>
Date: Sun, 28 Nov 2021 12:54:47 +0800
Subject: [PATCH] fix compile errors

---
 corsika/detail/modules/ObservationCubic.inl   | 35 ++++++++++---------
 corsika/modules/ObservationCubic.hpp          |  4 +--
 .../writers/ObservationCubicWriterParquet.hpp |  2 +-
 3 files changed, 21 insertions(+), 20 deletions(-)

diff --git a/corsika/detail/modules/ObservationCubic.inl b/corsika/detail/modules/ObservationCubic.inl
index 668150624..6e7428db2 100644
--- a/corsika/detail/modules/ObservationCubic.inl
+++ b/corsika/detail/modules/ObservationCubic.inl
@@ -10,10 +10,10 @@ namespace corsika {
 
 template <typename TTracking, typename TOutput>
 ObservationCubic<TTracking, TOutput>::ObservationCubic(
-    Point const &center, LengthType const x, LengthType const y,
-    LengthType const z, bool deleteOnHit)
-    : Cubic(center, x, y, z), deleteOnHit_(deleteOnHit),
-      energy_(0_GeV), count_(0) {}
+    Point const &center, CoordinateSystemPtr cs, LengthType const x,
+    LengthType const y, LengthType const z, bool deleteOnHit)
+    : Cubic(center, cs, x, y, z), deleteOnHit_(deleteOnHit), energy_(0_GeV),
+      count_(0) {}
 
 template <typename TTracking, typename TOutput>
 template <typename TParticle, typename TTrajectory>
@@ -47,7 +47,7 @@ inline ProcessReturn ObservationCubic<TTracking, TOutput>::doContinuous(
 
   // add our particles to the output file stream
   this->write(particle.getPID(), energy, pointOfIntersection.getX(cs_),
-              pointOfIntersection.getY(cs_), pointOfIntersection.getZ(cs_), 
+              pointOfIntersection.getY(cs_), pointOfIntersection.getZ(cs_),
               dirction.getX(cs_), dirction.getY(cs_), dirction.getZ(cs_),
               particle.getTime());
 
@@ -71,7 +71,8 @@ inline LengthType ObservationCubic<TTracking, TOutput>::getMaxStepLength(
                     particle.asString(), particle.getPosition(),
                     particle.getDirection(), cubic_.asString());
 
-  auto const intersection = TTracking::intersect(particle, *this);
+  auto const intersection =
+      TTracking::intersect(particle, static_cast<Cubic const>(*this));
 
   TimeType const timeOfIntersection = intersection.getEntry();
   CORSIKA_LOG_TRACE("timeOfIntersection={}", timeOfIntersection);
@@ -118,21 +119,21 @@ inline YAML::Node ObservationCubic<TTracking, TOutput>::getConfig() const {
 
   // the x-axis vector
   DirectionVector const x_axis = DirectionVector{cs_, {1, 0, 0}};
-  node["x-axis"].push_back(x_axis.getX(root_cs));
-  node["x-axis"].push_back(x_axis.getY(root_cs));
-  node["x-axis"].push_back(x_axis.getZ(root_cs));
+  node["x-axis"].push_back(x_axis.getX(root_cs).magnitude());
+  node["x-axis"].push_back(x_axis.getY(root_cs).magnitude());
+  node["x-axis"].push_back(x_axis.getZ(root_cs).magnitude());
 
   // the y-axis vector
   DirectionVector const y_axis = DirectionVector{cs_, {0, 1, 0}};
-  node["y-axis"].push_back(y_axis.getX(root_cs));
-  node["y-axis"].push_back(y_axis.getY(root_cs));
-  node["y-axis"].push_back(y_axis.getZ(root_cs));
+  node["y-axis"].push_back(y_axis.getX(root_cs).magnitude());
+  node["y-axis"].push_back(y_axis.getY(root_cs).magnitude());
+  node["y-axis"].push_back(y_axis.getZ(root_cs).magnitude());
 
   // the x-axis vector
   DirectionVector const z_axis = DirectionVector{cs_, {0, 0, 1}};
-  node["z-axis"].push_back(z_axis.getX(root_cs));
-  node["z-axis"].push_back(z_axis.getY(root_cs));
-  node["z-axis"].push_back(z_axis.getZ(root_cs));
+  node["z-axis"].push_back(z_axis.getX(root_cs).magnitude());
+  node["z-axis"].push_back(z_axis.getY(root_cs).magnitude());
+  node["z-axis"].push_back(z_axis.getZ(root_cs).magnitude());
 
   node["delete_on_hit"] = deleteOnHit_;
 
@@ -141,8 +142,8 @@ inline YAML::Node ObservationCubic<TTracking, TOutput>::getConfig() const {
 
 template <typename TTracking, typename TOutput>
 inline void ObservationCubic<TTracking, TOutput>::reset() {
-  energy_= 0_GeV;
-  count_= 0;
+  energy_ = 0_GeV;
+  count_ = 0;
 }
 
 } // namespace corsika
diff --git a/corsika/modules/ObservationCubic.hpp b/corsika/modules/ObservationCubic.hpp
index 6095a0fd1..f38d23d67 100644
--- a/corsika/modules/ObservationCubic.hpp
+++ b/corsika/modules/ObservationCubic.hpp
@@ -30,7 +30,7 @@ namespace corsika {
         public TOutputWriter {
 
   public:
-    ObservationCubic(Point const& center, 
+    ObservationCubic(Point const& center, CoordinateSystemPtr cs,
     LengthType const x, LengthType const y, LengthType const z, bool = true);
 
     template <typename TParticle, typename TTrajectory>
@@ -56,4 +56,4 @@ namespace corsika {
 
 
 
-#include <corsika/details/modules/ObservationCubic.inl>
\ No newline at end of file
+#include <corsika/detail/modules/ObservationCubic.inl>
\ No newline at end of file
diff --git a/corsika/modules/writers/ObservationCubicWriterParquet.hpp b/corsika/modules/writers/ObservationCubicWriterParquet.hpp
index 86514abff..449cb3803 100644
--- a/corsika/modules/writers/ObservationCubicWriterParquet.hpp
+++ b/corsika/modules/writers/ObservationCubicWriterParquet.hpp
@@ -58,4 +58,4 @@ namespace corsika {
 
 } // namespace corsika
 
-#include <corsika/details/modules/writers/ObservationCubicWriterParquet.inl>
+#include <corsika/detail/modules/writers/ObservationCubicWriterParquet.inl>
-- 
GitLab