CORSIKA  @c8_version@
The framework to simulate particle cascades for astroparticle physics
LongitudinalProfileWriterParquet.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 #include <array>
17 
18 namespace corsika {
19 
30  template <size_t NColumns>
32 
33  public:
37  LongitudinalProfileWriterParquet(std::array<const char*, NColumns> const& colNames);
38 
42  void startOfLibrary(boost::filesystem::path const& directory) override;
43 
47  void startOfShower(unsigned int const showerId) override;
48 
52  void endOfShower(unsigned int const showerId) override;
53 
60  void endOfLibrary() override;
61 
65  void write(unsigned int const showerId, GrammageType const grammage,
66  std::array<double, NColumns> const& data);
67 
68  private:
69  std::array<const char*, NColumns> columns_;
70  ParquetStreamer output_;
71 
72  }; // namespace corsika
73 
74 } // namespace corsika
75 
76 #include <corsika/detail/modules/writers/LongitudinalProfileWriterParquet.inl>
LongitudinalProfileWriterParquet(std::array< const char *, NColumns > const &colNames)
Construct a new writer.
Import and extend the phys::units package.
void startOfLibrary(boost::filesystem::path const &directory) override
Called at the start of each library.
void write(unsigned int const showerId, GrammageType const grammage, std::array< double, NColumns > const &data)
Add profile to disk.
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 endOfLibrary() override
Called at the end of each library.
This is the base class for all outputs so that they can be stored in homogeneous containers.
Definition: BaseOutput.hpp:21
void endOfShower(unsigned int const showerId) override
Called at the end of each shower.
The actual writer to save longitudinal profile data to disk.
void startOfShower(unsigned int const showerId) override
Called at the start of each shower.
Interface to particle properties.