Ignore:
Timestamp:
05/13/03 15:16:54 (21 years ago)
Author:
tbretz
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mdata
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mdata/MDataArray.cc

    r2109 r2114  
    3535#include <fstream.h>
    3636
     37#include <TVector.h>
     38
    3739#include "MLog.h"
    3840#include "MLogManip.h"
     
    8991// Return the data value of the i-th entry
    9092//
    91 Double_t MDataArray::operator()(Int_t i)
    92 {
    93     return ((MData*)fList[i])->GetValue();
     93Double_t MDataArray::operator()(Int_t i) const
     94{
     95    return (*this)[i].GetValue();
    9496}
    9597
     
    189191    return str;
    190192}
     193
     194void 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  
    1414#include <TObjArray.h>
    1515#endif
     16
     17class TVector;
    1618
    1719class MData;
     
    3133
    3234    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    }
    3443
    3544    TString GetRule(int i) const;
Note: See TracChangeset for help on using the changeset viewer.