| The Gaudi Framework v30r0 (c919700c)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

TupleObj.h
Go to the documentation of this file.
1 // ============================================================================
2 #ifndef GAUDIALG_TUPLEOBJ_H
3 #define GAUDIALG_TUPLEOBJ_H 1
4 // ============================================================================
5 // Include files
6 // ============================================================================
7 // STD&STL
8 // ============================================================================
9 #include <array>
10 #include <cstddef>
11 #include <functional>
12 #include <limits>
13 #include <numeric>
14 #include <set>
15 #include <sstream>
16 #include <string>
17 // ============================================================================
18 // GaudiKernel
19 // ============================================================================
20 #include "GaudiKernel/NTuple.h"
21 #include "GaudiKernel/SerializeSTL.h"
22 #include "GaudiKernel/VectorMap.h"
23 #include "GaudiKernel/invoke.h"
24 // ============================================================================
25 // GaudiAlg
26 // ============================================================================
27 #include "GaudiAlg/Maps.h"
28 #include "GaudiAlg/Tuples.h"
29 // ============================================================================
30 // ROOT
31 // ============================================================================
32 #include "Math/Point3D.h"
33 #include "Math/SMatrix.h"
34 #include "Math/SVector.h"
35 #include "Math/Vector3D.h"
36 #include "Math/Vector4D.h"
37 // ============================================================================
38 // forward declaration
39 // ============================================================================
40 // GaudiKernel
41 // ============================================================================
42 class IOpaqueAddress;
43 // ============================================================================
52 // ============================================================================
60 namespace Tuples
61 {
62 namespace detail
63 {
64 template <typename T>
65 struct to_ {
66 template <typename Arg>
67 T operator()( Arg&& i ) const
68 {
69 return T( std::forward<Arg>( i ) );
70 }
71 };
72 constexpr struct to_<float> to_float {
73 };
74
75 template <typename Iterator>
76 using const_ref_t = std::add_const_t<typename std::iterator_traits<Iterator>::reference>;
77 }
78 // ==========================================================================
84 enum Type {
85 NTUPLE, // Analysis nTuple
86 EVTCOL // Event Collection
87 };
88 // ==========================================================================
96 enum ErrorCodes {
97 InvalidTuple = 100,
98 InvalidColumn,
99 InvalidOperation,
100 InvalidObject,
101 InvalidItem,
102 TruncateValue = 200
103 };
104 // ==========================================================================
199 class GAUDI_API TupleObj
200 {
201 public:
202 // ========================================================================
204 typedef NTuple::Item<bool> Bool;
205 // ========================================================================
207 typedef NTuple::Item<char> Char;
208 // ========================================================================
210 typedef NTuple::Item<unsigned char> UChar;
211 // ========================================================================
213 typedef NTuple::Item<short> Short;
214 // ========================================================================
216 typedef NTuple::Item<unsigned short> UShort;
217 // ========================================================================
219 typedef NTuple::Item<int> Int;
220 // ========================================================================
222 typedef NTuple::Item<unsigned int> UInt;
223 // ========================================================================
225 typedef NTuple::Item<long long> LongLong;
226 // ========================================================================
228 typedef NTuple::Item<unsigned long long> ULongLong;
229 // ========================================================================
231 typedef NTuple::Item<float> Float;
232 // ========================================================================
234 typedef NTuple::Item<double> Double;
235 // ========================================================================
237 typedef NTuple::Item<IOpaqueAddress*> Address;
238 // ========================================================================
240 typedef NTuple::Array<float> FArray;
241 // ========================================================================
243 typedef NTuple::Matrix<float> FMatrix;
244 // ========================================================================
245 // the actual type for variable size matrix indices
246 typedef unsigned short MIndex;
247 // ========================================================================
248 // the map of all items
249 typedef std::map<std::string, std::string> ItemMap;
250 // ========================================================================
251 protected:
252 // ========================================================================
260 TupleObj( std::string name, NTuple::Tuple* tuple, const CLID& clid = CLID_ColumnWiseTuple,
261 const Tuples::Type type = Tuples::NTUPLE );
262 // ========================================================================
263 protected:
264 // ========================================================================
266 virtual ~TupleObj();
267 // ========================================================================
268 public:
269 // ========================================================================
285 StatusCode column( const std::string& name, float value );
286 // ========================================================================
287 public:
288 // ========================================================================
305 StatusCode column( const std::string& name, double value );
306 // ========================================================================
307 public:
308 // ========================================================================
324 StatusCode column( const std::string& name, short value );
325 // ========================================================================
343 StatusCode column( const std::string& name, short value, short minv, short maxv );
344 // ========================================================================
345 public:
346 // ========================================================================
362 StatusCode column( const std::string& name, unsigned short value );
363 // ========================================================================
381 StatusCode column( const std::string& name, unsigned short value, unsigned short minv, unsigned short maxv );
382 // ========================================================================
383 public:
384 // ========================================================================
400 StatusCode column( const std::string& name, char value );
401 // ========================================================================
419 StatusCode column( const std::string& name, char value, char minv, char maxv );
420 // ========================================================================
421 public:
422 // ========================================================================
438 StatusCode column( const std::string& name, unsigned char value );
439 // ========================================================================
457 StatusCode column( const std::string& name, unsigned char value, unsigned char minv, unsigned char maxv );
458 // ========================================================================
459 public:
460 // ========================================================================
476 StatusCode column( const std::string& name, int value );
477 // ========================================================================
495 StatusCode column( const std::string& name, int value, int minv, int maxv );
496 // ========================================================================
497 public:
498 // ========================================================================
514 StatusCode column( const std::string& name, unsigned int value );
515 // ========================================================================
533 StatusCode column( const std::string& name, unsigned int value, unsigned int minv, unsigned int maxv );
534 // ========================================================================
535 public:
536 // ========================================================================
553 StatusCode column( const std::string& name, long value );
554 // ========================================================================
572 StatusCode column( const std::string& name, long value, long minv, long maxv );
573 // ========================================================================
574 public:
575 // ========================================================================
592 StatusCode column( const std::string& name, unsigned long value );
593 // ========================================================================
611 StatusCode column( const std::string& name, unsigned long value, unsigned long minv, unsigned long maxv );
612 // ========================================================================
613 public:
614 // ========================================================================
630 StatusCode column( const std::string& name, long long value );
631 // ========================================================================
649 StatusCode column( const std::string& name, long long value, long long minv, long long maxv );
650 // ========================================================================
651 public:
652 // ========================================================================
668 StatusCode column( const std::string& name, unsigned long long value );
669 // ========================================================================
687 StatusCode column( const std::string& name, unsigned long long value, unsigned long long minv,
688 unsigned long long maxv );
689 // ========================================================================
690 public:
691 // ========================================================================
707 StatusCode column( const std::string& name, signed char value )
708 {
709 return column( name, value, std::numeric_limits<signed char>::min(), std::numeric_limits<signed char>::max() );
710 }
711 // ========================================================================
712 public:
713 // ========================================================================
728 StatusCode column( const std::string& name, bool value );
729 // ========================================================================
730 public:
731 // ========================================================================
750 StatusCode column( const std::string& name, IOpaqueAddress* address );
751 // ========================================================================
768 StatusCode column( IOpaqueAddress* address );
769 // ========================================================================
770 public:
771 // ========================================================================
790 private:
791 template <typename Tuple, typename Value, std::size_t... I>
792 StatusCode columns_helper( const Value& value, const Tuple& tup, std::index_sequence<I...> )
793 {
794 auto scs = std::initializer_list<StatusCode>{
795 this->column( std::get<I>( tup ).first, Gaudi::invoke( std::get<I>( tup ).second, value ) )...};
796 auto is_ok = []( const StatusCode& sc ) -> bool { return sc.isSuccess(); };
797 auto i = std::find_if_not( begin( scs ), end( scs ), is_ok );
798 if ( i != end( scs ) ) {
799 // avoid unchecked StatusCodes...
800 std::for_each( std::next( i ), end( scs ), is_ok );
801 return *i;
802 }
803 return StatusCode::SUCCESS;
804 }
805
806 public:
807 template <typename Value, typename... Args>
808 StatusCode columns( Value&& value, Args&&... args )
809 {
810 return columns_helper( std::forward<Value>( value ), std::forward_as_tuple( std::forward<Args>( args )... ),
811 std::index_sequence_for<Args...>{} );
812 }
813 // ========================================================================
814 public:
815 // ========================================================================
839 StatusCode fill( const char* format... );
840 // =======================================================================
841 public:
842 // =======================================================================
891 template <typename ITERATOR1, typename ITERATOR2>
892 StatusCode farray( const std::string& name, ITERATOR1&& first, ITERATOR2&& last, const std::string& length,
893 size_t maxv )
894 {
895 return farray( name, detail::to_float, std::forward<ITERATOR1>( first ), std::forward<ITERATOR2>( last ), length,
896 maxv );
897 }
898 // =======================================================================
941 template <class DATA>
942 StatusCode farray( const std::string& name, const DATA& data, const std::string& length, const size_t maxv )
943 {
944 return farray( name, std::begin( data ), std::end( data ), length, maxv );
945 }
946 // =======================================================================
1009 template <class FUNCTION, class ITERATOR>
1010 StatusCode farray( const std::string& name, const FUNCTION& function, ITERATOR first, ITERATOR last,
1011 const std::string& length, size_t maxv )
1012 {
1013 if ( invalid() ) {
1014 return InvalidTuple;
1015 }
1016 if ( rowWise() ) {
1017 return InvalidOperation;
1018 }
1019
1020 // adjust the length
1021 if ( std::distance( first, last ) > static_cast<std::ptrdiff_t>( maxv ) ) {
1022 Warning( "farray('" + name + "'): array is overflow, skip extra entries" );
1023 last = std::next( first, maxv );
1024 }
1025
1026 // get the length item
1027 Int* len = ints( length, 0, maxv );
1028 if ( !len ) {
1029 return InvalidColumn;
1030 }
1031
1032 // adjust the length
1033 *len = std::distance( first, last );
1034
1035 // get the array itself
1036 FArray* var = fArray( name, len );
1037 if ( !var ) {
1038 return InvalidColumn;
1039 }
1040
1041 // fill the array
1042 std::transform( first, last, std::begin( *var ), std::cref( function ) );
1043
1044 return StatusCode::SUCCESS;
1045 }
1046 // =======================================================================
1074 template <typename FunIterator, typename DataIterator>
1075 StatusCode farray_impl( FunIterator first_item, FunIterator last_item, DataIterator first, DataIterator last,
1076 const std::string& length, size_t maxv )
1077 {
1078 if ( invalid() ) return InvalidTuple;
1079 if ( rowWise() ) return InvalidOperation;
1080
1081 // adjust the length
1082 if ( std::distance( first, last ) > static_cast<std::ptrdiff_t>( maxv ) ) {
1083 using GaudiUtils::details::ostream_joiner;
1084 std::ostringstream os;
1085 ostream_joiner( os, first_item, last_item, ",",
1086 []( std::ostream& os, const auto& i ) -> std::ostream& { return os << i.first; } );
1087 Warning( "farray('" + os.str() + "'): array overflow, skipping extra entries" ).ignore();
1088 last = std::next( first, maxv );
1089 }
1090
1091 // get the length item
1092 Int* len = ints( length, 0, maxv );
1093 if ( !len ) {
1094 return InvalidColumn;
1095 }
1096
1097 // adjust the length
1098 *len = std::distance( first, last );
1099
1100 // get the arrays themselves
1101 std::vector<FArray*> vars;
1102 vars.reserve( std::distance( first_item, last_item ) );
1103 std::transform( first_item, last_item, std::back_inserter( vars ),
1104 [&]( const auto& item ) { return this->fArray( item.first, len ); } );
1105 if ( std::any_of( vars.begin(), vars.end(), []( const FArray* f ) { return !f; } ) ) {
1106 return InvalidColumn;
1107 }
1108
1109 // fill the array
1110 for ( size_t index = 0; first != last; ++first, ++index ) {
1111 auto item = first_item;
1112 for ( auto& var : vars ) {
1113 ( *var )[index] = ( item++ )->second( *first );
1114 }
1115 }
1116
1117 return StatusCode::SUCCESS;
1118 }
1119
1120 template <
1121 typename DataIterator, template <typename, typename...> class Container = std::initializer_list,
1122 typename NamedFunction = std::pair<std::string, std::function<float( detail::const_ref_t<DataIterator> )>>,
1123 typename = std::enable_if_t<!std::is_convertible<Container<NamedFunction>, std::string>::value>>
1124 StatusCode farray( const Container<NamedFunction>& funs, DataIterator first, DataIterator last,
1125 const std::string& length, size_t maxv )
1126 {
1127 return farray_impl( funs.begin(), funs.end(), std::forward<DataIterator>( first ),
1128 std::forward<DataIterator>( last ), length, maxv );
1129 }
1130
1131 template <typename NamedFunctions, typename DataIterator,
1132 typename = std::enable_if_t<!std::is_convertible<NamedFunctions, std::string>::value>>
1133 StatusCode farray( const NamedFunctions& funs, DataIterator first, DataIterator last, const std::string& length,
1134 size_t maxv )
1135 {
1136 return farray_impl( funs.begin(), funs.end(), std::forward<DataIterator>( first ),
1137 std::forward<DataIterator>( last ), length, maxv );
1138 }
1139 // =======================================================================
1171 template <class FUNC1, class FUNC2, class Iterator>
1172 StatusCode farray( const std::string& name1, const FUNC1& func1, const std::string& name2, const FUNC2& func2,
1173 Iterator&& first, Iterator&& last, const std::string& length, size_t maxv )
1174 {
1175 return farray( {{name1, std::cref( func1 )}, {name2, std::cref( func2 )}}, std::forward<Iterator>( first ),
1176 std::forward<Iterator>( last ), length, maxv );
1177 }
1178 // =======================================================================
1215 template <class FUNC1, class FUNC2, class FUNC3, class Iterator>
1216 StatusCode farray( const std::string& name1, const FUNC1& func1, const std::string& name2, const FUNC2& func2,
1217 const std::string& name3, const FUNC3& func3, Iterator&& first, Iterator&& last,
1218 const std::string& length, size_t maxv )
1219 {
1220 return farray( {{name1, std::cref( func1 )}, {name2, std::cref( func2 )}, {name3, std::cref( func3 )}},
1221 std::forward<Iterator>( first ), std::forward<Iterator>( last ), length, maxv );
1222 }
1223 // =======================================================================
1263 template <class FUNC1, class FUNC2, class FUNC3, class FUNC4, class Iterator>
1264 StatusCode farray( const std::string& name1, const FUNC1& func1, const std::string& name2, const FUNC2& func2,
1265 const std::string& name3, const FUNC3& func3, const std::string& name4, const FUNC4& func4,
1266 Iterator&& first, Iterator&& last, const std::string& length, size_t maxv )
1267 {
1268 return farray( {{name1, std::cref( func1 )},
1269 {name2, std::cref( func2 )},
1270 {name3, std::cref( func3 )},
1271 {name4, std::cref( func4 )}},
1272 std::forward<Iterator>( first ), std::forward<Iterator>( last ), length, maxv );
1273 }
1274 // =======================================================================
1275 public:
1276 // =======================================================================
1327 template <class MATRIX>
1328 StatusCode fmatrix( const std::string& name, const MATRIX& data, size_t rows, const MIndex& cols,
1329 const std::string& length, size_t maxv )
1330 {
1331 if ( invalid() ) {
1332 return InvalidTuple;
1333 }
1334 if ( rowWise() ) {
1335 return InvalidOperation;
1336 }
1337
1338 // adjust the length
1339 if ( rows >= maxv ) {
1340 Warning( "fmatrix('" + name + "'): matrix is overflow, skip extra items" ).ignore();
1341 rows = ( 0 < maxv ) ? ( maxv - 1 ) : 0;
1342 }
1343
1344 // get the length item
1345 Int* len = ints( length, 0, maxv );
1346 if ( !len ) {
1347 return InvalidColumn;
1348 }
1349
1350 // adjust the length item
1351 *len = rows;
1352
1353 // get the array itself
1354 FMatrix* var = fMatrix( name, len, cols );
1355 if ( !var ) {
1356 return InvalidColumn;
1357 }
1358
1360 for ( size_t iCol = 0; iCol < cols; ++iCol ) {
1361 for ( MIndex iRow = 0; iRow < rows; ++iRow ) {
1362 ( *var )[iRow][iCol] = data[iRow][iCol];
1363 }
1364 }
1365
1366 return StatusCode::SUCCESS;
1367 }
1368 // =======================================================================
1405 template <class DATA>
1406 StatusCode fmatrix( const std::string& name, DATA first, DATA last, const MIndex& cols, const std::string& length,
1407 size_t maxv )
1408 {
1409 if ( invalid() ) {
1410 return InvalidTuple;
1411 }
1412 if ( rowWise() ) {
1413 return InvalidOperation;
1414 }
1415
1416 // adjust the length
1417 if ( first + maxv < last ) {
1418 Warning( "fmatrix('" + name + "'): matrix is overflow, skip extra items" ).ignore();
1419 last = first + maxv;
1420 }
1421
1422 // get the length item
1423 Int* len = ints( length, 0, maxv );
1424 if ( !len ) {
1425 return InvalidColumn;
1426 }
1427
1428 // adjust the length item
1429 *len = last - first;
1430
1431 // get the array itself
1432 FMatrix* var = fMatrix( name, len, cols );
1433 if ( !var ) {
1434 return InvalidColumn;
1435 }
1436
1438 size_t iRow = 0;
1439 for ( ; first != last; ++first ) {
1440 //
1441 for ( MIndex iCol = 0; iCol < cols; ++iCol ) {
1442 ( *var )[iRow][iCol] = (float)( ( *first )[iCol] );
1443 }
1444 //
1445 ++iRow;
1446 }
1447
1448 return StatusCode::SUCCESS;
1449 }
1450 // =======================================================================
1529 template <class FUN, class DATA>
1530 StatusCode fmatrix( const std::string& name, FUN funF, FUN funL, DATA first, DATA last, const std::string& length,
1531 size_t maxv )
1532 {
1533 if ( invalid() ) {
1534 return InvalidTuple;
1535 }
1536 if ( rowWise() ) {
1537 return InvalidOperation;
1538 }
1539
1540 // adjust the length
1541 if ( std::distance( first, last ) > static_cast<std::ptrdiff_t>( maxv ) ) {
1542 Warning( "fmatrix('" + name + "'): matrix is overflow, skip extra items" ).ignore();
1543 last = std::next( first, maxv );
1544 }
1545
1546 // get the length item
1547 Int* len = ints( length, 0, maxv );
1548 if ( !len ) {
1549 return InvalidColumn;
1550 }
1551
1552 // adjust the length item
1553 *len = std::distance( first, last );
1554
1555 // get the array itself
1556 auto cols = std::distance( funF, funL );
1557 FMatrix* var = fMatrix( name, len, cols );
1558 if ( !var ) {
1559 return InvalidColumn;
1560 }
1561
1563 size_t iRow = 0;
1564 for ( ; first != last; ++first ) {
1565 //
1566 for ( FUN fun = funF; fun < funL; ++fun ) {
1567 ( *var )[iRow][fun - funF] = ( *fun )( *first );
1568 }
1569 //
1570 ++iRow;
1571 }
1572
1573 return StatusCode::SUCCESS;
1574 }
1575 // =======================================================================
1576 public:
1577 // =======================================================================
1600 template <class DATA>
1601 StatusCode array( const std::string& name, DATA first, DATA last )
1602
1603 {
1604 if ( invalid() ) {
1605 return InvalidTuple;
1606 }
1607 if ( rowWise() ) {
1608 return InvalidOperation;
1609 }
1610
1611 // get the length (fixed!)
1612 auto length = std::distance( first, last );
1613
1614 // get the array itself
1615 FArray* var = fArray( name, length );
1616 if ( !var ) {
1617 return InvalidColumn;
1618 }
1619
1621 std::copy( first, last, std::begin( *var ) );
1622
1623 return StatusCode::SUCCESS;
1624 }
1625 // =======================================================================
1664 template <class ARRAY>
1665 StatusCode array( const std::string& name, const ARRAY& data, const MIndex& length )
1666 {
1667 using std::begin; // allow data to be eg. CLHEP::HepVector (which does not define HepVector::begin()!,
1668 // in which case ADL prefers CLHEP::begin (yah! at least they (now) use a namespace)
1669 // so one just to insure double* CLHEP::begin(CLHEP::HepVector& v) { return &v[0]; }
1670 // is visible when this function gets instantiated for CLHEP::HepVector...
1671 auto first = begin( data );
1672 return array( name, first, std::next( first, length ) );
1673 }
1674 // =======================================================================
1705 template <class ARRAY>
1706 StatusCode array( const std::string& name, const ARRAY& data )
1707 {
1708 using std::begin;
1709 using std::end;
1710 return array( name, begin( data ), end( data ) );
1711 }
1712 // =======================================================================
1713 public:
1714 // =======================================================================
1763 template <class MATRIX>
1764 StatusCode matrix( const std::string& name, const MATRIX& data, const MIndex& rows, const MIndex& cols )
1765 {
1766 if ( invalid() ) {
1767 return InvalidTuple;
1768 }
1769 if ( rowWise() ) {
1770 return InvalidOperation;
1771 }
1772
1773 // get the matrix itself
1774 FMatrix* var = fMatrix( name, rows, cols );
1775 if ( !var ) {
1776 return InvalidColumn;
1777 }
1778
1780 for ( size_t iCol = 0; iCol < cols; ++iCol ) {
1781 for ( size_t iRow = 0; iRow < rows; ++iRow ) {
1782 ( *var )[iRow][iCol] = data[iRow][iCol];
1783 }
1784 };
1785 return StatusCode::SUCCESS;
1786 }
1787 // =======================================================================
1788 public:
1789 // =======================================================================
1806 template <class TYPE>
1807 StatusCode column( const std::string& name, const ROOT::Math::LorentzVector<TYPE>& v )
1808 {
1809 return columns( v, std::make_pair( name + "E", &ROOT::Math::LorentzVector<TYPE>::E ),
1810 std::make_pair( name + "X", &ROOT::Math::LorentzVector<TYPE>::Px ),
1811 std::make_pair( name + "Y", &ROOT::Math::LorentzVector<TYPE>::Py ),
1812 std::make_pair( name + "Z", &ROOT::Math::LorentzVector<TYPE>::Pz ) );
1813 }
1814 // =======================================================================
1831 template <class TYPE, class TAG>
1832 StatusCode column( const std::string& name, const ROOT::Math::DisplacementVector3D<TYPE, TAG>& v )
1833 {
1834 return this->columns( v, std::make_pair( name + "X", &ROOT::Math::DisplacementVector3D<TYPE, TAG>::X ),
1835 std::make_pair( name + "Y", &ROOT::Math::DisplacementVector3D<TYPE, TAG>::Y ),
1836 std::make_pair( name + "Z", &ROOT::Math::DisplacementVector3D<TYPE, TAG>::Z ) );
1837 }
1838 // =======================================================================
1855 template <class TYPE, class TAG>
1856 StatusCode column( const std::string& name, const ROOT::Math::PositionVector3D<TYPE, TAG>& v )
1857 {
1858 return this->columns( v, std::make_pair( name + "X", &ROOT::Math::PositionVector3D<TYPE, TAG>::X ),
1859 std::make_pair( name + "Y", &ROOT::Math::PositionVector3D<TYPE, TAG>::Y ),
1860 std::make_pair( name + "Z", &ROOT::Math::PositionVector3D<TYPE, TAG>::Z ) );
1861 }
1862 // =======================================================================
1871 template <class TYPE, unsigned int D1, unsigned int D2, class REP>
1872 StatusCode matrix( const std::string& name, const ROOT::Math::SMatrix<TYPE, D1, D2, REP>& mtrx )
1873 {
1874 if ( invalid() ) {
1875 return InvalidTuple;
1876 }
1877 if ( rowWise() ) {
1878 return InvalidOperation;
1879 }
1880
1881 // get the matrix itself
1882 FMatrix* var = fMatrix( name, (MIndex)D1, (MIndex)D2 );
1883 if ( !var ) {
1884 return InvalidColumn;
1885 }
1886
1888 for ( size_t iCol = 0; iCol < D2; ++iCol ) {
1889 for ( size_t iRow = 0; iRow < D1; ++iRow ) {
1890 ( *var )[iRow][iCol] = mtrx( iRow, iCol );
1891 }
1892 };
1893
1894 return StatusCode::SUCCESS;
1895 }
1896 // =======================================================================
1914 template <class KEY, class VALUE>
1915 StatusCode fmatrix( const std::string& name, const GaudiUtils::VectorMap<KEY, VALUE>& info,
1916 const std::string& length, const size_t maxv = 100 )
1917 {
1918 using Info = std::pair<KEY, VALUE>;
1919 static const std::array<std::function<float( const Info& )>, 2> fns = {
1920 {[]( const Info& i ) { return i.first; }, []( const Info& i ) { return i.second; }}};
1921 return fmatrix( name, std::begin( fns ), std::end( fns ), std::begin( info ), std::end( info ), length, maxv );
1922 }
1923 // =======================================================================
1924 public:
1925 // =======================================================================
1933 template <class TYPE>
1934 StatusCode put( const std::string& name, const TYPE* obj );
1935 // =======================================================================
1936 public:
1937 // =======================================================================
1941 StatusCode write();
1942 // =======================================================================
1944 const std::string& name() const { return m_name; }
1945 // =======================================================================
1949 const NTuple::Tuple* tuple() const { return m_tuple; }
1950 // =======================================================================
1954 NTuple::Tuple* tuple() { return m_tuple; }
1955 // =======================================================================
1959 unsigned long refCount() const { return m_refCount; }
1960 // =======================================================================
1964 unsigned long addRef() { return ++m_refCount; }
1965 // =======================================================================
1970 void release();
1971 // =======================================================================
1973 const CLID& clid() const { return m_clid; }
1974 // =======================================================================
1976 Tuples::Type type() const { return m_type; }
1977 // =======================================================================
1979 bool columnWise() const { return CLID_ColumnWiseTuple == clid(); }
1980 // =======================================================================
1982 bool rowWise() const { return CLID_RowWiseTuple == clid(); }
1983 // =======================================================================
1985 bool evtColType() const { return Tuples::EVTCOL == type(); }
1986 // =======================================================================
1988 bool valid() const { return 0 != tuple(); }
1989 // =======================================================================
1991 bool invalid() const { return !valid(); }
1992 // =======================================================================
1993 public:
1994 // =======================================================================
2000 bool addItem( std::string name, std::string type )
2001 {
2002 return m_items.emplace( std::move( name ), std::move( type ) ).second;
2003 }
2004 // =======================================================================
2009 bool goodItem( const std::string& name ) const { return m_items.end() == m_items.find( name ); }
2010 // =======================================================================
2012 const ItemMap& items() const { return m_items; }
2013 // =======================================================================
2014 public:
2015 // =======================================================================
2016 virtual StatusCode Error( const std::string& msg, const StatusCode sc = StatusCode::FAILURE ) const = 0;
2017 // =======================================================================
2018 virtual StatusCode Warning( const std::string& msg, const StatusCode sc = StatusCode::FAILURE ) const = 0;
2019 // =======================================================================
2020 private:
2021 // =======================================================================
2023 Int* ints( const std::string& name, int minv, int maxv );
2024 // =======================================================================
2026 FArray* fArray( const std::string& name, Int* item );
2027 // =======================================================================
2029 FArray* fArray( const std::string& name, const MIndex& rows );
2030 // =======================================================================
2032 Address* addresses( const std::string& name );
2033 // =======================================================================
2035 FMatrix* fMatrix( const std::string& name, Int* item, const MIndex& cols );
2036 // =======================================================================
2038 FMatrix* fMatrix( const std::string& name, const MIndex& rows, const MIndex& cols );
2039 // =======================================================================
2040 private:
2041 // =======================================================================
2043 TupleObj() = delete;
2044 TupleObj( const TupleObj& ) = delete;
2045 TupleObj& operator=( const TupleObj& ) = delete;
2046 // =======================================================================
2047 private:
2048 // =======================================================================
2050 typedef GaudiUtils::HashMap<std::string, std::unique_ptr<Bool>> Bools;
2051 // =======================================================================
2053 typedef GaudiUtils::HashMap<std::string, std::unique_ptr<Char>> Chars;
2054 // =======================================================================
2056 typedef GaudiUtils::HashMap<std::string, std::unique_ptr<UChar>> UChars;
2057 // =======================================================================
2059 typedef GaudiUtils::HashMap<std::string, std::unique_ptr<Short>> Shorts;
2060 // =======================================================================
2062 typedef GaudiUtils::HashMap<std::string, std::unique_ptr<UShort>> UShorts;
2063 // =======================================================================
2065 typedef GaudiUtils::HashMap<std::string, std::unique_ptr<Int>> Ints;
2066 // =======================================================================
2068 typedef GaudiUtils::HashMap<std::string, std::unique_ptr<UInt>> UInts;
2069 // =======================================================================
2071 typedef GaudiUtils::HashMap<std::string, std::unique_ptr<LongLong>> LongLongs;
2072 // =======================================================================
2074 typedef GaudiUtils::HashMap<std::string, std::unique_ptr<ULongLong>> ULongLongs;
2075 // =======================================================================
2077 typedef GaudiUtils::HashMap<std::string, std::unique_ptr<Float>> Floats;
2078 // =======================================================================
2080 typedef GaudiUtils::HashMap<std::string, std::unique_ptr<Double>> Doubles;
2081 // =======================================================================
2083 typedef GaudiUtils::HashMap<std::string, std::unique_ptr<Address>> Addresses;
2084 // =======================================================================
2086 typedef GaudiUtils::HashMap<std::string, std::unique_ptr<FArray>> FArrays;
2087 // =======================================================================
2089 typedef GaudiUtils::HashMap<std::string, std::unique_ptr<FMatrix>> FMatrices;
2090 // =======================================================================
2091 private:
2092 // =======================================================================
2094 std::string m_name;
2095 // =======================================================================
2097 NTuple::Tuple* m_tuple;
2098 // =======================================================================
2100 CLID m_clid;
2101 // =======================================================================
2103 Tuples::Type m_type;
2104 // =======================================================================
2106 size_t m_refCount = 0;
2107 // =======================================================================
2109 mutable Bools m_bools;
2110 // =======================================================================
2112 mutable Chars m_chars;
2113 // =======================================================================
2115 mutable UChars m_uchars;
2116 // =======================================================================
2118 mutable Shorts m_shorts;
2119 // =======================================================================
2121 mutable UShorts m_ushorts;
2122 // =======================================================================
2124 mutable Ints m_ints;
2125 // =======================================================================
2127 mutable UInts m_uints;
2128 // =======================================================================
2130 mutable LongLongs m_longlongs;
2131 // =======================================================================
2133 mutable ULongLongs m_ulonglongs;
2134 // =======================================================================
2136 mutable Floats m_floats;
2137 // =======================================================================
2139 mutable Doubles m_doubles;
2140 // =======================================================================
2142 mutable Addresses m_addresses;
2143 // =======================================================================
2145 mutable FArrays m_farrays;
2146 // =======================================================================
2148 mutable FArrays m_arraysf;
2149 // =======================================================================
2151 mutable FMatrices m_fmatrices;
2152 // =======================================================================
2154 mutable FMatrices m_matricesf;
2155 // =======================================================================
2157 ItemMap m_items;
2158 // =======================================================================
2159 };
2160 // ==========================================================================
2161 } // end of namespace Tuples
2162 // ============================================================================
2163 // GaudiAlg
2164 // ============================================================================
2165 #include "GaudiAlg/TuplePut.h"
2166 // ============================================================================
2167 // The END
2168 // ============================================================================
2169 #endif // GAUDIALG_TUPLEOBJ_H
2170 // ============================================================================
Tuples::TupleObj::column
StatusCode column(const std::string &name, const ROOT::Math::DisplacementVector3D< TYPE, TAG > &v)
Useful shortcut to put 3D-Vector directly into N-Tuple:
Definition: TupleObj.h:1832
Tuples::TupleObj::m_ushorts
UShorts m_ushorts
the actual storage of all &#39;unsigned int&#39; columns
Definition: TupleObj.h:2121
Tuples::TupleObj::m_fmatrices
FMatrices m_fmatrices
the actual storage of all &#39;FArray&#39; columns
Definition: TupleObj.h:2151
StatusCode::SUCCESS
Definition: StatusCode.h:29
GaudiUtils::VectorMap
A bit modified version of &#39;Loki::AssocVector&#39; associative vector from Loki library by Andrei Alexandr...
Definition: VectorMap.h:103
Tuples::TupleObj::m_clid
CLID m_clid
tuple CLID
Definition: TupleObj.h:2100
Tuples::TupleObj::ItemMap
std::map< std::string, std::string > ItemMap
Definition: TupleObj.h:249
Tuples::TupleObj::tuple
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:1949
std::copy
T copy(T...args)
Tuples::TupleObj::matrix
StatusCode matrix(const std::string &name, const MATRIX &data, const MIndex &rows, const MIndex &cols)
fill N-Tuple with fixed-size matrix
Definition: TupleObj.h:1764
std::forward_as_tuple
T forward_as_tuple(T...args)
std::distance
T distance(T...args)
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:120
Tuples::TupleObj::Float
NTuple::Item< float > Float
basic type for float items
Definition: TupleObj.h:231
gaudiComponentHelp.name
name
Definition: gaudiComponentHelp.py:32
Tuples::TupleObj::goodItem
bool goodItem(const std::string &name) const
check the uniqueness of the name
Definition: TupleObj.h:2009
Tuples::TupleObj::evtColType
bool evtColType() const
Event collection ?
Definition: TupleObj.h:1985
Tuples::InvalidTuple
Definition: TupleObj.h:97
gaudirun.args
args
Definition: gaudirun.py:244
Tuples::TupleObj::m_doubles
Doubles m_doubles
the actual storage of all &#39;Double&#39; columns
Definition: TupleObj.h:2139
Tuples::TupleObj::m_type
Tuples::Type m_type
tuple &#39;type&#39;
Definition: TupleObj.h:2103
Tuples::TupleObj::columns_helper
StatusCode columns_helper(const Value &value, const Tuple &tup, std::index_sequence< I... >)
Set the values for several columns simultaneously, for the same object Non-existing columns will be a...
Definition: TupleObj.h:792
NTuple::Matrix
Class acting as a smart pointer holding a N tuple _Item.
Definition: NTuple.h:53
GaudiPython.GaudiAlgs.fmatrix
fmatrix
Definition: GaudiAlgs.py:1266
Tuples::TupleObj::Address
NTuple::Item< IOpaqueAddress * > Address
basic type for address items
Definition: TupleObj.h:237
NTuple.h
Tuples::TupleObj::m_matricesf
FMatrices m_matricesf
the actual storage of all &#39;FMatrix&#39; columns (fixed)
Definition: TupleObj.h:2154
Tuples::TupleObj::m_floats
Floats m_floats
the actual storage of all &#39;Float&#39; columns
Definition: TupleObj.h:2136
Gaudi::Utils::Histos::fill
GAUDI_API void fill(AIDA::IHistogram1D *histo, const double value, const double weight=1.0)
simple function to fill AIDA::IHistogram1D objects
Definition: Fill.cpp:35
Tuples::TupleObj::ULongLong
NTuple::Item< unsigned long long > ULongLong
basic type for unsigned long long items
Definition: TupleObj.h:228
Tuples::TupleObj::m_farrays
FArrays m_farrays
the actual storage of all &#39;FArray&#39; columns
Definition: TupleObj.h:2145
Tuples::TupleObj::UShort
NTuple::Item< unsigned short > UShort
basic type for unsigned int items
Definition: TupleObj.h:216
std::end
T end(T...args)
Tuples::TupleObj::fmatrix
StatusCode fmatrix(const std::string &name, const MATRIX &data, size_t rows, const MIndex &cols, const std::string &length, size_t maxv)
Fill N-Tuple with data from variable-size matrix.
Definition: TupleObj.h:1328
Tuples::detail::to_float
Definition: TupleObj.h:72
Tuples::InvalidItem
Definition: TupleObj.h:101
Tuples::TupleObj::MIndex
unsigned short MIndex
Definition: TupleObj.h:246
Tuples::TupleObj::Chars
GaudiUtils::HashMap< std::string, std::unique_ptr< Char > > Chars
the actual storage type for short columns
Definition: TupleObj.h:2053
std::size_t
ROOT::Math::PositionVector3D
Definition: IMagneticFieldSvc.h:17
invoke.h
std::map< std::string, std::string >
Tuples::TupleObj::m_name
std::string m_name
name
Definition: TupleObj.h:2094
Tuples::TruncateValue
Definition: TupleObj.h:102
Tuples::TupleObj::tuple
NTuple::Tuple * tuple()
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:1954
Tuples::TupleObj::Shorts
GaudiUtils::HashMap< std::string, std::unique_ptr< Short > > Shorts
the actual storage type for short columns
Definition: TupleObj.h:2059
Tuples::TupleObj::m_arraysf
FArrays m_arraysf
the actual storage of all &#39;FArray&#39; columns (fixed)
Definition: TupleObj.h:2148
Tuples::TupleObj::farray
StatusCode farray(const std::string &name, ITERATOR1 &&first, ITERATOR2 &&last, const std::string &length, size_t maxv)
Add an indexed array (of type float) to N-tuple.
Definition: TupleObj.h:892
Tuples::InvalidOperation
Definition: TupleObj.h:99
Tuples::TupleObj::UChar
NTuple::Item< unsigned char > UChar
basic type for unsigned int items
Definition: TupleObj.h:210
Tuples::TupleObj::m_bools
Bools m_bools
the actual storage of all &#39;bool&#39; columns
Definition: TupleObj.h:2109
SerializeSTL.h
Provide serialization function (output only) for some common STL classes (vectors, lists, pairs, maps) plus GaudiUtils::Map and GaudiUtils::HashMap.
begin
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:58
Tuples::TupleObj::columnWise
bool columnWise() const
column wise NTuple ?
Definition: TupleObj.h:1979
operator=
PropertyMgr & operator=(const PropertyMgr &)=delete
Gaudi::Units::second
constexpr double second
Definition: SystemOfUnits.h:123
std::string
STL class.
GaudiPython.GaudiAlgs.farray
farray
Definition: GaudiAlgs.py:1265
Tuples::TupleObj::Short
NTuple::Item< short > Short
basic type for int items
Definition: TupleObj.h:213
Tuples::TupleObj::m_chars
Chars m_chars
the actual storage of all &#39;Int&#39; columns
Definition: TupleObj.h:2112
std::is_convertible
Tuples::Tuple
A simple wrapper class over standard Gaudi NTuple::Tuple facility.
Definition: Tuple.h:117
Tuples::TupleObj::addItem
bool addItem(std::string name, std::string type)
add the item name into the list of known items
Definition: TupleObj.h:2000
Tuples::TupleObj::fmatrix
StatusCode fmatrix(const std::string &name, FUN funF, FUN funL, DATA first, DATA last, const std::string &length, size_t maxv)
fill N-Tuple with matrix of "direct-product" of "data-vector" [first,last) and "function-vector" [fun...
Definition: TupleObj.h:1530
Tuples::TupleObj::Ints
GaudiUtils::HashMap< std::string, std::unique_ptr< Int > > Ints
the actual storage type for integer columns
Definition: TupleObj.h:2065
Tuples::TupleObj::m_ulonglongs
ULongLongs m_ulonglongs
the actual storage of all &#39;ulonglong&#39; columns
Definition: TupleObj.h:2133
detail
TupleObj.h GaudiAlg/TupleObj.h namespace with few technical implementations.
VectorMap.h
Tuples::TupleObj
A simple wrapper class over standard Gaudi NTuple::Tuple facility.
Definition: TupleObj.h:199
std::next
T next(T...args)
Tuples::TupleObj::array
StatusCode array(const std::string &name, const ARRAY &data)
fill N-Tuple with fixed-size array
Definition: TupleObj.h:1706
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Tuples::TupleObj::farray
StatusCode farray(const std::string &name1, const FUNC1 &func1, const std::string &name2, const FUNC2 &func2, const std::string &name3, const FUNC3 &func3, Iterator &&first, Iterator &&last, const std::string &length, size_t maxv)
Put three functions from one data array into LoKi-style N-Tuple simultaneously (effective!) ...
Definition: TupleObj.h:1216
Tuples::TupleObj::farray
StatusCode farray(const std::string &name, const DATA &data, const std::string &length, const size_t maxv)
Add an indexed array (of type float) to N-tuple.
Definition: TupleObj.h:942
Tuples::TupleObj::FMatrix
NTuple::Matrix< float > FMatrix
basic type for matrix of floats
Definition: TupleObj.h:243
std::ostringstream
STL class.
gaudirun.type
type
Definition: gaudirun.py:133
Tuples::TupleObj::m_uints
UInts m_uints
the actual storage of all &#39;unsigned int&#39; columns
Definition: TupleObj.h:2127
Tuples::TupleObj::matrix
StatusCode matrix(const std::string &name, const ROOT::Math::SMatrix< TYPE, D1, D2, REP > &mtrx)
shortcut to put Smatrix into N-tuple:
Definition: TupleObj.h:1872
Tuples::TupleObj::Doubles
GaudiUtils::HashMap< std::string, std::unique_ptr< Double > > Doubles
the actual storage type for float columns
Definition: TupleObj.h:2080
Tuples::TupleObj::FArrays
GaudiUtils::HashMap< std::string, std::unique_ptr< FArray > > FArrays
the actual storage type for array columns
Definition: TupleObj.h:2086
Tuples::detail::to_::operator()
T operator()(Arg &&i) const
Definition: TupleObj.h:67
Tuples::TupleObj::UInts
GaudiUtils::HashMap< std::string, std::unique_ptr< UInt > > UInts
the actual storage type for unsigned integer columns
Definition: TupleObj.h:2068
std::make_pair
T make_pair(T...args)
Tuples::TupleObj::m_items
ItemMap m_items
all booked types:
Definition: TupleObj.h:2157
Tuples::TupleObj::Bool
NTuple::Item< bool > Bool
basic type for int items
Definition: TupleObj.h:204
end
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:64
Tuples::TupleObj::Double
NTuple::Item< double > Double
basic type for double items
Definition: TupleObj.h:234
Tuples::TupleObj::FMatrices
GaudiUtils::HashMap< std::string, std::unique_ptr< FMatrix > > FMatrices
the actual storage type for matrix columns
Definition: TupleObj.h:2089
Tuples::TupleObj::farray
StatusCode farray(const std::string &name1, const FUNC1 &func1, const std::string &name2, const FUNC2 &func2, Iterator &&first, Iterator &&last, const std::string &length, size_t maxv)
Put two functions from one data array into LoKi-style N-Tuple simultaneously (effective!) ...
Definition: TupleObj.h:1172
NTuple::Item< bool >
Specialization acting as a smart pointer holding a N tuple _Item.
Definition: NTuple.h:318
Tuples::TupleObj::m_ints
Ints m_ints
the actual storage of all &#39;Int&#39; columns
Definition: TupleObj.h:2124
CLID
unsigned int CLID
Class ID definition.
Definition: ClassID.h:8
Tuples::TupleObj::Bools
GaudiUtils::HashMap< std::string, std::unique_ptr< Bool > > Bools
the actual storage type for short columns
Definition: TupleObj.h:2050
Tuples::TupleObj::m_longlongs
LongLongs m_longlongs
the actual storage of all &#39;longlong&#39; columns
Definition: TupleObj.h:2130
Tuples::TupleObj::LongLongs
GaudiUtils::HashMap< std::string, std::unique_ptr< LongLong > > LongLongs
the actual storage type for longlong columns
Definition: TupleObj.h:2071
Tuples::TupleObj::farray_impl
StatusCode farray_impl(FunIterator first_item, FunIterator last_item, DataIterator first, DataIterator last, const std::string &length, size_t maxv)
Put arbitrary number of functions from one data array into LoKi-style N-Tuple simultaneously (effecti...
Definition: TupleObj.h:1075
Tuples::TupleObj::valid
bool valid() const
valid pointer to tuple ?
Definition: TupleObj.h:1988
std::move
T move(T...args)
Tuples::InvalidColumn
Definition: TupleObj.h:98
ROOT::Math::DisplacementVector3D
Definition: IMagneticFieldSvc.h:20
Tuples::TupleObj::fmatrix
StatusCode fmatrix(const std::string &name, DATA first, DATA last, const MIndex &cols, const std::string &length, size_t maxv)
Fill N-Tuple with data from variable-size matrix.
Definition: TupleObj.h:1406
Tuples::TupleObj::addRef
unsigned long addRef()
add the reference to TupleObj
Definition: TupleObj.h:1964
Tuples::TupleObj::refCount
unsigned long refCount() const
return the reference counter
Definition: TupleObj.h:1959
Tuples::TupleObj::rowWise
bool rowWise() const
row wise NTuple ?
Definition: TupleObj.h:1982
GaudiUtils::details::ostream_joiner
Stream & ostream_joiner(Stream &os, Iterator first, Iterator last, Separator sep, OutputElement output=OutputElement{})
Definition: SerializeSTL.h:40
NTuple::Tuple
Abstract base class which allows the user to interact with the actual N tuple implementation.
Definition: NTuple.h:412
Tuples::TupleObj::column
StatusCode column(const std::string &name, signed char value)
Set the value for the selected tuple column.
Definition: TupleObj.h:707
std::pair
Tuples::ErrorCodes
ErrorCodes
Tuple error codes.
Definition: TupleObj.h:96
Tuples::TupleObj::LongLong
NTuple::Item< long long > LongLong
basic type for unsigned long long items
Definition: TupleObj.h:225
Tuples::TupleObj::m_addresses
Addresses m_addresses
the actual storage of all &#39;Address&#39; columns
Definition: TupleObj.h:2142
Tuples::EVTCOL
Definition: TupleObj.h:86
Tuples::TupleObj::farray
StatusCode farray(const NamedFunctions &funs, DataIterator first, DataIterator last, const std::string &length, size_t maxv)
Definition: TupleObj.h:1133
std::find_if_not
T find_if_not(T...args)
Maps.h
Tuples::TupleObj::ULongLongs
GaudiUtils::HashMap< std::string, std::unique_ptr< ULongLong > > ULongLongs
the actual storage type for ulonglong columns
Definition: TupleObj.h:2074
Tuples::TupleObj::farray
StatusCode farray(const std::string &name1, const FUNC1 &func1, const std::string &name2, const FUNC2 &func2, const std::string &name3, const FUNC3 &func3, const std::string &name4, const FUNC4 &func4, Iterator &&first, Iterator &&last, const std::string &length, size_t maxv)
Put four functions from one data array into LoKi-style N-Tuple simultaneously (effective!) ...
Definition: TupleObj.h:1264
Tuples::TupleObj::array
StatusCode array(const std::string &name, DATA first, DATA last)
fill N-Tuple with fixed-size array
Definition: TupleObj.h:1601
Containers::array
struct GAUDI_API array
Parametrisation class for redirection array - like implementation.
Definition: KeyedObjectManager.h:28
std::vector
STL class.
Tuples::TupleObj::m_tuple
NTuple::Tuple * m_tuple
tuple itself
Definition: TupleObj.h:2097
Tuples::TupleObj::fmatrix
StatusCode fmatrix(const std::string &name, const GaudiUtils::VectorMap< KEY, VALUE > &info, const std::string &length, const size_t maxv=100)
shortcut to put "ExtraInfo" fields of major into N-Tuple
Definition: TupleObj.h:1915
std::cref
T cref(T...args)
Tuples::TupleObj::type
Tuples::Type type() const
accessor to the N-Tuple type
Definition: TupleObj.h:1976
Iterator
boost::spirit::classic::position_iterator2< ForwardIterator > Iterator
Definition: Iterator.h:18
std::begin
T begin(T...args)
Tuples::TupleObj::farray
StatusCode farray(const std::string &name, const FUNCTION &function, ITERATOR first, ITERATOR last, const std::string &length, size_t maxv)
Put an indexed array into LoKi-style N-Tuple.
Definition: TupleObj.h:1010
std::back_inserter
T back_inserter(T...args)
std::any_of
T any_of(T...args)
Tuples::TupleObj::farray
StatusCode farray(const Container< NamedFunction > &funs, DataIterator first, DataIterator last, const std::string &length, size_t maxv)
Definition: TupleObj.h:1124
fun
double fun(const std::vector< double > &x)
Definition: PFuncTest.cpp:26
Tuples::TupleObj::Char
NTuple::Item< char > Char
basic type for int items
Definition: TupleObj.h:207
GaudiPython.GaudiAlgs.write
write
Definition: GaudiAlgs.py:1259
Tuples::detail::const_ref_t
std::add_const_t< typename std::iterator_traits< Iterator >::reference > const_ref_t
Definition: TupleObj.h:76
GaudiUtils::HashMap
Common class providing an architecture-independent hash map.
Definition: HashMap.h:74
GaudiMP.FdsRegistry.msg
msg
Definition: FdsRegistry.py:8
std::array
STL class.
Tuples::TupleObj::Int
NTuple::Item< int > Int
basic type for int items
Definition: TupleObj.h:219
Tuples.h
Tuples::TupleObj::UShorts
GaudiUtils::HashMap< std::string, std::unique_ptr< UShort > > UShorts
the actual storage type for unsigned short columns
Definition: TupleObj.h:2062
GaudiPython.GaudiAlgs.valid
valid
Definition: GaudiAlgs.py:1258
Tuples::TupleObj::column
StatusCode column(const std::string &name, const ROOT::Math::LorentzVector< TYPE > &v)
Useful shortcut to put LorentzVector directly into N-Tuple:
Definition: TupleObj.h:1807
Tuples::TupleObj::m_shorts
Shorts m_shorts
the actual storage of all &#39;Int&#39; columns
Definition: TupleObj.h:2118
Tuples::TupleObj::invalid
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:1991
std::transform
T transform(T...args)
Tuples::NTUPLE
Definition: TupleObj.h:85
Tuples::TupleObj::items
const ItemMap & items() const
get the full list of booked items
Definition: TupleObj.h:2012
Tuples::TupleObj::FArray
NTuple::Array< float > FArray
basic type for array of floats
Definition: TupleObj.h:240
StatusCode::FAILURE
Definition: StatusCode.h:29
Gaudi::invoke
auto invoke(F &&f, ArgTypes &&...args) noexcept(noexcept(detail2::INVOKE(std::forward< F >(f), std::forward< ArgTypes >(args)...))) -> decltype(detail2::INVOKE(std::forward< F >(f), std::forward< ArgTypes >(args)...))
Definition: invoke.h:85
TuplePut.h
Implementation file for Tuple::TupleObj::put method.
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
Tuples::InvalidObject
Definition: TupleObj.h:100
NTuple::Item
Class acting as a smart pointer holding a N tuple _Item.
Definition: NTuple.h:49
Tuples::TupleObj::clid
const CLID & clid() const
accessor to the N-Tuple CLID
Definition: TupleObj.h:1973
Tuples::TupleObj::array
StatusCode array(const std::string &name, const ARRAY &data, const MIndex &length)
fill N-Tuple with fixed-size array
Definition: TupleObj.h:1665
std::for_each
T for_each(T...args)
Tuples::TupleObj::UChars
GaudiUtils::HashMap< std::string, std::unique_ptr< UChar > > UChars
the actual storage type for unsigned short columns
Definition: TupleObj.h:2056
NTuple::Array
Class acting as a smart pointer holding a N tuple _Item.
Definition: NTuple.h:51
Tuples::TupleObj::Addresses
GaudiUtils::HashMap< std::string, std::unique_ptr< Address > > Addresses
the actual storage type for address columns
Definition: TupleObj.h:2083
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:110
Tuples::detail::to_
Definition: TupleObj.h:65
Tuples::Type
Type
the list of available types for ntuples
Definition: TupleObj.h:84
std::ostream
STL class.
Tuples::TupleObj::name
const std::string & name() const
get the name
Definition: TupleObj.h:1944
Tuples::TupleObj::UInt
NTuple::Item< unsigned int > UInt
basic type for unsigned int items
Definition: TupleObj.h:222
Tuples::TupleObj::columns
StatusCode columns(Value &&value, Args &&...args)
Definition: TupleObj.h:808
Objects::reference
TO * reference(FROM *from)
Definition: KeyedObject.cpp:21
Tuples::TupleObj::m_uchars
UChars m_uchars
the actual storage of all &#39;unsigned int&#39; columns
Definition: TupleObj.h:2115
std::initializer_list
Gaudi::Functional::details::put
Out1 * put(DataObjectHandle< Out1 > &out_handle, Out2 &&out)
Definition: FunctionalDetails.h:115
GaudiPython.GaudiAlgs.Tuple
Tuple
Definition: GaudiAlgs.py:1130
std::vector::reserve
T reserve(T...args)
Tuples::TupleObj::Floats
GaudiUtils::HashMap< std::string, std::unique_ptr< Float > > Floats
the actual storage type for float columns
Definition: TupleObj.h:2077
GaudiPython.GaudiAlgs.column
column
Definition: GaudiAlgs.py:1164
std::numeric_limits
Tuples
General namespace for Tuple properties.
Definition: Maps.h:34
Tuples::TupleObj::column
StatusCode column(const std::string &name, const ROOT::Math::PositionVector3D< TYPE, TAG > &v)
Useful shortcut to put 3D-Vector directly into N-Tuple:
Definition: TupleObj.h:1856