|
AnalysisTree
|
#include <Matching.hpp>

Public Member Functions | |
| Matching (size_t id1, size_t id2) | |
| void | AddMatch (Integer_t id1, Integer_t id2) |
| ANALYSISTREE_ATTR_NODISCARD MatchRange | GetMatchesDirect (Integer_t id1) const |
| ANALYSISTREE_ATTR_NODISCARD MatchRange | GetMatchesInverted (Integer_t id2) const |
| ANALYSISTREE_ATTR_NODISCARD MatchRange | GetMatches (Integer_t id, bool is_inverted) const |
| ANALYSISTREE_ATTR_NODISCARD Integer_t | GetMatchDirect (Integer_t id) const |
| ANALYSISTREE_ATTR_NODISCARD Integer_t | GetMatchInverted (Integer_t id) const |
| ANALYSISTREE_ATTR_NODISCARD Integer_t | GetMatch (Integer_t id, bool is_inverted=false) const |
| ANALYSISTREE_ATTR_NODISCARD size_t | GetNumberOfPairs () const |
| ANALYSISTREE_ATTR_NODISCARD size_t | GetNumberOfIds (bool is_inverted=false) const |
| void | Clear () |
| ANALYSISTREE_ATTR_NODISCARD size_t | GetBranch1Id () const |
| ANALYSISTREE_ATTR_NODISCARD size_t | GetBranch2Id () const |
Protected Member Functions | |
| void | BuildInverse () const |
| void | ConvertLegacy () const |
A class for a matching information between channels of two branches (id1 of branch1, id2 of branch2).
All pairs are stored in CSR layout: the partners of id1 are ids2_[offsets_[id1], offsets_[id1 + 1]), in the order they were added. By convention the best partner is added first, GetMatch() returns it. The inverse direction (id2 -> id1) is not persisted, it is built on first use and ordered by id1. Ids are channel ids, i.e. indices in the Detector, and must be non-negative.
| void AnalysisTree::Matching::AddMatch | ( | Integer_t | id1, |
| Integer_t | id2 ) |
Adds a pair. Adding in increasing order of id1 is O(1), otherwise the pair is inserted in place.
|
protected |
Moves the pairs of match_ and match_inverted_ (read from a file of version <= 2) into the CSR layout
| Integer_t AnalysisTree::Matching::GetMatchDirect | ( | Integer_t | id | ) | const |
First partner of an object (inverted: smallest id1); UndefValueInt if there is none
| MatchRange AnalysisTree::Matching::GetMatchesDirect | ( | Integer_t | id1 | ) | const |
All partners of an object; empty if there is none
| size_t AnalysisTree::Matching::GetNumberOfIds | ( | bool | is_inverted = false | ) | const |
Upper bound of the ids on the origin side: all ids with partners are smaller