IAP GITLAB

Skip to content
Snippets Groups Projects
Commit 3d592fd1 authored by Jean-Marco Alameddine's avatar Jean-Marco Alameddine Committed by Remy Prechelt
Browse files

Add tracking of particle times to observation plane writer

parent 99aeece5
No related branches found
No related tags found
No related merge requests found
...@@ -51,7 +51,7 @@ namespace corsika { ...@@ -51,7 +51,7 @@ namespace corsika {
// add our particles to the output file stream // add our particles to the output file stream
this->write(particle.getPID(), energy, displacement.dot(xAxis_), this->write(particle.getPID(), energy, displacement.dot(xAxis_),
displacement.dot(yAxis_)); displacement.dot(yAxis_), particle.getTime());
CORSIKA_LOG_TRACE("Particle detected absorbed={}", deleteOnHit_); CORSIKA_LOG_TRACE("Particle detected absorbed={}", deleteOnHit_);
......
...@@ -31,6 +31,8 @@ namespace corsika { ...@@ -31,6 +31,8 @@ namespace corsika {
parquet::ConvertedType::NONE); parquet::ConvertedType::NONE);
output_.addField("y", parquet::Repetition::REQUIRED, parquet::Type::FLOAT, output_.addField("y", parquet::Repetition::REQUIRED, parquet::Type::FLOAT,
parquet::ConvertedType::NONE); parquet::ConvertedType::NONE);
output_.addField("t", parquet::Repetition::REQUIRED, parquet::Type::FLOAT,
parquet::ConvertedType::NONE);
// and build the streamer // and build the streamer
output_.buildStreamer(); output_.buildStreamer();
...@@ -43,12 +45,13 @@ namespace corsika { ...@@ -43,12 +45,13 @@ namespace corsika {
inline void ObservationPlaneWriterParquet::write(Code const& pid, inline void ObservationPlaneWriterParquet::write(Code const& pid,
HEPEnergyType const& energy, HEPEnergyType const& energy,
LengthType const& x, LengthType const& x,
LengthType const& y) { LengthType const& y,
TimeType const& t) {
// write the next row - we must write `shower_` first. // write the next row - we must write `shower_` first.
*(output_.getWriter()) << shower_ << static_cast<int>(get_PDG(pid)) *(output_.getWriter()) << shower_ << static_cast<int>(get_PDG(pid))
<< static_cast<float>(energy / 1_GeV) << static_cast<float>(energy / 1_GeV)
<< static_cast<float>(x / 1_m) << static_cast<float>(y / 1_m) << static_cast<float>(x / 1_m) << static_cast<float>(y / 1_m)
<< parquet::EndRow; << static_cast<float>(t / 1_ns) << parquet::EndRow;
} }
} // namespace corsika } // namespace corsika
...@@ -50,7 +50,8 @@ namespace corsika { ...@@ -50,7 +50,8 @@ namespace corsika {
* Write a particle to the file. * Write a particle to the file.
*/ */
void write(Code const& pid, units::si::HEPEnergyType const& energy, void write(Code const& pid, units::si::HEPEnergyType const& energy,
units::si::LengthType const& x, units::si::LengthType const& y); units::si::LengthType const& x, units::si::LengthType const& y,
units::si::TimeType const& t);
}; // class ObservationPlaneWriterParquet }; // class ObservationPlaneWriterParquet
......
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