Skip to content

Commit

Permalink
Backup
Browse files Browse the repository at this point in the history
  • Loading branch information
beomki-yeo committed Nov 20, 2024
1 parent 368cc94 commit dd8e734
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 17 deletions.
11 changes: 7 additions & 4 deletions core/include/traccc/edm/fitting_result.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,22 @@

namespace traccc {

template <typename algebra_t>
struct fitting_result {

using scalar_type = detray::dscalar<algebra_t>;

/// Fitted track parameter at the first track state
bound_track_parameters fitted_params_initial;
detray::bound_track_parameters<algebra_t> fitted_params_initial;

/// Fitted track parameter at the last track state
bound_track_parameters fitted_params_final;
detray::bound_track_parameters<algebra_t> fitted_params_final;

/// Number of degree of freedoms of the track
scalar ndf{0.f};
scalar_type ndf{0.f};

/// Chi square from finding/fitting algorithm
scalar chi2{std::numeric_limits<float>::max()};
scalar_type chi2{std::numeric_limits<scalar_type>::max()};

/// The number of holes
unsigned int n_holes{0u};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ struct statistics_updater {
template <typename mask_group_t, typename index_t>
TRACCC_HOST_DEVICE inline void operator()(
const mask_group_t& /*mask_group*/, const index_t& /*index*/,
fitting_result& fit_res, const track_state<algebra_t>& trk_state) {
fitting_result<traccc::default_algebra>& fit_res,
const track_state<algebra_t>& trk_state) {

if (!trk_state.is_hole) {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,19 @@ namespace traccc::details {

/// @c traccc::is_same_object specialisation for @c traccc::fitting_result
template <>
class is_same_object<fitting_result> {
class is_same_object<fitting_result<traccc::default_algebra>> {

public:
/// Constructor with a reference object, and an allowed uncertainty
is_same_object(const fitting_result& ref, scalar unc = float_epsilon);
is_same_object(const fitting_result<traccc::default_algebra>& ref,
scalar unc = float_epsilon);

/// Specialised implementation for @c traccc::measurement
bool operator()(const fitting_result& obj) const;
bool operator()(const fitting_result<traccc::default_algebra>& obj) const;

private:
/// The reference object
std::reference_wrapper<const fitting_result> m_ref;
std::reference_wrapper<const fitting_result<traccc::default_algebra>> m_ref;
/// The uncertainty
scalar m_unc;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class fitting_performance_writer {
/// @param evt_map event map to find the truth values
template <typename detector_t>
void write(const track_state_collection_types::host& track_states_per_track,
const fitting_result& fit_res, const detector_t& det,
const fitting_result<traccc::default_algebra>& fit_res, const detector_t& det,
event_data& evt_data) {

std::map<measurement, std::map<particle, std::size_t>> meas_to_ptc_map;
Expand Down Expand Up @@ -116,7 +116,7 @@ class fitting_performance_writer {
const particle& ptc);

/// Non-templated part of the @c write(...) function
void write_stat(const fitting_result& fit_res,
void write_stat(const fitting_result<traccc::default_algebra>& fit_res,
const track_state_collection_types::host& track_states);

/// Configuration for the tool
Expand Down
2 changes: 1 addition & 1 deletion performance/src/performance/details/is_same_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ is_same_object<fitting_result>::is_same_object(const fitting_result& ref,
: m_ref(ref), m_unc(unc) {}

bool is_same_object<fitting_result>::operator()(
const fitting_result& obj) const {
const fitting_result<traccc::default_algebra>& obj) const {

return (
is_same_object<bound_track_parameters>(
Expand Down
2 changes: 1 addition & 1 deletion performance/src/resolution/fitting_performance_writer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void fitting_performance_writer::write_res(
}

void fitting_performance_writer::write_stat(
const fitting_result& fit_res,
const fitting_result<traccc::default_algebra>& fit_res,
const track_state_collection_types::host& track_states) {

m_data->m_stat_plot_tool.fill(m_data->m_stat_plot_cache, fit_res);
Expand Down
5 changes: 3 additions & 2 deletions performance/src/resolution/stat_plot_tool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ void stat_plot_tool::book(stat_plot_cache& cache) const {
#endif // TRACCC_HAVE_ROOT
}

void stat_plot_tool::fill(stat_plot_cache& cache,
const fitting_result& fit_res) const {
void stat_plot_tool::fill(
stat_plot_cache& cache,
const fitting_result<traccc::default_algebra>& fit_res) const {

// Avoid unused variable warnings when building the code without ROOT.
(void)cache;
Expand Down
2 changes: 1 addition & 1 deletion tests/common/tests/kalman_fitting_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void KalmanFittingTests::pull_value_tests(
}

void KalmanFittingTests::ndf_tests(
const fitting_result& fit_res,
const fitting_result<traccc::default_algebra>& fit_res,
const track_state_collection_types::host& track_states_per_track) {

scalar dim_sum = 0;
Expand Down
2 changes: 1 addition & 1 deletion tests/common/tests/kalman_fitting_test.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ class KalmanFittingTests
/// @param track_states_per_track Track states of a track
///
void ndf_tests(
const fitting_result& fit_res,
const fitting_result<traccc::default_algebra>& fit_res,
const track_state_collection_types::host& track_states_per_track);

// The number of tracks successful with KF
Expand Down

0 comments on commit dd8e734

Please sign in to comment.