diff --git a/corsika/detail/modules/ObservationPlane.inl b/corsika/detail/modules/ObservationPlane.inl index 3b04a16dba70277c63f2bacb0ffe9b6cfb1c941f..3f11726d59b20b5d124acac90c2bc54a9111c936 100644 --- a/corsika/detail/modules/ObservationPlane.inl +++ b/corsika/detail/modules/ObservationPlane.inl @@ -151,19 +151,6 @@ namespace corsika { energy_ground_ / 1_GeV, count_ground_); } - // template <typename TOutput> - // YAML::Node ObservationPlane<TOutput>::getFinalResults() const { - - // // construct the top-level node - // YAML::Node node; - - // node["energy_at_ground"] = energy_ground_ / 1 GeV; - // node["count_at_ground"] = count_ground_; - - // return node; - - // } - template <typename TOutput> YAML::Node ObservationPlane<TOutput>::getConfig() const { using namespace units::si; diff --git a/corsika/detail/output/OutputManager.inl b/corsika/detail/output/OutputManager.inl index e839c1daf370838587644d4f37f284d327703901..ead11a08f95408e7a1adc157d8318252720f62a4 100644 --- a/corsika/detail/output/OutputManager.inl +++ b/corsika/detail/output/OutputManager.inl @@ -20,7 +20,6 @@ namespace corsika { - void OutputManager::writeNode(YAML::Node const& node, std::filesystem::path const& path) const { @@ -61,7 +60,6 @@ namespace corsika { // create a quick lambda function to convert a time-instance to a string auto timeToString = [&](auto const time) -> std::string { - // the format for our date string auto format{"%d/%m/%Y %H:%M:%S %Z"}; @@ -220,8 +218,18 @@ namespace corsika { throw std::runtime_error("endOfLibrary() called in invalid state."); } - // forward the endOfLibrary() call to all the registered outputs - for (auto& [name, output] : outputs_) { output.get().endOfLibrary(); } + // write the summary for each output and forward the endOfLibrary call() + for (auto& [name, output] : outputs_) { + + // we get the summary for each output as a YAML node + auto summary{outputs_.at(name).get().getSummary()}; + + // write the summary for this output to the file + writeNode(summary, root_ / name / "summary.yaml"); + + // and forward the end of library call + output.get().endOfLibrary(); + } // and the library has finished state_ = OutputState::LibraryFinished; diff --git a/corsika/output/BaseOutput.hpp b/corsika/output/BaseOutput.hpp index c799653819e51ba67a25979c731dbfafbf87babf..a5ebc483ab2475e2718eab29ec88bc3e8d58be75 100644 --- a/corsika/output/BaseOutput.hpp +++ b/corsika/output/BaseOutput.hpp @@ -52,9 +52,9 @@ namespace corsika { virtual YAML::Node getConfig() const = 0; /** - * Get final text outputs for the config file. + * Get any summary information for the entire library. */ - virtual YAML::Node getFinalOutput() { return YAML::Node(); }; + virtual YAML::Node getSummary() { return YAML::Node(); }; }; } // namespace corsika