IAP GITLAB

Skip to content
Snippets Groups Projects
Commit c5ba6070 authored by Remy Prechelt's avatar Remy Prechelt
Browse files

Add units to ObservationPlane config.

parent d2e8018b
No related branches found
No related tags found
No related merge requests found
...@@ -6,10 +6,6 @@ ...@@ -6,10 +6,6 @@
* the license. * the license.
*/ */
#include <corsika/modules/ObservationPlane.hpp>
#include <fstream>
namespace corsika { namespace corsika {
template <typename TOutput> template <typename TOutput>
...@@ -43,8 +39,7 @@ namespace corsika { ...@@ -43,8 +39,7 @@ namespace corsika {
auto const displacement = trajectory.getPosition(1) - plane_.getCenter(); auto const displacement = trajectory.getPosition(1) - plane_.getCenter();
// add our particles to the output file stream // add our particles to the output file stream
this->write(particle.getPID(), energy, this->write(particle.getPID(), energy, displacement.dot(xAxis_),
displacement.dot(xAxis_),
displacement.dot(yAxis_)); displacement.dot(yAxis_));
if (deleteOnHit_) { if (deleteOnHit_) {
...@@ -160,6 +155,7 @@ namespace corsika { ...@@ -160,6 +155,7 @@ namespace corsika {
// basic info // basic info
node["type"] = "ObservationPlane"; node["type"] = "ObservationPlane";
node["units"] = "m"; // add default units for values
// the center of the plane // the center of the plane
auto const center{plane_.getCenter()}; auto const center{plane_.getCenter()};
...@@ -169,7 +165,6 @@ namespace corsika { ...@@ -169,7 +165,6 @@ namespace corsika {
node["plane"]["center"].push_back(center_coords.getX() / 1_m); node["plane"]["center"].push_back(center_coords.getX() / 1_m);
node["plane"]["center"].push_back(center_coords.getY() / 1_m); node["plane"]["center"].push_back(center_coords.getY() / 1_m);
node["plane"]["center"].push_back(center_coords.getZ() / 1_m); node["plane"]["center"].push_back(center_coords.getZ() / 1_m);
node["plane"]["center.units"] = "m";
// the normal vector of the plane // the normal vector of the plane
auto const normal{plane_.getNormal().getComponents()}; auto const normal{plane_.getNormal().getComponents()};
......
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