ClusterCollection.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. // $Id$
  2. // Author: artur 2016/04/07
  3. #ifndef __CLUSTERCOLLECTION_H__
  4. #define __CLUSTERCOLLECTION_H__
  5. #include <TNamed.h>
  6. #include <vector>
  7. #include "Cluster.h"
  8. typedef std::map<Int_t,Cluster*> CL_CSET;
  9. ////////////////////////////////////////////////////////////////////////////////
  10. // //
  11. // ClusterCollection //
  12. // //
  13. // id[0]: unique id //
  14. // id[1]: split cluster id (if exists) //
  15. // id[2]: comprising cluster id (if exists) //
  16. // //
  17. ////////////////////////////////////////////////////////////////////////////////
  18. class ClusterCollection: public TNamed {
  19. public:
  20. ClusterCollection();
  21. ClusterCollection(Int_t uid);
  22. virtual ~ClusterCollection() {}
  23. virtual void clear() {}
  24. virtual void print(Int_t opt = 0) const;
  25. virtual void SetId(Int_t i, Int_t v); // !!! i > 0 !!!
  26. //------------------------------------------------------------
  27. Int_t GetId() const { return Id_[0]; }
  28. Int_t GetId(Int_t i) const { return Id_[i]; }
  29. Int_t GetNClusters() const { return Clusters_.size(); }
  30. const CL_CSET& GetClusters() const { return Clusters_; }
  31. const Cluster* GetCluster(Int_t id) const;
  32. //------------------------------------------------------------
  33. virtual Bool_t FindCluster(const Cluster* cl) const ;
  34. virtual Bool_t FindCluster(Int_t id) const ;
  35. //------------------------------------------------------------
  36. virtual Bool_t AddCluster(Cluster* cl);
  37. virtual Bool_t RemoveCluster(Cluster* cl);
  38. virtual Bool_t RemoveCluster(Int_t id);
  39. virtual void RemoveClusters();
  40. protected:
  41. TArrayI Id_;
  42. CL_CSET Clusters_; // <cluster ID, cluster>
  43. ClassDef(ClusterCollection,1)
  44. };
  45. #endif /* __CLUSTERCOLLECTION_H__ */