Skip to content

Commit

Permalink
fix: RootPlanarClusterWriter truncates output (#1047)
Browse files Browse the repository at this point in the history
The `RootPlanarClusterWriter` uses 32bit integers to write out our barcodes. They are 64bit however, meaning they get truncated to 32bit on write.

This PR makes the writer use 64bit unsigned integers to write out.
  • Loading branch information
paulgessinger committed Oct 22, 2021
1 parent eba829f commit 9eb9714
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,14 +92,13 @@ class RootPlanarClusterWriter
std::vector<float> m_cell_data; ///< local cell position y

// (optional) the truth position
std::vector<float> m_t_gx; ///< truth position global x
std::vector<float> m_t_gy; ///< truth position global y
std::vector<float> m_t_gz; ///< truth position global z
std::vector<float> m_t_gt; ///< truth time t
std::vector<float> m_t_lx; ///< truth position local x
std::vector<float> m_t_ly; ///< truth position local y
std::vector<unsigned long>
m_t_barcode; ///< associated truth particle barcode
std::vector<float> m_t_gx; ///< truth position global x
std::vector<float> m_t_gy; ///< truth position global y
std::vector<float> m_t_gz; ///< truth position global z
std::vector<float> m_t_gt; ///< truth time t
std::vector<float> m_t_lx; ///< truth position local x
std::vector<float> m_t_ly; ///< truth position local y
std::vector<uint64_t> m_t_barcode; ///< associated truth particle barcode
};

} // namespace ActsExamples
2 changes: 1 addition & 1 deletion Examples/Io/Root/src/RootPlanarClusterWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ ActsExamples::RootPlanarClusterWriter::RootPlanarClusterWriter(
m_outputTree->Branch("truth_g_t", &m_t_gt);
m_outputTree->Branch("truth_l_x", &m_t_lx);
m_outputTree->Branch("truth_l_y", &m_t_ly);
m_outputTree->Branch("truth_barcode", &m_t_barcode, "truth_barcode/l");
m_outputTree->Branch("truth_barcode", &m_t_barcode);
}

ActsExamples::RootPlanarClusterWriter::~RootPlanarClusterWriter() {}
Expand Down

0 comments on commit 9eb9714

Please sign in to comment.