Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:19:32

0001 #ifndef TRACKBASE_EMBRECOMATCHCONTAINER_H
0002 #define TRACKBASE_EMBRECOMATCHCONTAINER_H
0003 
0004 #include <phool/PHObject.h>
0005 
0006 #include <limits>
0007 #include <map>
0008 #include <vector>
0009 
0010 class EmbRecoMatch;
0011 
0012 class EmbRecoMatchContainer : public PHObject
0013 {
0014  public:
0015   using Vector = std::vector<EmbRecoMatch*>;
0016   using ConstIterator = Vector::const_iterator;
0017   using ConstRange = std::pair<ConstIterator, ConstIterator>;
0018   using Map_nMatches = std::map<unsigned short, unsigned short>;
0019   /* using Iterator      = Vector::iterator; */
0020   /* using Range         = std::pair<Iterator, Iterator>; */
0021 
0022   //! reset method
0023   void Reset() override {}
0024 
0025   //! add a match set
0026   virtual unsigned short nMatches() const { return std::numeric_limits<unsigned short>::max(); };
0027   virtual unsigned short nTruthUnmatched() const { return std::numeric_limits<unsigned short>::max(); };
0028 
0029   virtual std::vector<unsigned short>& ids_TruthUnmatched();                    // id's of the TrkrTruthTrack's that are not matched
0030   virtual std::vector<unsigned short> ids_TruthMatched() const { return {}; };  // id's of the TrkrTruthTrack's that are matched
0031   virtual std::vector<unsigned short> ids_RecoMatched() const { return {}; };   // id's of the TrkrTruthTrack's that are matched
0032 
0033   virtual std::map<unsigned short, unsigned short>& map_nRecoPerTruth();
0034   virtual std::map<unsigned short, unsigned short>& map_nTruthPerReco();
0035 
0036   virtual ConstRange getMatchedRange() const;
0037   virtual Vector& getMatches();
0038 
0039   virtual void addMatch(EmbRecoMatch*){};
0040   virtual bool hasTruthMatch(unsigned short /*Truth Track Id*/) { return false; };
0041   virtual bool hasRecoMatch(unsigned short /*Reco  Track Id*/) { return false; };
0042   virtual EmbRecoMatch* getMatchTruth(unsigned short /*idEmb*/, unsigned short /*offset*/ = 0) { return nullptr; };
0043   virtual EmbRecoMatch* getMatchReco(unsigned short /*idReco*/, unsigned short /*offset*/ = 0) { return nullptr; };
0044 
0045   virtual void checkfill_idsTruthUnmatched(unsigned short){};  // add tracks one-by-one and add to m_idsTruthUnmatched if not matched
0046 
0047   virtual void sort(){};  // only to be used when filling the contianer. Sorts the internal vectors for the sake of using them.
0048 
0049   // PHObject virtual overload
0050   void identify(std::ostream& os = std::cout) const override
0051   {
0052     os << "EmbREcoMatchContainer base class" << std::endl;
0053   };
0054 
0055  protected:
0056   EmbRecoMatchContainer() = default;
0057   ClassDefOverride(EmbRecoMatchContainer, 1)
0058 };
0059 
0060 #endif  // TRACKBASE_EMBRECOMATCHCONTAINER_H