IAP GITLAB

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

Add GetOutput() method to base interface.

parent bbe4d337
No related branches found
No related tags found
1 merge request!317Output infrastructure and Python analysis library.
...@@ -52,6 +52,11 @@ namespace corsika::output { ...@@ -52,6 +52,11 @@ namespace corsika::output {
* Get the configuration of this output. * Get the configuration of this output.
*/ */
virtual YAML::Node GetConfig() const = 0; virtual YAML::Node GetConfig() const = 0;
/**
* Get final text outputs for the config file.
*/
virtual YAML::Node GetOutput() = 0;
}; };
} // namespace corsika::output } // namespace corsika::output
...@@ -52,20 +52,22 @@ namespace corsika::output { ...@@ -52,20 +52,22 @@ namespace corsika::output {
/** /**
* Called at the start of each event/shower. * Called at the start of each event/shower.
*/ */
void StartOfEvent() final { ++event_; void StartOfEvent() final { ++event_; }
}
/** /**
* Called at the end of each event/shower. * Called at the end of each event/shower.
*/ */
void EndOfEvent() final { void EndOfEvent() final {}
}
/** /**
* Called at the end of each run. * Called at the end of each run.
*/ */
void EndOfRun() final { streamer_.Close(); void EndOfRun() final { streamer_.Close(); }
}
/**
* Get final text outputs for the config file.
*/
YAML::Node GetOutput() final { return YAML::Node(); }
protected: protected:
/** /**
...@@ -79,10 +81,8 @@ namespace corsika::output { ...@@ -79,10 +81,8 @@ namespace corsika::output {
// write the next row // write the next row
writer_ << event_ << static_cast<int>(particles::GetPDG(pid)) << energy / 1_eV writer_ << event_ << static_cast<int>(particles::GetPDG(pid)) << energy / 1_eV
<< distance / 1_m << parquet::EndRow; << distance / 1_m << parquet::EndRow;
} }
std::string const name_; ///< The name of this output. std::string const name_; ///< The name of this output.
private: private:
......
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