Changeset 2419 for trunk/MagicSoft
- Timestamp:
- 10/21/03 09:31:06 (21 years ago)
- Location:
- trunk/MagicSoft/Mars
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/Changelog
r2417 r2419 1 1 -*-*- END OF LINE -*-*- 2 2003/10/21: Wolfgang Wittek 3 4 * manalysis/MMatrixLoop.[h,cc] 5 - member function PreProcess() put from .h to .cc 6 7 * mhist/MHMatrix.[h,cc] 8 - member function SetNumRow() put from .h to .cc 9 10 11 2 12 2003/10/20: Thomas Bretz 3 13 -
trunk/MagicSoft/Mars/manalysis/MMatrixLoop.cc
r2206 r2419 34 34 35 35 #include "MHMatrix.h" 36 #include "MLog.h" 36 37 37 38 ClassImp(MMatrixLoop); … … 53 54 // -------------------------------------------------------------------------- 54 55 // 56 57 Int_t MMatrixLoop::PreProcess(MParList *plist) 58 { 59 fNumRow = 0; 60 61 return fMatrix ? kTRUE : kFALSE; 62 } 63 64 // -------------------------------------------------------------------------- 65 // 55 66 // Set the present row of the Matrix, stops the loop when all rows have 56 67 // been accessed. … … 61 72 } 62 73 74 75 76 77 78 79 80 81 82 -
trunk/MagicSoft/Mars/manalysis/MMatrixLoop.h
r2206 r2419 5 5 #include "MTask.h" 6 6 #endif 7 7 8 8 9 class MHMatrix; … … 21 22 MMatrixLoop(MHMatrix *mat, const char *name=NULL, const char *title=NULL); 22 23 23 Int_t PreProcess(MParList *plist) 24 { 25 fNumRow = 0; 26 27 return fMatrix ? kTRUE : kFALSE; 28 } 29 24 Int_t PreProcess(MParList *plist); 30 25 Int_t Process(); 31 26 -
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.