1 | #ifndef MARS_MHMatrix
|
---|
2 | #define MARS_MHMatrix
|
---|
3 |
|
---|
4 | #ifndef ROOT_TMatrix
|
---|
5 | #include <TMatrix.h>
|
---|
6 | #endif
|
---|
7 | #ifndef MARS_MH
|
---|
8 | #include "MH.h"
|
---|
9 | #endif
|
---|
10 |
|
---|
11 | class TArrayI;
|
---|
12 | class MDataArray;
|
---|
13 |
|
---|
14 | class MHMatrix : public MH
|
---|
15 | {
|
---|
16 | protected:
|
---|
17 | Int_t fNumRow; //! Number of dimensions of histogram
|
---|
18 | TMatrix fM; // Matrix to be filled
|
---|
19 |
|
---|
20 | TMatrix fM2; //!
|
---|
21 |
|
---|
22 | MDataArray *fData; // List of data members (columns)
|
---|
23 |
|
---|
24 | enum {
|
---|
25 | kIsOwner = BIT(14)
|
---|
26 | };
|
---|
27 |
|
---|
28 | void AddRow();
|
---|
29 |
|
---|
30 | Bool_t SetupFill(const MParList *pList);
|
---|
31 | Bool_t Fill(const MParContainer *par);
|
---|
32 | Bool_t Finalize();
|
---|
33 |
|
---|
34 | void StreamPrimitive(ofstream &out) const;
|
---|
35 |
|
---|
36 | public:
|
---|
37 | MHMatrix(const char *name=NULL, const char *title=NULL);
|
---|
38 | MHMatrix(MDataArray *mat, const char *name=NULL, const char *title=NULL);
|
---|
39 | ~MHMatrix();
|
---|
40 |
|
---|
41 | void AddColumn(const char *name);
|
---|
42 | void AddColumns(MDataArray *mat);
|
---|
43 |
|
---|
44 | MDataArray *GetColumns() { return fData; }
|
---|
45 |
|
---|
46 | const TMatrix &GetM() const { return fM; }
|
---|
47 |
|
---|
48 | //void Draw(Option_t *opt=NULL);
|
---|
49 | //TObject *DrawClone(Option_t *opt=NULL) const;
|
---|
50 |
|
---|
51 | void Print(Option_t *) const;
|
---|
52 |
|
---|
53 | const TMatrix *InvertPosDef();
|
---|
54 |
|
---|
55 | Double_t CalcDist(const TMatrix &m, const TVector &v, Int_t num = 25) const;
|
---|
56 | Double_t CalcDist(const TVector &v, Int_t num = 25);
|
---|
57 |
|
---|
58 | void SetIOwner(Bool_t b=kTRUE) { b ? SetBit(kIsOwner) : ResetBit(kIsOwner); }
|
---|
59 |
|
---|
60 | void Reassign();
|
---|
61 |
|
---|
62 | const TArrayI GetIndexOfSortedColumn(Int_t ncol=0, Bool_t desc=kTRUE) const;
|
---|
63 | void SortMatrixByColumn(Int_t ncol=0, Bool_t desc=kTRUE);
|
---|
64 |
|
---|
65 | ClassDef(MHMatrix, 1) // Multidimensional Matrix to store events
|
---|
66 | };
|
---|
67 |
|
---|
68 | #endif
|
---|