Skip to content

Commit

Permalink
feat: Add path length branch to RootTrajectoryStatesWriter (#932)
Browse files Browse the repository at this point in the history
This adds the path length branch to RootTrajectoryStatesWriter.

Motivation is to calculate the theoretical transverse momentum resolution, which requires the path length of the reconstructed tracks
  • Loading branch information
beomki-yeo committed Aug 11, 2021
1 parent af0ab90 commit e98107c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,7 @@ class RootTrajectoryStatesWriter final : public WriterT<TrajectoriesContainer> {
std::vector<int> m_volumeID; ///< volume identifier
std::vector<int> m_layerID; ///< layer identifier
std::vector<int> m_moduleID; ///< surface identifier
std::vector<float> m_pathLength; ///< path length
std::vector<float> m_lx_hit; ///< uncalibrated measurement local x
std::vector<float> m_ly_hit; ///< uncalibrated measurement local y
std::vector<float> m_x_hit; ///< uncalibrated measurement global x
Expand Down
5 changes: 5 additions & 0 deletions Examples/Io/Root/src/RootTrajectoryStatesWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ ActsExamples::RootTrajectoryStatesWriter::RootTrajectoryStatesWriter(
m_outputTree->Branch("volume_id", &m_volumeID);
m_outputTree->Branch("layer_id", &m_layerID);
m_outputTree->Branch("module_id", &m_moduleID);
m_outputTree->Branch("pathLength", &m_pathLength);
m_outputTree->Branch("l_x_hit", &m_lx_hit);
m_outputTree->Branch("l_y_hit", &m_ly_hit);
m_outputTree->Branch("g_x_hit", &m_x_hit);
Expand Down Expand Up @@ -365,6 +366,9 @@ ActsExamples::ProcessCode ActsExamples::RootTrajectoryStatesWriter::writeT(
m_layerID.push_back(geoID.layer());
m_moduleID.push_back(geoID.sensitive());

// get the path length
m_pathLength.push_back(state.pathLength());

// expand the local measurements into the full bound space
Acts::BoundVector meas =
state.projector().transpose() * state.calibrated();
Expand Down Expand Up @@ -581,6 +585,7 @@ ActsExamples::ProcessCode ActsExamples::RootTrajectoryStatesWriter::writeT(
m_volumeID.clear();
m_layerID.clear();
m_moduleID.clear();
m_pathLength.clear();
m_lx_hit.clear();
m_ly_hit.clear();
m_x_hit.clear();
Expand Down

0 comments on commit e98107c

Please sign in to comment.