ClManager.h 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. // $Id$
  2. // Author: artur 2016/04/07
  3. #ifndef __CLMANAGER_H__
  4. #define __CLMANAGER_H__
  5. #include <TObject.h>
  6. #include <TString.h>
  7. #include <TArrayD.h>
  8. #include <ClusterCollection.h>
  9. typedef std::map<Int_t,ClusterCollection*> CL_SSET;
  10. ////////////////////////////////////////////////////////////////////////////////
  11. // //
  12. // ClManager //
  13. // //
  14. // <brief class description> //
  15. // //
  16. ////////////////////////////////////////////////////////////////////////////////
  17. class ClManager {
  18. public:
  19. ClManager();
  20. virtual ~ClManager();
  21. virtual void Print(Int_t opt = 0) const;
  22. virtual void DeleteAll(); // delete all elements, clusters and collections
  23. virtual void ClearCLPars() { fCLPars.Set(0); }
  24. //------------------------------------------------------------
  25. virtual Bool_t InitCLPars();
  26. virtual Int_t GetCLParsN();
  27. virtual Double_t GetCLPar(Int_t i);
  28. virtual void SetCLPars(unsigned int ncopy, ... );
  29. //------------------------------------------------------------
  30. inline Int_t GetElementsN() const { return ElementsN_; }
  31. inline Int_t GetClustersN() const { return ClustersN_; }
  32. inline Int_t GetCollectionsN() const { return CollectionsN_; }
  33. virtual ClusterElement* FindElement(int id) const;
  34. virtual Cluster* FindCluster(int id) const;
  35. virtual ClusterCollection* FindCollection(int id) const;
  36. virtual ClusterCollection* FindCollection(TString name) const;
  37. //------------------------------------------------------------
  38. virtual ClusterElement* CreateNewElement();
  39. virtual Cluster* CreateNewCluster();
  40. virtual ClusterCollection* CreateNewCollection();
  41. //------------------------------------------------------------
  42. /* [1]- remove element from all clusters (without deleting)
  43. [1]- remove clusters ids from the element */
  44. virtual Bool_t RemoveElement(int id);
  45. /* [1]- remove cluster from all collections (without deleting)
  46. [1]- remove collections ids from the cluster
  47. [2]- remove all elements from the cluster (without deleting)
  48. [2]- remove cluster's id from the elements */
  49. virtual Bool_t RemoveCluster(int id);
  50. /* [2]- remove all clusters from the collection (without deleting)
  51. [2]- remove collection's id from clusters */
  52. virtual Bool_t RemoveCollection(int id);
  53. virtual void DeleteElement(int id); // remove & delete element anywhere
  54. virtual void DeleteCluster(int id); // remove & delete cluster anywhere
  55. virtual void DeleteCollection(int id); // remove & delete collection anywhere
  56. virtual void DeleteCollections(); // remove & delete all collections anywhere
  57. protected:
  58. CL_ESET Elements_; // all-elements collection <element ID, element>
  59. CL_CSET Clusters_; // all-clusters collection <cluster ID, cluster>
  60. CL_SSET Collections_; // all-cluster-sets collection <collection ID, collection>
  61. //private:
  62. Int_t ElementsN_;
  63. Int_t ClustersN_;
  64. Int_t CollectionsN_;
  65. TArrayD fCLPars;
  66. ClassDef(ClManager,1)
  67. };
  68. #endif /* __CLMANAGER_H__ */