File indexing completed on 2025-08-05 08:18:19
0001 #ifndef TRACKBASE_EMBRECOMATCHCONTAINERV1_H
0002 #define TRACKBASE_EMBRECOMATCHCONTAINERV1_H
0003
0004 #include <vector>
0005 #include "EmbRecoMatchContainer.h"
0006
0007 class EmbRecoMatch;
0008
0009 class EmbRecoMatchContainerv1 : public EmbRecoMatchContainer
0010 {
0011 public:
0012 void Reset() override;
0013
0014
0015 unsigned short nMatches() const override { return m_data.size(); };
0016 unsigned short nTruthUnmatched() const override { return m_idsTruthUnmatched.size(); };
0017 std::vector<unsigned short>& ids_TruthUnmatched() override { return m_idsTruthUnmatched; };
0018 std::vector<unsigned short> ids_TruthMatched() const override;
0019 std::vector<unsigned short> ids_RecoMatched() const override;
0020
0021 std::map<unsigned short, unsigned short>& map_nRecoPerTruth() override { return m_nRecoPerTruth; };
0022 std::map<unsigned short, unsigned short>& map_nTruthPerReco() override { return m_nTruthPerReco; };
0023
0024 ConstRange getMatchedRange() const override { return std::make_pair(m_data.begin(), m_data.end()); };
0025 Vector& getMatches() override { return m_data; };
0026
0027 void addMatch(EmbRecoMatch* match) override;
0028 bool hasTruthMatch(unsigned short idEmb) override;
0029 bool hasRecoMatch(unsigned short idReco) override;
0030 EmbRecoMatch* getMatchTruth(unsigned short idEmb, unsigned short offset = 0) override;
0031 EmbRecoMatch* getMatchReco(unsigned short idEmb, unsigned short offset = 0) override;
0032
0033
0034 void identify(std::ostream& os = std::cout) const override;
0035
0036 struct CompShortToPair
0037 {
0038 bool operator()(const unsigned short lhs, const std::pair<unsigned short, unsigned short> rhs) const
0039 {
0040 return lhs < rhs.first;
0041 }
0042 bool operator()(const std::pair<unsigned short, unsigned short> lhs, const unsigned short rhs) const
0043 {
0044 return lhs.first < rhs;
0045 }
0046 };
0047
0048 void sort() override;
0049 void checkfill_idsTruthUnmatched(unsigned short) override;
0050
0051 private:
0052 Vector m_data;
0053 std::vector<std::pair<unsigned short, unsigned short>> m_RecoToTruth;
0054 std::vector<unsigned short> m_idsTruthUnmatched;
0055 Map_nMatches m_nRecoPerTruth;
0056 Map_nMatches m_nTruthPerReco;
0057 ClassDefOverride(EmbRecoMatchContainerv1, 1)
0058 };
0059
0060 #endif