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 !394
parents 99aeece5 a2039030
No related branches found
No related tags found
1 merge request!394Add tracking of particle times to observation plane writer
Pipeline #5542 passed with warnings
...@@ -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
......
...@@ -54,7 +54,7 @@ namespace corsika { ...@@ -54,7 +54,7 @@ namespace corsika {
protected: protected:
void write(Code const&, units::si::HEPEnergyType const&, units::si::LengthType const&, 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 } // namespace corsika
......
...@@ -26,7 +26,7 @@ struct DummyNoOutput : public NoOutput { ...@@ -26,7 +26,7 @@ struct DummyNoOutput : public NoOutput {
NoOutput::getConfig(); NoOutput::getConfig();
NoOutput::getSummary(); 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 { struct DummyOutput : public BaseOutput {
......
...@@ -22,7 +22,7 @@ struct TestWriterPlane : public ObservationPlaneWriterParquet { ...@@ -22,7 +22,7 @@ struct TestWriterPlane : public ObservationPlaneWriterParquet {
YAML::Node getConfig() const { return YAML::Node(); } YAML::Node getConfig() const { return YAML::Node(); }
void checkWrite() { 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