IAP GITLAB

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

Merge branch 'track_times_on_obsplane' into 'master'

Add tracking of particle times to observation plane writer

See merge request AirShowerPhysics/corsika!394
parents 99aeece5 a2039030
No related branches found
No related tags found
No related merge requests found
......@@ -51,7 +51,7 @@ namespace corsika {
// add our particles to the output file stream
this->write(particle.getPID(), energy, displacement.dot(xAxis_),
displacement.dot(yAxis_));
displacement.dot(yAxis_), particle.getTime());
CORSIKA_LOG_TRACE("Particle detected absorbed={}", deleteOnHit_);
......
......@@ -31,6 +31,8 @@ namespace corsika {
parquet::ConvertedType::NONE);
output_.addField("y", parquet::Repetition::REQUIRED, parquet::Type::FLOAT,
parquet::ConvertedType::NONE);
output_.addField("t", parquet::Repetition::REQUIRED, parquet::Type::FLOAT,
parquet::ConvertedType::NONE);
// and build the streamer
output_.buildStreamer();
......@@ -43,12 +45,13 @@ namespace corsika {
inline void ObservationPlaneWriterParquet::write(Code const& pid,
HEPEnergyType const& energy,
LengthType const& x,
LengthType const& y) {
LengthType const& y,
TimeType const& t) {
// write the next row - we must write `shower_` first.
*(output_.getWriter()) << shower_ << static_cast<int>(get_PDG(pid))
<< static_cast<float>(energy / 1_GeV)
<< static_cast<float>(x / 1_m) << static_cast<float>(y / 1_m)
<< parquet::EndRow;
<< static_cast<float>(t / 1_ns) << parquet::EndRow;
}
} // namespace corsika
......@@ -50,7 +50,8 @@ namespace corsika {
* Write a particle to the file.
*/
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
......
......@@ -54,7 +54,7 @@ namespace corsika {
protected:
void write(Code const&, units::si::HEPEnergyType const&, units::si::LengthType const&,
units::si::LengthType const&) {}
units::si::LengthType const&, units::si::TimeType const&) {}
};
} // namespace corsika
......
......@@ -26,7 +26,7 @@ struct DummyNoOutput : public NoOutput {
NoOutput::getConfig();
NoOutput::getSummary();
}
void checkWrite() { NoOutput::write(Code::Unknown, 1_eV, 1_m, 1_m); }
void checkWrite() { NoOutput::write(Code::Unknown, 1_eV, 1_m, 1_m, 1_ns); }
};
struct DummyOutput : public BaseOutput {
......
......@@ -22,7 +22,7 @@ struct TestWriterPlane : public ObservationPlaneWriterParquet {
YAML::Node getConfig() const { return YAML::Node(); }
void checkWrite() {
ObservationPlaneWriterParquet::write(Code::Unknown, 1_eV, 2_m, 3_m);
ObservationPlaneWriterParquet::write(Code::Unknown, 1_eV, 2_m, 3_m, 4_ns);
}
};
......
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