Analysis Software
Documentation for sPHENIX simulation software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
EmbRecoMatchContainer.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file EmbRecoMatchContainer.h
1 #ifndef TRACKBASE_EMBRECOMATCHCONTAINER_H
2 #define TRACKBASE_EMBRECOMATCHCONTAINER_H
3 
4 #include <phool/PHObject.h>
5 #include <vector>
6 #include <climits>
7 #include <map>
8 
9 class EmbRecoMatch;
10 
12 {
13  public:
14  using Vector = std::vector<EmbRecoMatch*>;
15  using ConstIterator = Vector::const_iterator;
16  using ConstRange = std::pair<ConstIterator, ConstIterator>;
17  using Map_nMatches = std::map<unsigned short, unsigned short>;
18  /* using Iterator = Vector::iterator; */
19  /* using Range = std::pair<Iterator, Iterator>; */
20 
22  void Reset() override {}
23 
25  virtual unsigned short nMatches() const { return USHRT_MAX; };
26  virtual unsigned short nTruthUnmatched() const { return USHRT_MAX; };
27 
28  virtual std::vector<unsigned short>& ids_TruthUnmatched(); // id's of the TrkrTruthTrack's that are not matched
29  virtual std::vector<unsigned short> ids_TruthMatched() const { return {}; }; // id's of the TrkrTruthTrack's that are matched
30  virtual std::vector<unsigned short> ids_RecoMatched() const { return {}; }; // id's of the TrkrTruthTrack's that are matched
31 
32  virtual std::map<unsigned short, unsigned short>& map_nRecoPerTruth();
33  virtual std::map<unsigned short, unsigned short>& map_nTruthPerReco();
34 
35  virtual ConstRange getMatchedRange() const;
36  virtual Vector& getMatches() ;
37 
38  virtual void addMatch(EmbRecoMatch*) {};
39  virtual bool hasTruthMatch (unsigned short /*Truth Track Id*/) { return false; };
40  virtual bool hasRecoMatch (unsigned short /*Reco Track Id*/) { return false; };
41  virtual EmbRecoMatch* getMatchTruth (unsigned short /*idEmb*/, unsigned short /*offset*/=0) { return nullptr; };
42  virtual EmbRecoMatch* getMatchReco (unsigned short /*idReco*/, unsigned short /*offset*/=0) { return nullptr; };
43 
44  virtual void checkfill_idsTruthUnmatched(unsigned short){}; // add tracks one-by-one and add to m_idsTruthUnmatched if not matched
45 
46  virtual void sort() {}; // only to be used when filling the contianer. Sorts the internal vectors for the sake of using them.
47 
48  // PHObject virtual overload
49  void identify(std::ostream& os = std::cout) const override
50  {
51  os << "EmbREcoMatchContainer base class" << std::endl;
52  };
53 
54  protected:
55  EmbRecoMatchContainer() = default;
56  ClassDefOverride(EmbRecoMatchContainer, 1)
57 };
58 
59 #endif // TRACKBASE_EMBRECOMATCHCONTAINER_H