| The Gaudi Framework v32r1 (f65d50dc)

NTuple.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_NTUPLE_H
2 #define GAUDIKERNEL_NTUPLE_H
3 // ============================================================================
4 // STL include files
5 // ============================================================================
6 #include <algorithm>
7 #include <cfloat>
8 #include <limits>
9 #include <stdexcept>
10 #include <string>
11 // ============================================================================
12 // Framework include files
13 // ============================================================================
14 #include "GaudiKernel/DataObject.h"
15 #include "GaudiKernel/DataTypeInfo.h"
16 #include "GaudiKernel/INTuple.h"
17 #include "GaudiKernel/IOpaqueAddress.h"
18 #include "GaudiKernel/SmartDataPtr.h"
19 // ============================================================================
20 // Forward declarations
21 // ============================================================================
22 class NTupleFile;
23 class NTupleDirectory;
24 // ============================================================================
33 namespace NTuple {
34 // local forward declarations
35 template <class TYP>
36 class Range;
37 template <class TYP>
38 class _Data;
39 template <class TYP>
40 class _Item;
41 template <class TYP>
42 class _Array;
43 template <class TYP>
44 class _Matrix;
45 template <class TYP>
46 class _Accessor;
47 template <class TYP>
48 class Item;
49 template <class TYP>
50 class Array;
51 template <class TYP>
52 class Matrix;
53 // ==========================================================================
55 template <class TYP>
56 class Range {
58 /*const*/ TYP m_lower;
60 /*const*/ TYP m_upper;
61
62 public:
64 Range( TYP low, TYP upper ) : m_lower( std::move( low ) ), m_upper( std::move( upper ) ) {}
66 Range( const Range<TYP>& copy ) : m_lower( copy.m_lower ), m_upper( copy.m_upper ) {}
68 Range& operator=( const Range<TYP>& copy ) {
69 m_lower = copy.m_lower;
70 m_upper = copy.m_upper;
71 return *this;
72 }
74 virtual ~Range() = default;
76 TYP lower() const { return m_lower; }
78 TYP upper() const { return m_upper; }
80 TYP distance() const { return m_upper - m_lower; }
82 static TYP min() { return std::numeric_limits<TYP>::min(); }
84 static TYP max() { return std::numeric_limits<TYP>::max(); }
85 };
86 // ==========================================================================
87 template <>
88 class Range<bool> {
89 public:
91 Range( const bool /* low */, const bool /* upper */ ) {}
93 Range( const Range<bool>& /* copy */ ) {}
95 virtual ~Range() = default;
97 bool lower() const { return false; }
99 bool upper() const { return true; }
101 bool distance() const { return true; }
103 static bool min() { return false; }
105 static bool max() { return true; }
106 };
107 // ==========================================================================
108 template <>
109 inline IOpaqueAddress* Range<IOpaqueAddress*>::min() {
110 return (IOpaqueAddress*)0x0;
111 }
112 template <>
113 inline IOpaqueAddress* Range<IOpaqueAddress*>::max() {
114 return (IOpaqueAddress*)0xffffffff;
115 }
116 // ==========================================================================
119 template <class TYP>
120 class GAUDI_API _Data : virtual public INTupleItem {
121 protected:
123 TYP* m_buffer = nullptr;
124
125 public:
127 typedef Range<TYP> ItemRange;
129 virtual void setDefault( const TYP d ) = 0;
131 virtual const ItemRange& range() const = 0;
132 };
133 // ==========================================================================
136 template <class TYP>
137 class GAUDI_API _Item : virtual public _Data<TYP> {
138 public:
140 static _Item* create( INTuple* tup, const std::string& name, const std::type_info& info, TYP min, TYP max,
141 TYP def );
143 template <class T>
144 _Item<TYP>& operator=( const _Item<T>& copy ) {
145 *this->m_buffer = copy.get();
146 return *this;
147 }
149 void set( const TYP& item ) { *this->m_buffer = item; }
151 virtual TYP get() const { return *this->m_buffer; }
152 };
153 // ==========================================================================
156 template <class TYP>
157 class GAUDI_API _Array : virtual public _Data<TYP> {
158 public:
160 static _Array* create( INTuple* tup, const std::string& name, const std::type_info& info, const std::string& index,
161 long len, TYP min, TYP max, TYP def );
163 template <class T>
164 _Array<TYP>& operator=( const _Array<T>& copy ) {
165 long len = this->length();
166 if ( len == copy.length() ) {
167 const T* source = (const T*)copy.buffer();
168 std::copy_n( source, len, this->m_buffer );
169 return *this;
170 }
171 throw std::out_of_range( "N-tuple matrix cannot be copied! The index range does not match!" );
172 return *this;
173 }
175 const TYP& data( long i ) const { return this->m_buffer[i]; }
177 TYP& data( long i ) { return this->m_buffer[i]; }
178
179 TYP* begin() { return this->m_buffer; }
180 TYP* end() { return this->m_buffer + this->length(); }
181 };
182 // ==========================================================================
185 template <class TYP>
186 class GAUDI_API _Matrix : virtual public _Data<TYP> {
187 protected:
189 long m_rows;
190
191 public:
193 static _Matrix* create( INTuple* tup, const std::string& name, const std::type_info& info, const std::string& index,
194 long ncol, long nrow, TYP min, TYP max, TYP def );
196 template <class T>
197 _Matrix<TYP>& operator=( const _Matrix<T>& copy ) {
198 long len = this->length();
199 if ( len == copy.length() ) {
200 const T* source = (const T*)copy.buffer();
201 std::copy_n( source, len, this->m_buffer );
202 return *this;
203 }
204 throw std::out_of_range( "N-tuple matrix cannot be copied! The index range does not match!" );
205 return *this;
206 }
208 TYP* column( long i ) { return this->m_buffer + i * m_rows; }
210 const TYP* column( long i ) const { return this->m_buffer + i * m_rows; }
211 };
212 // ==========================================================================
215 template <class TYP>
216 class _Accessor {
217 friend class Tuple;
218
219 private:
220 _Accessor<TYP>& operator=( const _Accessor<TYP>& ) { return *this; }
221
222 protected:
224 mutable TYP* m_ptr = nullptr;
225
226 public:
228 _Accessor() = default;
230 virtual ~_Accessor() = default;
232 bool operator!() const { return m_ptr != 0; }
234 operator const void*() const { return m_ptr; }
236 TYP* operator->() { return m_ptr; }
238 const TYP* operator->() const { return m_ptr; }
240 const Range<TYP>& range() const { return m_ptr->range(); }
241 };
242 // ==========================================================================
245 template <class TYP>
246 class Item : virtual public _Accessor<_Item<TYP>> {
247 typedef Item<TYP> _My;
248
249 public:
251 Item() = default;
253 operator const TYP() const { return this->m_ptr->get(); }
255 TYP operator*() { return this->m_ptr->get(); }
257 const TYP operator*() const { return this->m_ptr->get(); }
258 // Arithmetic operators defined on NTuple column entries
259 Item& operator++() { return *this += TYP( 1 ); }
260 Item& operator++( int ) { return *this += TYP( 1 ); }
261 Item& operator--() { return *this -= TYP( 1 ); }
262 Item& operator--( int ) { return *this -= TYP( 1 ); }
264 Item& operator=( const TYP data ) {
265 this->m_ptr->set( data );
266 return *this;
267 }
269 template <class T>
270 Item& operator=( const Item<T>& data ) {
271 this->m_ptr->set( data->get() );
272 return *this;
273 }
274 Item<TYP>& operator+=( const TYP data ) {
275 this->m_ptr->set( this->m_ptr->get() + data );
276 return *this;
277 }
278 Item<TYP>& operator-=( const TYP data ) {
279 this->m_ptr->set( this->m_ptr->get() - data );
280 return *this;
281 }
282 Item<TYP>& operator*=( const TYP data ) {
283 this->m_ptr->set( this->m_ptr->get() * data );
284 return *this;
285 }
286 Item<TYP>& operator/=( const TYP data ) {
287 this->m_ptr->set( this->m_ptr->get() / data );
288 return *this;
289 }
290 };
291 // ==========================================================================
294 template <>
295 class Item<bool> : virtual public _Accessor<_Item<bool>> {
296 typedef Item<bool> _My;
297
298 public:
300 Item() = default;
302 operator bool() const { return this->m_ptr->get(); }
304 Item& operator=( const bool data ) {
305 this->m_ptr->set( data );
306 return *this;
307 }
309 template <class T>
310 Item& operator=( const Item<T>& data ) {
311 this->m_ptr->set( data->get() );
312 return *this;
313 }
314 };
315 // ==========================================================================
318 template <class TYP>
319 class Array : virtual public _Accessor<_Array<TYP>> {
320 public:
322 Array() = default;
324 template <class T>
325 Array& operator=( const Array<T>& copy ) {
326 *( this->m_ptr ) = *( copy.operator->() );
327 return *this;
328 }
330 template <class T>
331 TYP& operator[]( const T i ) {
332 return this->m_ptr->data( i );
333 }
335 template <class T>
336 const TYP& operator[]( const T i ) const {
337 return this->m_ptr->data( i );
338 }
339
340 TYP* begin() { return this->m_ptr->begin(); }
341 TYP* end() { return this->m_ptr->end(); }
342 };
343 // =========================================================================
346 template <class TYP>
347 class Matrix : virtual public _Accessor<_Matrix<TYP>> {
348 public:
350 Matrix() = default;
352 template <class T>
353 Matrix& operator=( const Matrix<T>& copy ) {
354 *( this->m_ptr ) = *( copy.operator->() );
355 return *this;
356 }
358 template <class T>
359 TYP* operator[]( const T i ) {
360 return this->m_ptr->column( i );
361 }
363 template <class T>
364 const TYP* operator[]( const T i ) const {
365 return this->m_ptr->column( i );
366 }
367 };
368 // =========================================================================
375 class Tuple : public DataObject, virtual public INTuple {
376
377 protected:
379 template <class TYPE>
380 StatusCode i_item( const std::string& name, _Item<TYPE>*& result ) const {
381 try {
382 result = dynamic_cast<_Item<TYPE>*>( i_find( name ) );
383 } catch ( ... ) { result = nullptr; }
384 return result ? StatusCode::SUCCESS : StatusCode::FAILURE;
385 }
387 template <class TYPE>
388 StatusCode i_item( const std::string& name, _Item<TYPE*>*& result ) const {
389 try {
390 _Item<void*>* p = dynamic_cast<_Item<void*>*>( i_find( name ) );
391 result = (_Item<TYPE*>*)p;
392 } catch ( ... ) { result = nullptr; }
393 return result ? StatusCode::SUCCESS : StatusCode::FAILURE;
394 }
396 StatusCode i_item( const std::string& name, _Item<IOpaqueAddress*>*& result ) const {
397 try {
398 result = dynamic_cast<_Item<IOpaqueAddress*>*>( i_find( name ) );
399 } catch ( ... ) { result = nullptr; }
400 return result ? StatusCode::SUCCESS : StatusCode::FAILURE;
401 }
403 template <class TYPE>
404 StatusCode i_item( const std::string& name, _Array<TYPE>*& result ) const {
405 try {
406 if ( clID() == CLID_ColumnWiseTuple ) { result = dynamic_cast<_Array<TYPE>*>( i_find( name ) ); }
407 } catch ( ... ) { result = nullptr; }
408 return result ? StatusCode::SUCCESS : StatusCode::FAILURE;
409 }
411 template <class TYPE>
412 StatusCode i_item( const std::string& name, _Matrix<TYPE>*& result ) const {
413 try {
414 if ( clID() == CLID_ColumnWiseTuple ) { result = dynamic_cast<_Matrix<TYPE>*>( i_find( name ) ); }
415 } catch ( ... ) { result = nullptr; }
416 return result ? StatusCode::SUCCESS : StatusCode::FAILURE;
417 }
419 template <class TYPE>
420 StatusCode i_addItem( const std::string& name, long, const std::string&, TYPE low, TYPE high,
421 _Item<TYPE>*& result ) {
422 if ( !i_find( name ) ) {
423 TYPE nil;
424 nil = 0;
425 return add( result = _Item<TYPE>::create( this, name, typeid( TYPE ), low, high, nil ) );
426 }
427 return StatusCode::FAILURE;
428 }
430 template <class TYPE>
431 StatusCode i_addItem( const std::string& name, long dim, const std::string& index, TYPE low, TYPE high,
432 _Array<TYPE>*& result ) {
433 if ( !i_find( name ) && clID() == CLID_ColumnWiseTuple ) {
434 return add( result = _Array<TYPE>::create( this, name, typeid( TYPE ), index, dim, low, high, TYPE( 0 ) ) );
435 }
436 return StatusCode::FAILURE;
437 }
439 template <class TYPE>
440 StatusCode i_addItem( const std::string& name, long dim1, long dim2, const std::string& index, TYPE low, TYPE high,
441 _Matrix<TYPE>*& result ) {
442 if ( !i_find( name ) && clID() == CLID_ColumnWiseTuple ) {
443 return add( result =
444 _Matrix<TYPE>::create( this, name, typeid( TYPE ), index, dim1, dim2, low, high, TYPE( 0 ) ) );
445 }
446 return StatusCode::FAILURE;
447 }
448 template <class TYPE>
449 StatusCode i_addObject( const std::string& name, _Item<TYPE*>*& result, const std::type_info& /* typ */ ) {
450 if ( !i_find( name ) && clID() == CLID_ColumnWiseTuple ) {
451 return add( result = (_Item<TYPE*>*)_Item<void*>::create( this, name, typeid( TYPE ), 0, 0, 0 ) );
452 }
453 return StatusCode::FAILURE;
454 }
455
456 public:
458 template <class TYPE>
459 StatusCode item( const std::string& name, Item<TYPE>& result ) {
460 return i_item( name, result.m_ptr );
461 }
463 template <class TYPE>
464 StatusCode item( const std::string& name, const Item<TYPE>& result ) const {
465 return i_item( name, result.m_ptr );
466 }
468 template <class TYPE>
469 StatusCode item( const std::string& name, Array<TYPE>& result ) {
470 return i_item( name, result.m_ptr );
471 }
473 template <class TYPE>
474 StatusCode item( const std::string& name, const Array<TYPE>& result ) const {
475 return i_item( name, result.m_ptr );
476 }
478 template <class TYPE>
479 StatusCode item( const std::string& name, Matrix<TYPE>& result ) {
480 return i_item( name, result.m_ptr );
481 }
482
484 template <class TYPE>
485 StatusCode item( const std::string& name, const Matrix<TYPE>& result ) const {
486 return i_item( name, result.m_ptr );
487 }
488
502 template <class TYPE>
503 StatusCode addItem( const std::string& name, Item<TYPE>& itm ) {
504 typedef Range<TYPE> _R;
505 return i_addItem( name, 1, "", _R::min(), _R::max(), itm.m_ptr );
506 }
507
516 template <class TYPE>
517 StatusCode addItem( const std::string& name, Item<TYPE*>& itm ) {
518 return i_addObject( name, itm.m_ptr, typeid( TYPE ) );
519 }
520
529 StatusCode addItem( const std::string& name, Item<IOpaqueAddress*>& itm ) {
530 typedef Range<IOpaqueAddress*> _R;
531 return i_addItem( name, 1, "", _R::min(), _R::max(), itm.m_ptr );
532 }
533
551 template <class TYPE, class RANGE>
552 StatusCode addItem( const std::string& name, Item<TYPE>& itm, const RANGE low, const RANGE high ) {
553 return i_addItem( name, 1, "", TYPE( low ), TYPE( high ), itm.m_ptr );
554 }
555
569 template <class TYPE>
570 StatusCode addItem( const std::string& name, long dim, Array<TYPE>& array ) {
571 return i_addItem( name, dim, "", Range<TYPE>::min(), Range<TYPE>::max(), array.m_ptr );
572 }
573
593 template <class TYPE, class RANGE>
594 StatusCode addItem( const std::string& name, long dim, Array<TYPE>& array, const RANGE low, const RANGE high ) {
595 return i_addItem( name, dim, "", TYPE( low ), TYPE( high ), array.m_ptr );
596 }
597
628 template <class TYPE, class INDEX, class RANGE>
629 StatusCode addItem( const std::string& name, Item<INDEX>& index, Array<TYPE>& array, const RANGE low,
630 const RANGE high ) {
631 return i_addItem( name, index->range().distance(), index->name(), TYPE( low ), TYPE( high ), array.m_ptr );
632 }
633
659 template <class TYPE, class INDEX, class RANGE>
660 StatusCode addIndexedItem( const std::string& name, Item<INDEX>& index, Array<TYPE>& array, const RANGE low,
661 const RANGE high ) {
662 return i_addItem( name, index->range().distance(), index->name(), TYPE( low ), TYPE( high ), array.m_ptr );
663 }
664
689 template <class TYPE, class INDEX>
690 StatusCode addItem( const std::string& name, Item<INDEX>& index, Array<TYPE>& array ) {
691 return i_addItem( name, index->range().distance(), index->name(), Range<TYPE>::min(), Range<TYPE>::max(),
692 array.m_ptr );
693 }
694
714 template <class TYPE, class INDEX>
715 StatusCode addIndexedItem( const std::string& name, Item<INDEX>& index, Array<TYPE>& array ) {
716 return i_addItem( name, index->range().distance(), index->name(), Range<TYPE>::min(), Range<TYPE>::max(),
717 array.m_ptr );
718 }
719
737 template <class TYPE>
738 StatusCode addItem( const std::string& name, long cols, long rows, Matrix<TYPE>& matrix ) {
739 return i_addItem( name, cols, rows, "", Range<TYPE>::min(), Range<TYPE>::max(), matrix.m_ptr );
740 }
741
764 template <class TYPE, class RANGE>
765 StatusCode addItem( const std::string& name, long cols, long rows, Matrix<TYPE>& result, const RANGE low,
766 const RANGE high ) {
767 return i_addItem( name, cols, rows, "", TYPE( low ), TYPE( high ), result.m_ptr );
768 }
769
795 template <class TYPE, class INDEX>
796 StatusCode addItem( const std::string& name, Item<INDEX>& index, Matrix<TYPE>& matrix, long rows ) {
797 return i_addItem( name, index->range().distance(), rows, index->name(), Range<TYPE>::min(), Range<TYPE>::max(),
798 matrix.m_ptr );
799 }
800
821 template <class TYPE, class INDEX>
822 StatusCode addIndexedItem( const std::string& name, Item<INDEX>& col_index, long rows, Matrix<TYPE>& matrix ) {
823 return i_addItem( name, col_index->range().distance(), rows, col_index->name(), Range<TYPE>::min(),
824 Range<TYPE>::max(), matrix.m_ptr );
825 }
826
859 template <class TYPE, class INDEX, class RANGE>
860 StatusCode addItem( const std::string& name, Item<INDEX>& index, Matrix<TYPE>& matrix, long rows, const RANGE low,
861 const RANGE high ) {
862 return i_addItem( name, index->range().distance(), rows, index->name(), TYPE( low ), TYPE( high ), matrix.m_ptr );
863 }
864
892 template <class TYPE, class INDEX, class RANGE>
893 StatusCode addIndexedItem( const std::string& name, Item<INDEX>& index, long rows, Matrix<TYPE>& matrix,
894 const RANGE low, const RANGE high ) {
895 return i_addItem( name, index->range().distance(), rows, index->name(), TYPE( low ), TYPE( high ), matrix.m_ptr );
896 }
897 };
898
901 struct Directory : DataObject {
903 static const CLID& classID() { return CLID_NTupleDirectory; }
905 const CLID& clID() const override { return classID(); }
906 };
907
910 class File : public Directory {
911 protected:
913 std::string m_name;
915 std::string m_logName;
917 long m_type = 0;
919 bool m_isOpen = false;
920
921 public:
922 File() = default;
924 File( long type, std::string name, std::string logName )
925 : m_name( std::move( name ) ), m_logName( std::move( logName ) ), m_type( type ) {}
926
928 static const CLID& classID() { return CLID_NTupleFile; }
930 const CLID& clID() const override { return classID(); }
932 void setType( const long typ ) { m_type = typ; }
934 long type() const { return m_type; }
936 const std::string& name() const { return m_name; }
938 void setName( std::string nam ) { m_name = std::move( nam ); }
940 const std::string& logicalName() const { return m_logName; }
942 void setLogicalName( std::string l ) { m_logName = std::move( l ); }
944 void setOpen( bool flag ) { m_isOpen = flag; }
946 bool isOpen() const { return m_isOpen; }
947 };
948 // =========================================================================
949 // inhibit certain types by defining specialized templates which do not
950 // allow for construction.
951 template <>
952 class Array<IOpaqueAddress*> {
953 Array() = delete;
954
955 public:
956 virtual ~Array() = default;
957 virtual void dummy() = 0;
958 };
959 template <>
960 class Matrix<IOpaqueAddress*> {
961 Matrix() = delete;
962
963 public:
964 virtual ~Matrix() = default;
965 virtual void dummy() = 0;
966 };
967 // =========================================================================
968 #ifndef ALLOW_ALL_TYPES
969 #else
970 typedef Item<bool> BoolItem;
971 typedef Item<char> CharItem;
972 typedef Item<unsigned char> UCharItem;
973 typedef Item<short> ShortItem;
974 typedef Item<unsigned short> UShortItem;
975 typedef Item<long> LongItem;
976 typedef Item<long long> LongLongItem;
977 typedef Item<unsigned long> ULongItem;
978 typedef Item<unsigned long long> ULongLongItem;
979 typedef Item<int> IntItem;
980 typedef Item<unsigned int> UIntItem;
981 typedef Item<float> FloatItem;
982 typedef Item<double> DoubleItem;
983 typedef Array<bool> BoolArray;
984 typedef Array<char> CharArray;
985 typedef Array<unsigned char> UCharArray;
986 typedef Array<short> ShortArray;
987 typedef Array<unsigned short> UShortArray;
988 typedef Array<long> LongArray;
989 typedef Array<unsigned long> ULongArray;
990 typedef Array<int> IntArray;
991 typedef Array<unsigned int> UIntArray;
992 typedef Array<float> FloatArray;
993 typedef Array<double> DoubleArray;
994 typedef Matrix<bool> BoolMatrix;
995 typedef Matrix<char> CharMatrix;
996 typedef Matrix<unsigned char> UCharMatrix;
997 typedef Matrix<short> ShortMatrix;
998 typedef Matrix<unsigned short> UShortMatrix;
999 typedef Matrix<long> LongMatrix;
1000 typedef Matrix<unsigned long> ULongMatrix;
1001 typedef Matrix<int> IntMatrix;
1002 typedef Matrix<unsigned int> UIntMatrix;
1003 typedef Matrix<float> FloatMatrix;
1004 typedef Matrix<double> DoubleMatrix;
1005 #endif
1006
1007 template <class T>
1008 inline std::ostream& operator<<( std::ostream& s, const Item<T>& obj ) {
1009 return s << T( obj );
1010 }
1011 } // end of namespace NTuple
1012
1013 // Useful:
1014 typedef SmartDataPtr<NTuple::Tuple> NTuplePtr;
1015 typedef SmartDataPtr<NTuple::Directory> NTupleDirPtr;
1016 typedef SmartDataPtr<NTuple::File> NTupleFilePtr;
1017
1018 #endif // GAUDIKERNEL_NTUPLE_H
NTuple::Item::operator *=
Item< TYP > & operator *=(const TYP data)
Definition: NTuple.h:282
NTuple::_Matrix::column
const TYP * column(long i) const
Access to data by reference (CONST)
Definition: NTuple.h:210
NTuple::Tuple::addItem
StatusCode addItem(const std::string &name, Item< INDEX > &index, Matrix< TYPE > &matrix, long rows, const RANGE low, const RANGE high)
Add an variable size Matrix of data to a column wise N tuple.
Definition: NTuple.h:860
NTuple::Item< bool >::_My
Item< bool > _My
Definition: NTuple.h:296
std::out_of_range
STL class.
NTuple::_Array::data
const TYP & data(long i) const
Access to data by reference (CONST)
Definition: NTuple.h:175
NTuple::Item::operator/=
Item< TYP > & operator/=(const TYP data)
Definition: NTuple.h:286
NTuple::Item::operator+=
Item< TYP > & operator+=(const TYP data)
Definition: NTuple.h:274
NTuple::File::setOpen
void setOpen(bool flag)
Set "open" flag.
Definition: NTuple.h:944
NTuple::File::File
File(long type, std::string name, std::string logName)
Standard constructor.
Definition: NTuple.h:924
NTuple::_Accessor::operator->
const TYP * operator->() const
Dereference operator (CONST)
Definition: NTuple.h:238
NTuple::operator<<
std::ostream & operator<<(std::ostream &s, const Item< T > &obj)
Definition: NTuple.h:1008
NTuple::Item::operator--
Item & operator--(int)
Definition: NTuple.h:262
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:41
NTuple::Range::m_lower
TYP m_lower
Lower boundary of range.
Definition: NTuple.h:58
NTuple::Range< bool >::lower
bool lower() const
Lower boundary of range.
Definition: NTuple.h:97
DataTypeInfo.h
NTuple::Tuple::addItem
StatusCode addItem(const std::string &name, Item< INDEX > &index, Array< TYPE > &array)
Add an indexed Array of data to a column wise N tuple.
Definition: NTuple.h:690
Gaudi::Functional::details::zip::range
decltype(auto) range(Args &&... args)
Zips multiple containers together to form a single range.
Definition: FunctionalDetails.h:71
NTuple::Tuple::i_item
StatusCode i_item(const std::string &name, _Matrix< TYPE > *&result) const
Locate a _Matrix of data to the N tuple type safe.
Definition: NTuple.h:412
NTuple::_Accessor::operator!
bool operator!() const
Check if column is present.
Definition: NTuple.h:232
NTuple::_Accessor::_Accessor
_Accessor()=default
Standard Constructor.
NTuple::Matrix::Matrix
Matrix()=default
Standard Constructor.
NTuple::Range< bool >::distance
bool distance() const
Distance between lower and upper range.
Definition: NTuple.h:101
NTuple::File::m_logName
std::string m_logName
Logical file name.
Definition: NTuple.h:915
NTuple::Tuple::addItem
StatusCode addItem(const std::string &name, Item< INDEX > &index, Array< TYPE > &array, const RANGE low, const RANGE high)
Add an indexed Array of data to a column wise N tuple with a range.
Definition: NTuple.h:629
NTuple::Tuple::addIndexedItem
StatusCode addIndexedItem(const std::string &name, Item< INDEX > &index, long rows, Matrix< TYPE > &matrix, const RANGE low, const RANGE high)
Add an variable size Matrix of data to a column wise N tuple.
Definition: NTuple.h:893
NTuple::_Matrix
Abstract class describing a matrix column in a N tuple.
Definition: NTuple.h:44
NTuple::Tuple::item
StatusCode item(const std::string &name, const Array< TYPE > &result) const
Locate a Array of data to the N tuple type safe (CONST)
Definition: NTuple.h:474
NTuple::Matrix
Class acting as a smart pointer holding a N tuple _Item.
Definition: NTuple.h:52
NTuple::Tuple::i_addItem
StatusCode i_addItem(const std::string &name, long dim1, long dim2, const std::string &index, TYPE low, TYPE high, _Matrix< TYPE > *&result)
Add a _Item of data to the N tuple.
Definition: NTuple.h:440
NTuple::Item::operator++
Item & operator++(int)
Definition: NTuple.h:260
NTuple::File::m_type
long m_type
Access type.
Definition: NTuple.h:917
NTuple::_Item
Abstract class describing a column in a N tuple.
Definition: NTuple.h:40
NTuple::_Data::ItemRange
Range< TYP > ItemRange
Set type definition to make life more easy easy.
Definition: NTuple.h:127
NTuple::Array::operator[]
TYP & operator[](const T i)
Array operator.
Definition: NTuple.h:331
NTupleFilePtr
SmartDataPtr< NTuple::File > NTupleFilePtr
Definition: NTuple.h:1016
min
EventIDBase min(const EventIDBase &lhs, const EventIDBase &rhs)
Definition: EventIDBase.h:202
INTuple::add
virtual StatusCode add(INTupleItem *item)=0
Add an item row to the N tuple.
NTuple::_Array::operator=
_Array< TYP > & operator=(const _Array< T > &copy)
Assignment operator.
Definition: NTuple.h:164
NTuple::_Array::begin
TYP * begin()
Definition: NTuple.h:179
NTuple::Range::min
static TYP min()
Minimal number of data.
Definition: NTuple.h:82
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
NTuple::_Accessor::operator->
TYP * operator->()
Dereference operator.
Definition: NTuple.h:236
std
STL namespace.
NTuple::Tuple::addItem
StatusCode addItem(const std::string &name, long cols, long rows, Matrix< TYPE > &matrix)
Add an fixed size Matrix of data to a column wise N tuple.
Definition: NTuple.h:738
NTuple::Item::operator--
Item & operator--()
Definition: NTuple.h:261
NTuple::_Matrix::column
TYP * column(long i)
Access to data by reference.
Definition: NTuple.h:208
std::copy_n
T copy_n(T... args)
NTuple::_Matrix::operator=
_Matrix< TYP > & operator=(const _Matrix< T > &copy)
Assignment operator.
Definition: NTuple.h:197
max
EventIDBase max(const EventIDBase &lhs, const EventIDBase &rhs)
Definition: EventIDBase.h:215
NTuplePtr
SmartDataPtr< NTuple::Tuple > NTuplePtr
Definition: NTuple.h:1014
NTuple::Tuple::item
StatusCode item(const std::string &name, const Item< TYPE > &result) const
Locate a scalar Item of data to the N tuple type safe (CONST)
Definition: NTuple.h:464
NTuple::File::name
const std::string & name() const
Retrun physical file name.
Definition: NTuple.h:936
NTuple::Tuple::addIndexedItem
StatusCode addIndexedItem(const std::string &name, Item< INDEX > &index, Array< TYPE > &array, const RANGE low, const RANGE high)
Add an indexed Array of data to a column wise N tuple with a range.
Definition: NTuple.h:660
NTuple::Matrix::operator[]
const TYP * operator[](const T i) const
Array operator.
Definition: NTuple.h:364
NTuple
NTuple name space.
Definition: INTupleSvc.h:9
NTuple::Tuple::addItem
StatusCode addItem(const std::string &name, Item< INDEX > &index, Matrix< TYPE > &matrix, long rows)
Add an variable size Matrix of data to a column wise N tuple.
Definition: NTuple.h:796
std::type_info
NTuple::File::classID
static const CLID & classID()
class ID of the object
Definition: NTuple.h:928
std::string
STL class.
NTuple::_Item::set
void set(const TYP &item)
Access to data by reference.
Definition: NTuple.h:149
std::numeric_limits::min
T min(T... args)
INTuple
NTuple interface class definition.
Definition: INTuple.h:81
NTuple::Matrix::operator=
Matrix & operator=(const Matrix< T > &copy)
Assignment operator.
Definition: NTuple.h:353
NTuple::Tuple::addIndexedItem
StatusCode addIndexedItem(const std::string &name, Item< INDEX > &col_index, long rows, Matrix< TYPE > &matrix)
Add an variable size Matrix of data to a column wise N tuple.
Definition: NTuple.h:822
NTuple::Tuple::addIndexedItem
StatusCode addIndexedItem(const std::string &name, Item< INDEX > &index, Array< TYPE > &array)
Add an indexed Array of data to a column wise N tuple.
Definition: NTuple.h:715
NTuple::Tuple::i_item
StatusCode i_item(const std::string &name, _Item< TYPE * > *&result) const
Locate a _Column of data to the N tuple type unsafe for objects.
Definition: NTuple.h:388
NTuple::File::File
File()=default
NTuple::Item::operator-=
Item< TYP > & operator-=(const TYP data)
Definition: NTuple.h:278
INTupleItem
NTuple interface class definition.
Definition: INTuple.h:27
NTuple::Range::distance
TYP distance() const
Distance between lower and upper range.
Definition: NTuple.h:80
SmartDataPtr.h
NTuple::File::clID
const CLID & clID() const override
class ID of the object
Definition: NTuple.h:930
INTuple.h
NTuple::Directory::classID
static const CLID & classID()
class ID of the object
Definition: NTuple.h:903
NTuple::_Accessor
Class acting as a smart pointer holding a N tuple entry.
Definition: NTuple.h:46
NTuple::Tuple::i_item
StatusCode i_item(const std::string &name, _Array< TYPE > *&result) const
Locate a _Array of data to the N tuple type safe.
Definition: NTuple.h:404
NTuple::_Accessor::range
const Range< TYP > & range() const
Access the range.
Definition: NTuple.h:240
NTuple::Range< bool >::max
static bool max()
Maximal number of data.
Definition: NTuple.h:105
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
NTuple::_Item::operator=
_Item< TYP > & operator=(const _Item< T > &copy)
Assignment operator.
Definition: NTuple.h:144
NTuple::Range::~Range
virtual ~Range()=default
Destructor.
NTuple::Tuple::addItem
StatusCode addItem(const std::string &name, Item< TYPE > &itm, const RANGE low, const RANGE high)
Add a scalar data item a N tuple with a range.
Definition: NTuple.h:552
NTuple::File::setName
void setName(std::string nam)
Set access type.
Definition: NTuple.h:938
NTuple::Tuple::addItem
StatusCode addItem(const std::string &name, long cols, long rows, Matrix< TYPE > &result, const RANGE low, const RANGE high)
Add an fixed size Matrix of data to a column wise N tuple.
Definition: NTuple.h:765
NTuple::File::setLogicalName
void setLogicalName(std::string l)
Definition: NTuple.h:942
NTuple::Range::max
static TYP max()
Maximal number of data.
Definition: NTuple.h:84
NTuple::Item< bool >::operator=
Item & operator=(const Item< T > &data)
Assignment operator.
Definition: NTuple.h:310
NTuple::File::m_name
std::string m_name
Physical file name.
Definition: NTuple.h:913
NTuple::Tuple::i_addObject
StatusCode i_addObject(const std::string &name, _Item< TYPE * > *&result, const std::type_info &)
Definition: NTuple.h:449
NTuple::Item< bool >
Specialization acting as a smart pointer holding a N tuple _Item.
Definition: NTuple.h:295
NTuple::Tuple::addItem
StatusCode addItem(const std::string &name, long dim, Array< TYPE > &array)
Add an fixed-size Array of data to a column wise N tuple.
Definition: NTuple.h:570
NTuple::_Data
Abstract class describing basic data in an Ntuple.
Definition: NTuple.h:38
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
std::numeric_limits::max
T max(T... args)
NTuple::Tuple::addItem
StatusCode addItem(const std::string &name, Item< IOpaqueAddress * > &itm)
Add an address object item to an N tuple: specialized call.
Definition: NTuple.h:529
NTuple::Range::Range
Range(const Range< TYP > &copy)
Copy constructor.
Definition: NTuple.h:66
NTuple::Tuple::i_item
StatusCode i_item(const std::string &name, _Item< IOpaqueAddress * > *&result) const
Locate a _Column of data to the N tuple type safe.
Definition: NTuple.h:396
std::move
T move(T... args)
NTuple::_Item::get
virtual TYP get() const
Access to data by reference (CONST)
Definition: NTuple.h:151
NTuple::File::logicalName
const std::string & logicalName() const
Definition: NTuple.h:940
NTuple::Tuple
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:375
DataObject::name
const std::string & name() const
Retreive DataObject name. It is the name when registered in the store.
Definition: DataObject.cpp:62
IOpaqueAddress.h
NTuple::File::setType
void setType(const long typ)
Set access type.
Definition: NTuple.h:932
gaudirun.l
dictionary l
Definition: gaudirun.py:521
NTuple::File::m_isOpen
bool m_isOpen
Flag to indicate wether the file was opened already.
Definition: NTuple.h:919
GaudiPython::Matrix
std::vector< Row > Matrix
Definition: Vector.h:20
NTuple::Array::end
TYP * end()
Definition: NTuple.h:341
NTuple::_Accessor::m_ptr
TYP * m_ptr
Pointer to instance.
Definition: NTuple.h:224
Containers::array
struct GAUDI_API array
Parametrisation class for redirection array - like implementation.
Definition: KeyedObjectManager.h:27
NTuple::Tuple::item
StatusCode item(const std::string &name, const Matrix< TYPE > &result) const
Locate a Matrix of data to the N tuple type safe (CONST)
Definition: NTuple.h:485
DataObject::clID
virtual const CLID & clID() const
Retrieve reference to class definition structure.
Definition: DataObject.cpp:56
NTuple::Tuple::addItem
StatusCode addItem(const std::string &name, Item< TYPE * > &itm)
Add an simple object item to an N tuple.
Definition: NTuple.h:517
NTuple::Tuple::i_addItem
StatusCode i_addItem(const std::string &name, long dim, const std::string &index, TYPE low, TYPE high, _Array< TYPE > *&result)
Add a _Item of data to the N tuple.
Definition: NTuple.h:431
NTuple::Item::_My
Item< TYP > _My
Definition: NTuple.h:247
NTuple::Item< bool >::operator=
Item & operator=(const bool data)
Assignment operator.
Definition: NTuple.h:304
NTuple::Tuple::item
StatusCode item(const std::string &name, Array< TYPE > &result)
Locate a Array of data to the N tuple type safe.
Definition: NTuple.h:469
NTuple::Item::operator=
Item & operator=(const Item< T > &data)
Assignment operator.
Definition: NTuple.h:270
NTuple::Array::begin
TYP * begin()
Definition: NTuple.h:340
NTuple::Directory::clID
const CLID & clID() const override
class ID of the object
Definition: NTuple.h:905
NTuple::Matrix::operator[]
TYP * operator[](const T i)
Array operator.
Definition: NTuple.h:359
INTuple::i_find
virtual INTupleItem * i_find(const std::string &name) const =0
Internally used by abstract classes.
NTuple::Item::operator=
Item & operator=(const TYP data)
Assignment operator.
Definition: NTuple.h:264
gaudirun.s
string s
Definition: gaudirun.py:316
SmartDataPtr
A small class used to access easily (and efficiently) data items residing in data stores.
Definition: SmartDataPtr.h:47
NTuple::Tuple::addItem
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
Definition: NTuple.h:503
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
NTuple::_Matrix::m_rows
long m_rows
Number of rows per column.
Definition: NTuple.h:189
NTuple::Range::m_upper
TYP m_upper
Upper boundary of range.
Definition: NTuple.h:60
NTuple::Range
Class defining a range.
Definition: NTuple.h:36
NTuple::Range< bool >::Range
Range(const Range< bool > &)
Copy constructor.
Definition: NTuple.h:93
NTupleDirPtr
SmartDataPtr< NTuple::Directory > NTupleDirPtr
Definition: NTuple.h:1015
NTuple::Array::operator[]
const TYP & operator[](const T i) const
Array operator.
Definition: NTuple.h:336
NTuple::Range::lower
TYP lower() const
Lower boundary of range.
Definition: NTuple.h:76
NTuple::Directory
Small class representing an N tuple directory in the transient store.
Definition: NTuple.h:901
NTuple::File::isOpen
bool isOpen() const
Access "open" flag.
Definition: NTuple.h:946
NTuple::Item::operator *
TYP operator *()
Dereference operator for pointers.
Definition: NTuple.h:255
NTuple::Array::operator=
Array & operator=(const Array< T > &copy)
Assignment operator.
Definition: NTuple.h:325
NTuple::Range< bool >::Range
Range(const bool, const bool)
Standard constructor.
Definition: NTuple.h:91
NTuple::Tuple::item
StatusCode item(const std::string &name, Item< TYPE > &result)
Locate a scalar Item of data to the N tuple type safe.
Definition: NTuple.h:459
NTuple::Tuple::i_item
StatusCode i_item(const std::string &name, _Item< TYPE > *&result) const
Locate a _Column of data to the N tuple type safe.
Definition: NTuple.h:380
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
NTuple::Item::Item
Item()=default
Standard Constructor.
NTuple::Tuple::addItem
StatusCode addItem(const std::string &name, long dim, Array< TYPE > &array, const RANGE low, const RANGE high)
Add an fixed-size Array of data to a column wise N tuple with a range.
Definition: NTuple.h:594
NTuple::Item
Class acting as a smart pointer holding a N tuple _Item.
Definition: NTuple.h:48
Containers::Array
KeyedObjectManager< array > Array
Forward declaration of specialized redirection array object manager.
Definition: KeyedObjectManager.h:101
NTuple::Array::Array
Array()=default
Standard Constructor.
NTuple::Array
Class acting as a smart pointer holding a N tuple _Item.
Definition: NTuple.h:50
NTuple::Range< bool >::min
static bool min()
Minimal number of data.
Definition: NTuple.h:103
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:71
DataObject
A DataObject is the base class of any identifiable object on any data store.
Definition: DataObject.h:30
NTuple::_Accessor::operator=
_Accessor< TYP > & operator=(const _Accessor< TYP > &)
Definition: NTuple.h:220
NTuple::_Array::end
TYP * end()
Definition: NTuple.h:180
NTuple::Item::operator++
Item & operator++()
Definition: NTuple.h:259
std::ostream
STL class.
NTuple::Tuple::item
StatusCode item(const std::string &name, Matrix< TYPE > &result)
Locate a Matrix of data to the N tuple type safe.
Definition: NTuple.h:479
NTuple::Tuple::i_addItem
StatusCode i_addItem(const std::string &name, long, const std::string &, TYPE low, TYPE high, _Item< TYPE > *&result)
Add a _Item of data to the N tuple.
Definition: NTuple.h:420
NTuple::_Array::data
TYP & data(long i)
Access to data by reference (CONST)
Definition: NTuple.h:177
NTuple::Range::upper
TYP upper() const
Upper boundary of range.
Definition: NTuple.h:78
NTuple::File::type
long type() const
Return access type.
Definition: NTuple.h:934
NTuple::Range::operator=
Range & operator=(const Range< TYP > &copy)
Adjust ranges.
Definition: NTuple.h:68
NTuple::File
Small class representing an N tuple file in the transient store.
Definition: NTuple.h:910
DataObject.h
NTuple::_Accessor::~_Accessor
virtual ~_Accessor()=default
Standard Destructor.
NTuple::Range::Range
Range(TYP low, TYP upper)
Standard constructor.
Definition: NTuple.h:64
NTuple::Range< bool >::upper
bool upper() const
Upper boundary of range.
Definition: NTuple.h:99
NTuple::Range< bool >
Definition: NTuple.h:88
NTuple::_Array
Abstract class describing a column-array in a N tuple.
Definition: NTuple.h:42