Changeset 2419 for trunk/MagicSoft/Mars/mhist
- Timestamp:
- 10/21/03 09:31:06 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mhist
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mhist/MHMatrix.cc
r2406 r2419 83 83 // 84 84 MHMatrix::MHMatrix(const char *name, const char *title) 85 : fNumRow (0), fData(NULL)85 : fNumRows(0), fData(NULL) 86 86 { 87 87 fName = name ? name : gsDefName.Data(); … … 94 94 // 95 95 MHMatrix::MHMatrix(const TMatrix &m, const char *name, const char *title) 96 : fNumRow (m.GetNrows()), fM(m), fData(NULL)96 : fNumRows(m.GetNrows()), fM(m), fData(NULL) 97 97 { 98 98 fName = name ? name : gsDefName.Data(); … … 106 106 // 107 107 MHMatrix::MHMatrix(MDataArray *mat, const char *name, const char *title) 108 : fNumRow (0), fData(mat)108 : fNumRows(0), fData(mat) 109 109 { 110 110 fName = name ? name : gsDefName.Data(); … … 122 122 delete fData; 123 123 } 124 125 // -------------------------------------------------------------------------- 126 // 127 Bool_t MHMatrix::SetNumRow(Int_t row) 128 { 129 if (row>=fM.GetNrows() || row<0) return kFALSE; 130 fRow = row; 131 return kTRUE; 132 } 133 124 134 125 135 // -------------------------------------------------------------------------- … … 205 215 void MHMatrix::AddRow() 206 216 { 207 fNumRow ++;208 209 if (fM.GetNrows() > fNumRow )217 fNumRows++; 218 219 if (fM.GetNrows() > fNumRows) 210 220 return; 211 221 … … 237 247 238 248 for (int col=0; col<fData->GetNumEntries(); col++) 239 fM(fNumRow -1, col) = (*fData)(col);249 fM(fNumRows-1, col) = (*fData)(col); 240 250 241 251 return kTRUE; … … 252 262 // It's not a fatal error so we don't need to stop PostProcessing... 253 263 // 254 if (fData->GetNumEntries()==0 || fNumRow <1)264 if (fData->GetNumEntries()==0 || fNumRows<1) 255 265 return kTRUE; 256 266 257 if (fNumRow != fM.GetNrows())267 if (fNumRows != fM.GetNrows()) 258 268 { 259 269 TMatrix m(fM); 260 CopyCrop(fM, m, fNumRow );270 CopyCrop(fM, m, fNumRows); 261 271 } 262 272 … … 900 910 // 901 911 CopyCrop(fM, mnewtmp, evtcount1); 902 fNumRow = evtcount1;912 fNumRows = evtcount1; 903 913 904 914 if (evtcount1 < nmaxevts) … … 1008 1018 // 1009 1019 CopyCrop(fM, mnewtmp, evtcount1); 1010 fNumRow = evtcount1;1020 fNumRows = evtcount1; 1011 1021 1012 1022 if (evtcount1 < nmaxevts) … … 1111 1121 TVector v(fM.GetNcols()); 1112 1122 TVector tmp(fM.GetNcols()); 1113 for (Int_t irow = 0; irow<fNumRow ; irow++)1114 { 1115 const Int_t jrow = rnd.Integer(fNumRow );1123 for (Int_t irow = 0; irow<fNumRows; irow++) 1124 { 1125 const Int_t jrow = rnd.Integer(fNumRows); 1116 1126 1117 1127 v = TMatrixRow(fM, irow); -
trunk/MagicSoft/Mars/mhist/MHMatrix.h
r2357 r2419 30 30 static const TString gsDefTitle; //! Default Title 31 31 32 Int_t fNumRow ; // Number of dimensions of histogram32 Int_t fNumRows; //! Number of rows filled into the matrix (this is NOT the number of rows of the matrix!) 33 33 Int_t fRow; //! Present row 34 34 TMatrix fM; // Matrix to be filled … … 75 75 76 76 Bool_t IsValid() const { return fM.IsValid(); } 77 Int_t GetNumRows() const { return f NumRow; }77 Int_t GetNumRows() const { return fM.GetNrows(); } 78 78 79 79 //void Draw(Option_t *opt=NULL); … … 94 94 void SortMatrixByColumn(Int_t ncol=0, Bool_t desc=kTRUE); 95 95 96 Bool_t SetNumRow(Int_t row) { if (row>=fNumRow || row<0) return kFALSE; fRow = row; return kTRUE; } 96 Bool_t SetNumRow(Int_t row); 97 97 98 Int_t GetNumRow() const { return fRow; }; 98 99 Double_t operator[](Int_t col) { return fM(fRow, col); }
Note:
See TracChangeset
for help on using the changeset viewer.