Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
ObjectMatrix.h
1/*
2 * HalObjectManager.h
3 *
4 * Created on: 30-04-2022
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#ifndef HALOBJECTMANAGER_H_
10#define HALOBJECTMANAGER_H_
11
12#include <TNamed.h>
13#include <TString.h>
14
15
16class Package;
17
18/*************************************************************************************************************************************
19 * 1 DIM ARRAYS
20 *************************************************************************************************************************************/
24namespace Hal {
25 class ObjectMatrix_1 : public TNamed {
26 protected:
30 Int_t fSize;
34 TString* fComments; //[fSize]
38 TObject** fArray; //[fSize]
39 public:
40 ObjectMatrix_1() : TNamed(), fSize(0), fComments(NULL), fArray(NULL) {};
41 ObjectMatrix_1(const ObjectMatrix_1& manager);
42 ObjectMatrix_1& operator=(const ObjectMatrix_1& manager);
48 virtual void Init(Int_t size, const TObject* temp);
54 inline TObject* At(Int_t i) const { return fArray[i]; };
59 inline TObject** GetArrray() const { return fArray; };
64 Int_t GetSize() const { return fSize; };
70 TString GetComment(Int_t i) { return fComments[i]; };
76 void SetComment(TString comment, Int_t i) { fComments[i] = comment; };
81 TList* GetFlatList() const;
86 Package* Report() const;
87 virtual ~ObjectMatrix_1() {
88 if (fSize == 0) return;
89 delete[] fComments;
90 for (int i = 0; i < fSize; i++)
91 delete fArray[i];
92 delete[] fArray;
93 }
94 ClassDef(ObjectMatrix_1, 1)
95 };
96 /*************************************************************************************************************************************
97 * 2 DIM ARRAYS
98 *************************************************************************************************************************************/
103 class ObjectMatrix_2 : public TNamed {
104 protected:
108 Int_t fSize;
113 public:
114 ObjectMatrix_2() : TNamed(), fSize(0), fArray(NULL) {};
115 ObjectMatrix_2(const ObjectMatrix_2& manager);
116 ObjectMatrix_2& operator=(const ObjectMatrix_2& manager);
123 virtual void Init(Int_t sizeX, Int_t sizeY, const TObject* temp);
128 Int_t GetSize() const { return fSize; };
133 TList* GetFlatList() const;
138 Package* Report() const;
144 ObjectMatrix_1* Get(Int_t i) const { return fArray[i]; };
151 inline TObject* At(Int_t i, Int_t j) const { return fArray[i]->At(j); };
152 virtual ~ObjectMatrix_2();
153 ClassDef(ObjectMatrix_2, 1)
154 };
155 /*************************************************************************************************************************************
156 * 3 DIM ARRAYS
157 *************************************************************************************************************************************/
162 class ObjectMatrix_3 : public TNamed {
163 protected:
164 Int_t fSize;
169 public:
170 ObjectMatrix_3() : TNamed(), fSize(0), fArray(NULL) {};
171 ObjectMatrix_3(const ObjectMatrix_3& manager);
172 ObjectMatrix_3& operator=(const ObjectMatrix_3& manager);
180 void Init(Int_t sizeX, Int_t sizeY, Int_t sizeZ, const TObject* temp);
185 Int_t GetSize() const { return fSize; };
190 TList* GetFlatList() const;
195 Package* Report() const;
201 ObjectMatrix_2* Get(Int_t i) const { return fArray[i]; };
209 inline TObject* At(Int_t i, Int_t j, Int_t k) const { return fArray[i]->Get(j)->At(k); };
210 virtual ~ObjectMatrix_3();
211 ClassDef(ObjectMatrix_3, 1)
212 };
213
214 //----------------------------- 4 DIM Arrays
219 class ObjectMatrix_4 : public TNamed {
220 protected:
221 Int_t fSize;
226 public:
227 ObjectMatrix_4() : TNamed(), fSize(0), fArray(NULL) {};
228 ObjectMatrix_4(const ObjectMatrix_4& manager);
229 ObjectMatrix_4& operator=(const ObjectMatrix_4& manager);
238 virtual void Init(Int_t sizeX, Int_t sizeY, Int_t sizeZ, Int_t sizeT, const TObject* temp);
243 Int_t GetSize() const { return fSize; };
248 TList* GetFlatList() const;
253 Package* Report() const;
259 ObjectMatrix_3* Get(const Int_t i) const { return fArray[i]; };
268 inline TObject* At(Int_t i, Int_t j, Int_t k, Int_t l) const { return fArray[i]->Get(j)->Get(k)->At(l); };
269 virtual ~ObjectMatrix_4();
270 ClassDef(ObjectMatrix_4, 1)
271 };
272} // namespace Hal
273#endif /* HALOBJECTMANAGER_H_ */
Package * Report() const
TList * GetFlatList() const
TString GetComment(Int_t i)
void SetComment(TString comment, Int_t i)
Int_t GetSize() const
TObject ** GetArrray() const
virtual void Init(Int_t size, const TObject *temp)
TObject * At(Int_t i) const
TList * GetFlatList() const
ObjectMatrix_1 * Get(Int_t i) const
Int_t GetSize() const
TObject * At(Int_t i, Int_t j) const
ObjectMatrix_1 ** fArray
virtual void Init(Int_t sizeX, Int_t sizeY, const TObject *temp)
Package * Report() const
ObjectMatrix_2 ** fArray
Int_t GetSize() const
void Init(Int_t sizeX, Int_t sizeY, Int_t sizeZ, const TObject *temp)
TList * GetFlatList() const
ObjectMatrix_2 * Get(Int_t i) const
Package * Report() const
TObject * At(Int_t i, Int_t j, Int_t k) const
TObject * At(Int_t i, Int_t j, Int_t k, Int_t l) const
ObjectMatrix_3 ** fArray
ObjectMatrix_3 * Get(const Int_t i) const
Int_t GetSize() const
TList * GetFlatList() const
Package * Report() const
virtual void Init(Int_t sizeX, Int_t sizeY, Int_t sizeZ, Int_t sizeT, const TObject *temp)