NCFS-Pack
A generic (astro)particle physics analysis framework
 
Loading...
Searching...
No Matches
NcObjMatrix.h
Go to the documentation of this file.
1#ifndef NcObjMatrix_h
2#define NcObjMatrix_h
3// Copyright(c) 2003 NCFS/IIHE, All Rights Reserved.
4// See cxx source for full Copyright notice.
5
6#include "TNamed.h"
7#include "TObjArray.h"
8#include "TArrayI.h"
9
11
12class NcObjMatrix : public TNamed
13{
14 public:
15 NcObjMatrix(); // Default constructor
16 virtual ~NcObjMatrix(); // Default destructor
17 NcObjMatrix(const NcObjMatrix& m); // Copy constructor
18 virtual TObject* Clone(const char* name="") const; // Make a deep copy and provide its pointer
19 virtual void Reset(); // Reset the whole matrix structure
20 virtual void SetOwner(Int_t own=1); // Set the owner flag for the stored objects
21 virtual Int_t GetOwner() const; // Provide the owner flag for the stored objects
22 virtual void SetSwapMode(Int_t swap=1); // Set the swap mode flag for this matrix
23 virtual Int_t GetSwapMode() const; // Provide the swap mode flag for this matrix
24 virtual void EnterObject(Int_t row,Int_t col,TObject* obj); // Enter an object into the matrix
25 void RemoveObject(Int_t row,Int_t col); // Remove object at (row,col) from the matrix
26 void RemoveObjects(TObject* obj,Int_t row=0,Int_t col=0); // Remove specified object(s) from the matrix
27 virtual TObject* GetObject(Int_t row,Int_t col) const; // Provide an object from the matrix
28 virtual Int_t GetMaxRow() const; // Provide the maximum row number index
29 virtual Int_t GetMaxColumn() const; // Provide the maximum column number index
30 virtual Int_t GetNobjects() const; // Provide the number of stored objects
31 virtual TObject* GetObject(Int_t j) const; // Provide pointer to the j-th object
32 virtual TObjArray* GetObjects(); // Provide pointers of all stored onjects
33 Int_t GetNrefs(TObject* obj) const; // Number of stored references to this object
34 Int_t GetIndices(TObject* obj,TArrayI& rows,TArrayI& cols) const; // All (row,col) indices of this object
35 Int_t GetIndices(TObject* obj,Int_t row,TArrayI& cols) const; // Column indices in a specific row
36 Int_t GetIndices(TObject* obj,TArrayI& rows,Int_t col) const; // Row indices in a specific column
37
38 protected:
39 TObjArray* fRows; // Pointers to the various arrays representing the matrix rows
40 Int_t fOwn; // Flag to indicate whether the objects are owned by the matrix structure
41 Int_t fSwap; // Flag to indicate swapped mode for internal matrix storage
42 Int_t fMaxrow; // The maximum row number index
43 Int_t fMaxcol; // The maximum column number index
44 TObjArray* fObjects; // Linear reference array for fast looping over the stored objects
45
46 ClassDef(NcObjMatrix,1) // Handling of a matrix structure of objects.
47};
48#endif
Int_t GetNrefs(TObject *obj) const
TObjArray * fObjects
Definition NcObjMatrix.h:44
virtual TObject * GetObject(Int_t row, Int_t col) const
virtual void EnterObject(Int_t row, Int_t col, TObject *obj)
virtual TObject * Clone(const char *name="") const
virtual Int_t GetMaxColumn() const
void RemoveObject(Int_t row, Int_t col)
virtual void SetOwner(Int_t own=1)
virtual ~NcObjMatrix()
TObjArray * fRows
Definition NcObjMatrix.h:39
Int_t GetIndices(TObject *obj, TArrayI &rows, TArrayI &cols) const
virtual Int_t GetSwapMode() const
virtual Int_t GetOwner() const
virtual TObjArray * GetObjects()
void RemoveObjects(TObject *obj, Int_t row=0, Int_t col=0)
Int_t fMaxrow
Definition NcObjMatrix.h:42
virtual Int_t GetMaxRow() const
virtual void SetSwapMode(Int_t swap=1)
Int_t fMaxcol
Definition NcObjMatrix.h:43
virtual Int_t GetNobjects() const
virtual void Reset()