source: trunk/MagicSoft/Mars/mbase/MArray.cc@ 3142

Last change on this file since 3142 was 3115, checked in by gaug, 21 years ago
*** empty log message ***
File size: 2.6 KB
Line 
1/* ======================================================================== *\
2!
3! *
4! * This file is part of MARS, the MAGIC Analysis and Reconstruction
5! * Software. It is distributed to you in the hope that it can be a useful
6! * and timesaving tool in analysing Data of imaging Cerenkov telescopes.
7! * It is distributed WITHOUT ANY WARRANTY.
8! *
9! * Permission to use, copy, modify and distribute this software and its
10! * documentation for any purpose is hereby granted without fee,
11! * provided that the above copyright notice appear in all copies and
12! * that both that copyright notice and this permission notice appear
13! * in supporting documentation. It is provided "as is" without express
14! * or implied warranty.
15! *
16!
17!
18! Author(s): Thomas Bretz 12/2000 <mailto:tbretz@uni-sw.gwdg.de>
19!
20! Copyright: MAGIC Software Development, 2000-2001
21!
22!
23\* ======================================================================== */
24
25
26//////////////////////////////////////////////////////////////////////////////
27// //
28// MArray //
29// //
30// This is an abstract base class for TObject derived Arrays. In principal //
31// it is almost the same than TArray. The difference is that this array //
32// base classed is derived from TObject which makes storage of variable //
33// sized arrays possible with splitlevel=1. //
34// //
35// This should not be needed anymore for root >3.00 //
36// //
37//////////////////////////////////////////////////////////////////////////////
38#include "MArray.h"
39
40#include <TArrayF.h>
41#include <TArrayD.h>
42
43ClassImp(MArray);
44
45// --------------------------------------------------------------------------
46//
47// Cuts the last entries of an array containing only zeros.
48//
49void MArray::StripZeros(TArrayD &arr)
50{
51 const Int_t n = arr.GetSize();
52
53 for (Int_t i=n-1; i>=0; i--)
54 if (arr[i] != 0)
55 {
56 arr.Set(i+1);
57 break;
58 }
59}
60
61// --------------------------------------------------------------------------
62//
63// Cuts the last entries of an array containing only zeros.
64//
65void MArray::StripZeros(TArrayF &arr)
66{
67 const Int_t n = arr.GetSize();
68
69 for (Int_t i=n-1; i>=0; i--)
70 if (arr[i] != 0)
71 {
72 arr.Set(i+1);
73 break;
74 }
75}
Note: See TracBrowser for help on using the repository browser.