Changeset 2114 for trunk/MagicSoft/Mars/mdata
- Timestamp:
- 05/13/03 15:16:54 (22 years ago)
- Location:
- trunk/MagicSoft/Mars/mdata
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mdata/MDataArray.cc
r2109 r2114 35 35 #include <fstream.h> 36 36 37 #include <TVector.h> 38 37 39 #include "MLog.h" 38 40 #include "MLogManip.h" … … 89 91 // Return the data value of the i-th entry 90 92 // 91 Double_t MDataArray::operator()(Int_t i) 92 { 93 return ( (MData*)fList[i])->GetValue();93 Double_t MDataArray::operator()(Int_t i) const 94 { 95 return (*this)[i].GetValue(); 94 96 } 95 97 … … 189 191 return str; 190 192 } 193 194 void MDataArray::GetData(TVector &v) const 195 { 196 Double_t ncols = GetNumEntries(); 197 198 v.ResizeTo(ncols); 199 200 // same as: for (int i=0; i<ncols; i++) <should be faster> 201 while (ncols--) 202 v(ncols) = (*this)(ncols); 203 } -
trunk/MagicSoft/Mars/mdata/MDataArray.h
r2109 r2114 14 14 #include <TObjArray.h> 15 15 #endif 16 17 class TVector; 16 18 17 19 class MData; … … 31 33 32 34 MData &operator[](Int_t i) const; 33 Double_t operator()(Int_t i); 35 Double_t operator()(Int_t i) const; 36 37 void GetData(TVector &v) const; 38 39 void operator>>(TVector &v) const 40 { 41 GetData(v); 42 } 34 43 35 44 TString GetRule(int i) const;
Note:
See TracChangeset
for help on using the changeset viewer.