CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
TrackWriterParquet.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 #include <corsika/framework/geometry/QuantityVector.hpp>
16 
17 namespace corsika {
18 
19  class TrackWriterParquet : public BaseOutput {
20 
21  public:
28 
32  void startOfLibrary(boost::filesystem::path const& directory) final override;
33 
37  void startOfShower(unsigned int const showerId) final override;
38 
42  void endOfShower(unsigned int const showerId) final override;
43 
50  void endOfLibrary() final override;
51 
55  void write(Code const pid, HEPEnergyType const KinenergyPre, double const weight,
56  QuantityVector<length_d> const& start, TimeType const t_start,
57  QuantityVector<length_d> const& end, HEPEnergyType const KinenergyPost,
58  TimeType const t_end);
59 
60  private:
61  ParquetStreamer output_;
62  unsigned int showerId_;
63 
64  }; // class TrackWriterParquet
65 
66 } // namespace corsika
67 
68 #include <corsika/detail/modules/writers/TrackWriterParquet.inl>
void startOfShower(unsigned int const showerId) final override
Called at the start of each shower.
Import and extend the phys::units package.
void endOfShower(unsigned int const showerId) final override
Called at the end of each shower.
This class automates the construction of simple tabular Parquet files using the parquet::StreamWriter...
TrackWriterParquet()
Construct a new writer.
void write(Code const pid, HEPEnergyType const KinenergyPre, double const weight, QuantityVector< length_d > const &start, TimeType const t_start, QuantityVector< length_d > const &end, HEPEnergyType const KinenergyPost, TimeType const t_end)
Write a track to the file.
`, since they are used everywhere as integral part of the framework.
This is the base class for all outputs so that they can be stored in homogeneous containers.
Definition: BaseOutput.hpp:21
void endOfLibrary() final override
Called at the end of each library.
Interface to particle properties.
void startOfLibrary(boost::filesystem::path const &directory) final override
Called at the start of each library.