File indexing completed on 2026-07-26 08:22:15
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "traccc/examples/print_fitted_tracks_statistics.hpp"
0010
0011 namespace traccc::details {
0012
0013 void print_fitted_tracks_statistics(
0014 const edm::track_container<default_algebra>::host& tracks,
0015 const Logger& log) {
0016 std::size_t success = 0;
0017 std::size_t forward = 0;
0018 std::size_t backward = 0;
0019 std::size_t propagation_forward = 0;
0020 std::size_t propagation_backward = 0;
0021 std::size_t non_positive_ndf = 0;
0022 std::size_t not_all_fitted = 0;
0023 std::size_t not_all_smoothed = 0;
0024 std::size_t unknown = 0;
0025
0026 for (track_fit_outcome outcome : tracks.tracks.fit_outcome()) {
0027 if (outcome == track_fit_outcome::SUCCESS) {
0028 ++success;
0029 } else if (outcome == track_fit_outcome::FAILURE_FITTER) {
0030 ++forward;
0031 } else if (outcome == track_fit_outcome::FAILURE_SMOOTHER) {
0032 ++backward;
0033 } else if (outcome == track_fit_outcome::FAILURE_FORWARD_PROPAGATION) {
0034 ++propagation_forward;
0035 } else if (outcome == track_fit_outcome::FAILURE_BACKWARD_PROPAGATION) {
0036 ++propagation_backward;
0037 } else if (outcome == track_fit_outcome::FAILURE_NON_POSITIVE_NDF) {
0038 ++non_positive_ndf;
0039 } else if (outcome == track_fit_outcome::FAILURE_NOT_ALL_FITTED) {
0040 ++not_all_fitted;
0041 } else if (outcome == track_fit_outcome::FAILURE_NOT_ALL_SMOOTHED) {
0042 ++not_all_smoothed;
0043 } else if (outcome == track_fit_outcome::UNKNOWN) {
0044 ++unknown;
0045 }
0046 }
0047
0048 auto logger = [&log]() -> const Logger& { return log; };
0049 TRACCC_INFO(
0050 "Success: " << success << "/" << tracks.tracks.size() << " ("
0051 << 100. * (static_cast<double>(success) /
0052 static_cast<double>(tracks.tracks.size()))
0053 << "%)"
0054 << "\n Fit failure during forward pass: " << forward
0055 << "\n Fit failure during backward pass: " << backward
0056 << "\n Failure during track propagation (forward): "
0057 << propagation_forward
0058 << "\n Failure during track propagation (backward): "
0059 << propagation_backward
0060 << "\n Non positive NDF: " << non_positive_ndf
0061 << "\n Skipped track state(s) in fit: " << not_all_fitted
0062 << "\n Skipped track state(s) in smoother: "
0063 << not_all_smoothed << "\n Unknown: " << unknown
0064 << "\n Total errors: "
0065 << (forward + backward + propagation_forward +
0066 propagation_backward + non_positive_ndf + not_all_fitted +
0067 not_all_smoothed + unknown));
0068 }
0069
0070 }