/** * \file CbmMatch2.h * \author Andrey Lebedev * \date 2013 * * Base data class for storing RECO-to-MC matching information. **/ #ifndef CBMMATCH2_H_ #define CBMMATCH2_H_ #include "TObject.h" #include "TList.h" #include "CbmLink.h" #include #include #include using std::string; using std::vector; using std::pair; class CbmMatch2 : public TObject { public: /** * \brief Default constructor. */ CbmMatch2(); /** * \brief Destructor. */ virtual ~CbmMatch2() { fLinks.Delete(); } /* Accessors */ CbmLink* GetLink(Int_t i) const { return dynamic_cast(fLinks.At(i)); } const TList& GetLinks() { return fLinks; } CbmLink* GetMatchedLink() { return GetLink(fMatchedIndex); } Int_t GetNofLinks() const { return fLinks.GetSize(); } Double_t GetTotalWeight() const { return fTotalWeight; } /* Modifiers */ void AddLinks(const CbmMatch2& match); void AddLink(CbmLink* newLink); void AddLink(Double_t weight, Int_t index, Int_t entry = -1, Int_t file = -1); void ClearLinks(); /** * \brief Return string representation of the object. * \return String representation of the object. **/ virtual string ToString() const; protected: TList fLinks; // List of links to MC Double_t fTotalWeight; // Sum of all reference weights Int_t fMatchedIndex; // Index of the matched reference in fReferences array ClassDef(CbmMatch2, 1); }; #endif /* CBMMATCH2_H_ */