File indexing completed on 2025-08-05 08:18:01
0001 #ifndef TRACKCLUSEVALUATOR_H
0002 #define TRACKCLUSEVALUATOR_H
0003
0004
0005 #include "TrkrClusLoc.h"
0006
0007 #include <trackbase/TrkrDefs.h>
0008
0009 #include <array>
0010 #include <vector>
0011
0012 class TrkrClusterIsMatcher;
0013 class SvtxTrack;
0014 class TrkrTruthTrack;
0015 class TrkrClusterContainer;
0016
0017 class TrackClusEvaluator
0018 {
0019 private:
0020 using Vector = std::vector<std::pair<TrkrDefs::hitsetkey, TrkrDefs::cluskey>>;
0021
0022 using Iter = Vector::iterator;
0023
0024
0025
0026 std::array<int, 5> cntclus(Vector& keys);
0027 std::array<int, 5> cnt_matchedclus(Vector& keys, std::vector<bool>& matches);
0028
0029 public:
0030 TrkrClusterIsMatcher* ismatcher{nullptr};
0031
0032 TrackClusEvaluator(TrkrClusterIsMatcher* tcm = nullptr)
0033 : ismatcher{tcm} {};
0034
0035 TrkrClusterContainer* get_PHG4_clusters();
0036 TrkrClusterContainer* get_SVTX_clusters();
0037
0038 Vector svtx_keys{};
0039 Vector phg4_keys{};
0040
0041 bool collect_match_statistic = false;
0042 double match_stat{0};
0043
0044 void reset();
0045 std::array<int, 3> find_matches();
0046
0047 std::array<int, 3> find_matches(TrkrTruthTrack* g4_track, SvtxTrack* sv_track);
0048
0049 int phg4_n_matched();
0050 int svtx_n_matched();
0051
0052 int phg4_nclus() { return (int) phg4_keys.size(); }
0053 int svtx_nclus() { return (int) svtx_keys.size(); }
0054
0055 std::vector<bool> svtx_matches;
0056 std::vector<bool> phg4_matches;
0057
0058 int addClusKeys(SvtxTrack*);
0059 int addClusKeys(TrkrTruthTrack*);
0060
0061 std::array<int, 5> svtx_cntclus() { return cntclus(svtx_keys); };
0062 std::array<int, 5> phg4_cntclus() { return cntclus(phg4_keys); };
0063
0064 std::array<int, 5> svtx_cnt_matchedclus() { return cnt_matchedclus(svtx_keys, svtx_matches); };
0065 std::array<int, 5> phg4_cnt_matchedclus() { return cnt_matchedclus(phg4_keys, phg4_matches); };
0066
0067
0068 std::vector<TrkrClusLoc> phg4_clusloc_all();
0069 std::vector<TrkrClusLoc> phg4_clusloc_unmatched();
0070 std::vector<TrkrClusLoc> svtx_clusloc_all();
0071 std::vector<TrkrClusLoc> svtx_clusloc_unmatched();
0072 std::vector<TrkrClusLoc> clusloc_matched();
0073 };
0074
0075 #endif