FairRoot/PandaRoot
PndFTSArray.h
Go to the documentation of this file.
1 /****************************************************************************
2  * This file is property of and copyright by the ALICE HLT Project *
3  * ALICE Experiment at CERN, All rights reserved. *
4  * *
5  * Copyright (C) 2009 Matthias Kretz <kretz@kde.org> *
6  * for The ALICE HLT Project. *
7  * *
8  * Permission to use, copy, modify and distribute this software and its *
9  * documentation strictly for non-commercial purposes is hereby granted *
10  * without fee, provided that the above copyright notice appears in all *
11  * copies and that both the copyright notice and this permission notice *
12  * appear in the supporting documentation. The authors make no claims *
13  * about the suitability of this software for any purpose. It is *
14  * provided "as is" without express or implied warranty. *
15  ***************************************************************************/
16 
27 #ifndef PNDFTSARRAY_H
28 #define PNDFTSARRAY_H
29 
30 #ifndef assert
31 #include <assert.h>
32 #endif
33 
34 #if (defined(__MMX__) || defined(__SSE__))
35 
36 #if defined(__GNUC__)
37 
38 #if __GNUC__ > 3
39 #define USE_MM_MALLOC
40 #endif // if __GNUC__ > 3
41 
42 #else // if defined(__GNUC__) // not gcc, assume it can use _mm_malloc since it supports MMX/SSE
43 
44 #define USE_MM_MALLOC
45 
46 #endif // if defined(__GNUC__)
47 #endif // if (defined(__MMX__) || defined(__SSE__))
48 
49 #ifdef USE_MM_MALLOC
50 #include <mm_malloc.h>
51 #else
52 #include <cstdlib>
53 #endif
54 #include <cstring>
55 
56 enum {
58 };
59 
60 namespace PndFTSArrayInternal
61 {
62  template<bool> class STATIC_ASSERT_FAILURE;
63  template<> class STATIC_ASSERT_FAILURE<true> {};
64 }
65 
66 #define PNDFTSARRAY_STATIC_ASSERT_CONCAT_HELPER(a, b) a##b
67 #define PNDFTSARRAY_STATIC_ASSERT_CONCAT(a, b) PNDFTSARRAY_STATIC_ASSERT_CONCAT_HELPER(a, b)
68 #define PNDFTSARRAY_STATIC_ASSERT_NC(cond, msg) \
69  typedef PndFTSArrayInternal::STATIC_ASSERT_FAILURE<cond> PNDFTSARRAY_STATIC_ASSERT_CONCAT(_STATIC_ASSERTION_FAILED_##msg, __LINE__); \
70  PNDFTSARRAY_STATIC_ASSERT_CONCAT(_STATIC_ASSERTION_FAILED_##msg, __LINE__) Error_##msg
71 #define PNDFTSARRAY_STATIC_ASSERT(cond, msg) PNDFTSARRAY_STATIC_ASSERT_NC(cond, msg); (void) Error_##msg
72 
73 template<typename T, int Dim> class PndFTSArray;
74 
75 namespace PndFTSInternal
76 {
77  template<unsigned int Size> struct Padding { char fPadding[Size]; };
78  template<> struct Padding<0> {};
79  template<typename T> struct CacheLineSizeHelperData { T fData; };
80  template<typename T> struct CacheLineSizeHelperEnums {
81  enum {
83  MaskedSize = sizeof( T ) & ( CacheLineSize - 1 ),
84  RequiredSize = MaskedSize == 0 ? sizeof( T ) : sizeof( T ) + CacheLineSize - MaskedSize,
85  PaddingSize = RequiredSize - sizeof( T )
86  };
87  };
88  template<typename T> class CacheLineSizeHelper : private CacheLineSizeHelperData<T>, private Padding<CacheLineSizeHelperEnums<T>::PaddingSize>
89  {
90  public:
91  operator T &() { return CacheLineSizeHelperData<T>::fData; }
92  operator const T &() const { return CacheLineSizeHelperData<T>::fData; }
93  //const T &operator=( const T &rhs ) { CacheLineSizeHelperData<T>::fData = rhs; }
94 
95  private:
96  };
97  template<typename T, int alignment> struct TypeForAlignmentHelper { typedef T Type; };
99 
100  // XXX
101  // The ArrayBoundsCheck and Allocator classes implement a virtual destructor only in order to
102  // silence the -Weffc++ warning. It really is not required for these classes to have a virtual
103  // dtor since polymorphism is not used (PndFTSResizableArray and PndFTSFixedArray are allocated on
104  // the stack only). The virtual dtor only adds an unnecessary vtable to the code.
105 #ifndef ENABLE_ARRAY_BOUNDS_CHECKING
106 
110  {
111  protected:
112  virtual inline ~ArrayBoundsCheck() {}
113  inline bool IsInBounds( int ) const { return true; }
114  inline void SetBounds( int, int ) {}
115  inline void MoveBounds( int ) {}
116  inline void ReinterpretCast( const ArrayBoundsCheck &, int, int ) {}
117  };
118 #define BOUNDS_CHECK(x, y)
119 #else
120 
123  class ArrayBoundsCheck
124  {
125  protected:
126  virtual inline ~ArrayBoundsCheck() {}
130  inline bool IsInBounds( int x ) const;
134  inline void SetBounds( int start, int end ) { fStart = start; fEnd = end; }
138  inline void MoveBounds( int d ) { fStart += d; fEnd += d; }
139 
140  inline void ReinterpretCast( const ArrayBoundsCheck &other, int sizeofOld, int sizeofNew ) {
141  fStart = other.fStart * sizeofNew / sizeofOld;
142  fEnd = other.fEnd * sizeofNew / sizeofOld;
143  }
144 
145  private:
146  int fStart;
147  int fEnd;
148  };
149 #define BOUNDS_CHECK(x, y) if (PndFTSInternal::ArrayBoundsCheck::IsInBounds(x)) {} else return y
150 #endif
151  template<typename T, int alignment> class Allocator
152  {
153  public:
154 #ifdef USE_MM_MALLOC
155  static inline T *Alloc( int s ) { T *p = reinterpret_cast<T *>( _mm_malloc( s * sizeof( T ), alignment ) ); return new( p ) T[s]; }
156  static inline void Free( T *const p, int size ) {
157  for ( int i = 0; i < size; ++i ) {
158  p[i].~T();
159  }
160  _mm_free( p );
161  }
162 #else
163  static inline T *Alloc( int s ) { T *p; posix_memalign( &p, alignment, s * sizeof( T ) ); return new( p ) T[s]; }
164  static inline void Free( T *const p, int size ) {
165  for ( int i = 0; i < size; ++i ) {
166  p[i].~T();
167  }
168  std::free( p );
169  }
170 #endif
171  };
172  template<typename T> class Allocator<T, PndFTSFullyCacheLineAligned>
173  {
174  public:
176 #ifdef USE_MM_MALLOC
177  static inline T2 *Alloc( int s ) { T2 *p = reinterpret_cast<T2 *>( _mm_malloc( s * sizeof( T2 ), 128 ) ); return new( p ) T2[s]; }
178  static inline void Free( T2 *const p, int size ) {
179  for ( int i = 0; i < size; ++i ) {
180  p[i].~T2();
181  }
182  _mm_free( p );
183  }
184 #else
185  static inline T2 *Alloc( int s ) { T2 *p; posix_memalign( &p, 128, s * sizeof( T2 ) ); return new( p ) T2[s]; }
186  static inline void Free( T2 *const p, int size ) {
187  for ( int i = 0; i < size; ++i ) {
188  p[i].~T2();
189  }
190  std::free( p );
191  }
192 #endif
193  };
194  template<typename T> class Allocator<T, 0>
195  {
196  public:
197 #ifdef USE_MM_MALLOC
198  static inline T *Alloc( int s ) { T *p = reinterpret_cast<T *>( _mm_malloc( s * sizeof( T ), 128 ) ); return new( p ) T[s]; }
199  static inline void Free( T *const p, int size ) {
200  for ( int i = 0; i < size; ++i ) {
201  p[i].~T();
202  }
203  _mm_free( p );
204  }
205 #else
206  static inline T *Alloc( int s ) { T *p; posix_memalign( &p, 128, s * sizeof( T ) ); return new( p ) T[s]; }
207  static inline void Free( T *const p, int size ) {
208  for ( int i = 0; i < size; ++i ) {
209  p[i].~T();
210  }
211  std::free( p );
212  }
213 #endif
214 
215 // public:
216 // static inline T *Alloc( int s ) { return new T[s]; }
217 // static inline void Free( const T *const p, int ) { delete[] p; }
218  };
219 
220  template<typename T> struct ReturnTypeHelper { typedef T Type; };
221  template<typename T> struct ReturnTypeHelper<CacheLineSizeHelper<T> > { typedef T Type; };
225  template<typename T, int Dim> class ArrayBase;
226 
230  template<typename T>
231  class ArrayBase<T, 1> : public ArrayBoundsCheck
232  {
233  friend class ArrayBase<T, 2>;
234  public:
235  ArrayBase() : fData( 0 ) {} // XXX really shouldn't be done. But -Weffc++ wants it so
236  ArrayBase( const ArrayBase &rhs ) : ArrayBoundsCheck( rhs ), fData( rhs.fData ), fSize( rhs.fSize ) {} // XXX
237  ArrayBase &operator=( const ArrayBase &rhs ) { ArrayBoundsCheck::operator=( rhs ); fData = rhs.fData; fSize = rhs.fSize; return *this; } // XXX
238  typedef typename ReturnTypeHelper<T>::Type R;
242  inline R &operator[]( int x ) { BOUNDS_CHECK( x, fData[0] ); return fData[x]; }
246  inline const R &operator[]( int x ) const { BOUNDS_CHECK( x, fData[0] ); return fData[x]; }
247 
248  protected:
250  int fSize;
251  inline void SetSize( int x, int, int ) { fSize = x; }
252  };
253 
258  template<typename T>
259  class ArrayBase<T, 2> : public ArrayBoundsCheck
260  {
261  friend class ArrayBase<T, 3>;
262  public:
263  ArrayBase() : fData( 0 ), fSize( 0 ), fStride( 0 ) {} // XXX really shouldn't be done. But -Weffc++ wants it so
264  ArrayBase( const ArrayBase &rhs ) : ArrayBoundsCheck( rhs ), fData( rhs.fData ), fSize( rhs.fSize ), fStride( rhs.fStride ) {} // XXX
265  ArrayBase &operator=( const ArrayBase &rhs ) { ArrayBoundsCheck::operator=( rhs ); fData = rhs.fData; fSize = rhs.fSize; fStride = rhs.fStride; return *this; } // XXX
266  typedef typename ReturnTypeHelper<T>::Type R;
270  inline R &operator()( int x, int y ) { BOUNDS_CHECK( x * fStride + y, fData[0] ); return fData[x * fStride + y]; }
274  inline const R &operator()( int x, int y ) const { BOUNDS_CHECK( x * fStride + y, fData[0] ); return fData[x * fStride + y]; }
278  inline PndFTSArray<T, 1> operator[]( int x );
282  inline const PndFTSArray<T, 1> operator[]( int x ) const;
283 
284  protected:
286  int fSize;
287  int fStride;
288  inline void SetSize( int x, int y, int ) { fStride = y; fSize = x * y; }
289  };
290 
295  template<typename T>
296  class ArrayBase<T, 3> : public ArrayBoundsCheck
297  {
298  public:
299  ArrayBase() : fData( 0 ), fSize( 0 ), fStrideX( 0 ), fStrideY( 0 ) {} // XXX really shouldn't be done. But -Weffc++ wants it so
300  ArrayBase( const ArrayBase &rhs ) : ArrayBoundsCheck( rhs ), fData( rhs.fData ), fSize( rhs.fSize ), fStrideX( rhs.fStrideX ), fStrideY( rhs.fStrideY ) {} // XXX
301  ArrayBase &operator=( const ArrayBase &rhs ) { ArrayBoundsCheck::operator=( rhs ); fData = rhs.fData; fSize = rhs.fSize; fStrideX = rhs.fStrideX; fStrideY = rhs.fStrideY; return *this; } // XXX
302  typedef typename ReturnTypeHelper<T>::Type R;
306  inline R &operator()( int x, int y, int z );
310  inline const R &operator()( int x, int y, int z ) const;
314  inline PndFTSArray<T, 2> operator[]( int x );
318  inline const PndFTSArray<T, 2> operator[]( int x ) const;
319 
320  protected:
322  int fSize;
323  int fStrideX;
324  int fStrideY;
325  inline void SetSize( int x, int y, int z ) { fStrideX = y * z; fStrideY = z; fSize = fStrideX * x; }
326  };
327 
328  template<typename T, unsigned int Size, int _alignment> class AlignedData
329  {
330  public:
332  const int offset = reinterpret_cast<unsigned long>( &fUnalignedArray[0] ) & ( Alignment - 1 );
333  void *mem = &fUnalignedArray[0] + ( Alignment - offset );
334  return new( mem ) T[Size];
335  }
337  const int offset = reinterpret_cast<unsigned long>( &fUnalignedArray[0] ) & ( Alignment - 1 );
338  T *mem = reinterpret_cast<T *>( &fUnalignedArray[0] + ( Alignment - offset ) );
339  for ( unsigned int i = 0; i < Size; ++i ) {
340  mem[i].~T();
341  }
342  }
343  private:
344  enum {
345  Alignment = _alignment == PndFTSFullyCacheLineAligned ? 128 : _alignment,
346  PaddedSize = Size * sizeof( T ) + Alignment
347  };
348  PNDFTSARRAY_STATIC_ASSERT_NC( ( Alignment & ( Alignment - 1 ) ) == 0, alignment_needs_to_be_a_multiple_of_2 );
349 
350  char fUnalignedArray[PaddedSize];
351  };
352  template<typename T, unsigned int Size> class AlignedData<T, Size, 0>
353  {
354  public:
355  T *ConstructAlignedData() { return &fArray[0]; }
356  private:
357  T fArray[Size];
358  };
359 } // namespace PndFTSInternal
360 
364 template < typename T, int Dim = 1 >
365 class PndFTSArray : public PndFTSInternal::ArrayBase<T, Dim>
366 {
367  public:
369 
374  inline int Size() const { return Parent::fSize; }
375 
379  inline operator bool() const { return Parent::fData != 0; }
383  inline bool IsValid() const { return Parent::fData != 0; }
384 
388  inline T &operator*() { BOUNDS_CHECK( 0, Parent::fData[0] ); return *Parent::fData; }
392  inline const T &operator*() const { BOUNDS_CHECK( 0, Parent::fData[0] ); return *Parent::fData; }
393 
398  inline T *Data() { return Parent::fData; }
403  inline const T *Data() const { return Parent::fData; }
404 
408  inline PndFTSArray operator+( int x ) const;
412  inline PndFTSArray operator-( int x ) const;
413 
414  template<typename Other> inline PndFTSArray<Other, Dim> ReinterpretCast() const {
416  r.fData = reinterpret_cast<Other *>( Parent::fData );
417  r.ReinterpretCast( *this, sizeof( T ), sizeof( Other ) );
418  }
419 };
420 
454 template < typename T, int Dim = 1, int alignment = 0 >
455 class PndFTSResizableArray : public PndFTSArray<typename PndFTSInternal::TypeForAlignmentHelper<T, alignment>::Type, Dim>
456 {
457  public:
463  inline PndFTSResizableArray();
467  inline PndFTSResizableArray( int x );
471  inline PndFTSResizableArray( int x, int y );
475  inline PndFTSResizableArray( int x, int y, int z );
476 
480  inline ~PndFTSResizableArray() { PndFTSInternal::Allocator<T, alignment>::Free( Parent::fData, Parent::fSize ); }
481 
488  inline void Resize( int x );
495  inline void Resize( int x, int y );
502  inline void Resize( int x, int y, int z );
503 
504  private:
505  // disable allocation on the heap
506  void *operator new( size_t );
507 
508  // disable copy
510  PndFTSResizableArray &operator=( const PndFTSResizableArray & );
511 };
512 
513 template<unsigned int x, unsigned int y = 0, unsigned int z = 0> class PndFTSArraySize
514 {
515  public:
516  enum {
517  Size = y == 0 ? x : ( z == 0 ? x * y : x * y * z ),
518  Dim = y == 0 ? 1 : ( z == 0 ? 2 : 3 ),
519  X = x, Y = y, Z = z
520  };
521 };
522 
535 template<typename T, typename Size, int alignment = 0>
536 class PndFTSFixedArray : public PndFTSArray<typename PndFTSInternal::TypeForAlignmentHelper<T, alignment>::Type, Size::Dim>
537 {
538  public:
541  inline PndFTSFixedArray() {
542  fData = fFixedArray.ConstructAlignedData();
543  Parent::SetBounds( 0, Size::Size - 1 );
544  SetSize( Size::X, Size::Y, Size::Z );
545  }
547  fData = fFixedArray.ConstructAlignedData();
548  Parent::SetBounds( 0, Size::Size - 1 );
549  SetSize( Size::X, Size::Y, Size::Z );
550  std::memcpy( fData, rhs.fData, Size::Size * sizeof( T ) );
551  }
552 
553  private:
555 
556  // disable allocation on the heap
557  void *operator new( size_t );
558 
559  using Parent::fData;
560 
561  // disable copy
562  PndFTSFixedArray &operator=( const PndFTSFixedArray & );
563 };
564 
565 
566 
567 
571 
572 
573 
574 
575 namespace PndFTSInternal
576 {
577 #ifdef ENABLE_ARRAY_BOUNDS_CHECKING
578  inline bool ArrayBoundsCheck::IsInBounds( int x ) const
579  {
580  assert( x >= fStart );
581  assert( x <= fEnd );
582  return ( x >= fStart && x <= fEnd );
583  }
584 #endif
585 
586  template<typename T>
588  {
589  x *= fStride;
590  //typedef PndFTSArray<T, 1> AT1;
591  //BOUNDS_CHECK( x, AT1() );
593  a.fData = &fData[x];
594  a.ArrayBoundsCheck::operator=( *this );
595  a.MoveBounds( -x );
596  return a;
597  }
598 
599  template<typename T>
600  inline const PndFTSArray<T, 1> ArrayBase<T, 2>::operator[]( int x ) const
601  {
602  x *= fStride;
603  //typedef PndFTSArray<T, 1> AT1;
604  //BOUNDS_CHECK( x, AT1() );
606  a.fData = &fData[x];
607  a.ArrayBoundsCheck::operator=( *this );
608  a.MoveBounds( -x );
609  return a;
610  }
611 
612  template<typename T>
614  {
615  BOUNDS_CHECK( x * fStrideX + y + fStrideY + z, fData[0] );
616  return fData[x * fStrideX + y + fStrideY + z];
617  }
618  template<typename T>
619  inline const typename PndFTSInternal::ArrayBase<T, 3>::R &ArrayBase<T, 3>::operator()( int x, int y, int z ) const
620  {
621  BOUNDS_CHECK( x * fStrideX + y + fStrideY + z, fData[0] );
622  return fData[x * fStrideX + y + fStrideY + z];
623  }
624  template<typename T>
626  {
627  x *= fStrideX;
628  //typedef PndFTSArray<T, 2> AT2;
629  //BOUNDS_CHECK( x, AT2() );
631  a.fData = &fData[x];
632  a.fStride = fStrideY;
633  a.ArrayBoundsCheck::operator=( *this );
634  a.MoveBounds( -x );
635  return a;
636  }
637  template<typename T>
638  inline const PndFTSArray<T, 2> ArrayBase<T, 3>::operator[]( int x ) const
639  {
640  x *= fStrideX;
641  //typedef PndFTSArray<T, 2> AT2;
642  //BOUNDS_CHECK( x, AT2() );
644  a.fData = &fData[x];
645  a.fStride = fStrideY;
646  a.ArrayBoundsCheck::operator=( *this );
647  a.MoveBounds( -x );
648  return a;
649  }
650 } // namespace PndFTSInternal
651 
652 
653 template<typename T, int Dim>
655 {
656  PndFTSArray<T, Dim> r( *this );
657  r.fData += x;
658  r.MoveBounds( -x );
659  return r;
660 }
661 template<typename T, int Dim>
663 {
664  PndFTSArray<T, Dim> r( *this );
665  r.fData -= x;
666  r.MoveBounds( x );
667  return r;
668 }
669 
670 template<typename T, int Dim, int alignment>
672 {
673  Parent::fData = 0;
674  Parent::SetSize( 0, 0, 0 );
675  Parent::SetBounds( 0, -1 );
676 }
677 template<typename T, int Dim, int alignment>
679 {
680  PNDFTSARRAY_STATIC_ASSERT( Dim == 1, PndFTSResizableArray1_used_with_incorrect_dimension );
682  Parent::SetSize( x, 0, 0 );
683  Parent::SetBounds( 0, x - 1 );
684 }
685 template<typename T, int Dim, int alignment>
687 {
688  PNDFTSARRAY_STATIC_ASSERT( Dim == 2, PndFTSResizableArray2_used_with_incorrect_dimension );
689  Parent::fData = PndFTSInternal::Allocator<T, alignment>::Alloc( x * y );
690  Parent::SetSize( x, y, 0 );
691  Parent::SetBounds( 0, x * y - 1 );
692 }
693 template<typename T, int Dim, int alignment>
695 {
696  PNDFTSARRAY_STATIC_ASSERT( Dim == 3, PndFTSResizableArray3_used_with_incorrect_dimension );
697  Parent::fData = PndFTSInternal::Allocator<T, alignment>::Alloc( x * y * z );
698  Parent::SetSize( x, y, z );
699  Parent::SetBounds( 0, x * y * z - 1 );
700 }
701 // #include <iostream>
702 template<typename T, int Dim, int alignment>
704 {
705  PNDFTSARRAY_STATIC_ASSERT( Dim == 1, PndFTSResizableArray1_resize_used_with_incorrect_dimension );
706  PndFTSInternal::Allocator<T, alignment>::Free( Parent::fData, Parent::fSize );
707  Parent::fData = ( x == 0 ) ? 0 : PndFTSInternal::Allocator<T, alignment>::Alloc( x );
708  Parent::SetSize( x, 0, 0 );
709  Parent::SetBounds( 0, x - 1 );
710 }
711 template<typename T, int Dim, int alignment>
713 {
714  PNDFTSARRAY_STATIC_ASSERT( Dim == 2, PndFTSResizableArray2_resize_used_with_incorrect_dimension );
715  PndFTSInternal::Allocator<T, alignment>::Free( Parent::fData, Parent::fSize );
716  Parent::fData = ( x == 0 ) ? 0 : PndFTSInternal::Allocator<T, alignment>::Alloc( x * y );
717  Parent::SetSize( x, y, 0 );
718  Parent::SetBounds( 0, x * y - 1 );
719 }
720 template<typename T, int Dim, int alignment>
722 {
723  PNDFTSARRAY_STATIC_ASSERT( Dim == 3, PndFTSResizableArray3_resize_used_with_incorrect_dimension );
724  PndFTSInternal::Allocator<T, alignment>::Free( Parent::fData, Parent::fSize );
725  Parent::fData = ( x == 0 ) ? 0 : PndFTSInternal::Allocator<T, alignment>::Alloc( x * y * z );
726  Parent::SetSize( x, y, z );
727  Parent::SetBounds( 0, x * y * z - 1 );
728 }
729 
730 #undef BOUNDS_CHECK
731 
732 #endif // PNDFTSARRAY_H
#define PNDFTSARRAY_STATIC_ASSERT(cond, msg)
Definition: PndFTSArray.h:71
RhoError operator-(const RhoError &m1, const RhoError &m2)
Definition: RhoError.cxx:255
Double_t p
Definition: anasim.C:58
const T & operator*() const
Definition: PndFTSArray.h:392
ReturnTypeHelper< T >::Type R
Definition: PndFTSArray.h:302
PndFTSInternal::TypeForAlignmentHelper< T, alignment >::Type T2
Definition: PndFTSArray.h:458
double r
Definition: RiemannTest.C:14
TObjArray * d
Int_t i
Definition: run_full.C:25
ArrayBase(const ArrayBase &rhs)
Definition: PndFTSArray.h:236
int Size() const
Definition: PndFTSArray.h:374
TLorentzVector s
Definition: Pnd2DStar.C:50
static void Free(T *const p, int size)
Definition: PndFTSArray.h:164
const R & operator()(int x, int y) const
Definition: PndFTSArray.h:274
PndFTSInternal::ArrayBase< T2, Dim > Parent
Definition: PndFTSArray.h:459
TVector3 offset(2, 0, 0)
double Y
Definition: anaLmdDigi.C:68
ArrayBase(const ArrayBase &rhs)
Definition: PndFTSArray.h:264
PndFTSArray< Other, Dim > ReinterpretCast() const
Definition: PndFTSArray.h:414
static void Free(T *const p, int size)
Definition: PndFTSArray.h:207
PndFTSInternal::ArrayBase< T2, Size::Dim > Parent
Definition: PndFTSArray.h:540
const R & operator[](int x) const
Definition: PndFTSArray.h:246
RhoError operator+(const RhoError &m1, const RhoError &m2)
Definition: RhoError.cxx:245
TTree * T
Definition: anaLmdReco.C:32
PndFTSArray operator-(int x) const
Definition: PndFTSArray.h:662
ArrayBase(const ArrayBase &rhs)
Definition: PndFTSArray.h:300
Int_t a
Definition: anaLmdDigi.C:126
void ReinterpretCast(const ArrayBoundsCheck &, int, int)
Definition: PndFTSArray.h:116
#define BOUNDS_CHECK(x, y)
Definition: PndFTSArray.h:118
ArrayBase & operator=(const ArrayBase &rhs)
Definition: PndFTSArray.h:265
const T * Data() const
Definition: PndFTSArray.h:403
PndFTSArray operator+(int x) const
Definition: PndFTSArray.h:654
ArrayBase & operator=(const ArrayBase &rhs)
Definition: PndFTSArray.h:237
T & operator*()
Definition: PndFTSArray.h:388
ReturnTypeHelper< T >::Type R
Definition: PndFTSArray.h:266
Double_t z
float & operator[](int i)
Definition: P4_F32vec4.h:6
PndFTSFixedArray(const PndFTSFixedArray &rhs)
Definition: PndFTSArray.h:546
static T * Alloc(int s)
Definition: PndFTSArray.h:163
void SetSize(int x, int y, int z)
Definition: PndFTSArray.h:325
double X
Definition: anaLmdDigi.C:68
ReturnTypeHelper< T >::Type R
Definition: PndFTSArray.h:238
#define PNDFTSARRAY_STATIC_ASSERT_NC(cond, msg)
Definition: PndFTSArray.h:68
bool IsValid() const
Definition: PndFTSArray.h:383
Double_t x
void SetSize(int x, int, int)
Definition: PndFTSArray.h:251
double Z
Definition: anaLmdDigi.C:68
ArrayBase & operator=(const ArrayBase &rhs)
Definition: PndFTSArray.h:301
PndFTSInternal::ArrayBase< T, Dim > Parent
Definition: PndFTSArray.h:368
PndFTSInternal::AlignedData< typename PndFTSInternal::TypeForAlignmentHelper< T, alignment >::Type, Size::Size, alignment > fFixedArray
Definition: PndFTSArray.h:554
Double_t y
void Resize(int x)
Definition: PndFTSArray.h:703
void SetSize(int x, int y, int)
Definition: PndFTSArray.h:288
PndFTSInternal::TypeForAlignmentHelper< T, alignment >::Type T2
Definition: PndFTSArray.h:539