CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
ParticleWriterParquet.hpp
1 /*
2  * (c) Copyright 2021 CORSIKA Project, corsika-project@lists.kit.edu
3  *
4  * This software is distributed under the terms of the GNU General Public
5  * Licence version 3 (GPL Version 3). See file LICENSE for a full version of
6  * the license.
7  */
8 
9 #pragma once
10 
11 #include <corsika/output/BaseOutput.hpp>
12 #include <corsika/output/ParquetStreamer.hpp>
15 
16 namespace corsika {
17 
19 
20  public:
25 
29  void startOfLibrary(boost::filesystem::path const& directory) final override;
30 
34  void startOfShower(unsigned int const showerId) final override;
35 
39  void endOfShower(unsigned int const showerId) final override;
40 
47  void endOfLibrary() final override;
48 
52  void write(Code const pid, units::si::HEPEnergyType const energy,
54  units::si::LengthType const z, units::si::TimeType const time,
55  const double weight);
56 
60  YAML::Node getSummary() const final override;
61 
65  HEPEnergyType getEnergyGround() const { return totalEnergy_; }
66 
67  private:
68  ParquetStreamer output_;
69  unsigned int showerId_;
70 
71  double countHadrons_ = 0;
72  double countMuons_ = 0;
73  double countEM_ = 0;
74  double countOthers_ = 0;
75 
76  HEPEnergyType totalEnergy_;
77 
78  }; // class ParticleWriterParquet
79 
80 } // namespace corsika
81 
82 #include <corsika/detail/modules/writers/ParticleWriterParquet.inl>
void endOfLibrary() final override
Called at the end of each library.
Import and extend the phys::units package.
void startOfLibrary(boost::filesystem::path const &directory) final override
Called at the start of each library.
void startOfShower(unsigned int const showerId) final override
Called at the beginning of each shower.
HEPEnergyType getEnergyGround() const
If plane is absorbing particles: return the total energy absorbed.
YAML::Node getSummary() const final override
Return collected library-level summary for output.
void write(Code const pid, units::si::HEPEnergyType const energy, units::si::LengthType const x, units::si::LengthType const y, units::si::LengthType const z, units::si::TimeType const time, const double weight)
Write a PDG/corsika::Code particle to the file.
This class automates the construction of simple tabular Parquet files using the parquet::StreamWriter...
`, since they are used everywhere as integral part of the framework.
void endOfShower(unsigned int const showerId) final override
Called at the end of each shower.
This is the base class for all outputs so that they can be stored in homogeneous containers.
Definition: BaseOutput.hpp:21
Interface to particle properties.
ParticleWriterParquet()
Construct an ObservationPlane.