Ignore:
Timestamp:
09/12/04 20:13:55 (20 years ago)
Author:
gaug
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mbase/MArray.cc

    r4952 r4953  
    4040ClassImp(MArray);
    4141
     42// --------------------------------------------------------------------------
     43//
     44//  Cuts the last entries of an array containing only zeros.
     45//
     46void MArray::StripZeros(TArray &arr)
     47{
     48
     49  const Int_t n = arr.GetSize();
     50 
     51  for (Int_t i=n-1; i>=0; i--)
     52    if (arr[i] != 0)
     53        {
     54          arr.Set(i+1);
     55          break;
     56        }
     57}
     58
     59// --------------------------------------------------------------------------
     60//
     61//  Cuts the last entries of an array containing only zeros.
     62//
     63void MArray::StripZeros(MArray &arr)
     64{
     65    const Int_t n = arr.GetSize();
     66
     67    for (Int_t i=n-1; i>=0; i--)
     68      if (arr[i] != 0)
     69        {
     70          arr.Set(i+1);
     71          break;
     72        }
     73}
     74
Note: See TracChangeset for help on using the changeset viewer.