Changeset 2419 for trunk/MagicSoft


Ignore:
Timestamp:
10/21/03 09:31:06 (21 years ago)
Author:
wittek
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/Changelog

    r2417 r2419  
    11                                                 -*-*- 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
    212  2003/10/20: Thomas Bretz
    313
  • trunk/MagicSoft/Mars/manalysis/MMatrixLoop.cc

    r2206 r2419  
    3434
    3535#include "MHMatrix.h"
     36#include "MLog.h"
    3637
    3738ClassImp(MMatrixLoop);
     
    5354// --------------------------------------------------------------------------
    5455//
     56
     57Int_t MMatrixLoop::PreProcess(MParList *plist)
     58    {
     59        fNumRow = 0;
     60
     61        return fMatrix ? kTRUE : kFALSE;
     62    }
     63
     64// --------------------------------------------------------------------------
     65//
    5566// Set the present row of the Matrix, stops the loop when all rows have
    5667// been accessed.
     
    6172}
    6273
     74
     75
     76
     77
     78
     79
     80
     81
     82
  • trunk/MagicSoft/Mars/manalysis/MMatrixLoop.h

    r2206 r2419  
    55#include "MTask.h"
    66#endif
     7
    78
    89class MHMatrix;
     
    2122    MMatrixLoop(MHMatrix *mat, const char *name=NULL, const char *title=NULL);
    2223
    23     Int_t PreProcess(MParList *plist)
    24     {
    25         fNumRow = 0;
    26 
    27         return fMatrix ? kTRUE : kFALSE;
    28     }
    29 
     24    Int_t PreProcess(MParList *plist);
    3025    Int_t Process();
    3126
  • trunk/MagicSoft/Mars/mhist/MHMatrix.cc

    r2406 r2419  
    8383//
    8484MHMatrix::MHMatrix(const char *name, const char *title)
    85     : fNumRow(0), fData(NULL)
     85    : fNumRows(0), fData(NULL)
    8686{
    8787    fName  = name  ? name  : gsDefName.Data();
     
    9494//
    9595MHMatrix::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)
    9797{
    9898    fName  = name  ? name  : gsDefName.Data();
     
    106106//
    107107MHMatrix::MHMatrix(MDataArray *mat, const char *name, const char *title)
    108     : fNumRow(0), fData(mat)
     108    : fNumRows(0), fData(mat)
    109109{
    110110    fName  = name  ? name  : gsDefName.Data();
     
    122122        delete fData;
    123123}
     124
     125// --------------------------------------------------------------------------
     126//
     127Bool_t MHMatrix::SetNumRow(Int_t row)
     128    {
     129      if (row>=fM.GetNrows() || row<0) return kFALSE;
     130      fRow = row;
     131      return kTRUE;
     132    }
     133
    124134
    125135// --------------------------------------------------------------------------
     
    205215void MHMatrix::AddRow()
    206216{
    207     fNumRow++;
    208 
    209     if (fM.GetNrows() > fNumRow)
     217    fNumRows++;
     218
     219    if (fM.GetNrows() > fNumRows)
    210220        return;
    211221
     
    237247
    238248    for (int col=0; col<fData->GetNumEntries(); col++)
    239         fM(fNumRow-1, col) = (*fData)(col);
     249        fM(fNumRows-1, col) = (*fData)(col);
    240250
    241251    return kTRUE;
     
    252262    // It's not a fatal error so we don't need to stop PostProcessing...
    253263    //
    254     if (fData->GetNumEntries()==0 || fNumRow<1)
     264    if (fData->GetNumEntries()==0 || fNumRows<1)
    255265        return kTRUE;
    256266
    257     if (fNumRow != fM.GetNrows())
     267    if (fNumRows != fM.GetNrows())
    258268    {
    259269        TMatrix m(fM);
    260         CopyCrop(fM, m, fNumRow);
     270        CopyCrop(fM, m, fNumRows);
    261271    }
    262272
     
    900910    //
    901911    CopyCrop(fM, mnewtmp, evtcount1);
    902     fNumRow = evtcount1;
     912    fNumRows = evtcount1;
    903913
    904914    if (evtcount1 < nmaxevts)
     
    10081018    //
    10091019    CopyCrop(fM, mnewtmp, evtcount1);
    1010     fNumRow = evtcount1;
     1020    fNumRows = evtcount1;
    10111021
    10121022    if (evtcount1 < nmaxevts)
     
    11111121    TVector v(fM.GetNcols());
    11121122    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);
    11161126
    11171127        v = TMatrixRow(fM, irow);
  • trunk/MagicSoft/Mars/mhist/MHMatrix.h

    r2357 r2419  
    3030    static const TString gsDefTitle; //! Default Title
    3131
    32     Int_t   fNumRow;    // Number of dimensions of histogram
     32    Int_t   fNumRows;   //! Number of rows filled into the matrix (this is NOT the number of rows of the matrix!)
    3333    Int_t   fRow;       //! Present row
    3434    TMatrix fM;         // Matrix to be filled
     
    7575
    7676    Bool_t IsValid() const { return fM.IsValid(); }
    77     Int_t  GetNumRows() const { return fNumRow; }
     77    Int_t  GetNumRows() const { return fM.GetNrows(); }
    7878
    7979    //void Draw(Option_t *opt=NULL);
     
    9494    void SortMatrixByColumn(Int_t ncol=0, Bool_t desc=kTRUE);
    9595
    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 
    9798    Int_t GetNumRow() const { return fRow; };
    9899    Double_t operator[](Int_t col) { return fM(fRow, col); }
Note: See TracChangeset for help on using the changeset viewer.