Tuples::TupleObj Class Referenceabstract

A simple wrapper class over standard Gaudi NTuple::Tuple facility. More...

#include <GaudiAlg/TupleObj.h>

Inheritance diagram for Tuples::TupleObj:
Collaboration diagram for Tuples::TupleObj:

Public Types

typedef NTuple::Item< bool > Bool
 basic type for int items More...
 
typedef NTuple::Item< char > Char
 basic type for int items More...
 
typedef NTuple::Item< unsigned char > UChar
 basic type for unsigned int items More...
 
typedef NTuple::Item< short > Short
 basic type for int items More...
 
typedef NTuple::Item< unsigned short > UShort
 basic type for unsigned int items More...
 
typedef NTuple::Item< int > Int
 basic type for int items More...
 
typedef NTuple::Item< unsigned int > UInt
 basic type for unsigned int items More...
 
typedef NTuple::Item< long long > LongLong
 basic type for unsigned long long items More...
 
typedef NTuple::Item< unsigned long long > ULongLong
 basic type for unsigned long long items More...
 
typedef NTuple::Item< float > Float
 basic type for float items More...
 
typedef NTuple::Item< double > Double
 basic type for double items More...
 
typedef NTuple::Item< IOpaqueAddress * > Address
 basic type for address items More...
 
typedef NTuple::Array< float > FArray
 basic type for array of floats More...
 
typedef NTuple::Matrix< float > FMatrix
 basic type for matrix of floats More...
 
typedef unsigned short MIndex
 
typedef std::map< std::string, std::string > ItemMap
 
typedef NTuple::Item< bool > Bool
 basic type for int items More...
 
typedef NTuple::Item< char > Char
 basic type for int items More...
 
typedef NTuple::Item< unsigned char > UChar
 basic type for unsigned int items More...
 
typedef NTuple::Item< short > Short
 basic type for int items More...
 
typedef NTuple::Item< unsigned short > UShort
 basic type for unsigned int items More...
 
typedef NTuple::Item< int > Int
 basic type for int items More...
 
typedef NTuple::Item< unsigned int > UInt
 basic type for unsigned int items More...
 
typedef NTuple::Item< long long > LongLong
 basic type for unsigned long long items More...
 
typedef NTuple::Item< unsigned long long > ULongLong
 basic type for unsigned long long items More...
 
typedef NTuple::Item< float > Float
 basic type for float items More...
 
typedef NTuple::Item< double > Double
 basic type for double items More...
 
typedef NTuple::Item< IOpaqueAddress * > Address
 basic type for address items More...
 
typedef NTuple::Array< float > FArray
 basic type for array of floats More...
 
typedef NTuple::Matrix< float > FMatrix
 basic type for matrix of floats More...
 
typedef unsigned short MIndex
 
typedef std::map< std::string, std::string > ItemMap
 

Public Member Functions

StatusCode column (const std::string &name, float value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, double value)
 Set the value for the selected tuple column If the column does not exist, it will be automatically created and appended to the tuple. More...
 
StatusCode column (const std::string &name, short value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, short value, short minv, short maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, unsigned short value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, unsigned short value, unsigned short minv, unsigned short maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, char value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, char value, char minv, char maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, unsigned char value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, unsigned char value, unsigned char minv, unsigned char maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, int value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, int value, int minv, int maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, unsigned int value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, unsigned int value, unsigned int minv, unsigned int maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, long value)
 Set the value for the selected tuple column. More...
 
StatusCode column (const std::string &name, long value, long minv, long maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, unsigned long value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, unsigned long value, unsigned long minv, unsigned long maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, long long value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, long long value, long long minv, long long maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, unsigned long long value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, unsigned long long value, unsigned long long minv, unsigned long long maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, signed char value)
 Set the value for the selected tuple column. More...
 
StatusCode column (const std::string &name, bool value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, IOpaqueAddress *address)
 Put IOpaqueAddress in POOL-based NTuple. More...
 
StatusCode column (IOpaqueAddress *address)
 Put IOpaqueAddress in NTuple. More...
 
StatusCode fill (const char *format...)
 Set the values for several columns simultaneously. More...
 
template<typename ITERATOR1 , typename ITERATOR2 >
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. More...
 
template<class DATA >
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. More...
 
template<class FUNCTION , class ITERATOR >
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. More...
 
template<class FUNC1 , class FUNC2 , class DATA >
StatusCode farray (const std::string &name1, const FUNC1 &func1, const std::string &name2, const FUNC2 &func2, DATA first, DATA last, const std::string &length, size_t maxv)
 Put two functions from one data array into LoKi-style N-Tuple simultaneously (effective!) More...
 
template<class FUNC1 , class FUNC2 , class FUNC3 , class DATA >
StatusCode farray (const std::string &name1, const FUNC1 &func1, const std::string &name2, const FUNC2 &func2, const std::string &name3, const FUNC3 &func3, DATA first, DATA last, const std::string &length, size_t maxv)
 Put three functions from one data array into LoKi-style N-Tuple simultaneously (effective!) More...
 
template<class FUNC1 , class FUNC2 , class FUNC3 , class FUNC4 , class DATA >
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, DATA first, DATA last, const std::string &length, size_t maxv)
 Put four functions from one data array into LoKi-style N-Tuple simultaneously (effective!) More...
 
template<class MATRIX >
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. More...
 
template<class DATA >
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. More...
 
template<class FUN , class DATA >
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" [funF, funL) More...
 
template<class DATA >
StatusCode array (const std::string &name, DATA first, DATA last)
 fill N-Tuple with fixed-size array More...
 
template<class ARRAY >
StatusCode array (const std::string &name, const ARRAY &data, const MIndex &length)
 fill N-Tuple with fixed-size array More...
 
template<class ARRAY >
StatusCode array (const std::string &name, const ARRAY &data)
 fill N-Tuple with fixed-size array More...
 
template<class MATRIX >
StatusCode matrix (const std::string &name, const MATRIX &data, const MIndex &rows, const MIndex &cols)
 fill N-Tuple with fixed-size matrix More...
 
template<class TYPE >
StatusCode column (const std::string &name, const ROOT::Math::LorentzVector< TYPE > &v)
 Useful shortcut to put LorentzVector directly into N-Tuple: More...
 
template<class TYPE , class TAG >
StatusCode column (const std::string &name, const ROOT::Math::DisplacementVector3D< TYPE, TAG > &v)
 Useful shortcut to put 3D-Vector directly into N-Tuple: More...
 
template<class TYPE , class TAG >
StatusCode column (const std::string &name, const ROOT::Math::PositionVector3D< TYPE, TAG > &v)
 Useful shortcut to put 3D-Vector directly into N-Tuple: More...
 
template<class TYPE , unsigned int D1, unsigned int D2, class REP >
StatusCode matrix (const std::string &name, const ROOT::Math::SMatrix< TYPE, D1, D2, REP > &mtrx)
 shortcut to put Smatrix into N-tuple: More...
 
template<class KEY , class VALUE >
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 More...
 
template<class TYPE >
StatusCode put (const std::string &name, const TYPE *obj)
 The function allows to add almost arbitrary object into N-tuple. More...
 
StatusCode write ()
 write a record to NTuple More...
 
const std::string & name () const
 get the name More...
 
const NTuple::Tupletuple () const
 provide the access to underlying Gaudi N-tuple More...
 
NTuple::Tupletuple ()
 provide the access to underlying Gaudi N-tuple More...
 
unsigned long refCount () const
 return the reference counter More...
 
unsigned long addRef ()
 add the reference to TupleObj More...
 
void release ()
 release the reference to TupleObj if reference counter becomes zero, object will be automatically deleted More...
 
const CLIDclid () const
 accessor to the N-Tuple CLID More...
 
Tuples::Type type () const
 accessor to the N-Tuple type More...
 
bool columnWise () const
 column wise NTuple ? More...
 
bool rowWise () const
 row wise NTuple ? More...
 
bool evtColType () const
 Event collection ? More...
 
bool valid () const
 valid pointer to tuple ? More...
 
bool invalid () const
 invalid pointer to tuple ? More...
 
bool addItem (std::string name, std::string type)
 add the item name into the list of known items More...
 
bool goodItem (const std::string &name) const
 check the uniqueness of the name More...
 
const ItemMapitems () const
 get the full list of booked items More...
 
virtual StatusCode Error (const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
 
virtual StatusCode Warning (const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
 
StatusCode column (const std::string &name, float value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, double value)
 Set the value for the selected tuple column If the column does not exist, it will be automatically created and appended to the tuple. More...
 
StatusCode column (const std::string &name, short value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, short value, short minv, short maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, unsigned short value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, unsigned short value, unsigned short minv, unsigned short maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, char value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, char value, char minv, char maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, unsigned char value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, unsigned char value, unsigned char minv, unsigned char maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, int value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, int value, int minv, int maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, unsigned int value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, unsigned int value, unsigned int minv, unsigned int maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, long value)
 Set the value for the selected tuple column. More...
 
StatusCode column (const std::string &name, long value, long minv, long maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, unsigned long value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, unsigned long value, unsigned long minv, unsigned long maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, long long value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, long long value, long long minv, long long maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, unsigned long long value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, unsigned long long value, unsigned long long minv, unsigned long long maxv)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, signed char value)
 Set the value for the selected tuple column. More...
 
StatusCode column (const std::string &name, bool value)
 Set the value for selected tuple column. More...
 
StatusCode column (const std::string &name, IOpaqueAddress *address)
 Put IOpaqueAddress in POOL-based NTuple. More...
 
StatusCode column (IOpaqueAddress *address)
 Put IOpaqueAddress in NTuple. More...
 
StatusCode fill (const char *format...)
 Set the values for several columns simultaneously. More...
 
template<typename ITERATOR1 , typename ITERATOR2 >
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. More...
 
template<class DATA >
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. More...
 
template<class FUNCTION , class ITERATOR >
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. More...
 
template<class FUNC1 , class FUNC2 , class DATA >
StatusCode farray (const std::string &name1, const FUNC1 &func1, const std::string &name2, const FUNC2 &func2, DATA first, DATA last, const std::string &length, size_t maxv)
 Put two functions from one data array into LoKi-style N-Tuple simultaneously (effective!) More...
 
template<class FUNC1 , class FUNC2 , class FUNC3 , class DATA >
StatusCode farray (const std::string &name1, const FUNC1 &func1, const std::string &name2, const FUNC2 &func2, const std::string &name3, const FUNC3 &func3, DATA first, DATA last, const std::string &length, size_t maxv)
 Put three functions from one data array into LoKi-style N-Tuple simultaneously (effective!) More...
 
template<class FUNC1 , class FUNC2 , class FUNC3 , class FUNC4 , class DATA >
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, DATA first, DATA last, const std::string &length, size_t maxv)
 Put four functions from one data array into LoKi-style N-Tuple simultaneously (effective!) More...
 
template<class MATRIX >
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. More...
 
template<class DATA >
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. More...
 
template<class FUN , class DATA >
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" [funF, funL) More...
 
template<class DATA >
StatusCode array (const std::string &name, DATA first, DATA last)
 fill N-Tuple with fixed-size array More...
 
template<class ARRAY >
StatusCode array (const std::string &name, const ARRAY &data, const MIndex &length)
 fill N-Tuple with fixed-size array More...
 
template<class ARRAY >
StatusCode array (const std::string &name, const ARRAY &data)
 fill N-Tuple with fixed-size array More...
 
template<class MATRIX >
StatusCode matrix (const std::string &name, const MATRIX &data, const MIndex &rows, const MIndex &cols)
 fill N-Tuple with fixed-size matrix More...
 
template<class TYPE >
StatusCode column (const std::string &name, const ROOT::Math::LorentzVector< TYPE > &v)
 Useful shortcut to put LorentzVector directly into N-Tuple: More...
 
template<class TYPE , class TAG >
StatusCode column (const std::string &name, const ROOT::Math::DisplacementVector3D< TYPE, TAG > &v)
 Useful shortcut to put 3D-Vector directly into N-Tuple: More...
 
template<class TYPE , class TAG >
StatusCode column (const std::string &name, const ROOT::Math::PositionVector3D< TYPE, TAG > &v)
 Useful shortcut to put 3D-Vector directly into N-Tuple: More...
 
template<class TYPE , unsigned int D1, unsigned int D2, class REP >
StatusCode matrix (const std::string &name, const ROOT::Math::SMatrix< TYPE, D1, D2, REP > &mtrx)
 shortcut to put Smatrix into N-tuple: More...
 
template<class KEY , class VALUE >
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 More...
 
template<class TYPE >
StatusCode put (const std::string &name, const TYPE *obj)
 The function allows to add almost arbitrary object into N-tuple. More...
 
StatusCode write ()
 write a record to NTuple More...
 
const std::string & name () const
 get the name More...
 
const NTuple::Tupletuple () const
 provide the access to underlying Gaudi N-tuple More...
 
NTuple::Tupletuple ()
 provide the access to underlying Gaudi N-tuple More...
 
unsigned long refCount () const
 return the reference counter More...
 
unsigned long addRef ()
 add the reference to TupleObj More...
 
void release ()
 release the reference to TupleObj if reference counter becomes zero, object will be automatically deleted More...
 
const CLIDclid () const
 accessor to the N-Tuple CLID More...
 
Tuples::Type type () const
 accessor to the N-Tuple type More...
 
bool columnWise () const
 column wise NTuple ? More...
 
bool rowWise () const
 row wise NTuple ? More...
 
bool evtColType () const
 Event collection ? More...
 
bool valid () const
 valid pointer to tuple ? More...
 
bool invalid () const
 invalid pointer to tuple ? More...
 
bool addItem (std::string name, std::string type)
 add the item name into the list of known items More...
 
bool goodItem (const std::string &name) const
 check the uniqueness of the name More...
 
const ItemMapitems () const
 get the full list of booked items More...
 
virtual StatusCode Error (const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
 
virtual StatusCode Warning (const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
 

Protected Member Functions

 TupleObj (std::string name, NTuple::Tuple *tuple, const CLID &clid=CLID_ColumnWiseTuple, const Tuples::Type type=Tuples::NTUPLE)
 Standard constructor. More...
 
virtual ~TupleObj ()
 destructor is protected More...
 
 TupleObj (std::string name, NTuple::Tuple *tuple, const CLID &clid=CLID_ColumnWiseTuple, const Tuples::Type type=Tuples::NTUPLE)
 Standard constructor. More...
 
virtual ~TupleObj ()
 destructor is protected More...
 

Private Types

typedef GaudiUtils::HashMap< std::string, std::unique_ptr< Bool > > Bools
 the actual storage type for short columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< Char > > Chars
 the actual storage type for short columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< UChar > > UChars
 the actual storage type for unsigned short columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< Short > > Shorts
 the actual storage type for short columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< UShort > > UShorts
 the actual storage type for unsigned short columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< Int > > Ints
 the actual storage type for integer columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< UInt > > UInts
 the actual storage type for unsigned integer columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< LongLong > > LongLongs
 the actual storage type for longlong columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< ULongLong > > ULongLongs
 the actual storage type for ulonglong columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< Float > > Floats
 the actual storage type for float columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< Double > > Doubles
 the actual storage type for float columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< Address > > Addresses
 the actual storage type for address columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< FArray > > FArrays
 the actual storage type for array columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< FMatrix > > FMatrices
 the actual storage type for matrix columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< Bool > > Bools
 the actual storage type for short columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< Char > > Chars
 the actual storage type for short columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< UChar > > UChars
 the actual storage type for unsigned short columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< Short > > Shorts
 the actual storage type for short columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< UShort > > UShorts
 the actual storage type for unsigned short columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< Int > > Ints
 the actual storage type for integer columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< UInt > > UInts
 the actual storage type for unsigned integer columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< LongLong > > LongLongs
 the actual storage type for longlong columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< ULongLong > > ULongLongs
 the actual storage type for ulonglong columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< Float > > Floats
 the actual storage type for float columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< Double > > Doubles
 the actual storage type for float columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< Address > > Addresses
 the actual storage type for address columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< FArray > > FArrays
 the actual storage type for array columns More...
 
typedef GaudiUtils::HashMap< std::string, std::unique_ptr< FMatrix > > FMatrices
 the actual storage type for matrix columns More...
 

Private Member Functions

Boolbools (const std::string &name)
 get the column More...
 
Floatfloats (const std::string &name)
 get the column More...
 
Doubledoubles (const std::string &name)
 get the column More...
 
Charchars (const std::string &name)
 get the column More...
 
Charchars (const std::string &name, const char minv, const char maxv)
 get the column More...
 
UCharuchars (const std::string &name)
 get the column More...
 
UCharuchars (const std::string &name, unsigned char minv, unsigned char maxv)
 get the column More...
 
Shortshorts (const std::string &name)
 get the column More...
 
Shortshorts (const std::string &name, short minv, short maxv)
 get the column More...
 
UShortushorts (const std::string &name)
 get the column More...
 
UShortushorts (const std::string &name, unsigned short minv, unsigned short maxv)
 get the column More...
 
Intints (const std::string &name)
 get the column More...
 
Intints (const std::string &name, int minv, int maxv)
 get the column More...
 
UIntuints (const std::string &name)
 get the column More...
 
UIntuints (const std::string &name, unsigned int minv, unsigned int maxv)
 get the column More...
 
LongLonglonglongs (const std::string &name)
 get the column More...
 
LongLonglonglongs (const std::string &name, long long minv, long long maxv)
 get the column More...
 
ULongLongulonglongs (const std::string &name)
 get the column More...
 
ULongLongulonglongs (const std::string &name, unsigned long long minv, unsigned long long maxv)
 get the column More...
 
FArrayfArray (const std::string &name, Int *item)
 get the column More...
 
FArrayfArray (const std::string &name, const MIndex &rows)
 get the column More...
 
Addressaddresses (const std::string &name)
 get the column More...
 
FMatrixfMatrix (const std::string &name, Int *item, const MIndex &cols)
 get the column More...
 
FMatrixfMatrix (const std::string &name, const MIndex &rows, const MIndex &cols)
 get the column More...
 
 TupleObj ()=delete
 delete the default/copy constructor and assignment More...
 
 TupleObj (const TupleObj &)=delete
 
TupleObjoperator= (const TupleObj &)=delete
 
template<typename T , NTuple::Item< T > *(TupleObj::*)(const std::string &) fun, typename UT >
StatusCode column_ (const std::string &name, UT &&value)
 
template<typename T , NTuple::Item< T > *(TupleObj::*)(const std::string &, T, T) fun, typename UT >
StatusCode column_ (const std::string &name, UT &&value, UT &&minv, UT &&maxv)
 
Boolbools (const std::string &name)
 get the column More...
 
Floatfloats (const std::string &name)
 get the column More...
 
Doubledoubles (const std::string &name)
 get the column More...
 
Charchars (const std::string &name)
 get the column More...
 
Charchars (const std::string &name, const char minv, const char maxv)
 get the column More...
 
UCharuchars (const std::string &name)
 get the column More...
 
UCharuchars (const std::string &name, unsigned char minv, unsigned char maxv)
 get the column More...
 
Shortshorts (const std::string &name)
 get the column More...
 
Shortshorts (const std::string &name, short minv, short maxv)
 get the column More...
 
UShortushorts (const std::string &name)
 get the column More...
 
UShortushorts (const std::string &name, unsigned short minv, unsigned short maxv)
 get the column More...
 
Intints (const std::string &name)
 get the column More...
 
Intints (const std::string &name, int minv, int maxv)
 get the column More...
 
UIntuints (const std::string &name)
 get the column More...
 
UIntuints (const std::string &name, unsigned int minv, unsigned int maxv)
 get the column More...
 
LongLonglonglongs (const std::string &name)
 get the column More...
 
LongLonglonglongs (const std::string &name, long long minv, long long maxv)
 get the column More...
 
ULongLongulonglongs (const std::string &name)
 get the column More...
 
ULongLongulonglongs (const std::string &name, unsigned long long minv, unsigned long long maxv)
 get the column More...
 
FArrayfArray (const std::string &name, Int *item)
 get the column More...
 
FArrayfArray (const std::string &name, const MIndex &rows)
 get the column More...
 
Addressaddresses (const std::string &name)
 get the column More...
 
FMatrixfMatrix (const std::string &name, Int *item, const MIndex &cols)
 get the column More...
 
FMatrixfMatrix (const std::string &name, const MIndex &rows, const MIndex &cols)
 get the column More...
 
 TupleObj ()=delete
 delete the default/copy constructor and assignment More...
 
 TupleObj (const TupleObj &)=delete
 
TupleObjoperator= (const TupleObj &)=delete
 
template<typename T , NTuple::Item< T > *(TupleObj::*)(const std::string &) fun, typename UT >
StatusCode column_ (const std::string &name, UT &&value)
 
template<typename T , NTuple::Item< T > *(TupleObj::*)(const std::string &, T, T) fun, typename UT >
StatusCode column_ (const std::string &name, UT &&value, UT &&minv, UT &&maxv)
 

Private Attributes

std::string m_name
 name More...
 
NTuple::Tuplem_tuple
 tuple itself More...
 
CLID m_clid
 tuple CLID More...
 
Tuples::Type m_type
 tuple 'type' More...
 
size_t m_refCount = 0
 reference counter More...
 
Bools m_bools
 the actual storage of all 'bool' columns More...
 
Chars m_chars
 the actual storage of all 'Int' columns More...
 
UChars m_uchars
 the actual storage of all 'unsigned int' columns More...
 
Shorts m_shorts
 the actual storage of all 'Int' columns More...
 
UShorts m_ushorts
 the actual storage of all 'unsigned int' columns More...
 
Ints m_ints
 the actual storage of all 'Int' columns More...
 
UInts m_uints
 the actual storage of all 'unsigned int' columns More...
 
LongLongs m_longlongs
 the actual storage of all 'longlong' columns More...
 
ULongLongs m_ulonglongs
 the actual storage of all 'ulonglong' columns More...
 
Floats m_floats
 the actual storage of all 'Float' columns More...
 
Doubles m_doubles
 the actual storage of all 'Double' columns More...
 
Addresses m_addresses
 the actual storage of all 'Address' columns More...
 
FArrays m_farrays
 the actual storage of all 'FArray' columns More...
 
FArrays m_arraysf
 the actual storage of all 'FArray' columns (fixed) More...
 
FMatrices m_fmatrices
 the actual storage of all 'FArray' columns More...
 
FMatrices m_matricesf
 the actual storage of all 'FMatrix' columns (fixed) More...
 
ItemMap m_items
 all booked types: More...
 

Detailed Description

A simple wrapper class over standard Gaudi NTuple::Tuple facility.

The design and implementation are imported from LoKi package

One should not use lass TupleObj directly. The special handler Tuples::Tuple should be used instead, which is simultaneously 'proxy' an d'smart pointer' for real (and heavy!) TupleObj class.

The main advantages of local ntuples with respect to 'standard' Gaudi NTuples ( NTuple::Tuple ) is their "locality". For 'standard' ntuples one need

  1. Define all ntuple columns/items as data members of the algorithm
  2. Book the NTuple::Tuple object using INTupleSvc
  3. Add all defined columns/items to the booked ntuple
  4. Fill ntuple records

Usually the first step is done in the header file (separate file!) of the algorithm, the second and the third steps are done in initialize() method of the algorithm and the fourth step is done somewhere in execute() method of the same algorithm. Such approach requires to keep track of the tuple structure through different method and event through different files. And even minor modification of the structure of the ntuple will require the modification of at least 2 methods and 2 files.

The Tuples::Tuple wrapper over standard Gaudi NTuple::Tuple class solves all above listed problems with "non-local" nature of Gaudi NTuple::Tuple objects.

Tuples::Tuple object is booked and used 'locally'. One does not need to pre-book the ntuple or its columns/items somewhere in different compilation units or other methods different from the actual point of using the ntuple.

The simplest example of usage Tuples::Tuple object:

Tuple tuple = nTuple( "some more or less unique tuple title ");
for( Loop D0 = loop( "K- pi+", "D0" ) , D0 , ++D0 )
{
tuple -> column ( "mass" , M ( D0 ) / GeV ) ;
tuple -> column ( "pt" , PT ( D0 ) / GeV ) ;
tuple -> column ( "p" , P ( D0 ) / GeV ) ;
tuple -> write () ;
}

One could fill some Tuple variables in one go

Tuple tuple = nTuple( "some more or less unique tuple title ");
for( Loop D0 = loop( "K- pi+", "D0" ) , D0 , ++D0 )
{
tuple -> column ( "mass" , M ( D0 ) / GeV ) ;
tuple -> fill ( "pt , p " , PT ( D0 ) / GeV , P(D0) / GeV ) ;
tuple -> write () ;
}

Even ALL variables could be filled in one go:

Tuple tuple = nTuple( "some more or less unique tuple title ");
for( Loop D0 = loop( "K- pi+", "D0" ) , D0 , ++D0 )
{
tuple -> fill ( "mass pt , p ", M(D0)/GeV,PT(D0)/GeV,P(D0)/GeV ) ;
tuple -> write () ;
}

The 'array-like' columns are also supported ( see methods 'farray')

All these techniques could be easily combined in arbitrary ways

class TupleObj is an abstract class with 3 pure abstract functions Error and Warning , which need to be reimplemented in any 'concrete class. Helper classes TupleObjImp, ErrorHandler and functions createTupleObj and make_handler allows to create concrete objects 'on-flight'

Attention
long long and unsigned long long types are not supported. One needs to convert the data into some other representation (e.g. as 2 separate fields, or perform the explicitly cast to long)
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2004-01-23

Definition at line 190 of file TupleObj.h.

Member Typedef Documentation

basic type for address items

Definition at line 228 of file TupleObj.h.

basic type for address items

Definition at line 228 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<Address> > Tuples::TupleObj::Addresses
private

the actual storage type for address columns

Definition at line 2228 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<Address> > Tuples::TupleObj::Addresses
private

the actual storage type for address columns

Definition at line 2228 of file TupleObj.h.

basic type for int items

Definition at line 195 of file TupleObj.h.

basic type for int items

Definition at line 195 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<Bool> > Tuples::TupleObj::Bools
private

the actual storage type for short columns

Definition at line 2195 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<Bool> > Tuples::TupleObj::Bools
private

the actual storage type for short columns

Definition at line 2195 of file TupleObj.h.

basic type for int items

Definition at line 198 of file TupleObj.h.

basic type for int items

Definition at line 198 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<Char> > Tuples::TupleObj::Chars
private

the actual storage type for short columns

Definition at line 2198 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<Char> > Tuples::TupleObj::Chars
private

the actual storage type for short columns

Definition at line 2198 of file TupleObj.h.

basic type for double items

Definition at line 225 of file TupleObj.h.

basic type for double items

Definition at line 225 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<Double> > Tuples::TupleObj::Doubles
private

the actual storage type for float columns

Definition at line 2225 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<Double> > Tuples::TupleObj::Doubles
private

the actual storage type for float columns

Definition at line 2225 of file TupleObj.h.

basic type for array of floats

Definition at line 231 of file TupleObj.h.

basic type for array of floats

Definition at line 231 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<FArray> > Tuples::TupleObj::FArrays
private

the actual storage type for array columns

Definition at line 2231 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<FArray> > Tuples::TupleObj::FArrays
private

the actual storage type for array columns

Definition at line 2231 of file TupleObj.h.

basic type for float items

Definition at line 222 of file TupleObj.h.

basic type for float items

Definition at line 222 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<Float> > Tuples::TupleObj::Floats
private

the actual storage type for float columns

Definition at line 2222 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<Float> > Tuples::TupleObj::Floats
private

the actual storage type for float columns

Definition at line 2222 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<FMatrix> > Tuples::TupleObj::FMatrices
private

the actual storage type for matrix columns

Definition at line 2234 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<FMatrix> > Tuples::TupleObj::FMatrices
private

the actual storage type for matrix columns

Definition at line 2234 of file TupleObj.h.

basic type for matrix of floats

Definition at line 234 of file TupleObj.h.

basic type for matrix of floats

Definition at line 234 of file TupleObj.h.

basic type for int items

Definition at line 210 of file TupleObj.h.

basic type for int items

Definition at line 210 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<Int> > Tuples::TupleObj::Ints
private

the actual storage type for integer columns

Definition at line 2210 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<Int> > Tuples::TupleObj::Ints
private

the actual storage type for integer columns

Definition at line 2210 of file TupleObj.h.

typedef std::map<std::string,std::string> Tuples::TupleObj::ItemMap

Definition at line 240 of file TupleObj.h.

typedef std::map<std::string,std::string> Tuples::TupleObj::ItemMap

Definition at line 240 of file TupleObj.h.

basic type for unsigned long long items

Definition at line 216 of file TupleObj.h.

basic type for unsigned long long items

Definition at line 216 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<LongLong> > Tuples::TupleObj::LongLongs
private

the actual storage type for longlong columns

Definition at line 2216 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<LongLong> > Tuples::TupleObj::LongLongs
private

the actual storage type for longlong columns

Definition at line 2216 of file TupleObj.h.

typedef unsigned short Tuples::TupleObj::MIndex

Definition at line 237 of file TupleObj.h.

typedef unsigned short Tuples::TupleObj::MIndex

Definition at line 237 of file TupleObj.h.

basic type for int items

Definition at line 204 of file TupleObj.h.

basic type for int items

Definition at line 204 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<Short> > Tuples::TupleObj::Shorts
private

the actual storage type for short columns

Definition at line 2204 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<Short> > Tuples::TupleObj::Shorts
private

the actual storage type for short columns

Definition at line 2204 of file TupleObj.h.

typedef NTuple::Item<unsigned char> Tuples::TupleObj::UChar

basic type for unsigned int items

Definition at line 201 of file TupleObj.h.

typedef NTuple::Item<unsigned char> Tuples::TupleObj::UChar

basic type for unsigned int items

Definition at line 201 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<UChar> > Tuples::TupleObj::UChars
private

the actual storage type for unsigned short columns

Definition at line 2201 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<UChar> > Tuples::TupleObj::UChars
private

the actual storage type for unsigned short columns

Definition at line 2201 of file TupleObj.h.

typedef NTuple::Item<unsigned int> Tuples::TupleObj::UInt

basic type for unsigned int items

Definition at line 213 of file TupleObj.h.

typedef NTuple::Item<unsigned int> Tuples::TupleObj::UInt

basic type for unsigned int items

Definition at line 213 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<UInt> > Tuples::TupleObj::UInts
private

the actual storage type for unsigned integer columns

Definition at line 2213 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<UInt> > Tuples::TupleObj::UInts
private

the actual storage type for unsigned integer columns

Definition at line 2213 of file TupleObj.h.

typedef NTuple::Item<unsigned long long> Tuples::TupleObj::ULongLong

basic type for unsigned long long items

Definition at line 219 of file TupleObj.h.

typedef NTuple::Item<unsigned long long> Tuples::TupleObj::ULongLong

basic type for unsigned long long items

Definition at line 219 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<ULongLong> > Tuples::TupleObj::ULongLongs
private

the actual storage type for ulonglong columns

Definition at line 2219 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<ULongLong> > Tuples::TupleObj::ULongLongs
private

the actual storage type for ulonglong columns

Definition at line 2219 of file TupleObj.h.

typedef NTuple::Item<unsigned short> Tuples::TupleObj::UShort

basic type for unsigned int items

Definition at line 207 of file TupleObj.h.

typedef NTuple::Item<unsigned short> Tuples::TupleObj::UShort

basic type for unsigned int items

Definition at line 207 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<UShort> > Tuples::TupleObj::UShorts
private

the actual storage type for unsigned short columns

Definition at line 2207 of file TupleObj.h.

typedef GaudiUtils::HashMap<std::string,std::unique_ptr<UShort> > Tuples::TupleObj::UShorts
private

the actual storage type for unsigned short columns

Definition at line 2207 of file TupleObj.h.

Constructor & Destructor Documentation

Tuples::TupleObj::TupleObj ( std::string  name,
NTuple::Tuple tuple,
const CLID clid = CLID_ColumnWiseTuple,
const Tuples::Type  type = Tuples::NTUPLE 
)
protected

Standard constructor.

See also
NTuple:Tuple
Parameters
namename of the object
tuplepointer to standard Gaudi NTuple::Tuple object
clidCLID_ColumnWiseTuple or CLID_RowWiseTuple
typethe type of the tuple

Definition at line 144 of file TupleObj.cpp.

149  : m_name ( std::move(name) )
150  , m_tuple ( tuple )
151  , m_clid ( clid )
152  , m_type ( type )
153 {
154  // make counts
155  Tuples::Local::s_InstanceCounter.increment ( m_name ) ;
156 }
CLID m_clid
tuple CLID
Definition: TupleObj.h:2262
Tuples::Type m_type
tuple 'type'
Definition: TupleObj.h:2265
std::string m_name
name
Definition: TupleObj.h:2256
Tuples::Type type() const
accessor to the N-Tuple type
Definition: TupleObj.h:2041
NTuple::Tuple * m_tuple
tuple itself
Definition: TupleObj.h:2259
const CLID & clid() const
accessor to the N-Tuple CLID
Definition: TupleObj.h:2038
const std::string & name() const
get the name
Definition: TupleObj.h:2009
Tuples::TupleObj::~TupleObj ( )
protectedvirtual

destructor is protected

Definition at line 160 of file TupleObj.cpp.

161 {
162  // make counts
163  Tuples::Local::s_InstanceCounter.decrement ( m_name ) ;
164 }
std::string m_name
name
Definition: TupleObj.h:2256
Tuples::TupleObj::TupleObj ( )
privatedelete

delete the default/copy constructor and assignment

Tuples::TupleObj::TupleObj ( const TupleObj )
privatedelete
Tuples::TupleObj::TupleObj ( std::string  name,
NTuple::Tuple tuple,
const CLID clid = CLID_ColumnWiseTuple,
const Tuples::Type  type = Tuples::NTUPLE 
)
protected

Standard constructor.

See also
NTuple:Tuple
Parameters
namename of the object
tuplepointer to standard Gaudi NTuple::Tuple object
clidCLID_ColumnWiseTuple or CLID_RowWiseTuple
typethe type of the tuple
virtual Tuples::TupleObj::~TupleObj ( )
protectedvirtual

destructor is protected

Tuples::TupleObj::TupleObj ( )
privatedelete

delete the default/copy constructor and assignment

Tuples::TupleObj::TupleObj ( const TupleObj )
privatedelete

Member Function Documentation

bool Tuples::TupleObj::addItem ( std::string  name,
std::string  type 
)
inline

add the item name into the list of known items

Parameters
namethe name of the item
typethe type of the item
Returns
true if the name is indeed added

Definition at line 2065 of file TupleObj.h.

2067  { return m_items.emplace ( std::move(name) , std::move(type) ).second ; }
ItemMap m_items
all booked types:
Definition: TupleObj.h:2319
Tuples::Type type() const
accessor to the N-Tuple type
Definition: TupleObj.h:2041
const std::string & name() const
get the name
Definition: TupleObj.h:2009
bool Tuples::TupleObj::addItem ( std::string  name,
std::string  type 
)
inline

add the item name into the list of known items

Parameters
namethe name of the item
typethe type of the item
Returns
true if the name is indeed added

Definition at line 2065 of file TupleObj.h.

2067  { return m_items.emplace ( std::move(name) , std::move(type) ).second ; }
ItemMap m_items
all booked types:
Definition: TupleObj.h:2319
Tuples::Type type() const
accessor to the N-Tuple type
Definition: TupleObj.h:2041
const std::string & name() const
get the name
Definition: TupleObj.h:2009
unsigned long Tuples::TupleObj::addRef ( )
inline

add the reference to TupleObj

Returns
current reference counter

Definition at line 2029 of file TupleObj.h.

2029 { return ++m_refCount ; }
size_t m_refCount
reference counter
Definition: TupleObj.h:2268
unsigned long Tuples::TupleObj::addRef ( )
inline

add the reference to TupleObj

Returns
current reference counter

Definition at line 2029 of file TupleObj.h.

2029 { return ++m_refCount ; }
size_t m_refCount
reference counter
Definition: TupleObj.h:2268
Tuples::TupleObj::Address * Tuples::TupleObj::addresses ( const std::string &  name)
private

get the column

Definition at line 638 of file TupleObj.cpp.

639 {
640  auto found = m_addresses.find( name ) ;
641  if( m_addresses.end() != found ) { return found->second.get() ; }
642  return create_(this, m_addresses, name,
643  [&](const std::string& n, Address& i)
644  { return this->tuple()->addItem(n,i); });
645 }
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
NTuple::Item< IOpaqueAddress * > Address
basic type for address items
Definition: TupleObj.h:228
iterator end()
Definition: Map.h:132
iterator find(const key_type &key)
Definition: Map.h:149
Addresses m_addresses
the actual storage of all 'Address' columns
Definition: TupleObj.h:2304
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
Definition: NTuple.h:554
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
Address* Tuples::TupleObj::addresses ( const std::string &  name)
private

get the column

template<class DATA >
StatusCode Tuples::TupleObj::array ( const std::string &  name,
DATA  first,
DATA  last 
)
inline

fill N-Tuple with fixed-size array

SEQUENCE data( 10 ) ;
...
tuple -> array("data" ,
data.begin () ,
data.end () ) ;

Sequence may be of any objects, implicitly convertible into "float"

Parameters
nameN-Tuple entry name
firstbegin-iterator for data sequence
lastend-iterator for data sequence
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@l.nosp@m.app..nosp@m.in2p3.nosp@m..fr
Date
2005-05-01

fill the array

Definition at line 1642 of file TupleObj.h.

1646  {
1647  if ( invalid () ) { return InvalidTuple ; }
1648  if ( rowWise () ) { return InvalidOperation ; }
1649 
1650  // get the length (fixed!)
1651  auto length = std::distance(first,last);
1652 
1653  // get the array itself
1654  FArray* var = fArray ( name , length ) ;
1655  if ( !var ) { return InvalidColumn ; }
1656 
1658  std::copy( first, last, std::begin(*var) );
1659 
1660  return StatusCode::SUCCESS ;
1661  }
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
bool rowWise() const
row wise NTuple ?
Definition: TupleObj.h:2047
FArray * fArray(const std::string &name, Int *item)
get the column
Definition: TupleObj.cpp:650
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
NTuple::Array< float > FArray
basic type for array of floats
Definition: TupleObj.h:231
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class DATA >
StatusCode Tuples::TupleObj::array ( const std::string &  name,
DATA  first,
DATA  last 
)
inline

fill N-Tuple with fixed-size array

SEQUENCE data( 10 ) ;
...
tuple -> array("data" ,
data.begin () ,
data.end () ) ;

Sequence may be of any objects, implicitly convertible into "float"

Parameters
nameN-Tuple entry name
firstbegin-iterator for data sequence
lastend-iterator for data sequence
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@l.nosp@m.app..nosp@m.in2p3.nosp@m..fr
Date
2005-05-01

fill the array

Definition at line 1642 of file TupleObj.h.

1646  {
1647  if ( invalid () ) { return InvalidTuple ; }
1648  if ( rowWise () ) { return InvalidOperation ; }
1649 
1650  // get the length (fixed!)
1651  auto length = std::distance(first,last);
1652 
1653  // get the array itself
1654  FArray* var = fArray ( name , length ) ;
1655  if ( !var ) { return InvalidColumn ; }
1656 
1658  std::copy( first, last, std::begin(*var) );
1659 
1660  return StatusCode::SUCCESS ;
1661  }
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
bool rowWise() const
row wise NTuple ?
Definition: TupleObj.h:2047
FArray * fArray(const std::string &name, Int *item)
get the column
Definition: TupleObj.cpp:650
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
NTuple::Array< float > FArray
basic type for array of floats
Definition: TupleObj.h:231
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class ARRAY >
StatusCode Tuples::TupleObj::array ( const std::string &  name,
const ARRAY &  data,
const MIndex length 
)
inline

fill N-Tuple with fixed-size array

"ARRAY" must support indexing operations: e.g it coudl be of type:

  • std::vector<TYPE>
  • CLHEP::HepVector, ...
  • "TYPE"[n]

The content of array should be implicitly convertible to "float"

CLHEP::HepVector vct1(10) ;
...
tuple -> array ( "vct1" , vct1 , 10 ) ;
double vct2[40];
...
tuple -> array ( "vct2" , vct2 , 40 ) ;
long vct3[4];
...
tuple -> array ( "vct3" , vct4 , 4 ) ;
std::vector<long double> vct4(15) ;
...
tuple -> array ( "vct4" , vct4 , 15 ) ;
Parameters
nameN-Tuple entry name
datadata sequence
lengthdata length (fixed!)
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@l.nosp@m.app..nosp@m.in2p3.nosp@m..fr
Date
2005-05-01

Definition at line 1702 of file TupleObj.h.

1705  {
1706  using std::begin; // allow data to be eg. CLHEP::HepVector (which does not define HepVector::begin()!,
1707  // in which case ADL prefers CLHEP::begin (yah! at least they (now) use a namespace)
1708  // so one just to insure double* CLHEP::begin(CLHEP::HepVector& v) { return &v[0]; }
1709  // is visible when this function gets instantiated for CLHEP::HepVector...
1710  auto first = begin(data);
1711  return array( name, first, std::next( first, length ) );
1712  }
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
StatusCode array(const std::string &name, DATA first, DATA last)
fill N-Tuple with fixed-size array
Definition: TupleObj.h:1642
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class ARRAY >
StatusCode Tuples::TupleObj::array ( const std::string &  name,
const ARRAY &  data,
const MIndex length 
)
inline

fill N-Tuple with fixed-size array

"ARRAY" must support indexing operations: e.g it coudl be of type:

  • std::vector<TYPE>
  • CLHEP::HepVector, ...
  • "TYPE"[n]

The content of array should be implicitly convertible to "float"

CLHEP::HepVector vct1(10) ;
...
tuple -> array ( "vct1" , vct1 , 10 ) ;
double vct2[40];
...
tuple -> array ( "vct2" , vct2 , 40 ) ;
long vct3[4];
...
tuple -> array ( "vct3" , vct4 , 4 ) ;
std::vector<long double> vct4(15) ;
...
tuple -> array ( "vct4" , vct4 , 15 ) ;
Parameters
nameN-Tuple entry name
datadata sequence
lengthdata length (fixed!)
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@l.nosp@m.app..nosp@m.in2p3.nosp@m..fr
Date
2005-05-01

Definition at line 1702 of file TupleObj.h.

1705  {
1706  using std::begin; // allow data to be eg. CLHEP::HepVector (which does not define HepVector::begin()!,
1707  // in which case ADL prefers CLHEP::begin (yah! at least they (now) use a namespace)
1708  // so one just to insure double* CLHEP::begin(CLHEP::HepVector& v) { return &v[0]; }
1709  // is visible when this function gets instantiated for CLHEP::HepVector...
1710  auto first = begin(data);
1711  return array( name, first, std::next( first, length ) );
1712  }
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
StatusCode array(const std::string &name, DATA first, DATA last)
fill N-Tuple with fixed-size array
Definition: TupleObj.h:1642
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class ARRAY >
StatusCode Tuples::TupleObj::array ( const std::string &  name,
const ARRAY &  data 
)
inline

fill N-Tuple with fixed-size array

"ARRAY" is any sequence, which supports ARRAY::begin() and ARRAY::end() protocol, e.g.

  • std::vector<TYPE>
  • ROOT::Math::SVector<double,15>

The content of array should be implicitly convertible to "float"

typedef std::vector<double> Seq ;
Seq data( 10 ) ;
for ( int i = 0 ; i < 10 ; ++i )
{
data[i] = ... ;
}
tuple -> array( "data" , data ) ;
Parameters
nameN-Tupel entry name
datadata sequence
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@l.nosp@m.app..nosp@m.in2p3.nosp@m..fr
Date
2005-05-01

Definition at line 1745 of file TupleObj.h.

1747  {
1748  using std::begin; using std::end;
1749  return array ( name , begin(data) , end(data) ) ;
1750  }
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
StatusCode array(const std::string &name, DATA first, DATA last)
fill N-Tuple with fixed-size array
Definition: TupleObj.h:1642
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class ARRAY >
StatusCode Tuples::TupleObj::array ( const std::string &  name,
const ARRAY &  data 
)
inline

fill N-Tuple with fixed-size array

"ARRAY" is any sequence, which supports ARRAY::begin() and ARRAY::end() protocol, e.g.

  • std::vector<TYPE>
  • ROOT::Math::SVector<double,15>

The content of array should be implicitly convertible to "float"

typedef std::vector<double> Seq ;
Seq data( 10 ) ;
for ( int i = 0 ; i < 10 ; ++i )
{
data[i] = ... ;
}
tuple -> array( "data" , data ) ;
Parameters
nameN-Tupel entry name
datadata sequence
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@l.nosp@m.app..nosp@m.in2p3.nosp@m..fr
Date
2005-05-01

Definition at line 1745 of file TupleObj.h.

1747  {
1748  using std::begin; using std::end;
1749  return array ( name , begin(data) , end(data) ) ;
1750  }
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
StatusCode array(const std::string &name, DATA first, DATA last)
fill N-Tuple with fixed-size array
Definition: TupleObj.h:1642
const std::string & name() const
get the name
Definition: TupleObj.h:2009
Tuples::TupleObj::Bool * Tuples::TupleObj::bools ( const std::string &  name)
private

get the column

Definition at line 456 of file TupleObj.cpp.

457 {
458  auto found = m_bools.find( name ) ;
459  if( m_bools.end() != found ) { return found->second.get() ; }
460  return create_(this, m_bools, name,
461  [&](const std::string& n, Bool& i)
462  { return this->tuple()->addItem(n,i); });
463 }
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
Bools m_bools
the actual storage of all 'bool' columns
Definition: TupleObj.h:2271
iterator end()
Definition: Map.h:132
iterator find(const key_type &key)
Definition: Map.h:149
NTuple::Item< bool > Bool
basic type for int items
Definition: TupleObj.h:195
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
Definition: NTuple.h:554
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
Bool* Tuples::TupleObj::bools ( const std::string &  name)
private

get the column

Tuples::TupleObj::Char * Tuples::TupleObj::chars ( const std::string &  name)
private

get the column

Definition at line 466 of file TupleObj.cpp.

467 {
468  auto found = m_chars.find( name ) ;
469  if( m_chars.end() != found ) { return found->second.get() ; }
470  return create_(this, m_chars, name,
471  [&](const std::string& n, Char& i)
472  { return this->tuple()->addItem(n,i); });
473 }
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
Chars m_chars
the actual storage of all 'Int' columns
Definition: TupleObj.h:2274
iterator end()
Definition: Map.h:132
iterator find(const key_type &key)
Definition: Map.h:149
NTuple::Item< char > Char
basic type for int items
Definition: TupleObj.h:198
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
Definition: NTuple.h:554
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
Char* Tuples::TupleObj::chars ( const std::string &  name)
private

get the column

Tuples::TupleObj::Char * Tuples::TupleObj::chars ( const std::string &  name,
const char  minv,
const char  maxv 
)
private

get the column

Definition at line 476 of file TupleObj.cpp.

477 {
478  auto found = m_chars.find( name ) ;
479  return ( found != m_chars.end() ) ? found->second.get()
480  : create_(this, m_chars, name,
481  [&](const std::string& n, Char& i)
482  { return this->tuple()->addItem(n,i,minv,maxv); });
483 }
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
Chars m_chars
the actual storage of all 'Int' columns
Definition: TupleObj.h:2274
iterator end()
Definition: Map.h:132
iterator find(const key_type &key)
Definition: Map.h:149
NTuple::Item< char > Char
basic type for int items
Definition: TupleObj.h:198
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
Definition: NTuple.h:554
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
Char* Tuples::TupleObj::chars ( const std::string &  name,
const char  minv,
const char  maxv 
)
private

get the column

const CLID& Tuples::TupleObj::clid ( ) const
inline

accessor to the N-Tuple CLID

Definition at line 2038 of file TupleObj.h.

2038 { return m_clid ; }
CLID m_clid
tuple CLID
Definition: TupleObj.h:2262
const CLID& Tuples::TupleObj::clid ( ) const
inline

accessor to the N-Tuple CLID

Definition at line 2038 of file TupleObj.h.

2038 { return m_clid ; }
CLID m_clid
tuple CLID
Definition: TupleObj.h:2262
StatusCode Tuples::TupleObj::column ( const std::string &  name,
float  value 
)

Set the value for selected tuple column.

If column does not exist, it will be automatically created and appended to the tuple

//
const float mass = ... ;
tuple->column( "m", mass );
//
Parameters
namethe name of the column
valuethe value of the variable
Returns
status code

Definition at line 263 of file TupleObj.cpp.

265 {
266  return column_<float,&Tuples::TupleObj::floats>(name,value);
267 }
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
float  value 
)

Set the value for selected tuple column.

If column does not exist, it will be automatically created and appended to the tuple

//
const float mass = ... ;
tuple->column( "m", mass );
//
Parameters
namethe name of the column
valuethe value of the variable
Returns
status code
StatusCode Tuples::TupleObj::column ( const std::string &  name,
double  value 
)

Set the value for the selected tuple column If the column does not exist, it will be automatically created and appended to the tuple.

//
const double mass = ... ;
tuple->column( "m", mass );
//
Warning
the value is truncated to float
Parameters
namethe name of the column
valuethe value of the variable
Returns
status code

Definition at line 269 of file TupleObj.cpp.

271 {
272  return column_<double,&Tuples::TupleObj::doubles>(name,value);
273 }
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
double  value 
)

Set the value for the selected tuple column If the column does not exist, it will be automatically created and appended to the tuple.

//
const double mass = ... ;
tuple->column( "m", mass );
//
Warning
the value is truncated to float
Parameters
namethe name of the column
valuethe value of the variable
Returns
status code
StatusCode Tuples::TupleObj::column ( const std::string &  name,
short  value 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

short number = ... ;
tuple -> column ( "num" , number );
Parameters
namethe name of the column
valuethe value of the variable
Returns
status code
StatusCode Tuples::TupleObj::column ( const std::string &  name,
short  value 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

short number = ... ;
tuple -> column ( "num" , number );
Parameters
namethe name of the column
valuethe value of the variable
Returns
status code

Definition at line 303 of file TupleObj.cpp.

305 {
306  return column_<short,&Tuples::TupleObj::shorts>(name,value);
307 }
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
short  value,
short  minv,
short  maxv 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

short number = ... ;
tuple->column( "num", number );
Parameters
namename of the column
valuevalue of the variable
minvminimum value of the variable
maxvmaximum value of the variable
Returns
status code

Definition at line 309 of file TupleObj.cpp.

313 {
314  return column_<short,&Tuples::TupleObj::shorts>(name,value,minv,maxv);
315 }
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
short  value,
short  minv,
short  maxv 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

short number = ... ;
tuple->column( "num", number );
Parameters
namename of the column
valuevalue of the variable
minvminimum value of the variable
maxvmaximum value of the variable
Returns
status code
StatusCode Tuples::TupleObj::column ( const std::string &  name,
unsigned short  value 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

unsigned short number = ... ;
tuple -> column ( "num" , number );
Parameters
namethe name of the column
valuethe value of the variable
Returns
status code

Definition at line 317 of file TupleObj.cpp.

319 {
320  return column_<unsigned short,&Tuples::TupleObj::ushorts>( name, value );
321 }
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
unsigned short  value 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

unsigned short number = ... ;
tuple -> column ( "num" , number );
Parameters
namethe name of the column
valuethe value of the variable
Returns
status code
StatusCode Tuples::TupleObj::column ( const std::string &  name,
unsigned short  value,
unsigned short  minv,
unsigned short  maxv 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

unsigned short number = ... ;
tuple->column( "num", number );
Parameters
namename of the column
valuevalue of the variable
minvminimum value of the variable
maxvmaximum value of the variable
Returns
status code
StatusCode Tuples::TupleObj::column ( const std::string &  name,
unsigned short  value,
unsigned short  minv,
unsigned short  maxv 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

unsigned short number = ... ;
tuple->column( "num", number );
Parameters
namename of the column
valuevalue of the variable
minvminimum value of the variable
maxvmaximum value of the variable
Returns
status code

Definition at line 323 of file TupleObj.cpp.

327 {
328  return column_<unsigned short,&Tuples::TupleObj::ushorts>( name, value, minv, maxv );
329 }
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
char  value 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

char number = ... ;
tuple -> column ( "num" , number );
Parameters
namethe name of the column
valuethe value of the variable
Returns
status code
StatusCode Tuples::TupleObj::column ( const std::string &  name,
char  value 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

char number = ... ;
tuple -> column ( "num" , number );
Parameters
namethe name of the column
valuethe value of the variable
Returns
status code

Definition at line 275 of file TupleObj.cpp.

277 {
278  return column_<char,&Tuples::TupleObj::chars>(name,value);
279 }
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
char  value,
char  minv,
char  maxv 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

char number = ... ;
tuple->column( "num", number );
Parameters
namename of the column
valuevalue of the variable
minvminimum value of the variable
maxvmaximum value of the variable
Returns
status code

Definition at line 281 of file TupleObj.cpp.

285 {
286  return column_<char,&Tuples::TupleObj::chars>(name,value,minv,maxv);
287 }
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
char  value,
char  minv,
char  maxv 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

char number = ... ;
tuple->column( "num", number );
Parameters
namename of the column
valuevalue of the variable
minvminimum value of the variable
maxvmaximum value of the variable
Returns
status code
StatusCode Tuples::TupleObj::column ( const std::string &  name,
unsigned char  value 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

unsigned char number = ... ;
tuple -> column ( "num" , number );
Parameters
namethe name of the column
valuethe value of the variable
Returns
status code

Definition at line 289 of file TupleObj.cpp.

291 {
292  return column_<unsigned char,&Tuples::TupleObj::uchars>(name,value);
293 }
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
unsigned char  value 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

unsigned char number = ... ;
tuple -> column ( "num" , number );
Parameters
namethe name of the column
valuethe value of the variable
Returns
status code
StatusCode Tuples::TupleObj::column ( const std::string &  name,
unsigned char  value,
unsigned char  minv,
unsigned char  maxv 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

unsigned char number = ... ;
tuple->column( "num", number );
Parameters
namename of the column
valuevalue of the variable
minvminimum value of the variable
maxvmaximum value of the variable
Returns
status code

Definition at line 295 of file TupleObj.cpp.

299 {
300  return column_<unsigned char,&Tuples::TupleObj::uchars>(name,value,minv,maxv);
301 }
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
unsigned char  value,
unsigned char  minv,
unsigned char  maxv 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

unsigned char number = ... ;
tuple->column( "num", number );
Parameters
namename of the column
valuevalue of the variable
minvminimum value of the variable
maxvmaximum value of the variable
Returns
status code
StatusCode Tuples::TupleObj::column ( const std::string &  name,
int  value 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

int number = ... ;
tuple->column("num", number );
Parameters
namename of the column
valuevalue of the variable
Returns
status code

Definition at line 331 of file TupleObj.cpp.

333 {
334  return column_<int,&Tuples::TupleObj::ints>( name, value );
335 }
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
int  value 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

int number = ... ;
tuple->column("num", number );
Parameters
namename of the column
valuevalue of the variable
Returns
status code
StatusCode Tuples::TupleObj::column ( const std::string &  name,
int  value,
int  minv,
int  maxv 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

int number = ... ;
tuple->column( "num", number );
Parameters
namename of the column
valuevalue of the variable
minvminimum value of the variable
maxvmaximum value of the variable
Returns
status code

Definition at line 337 of file TupleObj.cpp.

341 {
342  return column_<int,&Tuples::TupleObj::ints>(name,value,minv,maxv);
343 }
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
int  value,
int  minv,
int  maxv 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

int number = ... ;
tuple->column( "num", number );
Parameters
namename of the column
valuevalue of the variable
minvminimum value of the variable
maxvmaximum value of the variable
Returns
status code
StatusCode Tuples::TupleObj::column ( const std::string &  name,
unsigned int  value 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

unsigned int number = ... ;
tuple->column("num", number );
Parameters
namename of the column
valuevalue of the variable
Returns
status code

Definition at line 345 of file TupleObj.cpp.

347 {
348  return column_<unsigned int,&Tuples::TupleObj::uints>(name,value);
349 }
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
unsigned int  value 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

unsigned int number = ... ;
tuple->column("num", number );
Parameters
namename of the column
valuevalue of the variable
Returns
status code
StatusCode Tuples::TupleObj::column ( const std::string &  name,
unsigned int  value,
unsigned int  minv,
unsigned int  maxv 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

unsigned int number = ... ;
tuple->column("num", number );
Parameters
namename of the column
valuevalue of the variable
minvminimum value of the variable
maxvmaximum value of the variable
Returns
status code
StatusCode Tuples::TupleObj::column ( const std::string &  name,
unsigned int  value,
unsigned int  minv,
unsigned int  maxv 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

unsigned int number = ... ;
tuple->column("num", number );
Parameters
namename of the column
valuevalue of the variable
minvminimum value of the variable
maxvmaximum value of the variable
Returns
status code

Definition at line 351 of file TupleObj.cpp.

355 {
356  return column_<unsigned int, &Tuples::TupleObj::uints>(name,value,minv,maxv);
357 }
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
long  value 
)

Set the value for the selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

long number = ... ;
tuple -> column ( "num", number );
Warning
the value could be truncated to int
Parameters
namethe name of the column
valuethe value of the variable
Returns
status code
StatusCode Tuples::TupleObj::column ( const std::string &  name,
long  value 
)

Set the value for the selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

long number = ... ;
tuple -> column ( "num", number );
Warning
the value could be truncated to int
Parameters
namethe name of the column
valuethe value of the variable
Returns
status code

Definition at line 359 of file TupleObj.cpp.

361 {
362  Warning( "'long' has different sizes on 32/64 bit systems. Casting '" +
363  name + "' to 'long long'", StatusCode::SUCCESS ).ignore();
364  return column( name, (long long)value );
365 }
StatusCode column(const std::string &name, float value)
Set the value for selected tuple column.
Definition: TupleObj.cpp:263
virtual StatusCode Warning(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
void ignore() const
Definition: StatusCode.h:108
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
long  value,
long  minv,
long  maxv 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

long number = ... ;
tuple->column("num", number );
Parameters
namename of the column
valuevalue of the variable
minvminimum value of the variable
maxvmaximum value of the variable
Returns
status code

Definition at line 367 of file TupleObj.cpp.

371 {
372  Warning( "'long' has different sizes on 32/64 bit systems. Casting '" +
373  name + "' to 'long long'", StatusCode::SUCCESS ).ignore();
374  return column( name,
375  (long long)value,
376  (long long)minv,
377  (long long)maxv );
378 }
StatusCode column(const std::string &name, float value)
Set the value for selected tuple column.
Definition: TupleObj.cpp:263
virtual StatusCode Warning(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
void ignore() const
Definition: StatusCode.h:108
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
long  value,
long  minv,
long  maxv 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

long number = ... ;
tuple->column("num", number );
Parameters
namename of the column
valuevalue of the variable
minvminimum value of the variable
maxvmaximum value of the variable
Returns
status code
StatusCode Tuples::TupleObj::column ( const std::string &  name,
unsigned long  value 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

unsigned long number = ... ;
tuple -> column ( "num" , number );
Warning
the value could be truncated to int
Parameters
namethe name of the column
valuethe value of the variable
Returns
status code

Definition at line 380 of file TupleObj.cpp.

382 {
383  Warning( "'unsigned long' has different sizes on 32/64 bit systems. Casting '" +
384  name + "' to 'unsigned long long'", StatusCode::SUCCESS ).ignore();
385  return column( name, (unsigned long long)value );
386 }
StatusCode column(const std::string &name, float value)
Set the value for selected tuple column.
Definition: TupleObj.cpp:263
virtual StatusCode Warning(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
void ignore() const
Definition: StatusCode.h:108
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
unsigned long  value 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

unsigned long number = ... ;
tuple -> column ( "num" , number );
Warning
the value could be truncated to int
Parameters
namethe name of the column
valuethe value of the variable
Returns
status code
StatusCode Tuples::TupleObj::column ( const std::string &  name,
unsigned long  value,
unsigned long  minv,
unsigned long  maxv 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

unsigned long number = ... ;
tuple->column( "num", number );
Parameters
namename of the column
valuevalue of the variable
minvminimum value of the variable
maxvmaximum value of the variable
Returns
status code

Definition at line 388 of file TupleObj.cpp.

392 {
393  Warning( "'unsigned long' has different sizes on 32/64 bit systems. Casting '" +
394  name + "' to 'unsigned long long'", StatusCode::SUCCESS ).ignore();
395  return column( name,
396  (unsigned long long)value,
397  (unsigned long long)minv,
398  (unsigned long long)maxv );
399 }
StatusCode column(const std::string &name, float value)
Set the value for selected tuple column.
Definition: TupleObj.cpp:263
virtual StatusCode Warning(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
void ignore() const
Definition: StatusCode.h:108
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
unsigned long  value,
unsigned long  minv,
unsigned long  maxv 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

unsigned long number = ... ;
tuple->column( "num", number );
Parameters
namename of the column
valuevalue of the variable
minvminimum value of the variable
maxvmaximum value of the variable
Returns
status code
StatusCode Tuples::TupleObj::column ( const std::string &  name,
long long  value 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

long long number = ... ;
tuple->column( "num", number );
Parameters
namename of the column
valuevalue of the variable
Returns
status code

Definition at line 401 of file TupleObj.cpp.

403 {
404  return column_<long long,&Tuples::TupleObj::longlongs>(name,value);
405 }
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
long long  value 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

long long number = ... ;
tuple->column( "num", number );
Parameters
namename of the column
valuevalue of the variable
Returns
status code
StatusCode Tuples::TupleObj::column ( const std::string &  name,
long long  value,
long long  minv,
long long  maxv 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

long long number = ... ;
tuple->column( "num", number );
Parameters
namename of the column
valuevalue of the variable
minvminimum value of the variable
maxvmaximum value of the variable
Returns
status code

Definition at line 407 of file TupleObj.cpp.

411 {
412  return column_<long long,&Tuples::TupleObj::longlongs>(name,value,minv,maxv);
413 }
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
long long  value,
long long  minv,
long long  maxv 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

long long number = ... ;
tuple->column( "num", number );
Parameters
namename of the column
valuevalue of the variable
minvminimum value of the variable
maxvmaximum value of the variable
Returns
status code
StatusCode Tuples::TupleObj::column ( const std::string &  name,
unsigned long long  value 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

unsigned long long number = ... ;
tuple->column( "num", number );
Parameters
namename of the column
valuevalue of the variable
Returns
status code

Definition at line 415 of file TupleObj.cpp.

417 {
418  return column_<unsigned long long,&Tuples::TupleObj::ulonglongs>(name,value);
419 }
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
unsigned long long  value 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

unsigned long long number = ... ;
tuple->column( "num", number );
Parameters
namename of the column
valuevalue of the variable
Returns
status code
StatusCode Tuples::TupleObj::column ( const std::string &  name,
unsigned long long  value,
unsigned long long  minv,
unsigned long long  maxv 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

unsigned long long number = ... ;
tuple->column( "num", number );
Parameters
namename of the column
valuevalue of the variable
minvminimum value of the variable
maxvmaximum value of the variable
Returns
status code

Definition at line 421 of file TupleObj.cpp.

425 {
426  return column_<unsigned long long,&Tuples::TupleObj::ulonglongs>(name,value,minv,maxv);
427 }
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
unsigned long long  value,
unsigned long long  minv,
unsigned long long  maxv 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

unsigned long long number = ... ;
tuple->column( "num", number );
Parameters
namename of the column
valuevalue of the variable
minvminimum value of the variable
maxvmaximum value of the variable
Returns
status code
StatusCode Tuples::TupleObj::column ( const std::string &  name,
signed char  value 
)
inline

Set the value for the selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

signed char number = ... ;
tuple->column("num", number );
Parameters
namethe name of the column
valuethe value of tve variable
Returns
status code

Definition at line 742 of file TupleObj.h.

744  {
745  return column
746  ( name ,
747  value ,
748  std::numeric_limits<signed char>::min() ,
749  std::numeric_limits<signed char>::max() ) ;
750  }
StatusCode column(const std::string &name, float value)
Set the value for selected tuple column.
Definition: TupleObj.cpp:263
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
signed char  value 
)
inline

Set the value for the selected tuple column.

If the column does not exist yet, it will be automatically created and appended to the tuple

signed char number = ... ;
tuple->column("num", number );
Parameters
namethe name of the column
valuethe value of tve variable
Returns
status code

Definition at line 742 of file TupleObj.h.

744  {
745  return column
746  ( name ,
747  value ,
748  std::numeric_limits<signed char>::min() ,
749  std::numeric_limits<signed char>::max() ) ;
750  }
StatusCode column(const std::string &name, float value)
Set the value for selected tuple column.
Definition: TupleObj.cpp:263
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
bool  value 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically create and appended to the tuple

tuple->column( "empty" , v.empty() );
Parameters
namethe name of the column
valuethe value of the variable
Returns
status code

Definition at line 429 of file TupleObj.cpp.

431 {
432  return column_<bool,&Tuples::TupleObj::bools>(name,value);
433 }
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
bool  value 
)

Set the value for selected tuple column.

If the column does not exist yet, it will be automatically create and appended to the tuple

tuple->column( "empty" , v.empty() );
Parameters
namethe name of the column
valuethe value of the variable
Returns
status code
StatusCode Tuples::TupleObj::column ( const std::string &  name,
IOpaqueAddress address 
)

Put IOpaqueAddress in POOL-based NTuple.

If the column does not exist, it will be automatically created and appended to the tuple.

IOpaqueAddress* address = ... ;
tuple->column( "Address", address );
Warning
It has sense only for Event tag collection N-Tuples
Parameters
namename of the column ("Address" is a recommended convention!)
addressIOpaqueAddress
Returns
status code

Definition at line 243 of file TupleObj.cpp.

245 {
246  if ( !evtColType () ) { return InvalidOperation ; }
247  if ( !address )
248  { return Error ( "column('" + name +
249  "') IOpaqueAddress* is NULL!" , InvalidObject ) ; }
250  return column_<IOpaqueAddress*,&Tuples::TupleObj::addresses>(name, address);
251 }
bool evtColType() const
Event collection ?
Definition: TupleObj.h:2050
virtual StatusCode Error(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
const std::string & name() const
get the name
Definition: TupleObj.h:2009
StatusCode Tuples::TupleObj::column ( const std::string &  name,
IOpaqueAddress address 
)

Put IOpaqueAddress in POOL-based NTuple.

If the column does not exist, it will be automatically created and appended to the tuple.

IOpaqueAddress* address = ... ;
tuple->column( "Address", address );
Warning
It has sense only for Event tag collection N-Tuples
Parameters
namename of the column ("Address" is a recommended convention!)
addressIOpaqueAddress
Returns
status code
StatusCode Tuples::TupleObj::column ( IOpaqueAddress address)

Put IOpaqueAddress in NTuple.

If the column does not exist, it will be automatically created and appended to the tuple. The column name is set to be "Address"

IOpaqueAddress* address = ... ;
tuple->column ( address );
Warning
It has sense only for Event tag collection N-Tuples
Parameters
addressIOpaqueAddress
Returns
status code

Definition at line 257 of file TupleObj.cpp.

258 {
259  return column ( "Address" , address ) ;
260 }
StatusCode column(const std::string &name, float value)
Set the value for selected tuple column.
Definition: TupleObj.cpp:263
StatusCode Tuples::TupleObj::column ( IOpaqueAddress address)

Put IOpaqueAddress in NTuple.

If the column does not exist, it will be automatically created and appended to the tuple. The column name is set to be "Address"

IOpaqueAddress* address = ... ;
tuple->column ( address );
Warning
It has sense only for Event tag collection N-Tuples
Parameters
addressIOpaqueAddress
Returns
status code
template<class TYPE >
StatusCode Tuples::TupleObj::column ( const std::string &  name,
const ROOT::Math::LorentzVector< TYPE > &  v 
)
inline

Useful shortcut to put LorentzVector directly into N-Tuple:

const LHCb::Particle* B = ...
Tuple tuple = nTuple("My N-Tuple") ;
// put 4-vector of B-candidate into N-tuple:
tuple -> column ("B" , B->momentum() ) ;
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-11-26

Definition at line 1844 of file TupleObj.h.

1846  {
1847  if ( invalid() ) { return InvalidTuple ; }
1848  // fill all separate columns:
1849  StatusCode sc1 = this -> column ( name + "E" , v.E () ) ;
1850  StatusCode sc2 = this -> column ( name + "X" , v.Px () ) ;
1851  StatusCode sc3 = this -> column ( name + "Y" , v.Py () ) ;
1852  StatusCode sc4 = this -> column ( name + "Z" , v.Pz () ) ;
1853  return
1854  sc1.isFailure () ? sc1 :
1855  sc2.isFailure () ? sc2 :
1856  sc3.isFailure () ? sc3 :
1857  sc4.isFailure () ? sc4 : StatusCode(StatusCode::SUCCESS) ;
1858  }
StatusCode column(const std::string &name, float value)
Set the value for selected tuple column.
Definition: TupleObj.cpp:263
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class TYPE >
StatusCode Tuples::TupleObj::column ( const std::string &  name,
const ROOT::Math::LorentzVector< TYPE > &  v 
)
inline

Useful shortcut to put LorentzVector directly into N-Tuple:

const LHCb::Particle* B = ...
Tuple tuple = nTuple("My N-Tuple") ;
// put 4-vector of B-candidate into N-tuple:
tuple -> column ("B" , B->momentum() ) ;
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-11-26

Definition at line 1844 of file TupleObj.h.

1846  {
1847  if ( invalid() ) { return InvalidTuple ; }
1848  // fill all separate columns:
1849  StatusCode sc1 = this -> column ( name + "E" , v.E () ) ;
1850  StatusCode sc2 = this -> column ( name + "X" , v.Px () ) ;
1851  StatusCode sc3 = this -> column ( name + "Y" , v.Py () ) ;
1852  StatusCode sc4 = this -> column ( name + "Z" , v.Pz () ) ;
1853  return
1854  sc1.isFailure () ? sc1 :
1855  sc2.isFailure () ? sc2 :
1856  sc3.isFailure () ? sc3 :
1857  sc4.isFailure () ? sc4 : StatusCode(StatusCode::SUCCESS) ;
1858  }
StatusCode column(const std::string &name, float value)
Set the value for selected tuple column.
Definition: TupleObj.cpp:263
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class TYPE , class TAG >
StatusCode Tuples::TupleObj::column ( const std::string &  name,
const ROOT::Math::DisplacementVector3D< TYPE, TAG > &  v 
)
inline

Useful shortcut to put 3D-Vector directly into N-Tuple:

const LHCb::Vertex* V = ...
Tuple tuple = nTuple("My N-Tuple") ;
// put vertex position into N-tuple:
tuple -> column ("B" , B->position() ) ;
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-11-26

fill separate columns

Definition at line 1878 of file TupleObj.h.

1880  {
1881  if ( invalid() ) { return InvalidTuple ; }
1883  StatusCode sc1 = this -> column ( name + "X" , v.X () ) ;
1884  StatusCode sc2 = this -> column ( name + "Y" , v.Y () ) ;
1885  StatusCode sc3 = this -> column ( name + "Z" , v.Z () ) ;
1886  return
1887  sc1.isFailure () ? sc1 :
1888  sc2.isFailure () ? sc2 :
1889  sc3.isFailure () ? sc3 : StatusCode(StatusCode::SUCCESS) ;
1890  }
StatusCode column(const std::string &name, float value)
Set the value for selected tuple column.
Definition: TupleObj.cpp:263
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class TYPE , class TAG >
StatusCode Tuples::TupleObj::column ( const std::string &  name,
const ROOT::Math::DisplacementVector3D< TYPE, TAG > &  v 
)
inline

Useful shortcut to put 3D-Vector directly into N-Tuple:

const LHCb::Vertex* V = ...
Tuple tuple = nTuple("My N-Tuple") ;
// put vertex position into N-tuple:
tuple -> column ("B" , B->position() ) ;
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-11-26

fill separate columns

Definition at line 1878 of file TupleObj.h.

1880  {
1881  if ( invalid() ) { return InvalidTuple ; }
1883  StatusCode sc1 = this -> column ( name + "X" , v.X () ) ;
1884  StatusCode sc2 = this -> column ( name + "Y" , v.Y () ) ;
1885  StatusCode sc3 = this -> column ( name + "Z" , v.Z () ) ;
1886  return
1887  sc1.isFailure () ? sc1 :
1888  sc2.isFailure () ? sc2 :
1889  sc3.isFailure () ? sc3 : StatusCode(StatusCode::SUCCESS) ;
1890  }
StatusCode column(const std::string &name, float value)
Set the value for selected tuple column.
Definition: TupleObj.cpp:263
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class TYPE , class TAG >
StatusCode Tuples::TupleObj::column ( const std::string &  name,
const ROOT::Math::PositionVector3D< TYPE, TAG > &  v 
)
inline

Useful shortcut to put 3D-Vector directly into N-Tuple:

const LHCb::Vertex* V = ...
Tuple tuple = nTuple("My N-Tuple") ;
// put vertex position into N-tuple:
tuple -> column ("B" , B->position() ) ;
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-11-26

fill separate columns

Definition at line 1910 of file TupleObj.h.

1912  {
1913  if ( invalid() ) { return InvalidTuple ; }
1915  StatusCode sc1 = this -> column ( name + "X" , v.X () ) ;
1916  StatusCode sc2 = this -> column ( name + "Y" , v.Y () ) ;
1917  StatusCode sc3 = this -> column ( name + "Z" , v.Z () ) ;
1918  return
1919  sc1.isFailure () ? sc1 :
1920  sc2.isFailure () ? sc2 :
1921  sc3.isFailure () ? sc3 : StatusCode(StatusCode::SUCCESS) ;
1922  }
StatusCode column(const std::string &name, float value)
Set the value for selected tuple column.
Definition: TupleObj.cpp:263
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class TYPE , class TAG >
StatusCode Tuples::TupleObj::column ( const std::string &  name,
const ROOT::Math::PositionVector3D< TYPE, TAG > &  v 
)
inline

Useful shortcut to put 3D-Vector directly into N-Tuple:

const LHCb::Vertex* V = ...
Tuple tuple = nTuple("My N-Tuple") ;
// put vertex position into N-tuple:
tuple -> column ("B" , B->position() ) ;
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-11-26

fill separate columns

Definition at line 1910 of file TupleObj.h.

1912  {
1913  if ( invalid() ) { return InvalidTuple ; }
1915  StatusCode sc1 = this -> column ( name + "X" , v.X () ) ;
1916  StatusCode sc2 = this -> column ( name + "Y" , v.Y () ) ;
1917  StatusCode sc3 = this -> column ( name + "Z" , v.Z () ) ;
1918  return
1919  sc1.isFailure () ? sc1 :
1920  sc2.isFailure () ? sc2 :
1921  sc3.isFailure () ? sc3 : StatusCode(StatusCode::SUCCESS) ;
1922  }
StatusCode column(const std::string &name, float value)
Set the value for selected tuple column.
Definition: TupleObj.cpp:263
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<typename T , NTuple::Item< T > *(TupleObj::*)(const std::string &) fun, typename UT >
StatusCode Tuples::TupleObj::column_ ( const std::string &  name,
UT &&  value 
)
inlineprivate

Definition at line 2238 of file TupleObj.h.

2238  {
2239  if ( invalid() ) { return InvalidTuple ; }
2240  auto item = (this->*fun)( name );
2241  if ( !item ) { return InvalidColumn ; }
2242  *item = std::forward<UT>(value);
2243  return StatusCode::SUCCESS ;
2244  }
double fun(const std::vector< double > &x)
Definition: PFuncTest.cpp:26
tuple item
print s1,s2
Definition: ana.py:146
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<typename T , NTuple::Item< T > *(TupleObj::*)(const std::string &) fun, typename UT >
StatusCode Tuples::TupleObj::column_ ( const std::string &  name,
UT &&  value 
)
inlineprivate

Definition at line 2238 of file TupleObj.h.

2238  {
2239  if ( invalid() ) { return InvalidTuple ; }
2240  auto item = (this->*fun)( name );
2241  if ( !item ) { return InvalidColumn ; }
2242  *item = std::forward<UT>(value);
2243  return StatusCode::SUCCESS ;
2244  }
double fun(const std::vector< double > &x)
Definition: PFuncTest.cpp:26
tuple item
print s1,s2
Definition: ana.py:146
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<typename T , NTuple::Item< T > *(TupleObj::*)(const std::string &, T, T) fun, typename UT >
StatusCode Tuples::TupleObj::column_ ( const std::string &  name,
UT &&  value,
UT &&  minv,
UT &&  maxv 
)
inlineprivate

Definition at line 2246 of file TupleObj.h.

2246  {
2247  if ( invalid() ) { return InvalidTuple ; }
2248  auto item = (this->*fun)( name, std::forward<UT>(minv),std::forward<UT>(maxv) );
2249  if ( !item ) { return InvalidColumn ; }
2250  *item = std::forward<UT>(value);
2251  return StatusCode::SUCCESS ;
2252  }
double fun(const std::vector< double > &x)
Definition: PFuncTest.cpp:26
tuple item
print s1,s2
Definition: ana.py:146
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<typename T , NTuple::Item< T > *(TupleObj::*)(const std::string &, T, T) fun, typename UT >
StatusCode Tuples::TupleObj::column_ ( const std::string &  name,
UT &&  value,
UT &&  minv,
UT &&  maxv 
)
inlineprivate

Definition at line 2246 of file TupleObj.h.

2246  {
2247  if ( invalid() ) { return InvalidTuple ; }
2248  auto item = (this->*fun)( name, std::forward<UT>(minv),std::forward<UT>(maxv) );
2249  if ( !item ) { return InvalidColumn ; }
2250  *item = std::forward<UT>(value);
2251  return StatusCode::SUCCESS ;
2252  }
double fun(const std::vector< double > &x)
Definition: PFuncTest.cpp:26
tuple item
print s1,s2
Definition: ana.py:146
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
const std::string & name() const
get the name
Definition: TupleObj.h:2009
bool Tuples::TupleObj::columnWise ( ) const
inline

column wise NTuple ?

Definition at line 2044 of file TupleObj.h.

2044 { return CLID_ColumnWiseTuple == clid() ; }
const CLID & clid() const
accessor to the N-Tuple CLID
Definition: TupleObj.h:2038
bool Tuples::TupleObj::columnWise ( ) const
inline

column wise NTuple ?

Definition at line 2044 of file TupleObj.h.

2044 { return CLID_ColumnWiseTuple == clid() ; }
const CLID & clid() const
accessor to the N-Tuple CLID
Definition: TupleObj.h:2038
Tuples::TupleObj::Double * Tuples::TupleObj::doubles ( const std::string &  name)
private

get the column

Definition at line 446 of file TupleObj.cpp.

447 {
448  auto found = m_doubles.find( name ) ;
449  if ( m_doubles.end() != found ) { return found->second.get() ; }
450  return create_(this, m_doubles,name,
451  [&](const std::string& n, Double& i)
452  { return this->tuple()->addItem(n,i); });
453 }
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
Doubles m_doubles
the actual storage of all 'Double' columns
Definition: TupleObj.h:2301
iterator end()
Definition: Map.h:132
iterator find(const key_type &key)
Definition: Map.h:149
NTuple::Item< double > Double
basic type for double items
Definition: TupleObj.h:225
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
Definition: NTuple.h:554
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
Double* Tuples::TupleObj::doubles ( const std::string &  name)
private

get the column

virtual StatusCode Tuples::TupleObj::Error ( const std::string &  msg,
const StatusCode  sc = StatusCode::FAILURE 
) const
pure virtual
virtual StatusCode Tuples::TupleObj::Error ( const std::string &  msg,
const StatusCode  sc = StatusCode::FAILURE 
) const
pure virtual
bool Tuples::TupleObj::evtColType ( ) const
inline

Event collection ?

Definition at line 2050 of file TupleObj.h.

2050 { return Tuples::EVTCOL == type() ; }
Tuples::Type type() const
accessor to the N-Tuple type
Definition: TupleObj.h:2041
bool Tuples::TupleObj::evtColType ( ) const
inline

Event collection ?

Definition at line 2050 of file TupleObj.h.

2050 { return Tuples::EVTCOL == type() ; }
Tuples::Type type() const
accessor to the N-Tuple type
Definition: TupleObj.h:2041
template<typename ITERATOR1 , typename ITERATOR2 >
StatusCode Tuples::TupleObj::farray ( const std::string &  name,
ITERATOR1 &&  first,
ITERATOR2 &&  last,
const std::string &  length,
size_t  maxv 
)
inline

Add an indexed array (of type float) to N-tuple.

The method is not VERY efficient since it copies the data.

std::vector<double> values = ... ;
tuple->farray( "Values" , // item name
values.begin () , // begin of sequence
values.end () , // end of sequence
"Length" , // name of "length" item
10000 ) ;

The name of "length" item can be reused for several arrays. The last assignement "wins"

std::vector<double> val1 = ... ;
std::vector<double> val2 = ... ;
tuple->farray( "Val1" , // item name
val1.begin () , // begin of sequence
val1.end () , // end of sequence
"Length" , // name of "length" item
10000 ) ; // maximal length
tuple->farray( "Val2" , // item name
val2.begin () , // begin of sequence
val2.end () , // end of sequence
"Length" , // name of "length" item
10000 ) ; // maximal length

Any sequence [first:last[ of objects which can be converted to type float can be used as input data, e.g. std::vector<double>, std::vector<float>, plain C-array, or whatever else

Parameters
namename of N-tuple item
firstbegin of data sequence
lastend of data sequence
lengthname of "length" item
maxvmaximal length of array

Definition at line 890 of file TupleObj.h.

895  {
896  return farray( name, implementation_detail::to_float,
897  std::forward<ITERATOR1>(first), std::forward<ITERATOR2>(last),
898  length, maxv );
899  }
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:890
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<typename ITERATOR1 , typename ITERATOR2 >
StatusCode Tuples::TupleObj::farray ( const std::string &  name,
ITERATOR1 &&  first,
ITERATOR2 &&  last,
const std::string &  length,
size_t  maxv 
)
inline

Add an indexed array (of type float) to N-tuple.

The method is not VERY efficient since it copies the data.

std::vector<double> values = ... ;
tuple->farray( "Values" , // item name
values.begin () , // begin of sequence
values.end () , // end of sequence
"Length" , // name of "length" item
10000 ) ;

The name of "length" item can be reused for several arrays. The last assignement "wins"

std::vector<double> val1 = ... ;
std::vector<double> val2 = ... ;
tuple->farray( "Val1" , // item name
val1.begin () , // begin of sequence
val1.end () , // end of sequence
"Length" , // name of "length" item
10000 ) ; // maximal length
tuple->farray( "Val2" , // item name
val2.begin () , // begin of sequence
val2.end () , // end of sequence
"Length" , // name of "length" item
10000 ) ; // maximal length

Any sequence [first:last[ of objects which can be converted to type float can be used as input data, e.g. std::vector<double>, std::vector<float>, plain C-array, or whatever else

Parameters
namename of N-tuple item
firstbegin of data sequence
lastend of data sequence
lengthname of "length" item
maxvmaximal length of array

Definition at line 890 of file TupleObj.h.

895  {
896  return farray( name, implementation_detail::to_float,
897  std::forward<ITERATOR1>(first), std::forward<ITERATOR2>(last),
898  length, maxv );
899  }
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:890
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class DATA >
StatusCode Tuples::TupleObj::farray ( const std::string &  name,
const DATA &  data,
const std::string &  length,
const size_t  maxv 
)
inline

Add an indexed array (of type float) to N-tuple.

it is just a small adaptor for the previous method

std::vector<double> values = ... ;
tuple->farray( "Values" , // item name
values , // sequence
"Length" , // name of "length" item
10000 ) ;

The name of "length" item can be reused for several arrays. The last assignment "wins"

std::vector<double> val1 = ... ;
std::vector<double> val2 = ... ;
tuple->farray( "Val1" , // item name
val1 , // begin of sequence
"Length" , // name of "length" item
10000 ) ; // maximal length
tuple->farray( "Val2" , // item name
val2 , // begin of sequence
"Length" , // name of "length" item
10000 ) ; // maximal length

Any sequence which provides begin() and end() methods can be used.

Parameters
namename of N-tuple item
datadata sequence
lengthname of "length" item
maxvmaximal length of array

Definition at line 944 of file TupleObj.h.

948  { return farray ( name , std::begin(data) , std::end(data) , length , maxv ) ; }
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
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:890
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class DATA >
StatusCode Tuples::TupleObj::farray ( const std::string &  name,
const DATA &  data,
const std::string &  length,
const size_t  maxv 
)
inline

Add an indexed array (of type float) to N-tuple.

it is just a small adaptor for the previous method

std::vector<double> values = ... ;
tuple->farray( "Values" , // item name
values , // sequence
"Length" , // name of "length" item
10000 ) ;

The name of "length" item can be reused for several arrays. The last assignment "wins"

std::vector<double> val1 = ... ;
std::vector<double> val2 = ... ;
tuple->farray( "Val1" , // item name
val1 , // begin of sequence
"Length" , // name of "length" item
10000 ) ; // maximal length
tuple->farray( "Val2" , // item name
val2 , // begin of sequence
"Length" , // name of "length" item
10000 ) ; // maximal length

Any sequence which provides begin() and end() methods can be used.

Parameters
namename of N-tuple item
datadata sequence
lengthname of "length" item
maxvmaximal length of array

Definition at line 944 of file TupleObj.h.

948  { return farray ( name , std::begin(data) , std::end(data) , length , maxv ) ; }
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
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:890
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class FUNCTION , class ITERATOR >
StatusCode Tuples::TupleObj::farray ( const std::string &  name,
const FUNCTION &  function,
ITERATOR  first,
ITERATOR  last,
const std::string &  length,
size_t  maxv 
)
inline

Put an indexed array into LoKi-style N-Tuple.

std::vector<double> data = ... ;
Tuple tuple = ntuple( "My Ntuple" );
tuple->farray( "data" , // data item name
sqrt , // "function" to be applied
data.begin () , // begin of data sequence
data.end () , // end of data sequence
"length" , // name of "length" tuple item
10000 ) ; // maximal array length

Since the method is templated, one can use arbitrary combinations of "sequences" and "functions", e.g. one can directly manipulate with complex objects. The only one thing is required - the result of FUNCTION(*DATA) formal operation MUST be convertible to type float

// some container of particles.
ParticleVector particles = ... ;
Tuple tuple = ntuple( "My Ntuple" );
// put the transverse momentum of all particles into N-Tuple
tuple->farray( "pt" , // data item name
PT , // function object
particles.begin () , // begin of data sequence
particles.end () , // end of data sequence
"num" , // name of "length" tuple item
10000 ) ; // maximal array length
// create the appropriate function object
Fun fun = Q / P ;
// put Q/P of all particles into N-Tuple
tuple->farray( "qp" , // data item name
fun , // function object
particles.begin () , // begin of data sequence
particles.end () , // end of data sequence
"num" , // name of "length" tuple item
10000 ) ; // maximal array length
Parameters
nametuple item name
functionfunction to be applied
firstbegin of data sequence
lastend of data sequence
lengthname of "length" tuple name
maxvmaximal length of the array
Returns
status code

Definition at line 1013 of file TupleObj.h.

1019  {
1020  if ( invalid () ) { return InvalidTuple ; }
1021  if ( rowWise () ) { return InvalidOperation ; }
1022 
1023  // adjust the length
1024  if( std::distance(first,last) > static_cast<std::ptrdiff_t>(maxv) ) {
1025  Warning("farray('"
1026  + name + "'): array is overflow, skip extra entries") ;
1027  last = std::next(first,maxv);
1028  }
1029 
1030  // get the length item
1031  Int* len = ints( length , 0 , maxv ) ;
1032  if( !len ) { return InvalidColumn ; }
1033 
1034  // adjust the length
1035  *len = std::distance(first,last);
1036 
1037  // get the array itself
1038  FArray* var = fArray ( name , len ) ;
1039  if( !var ) { return InvalidColumn ; }
1040 
1041  // fill the array
1042  std::transform( first, last, std::begin(*var), std::cref(function) );
1043 
1044  return StatusCode::SUCCESS ;
1045  }
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
virtual StatusCode Warning(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
bool rowWise() const
row wise NTuple ?
Definition: TupleObj.h:2047
FArray * fArray(const std::string &name, Int *item)
get the column
Definition: TupleObj.cpp:650
NTuple::Item< int > Int
basic type for int items
Definition: TupleObj.h:210
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
Int * ints(const std::string &name)
get the column
Definition: TupleObj.cpp:550
NTuple::Array< float > FArray
basic type for array of floats
Definition: TupleObj.h:231
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class FUNCTION , class ITERATOR >
StatusCode Tuples::TupleObj::farray ( const std::string &  name,
const FUNCTION &  function,
ITERATOR  first,
ITERATOR  last,
const std::string &  length,
size_t  maxv 
)
inline

Put an indexed array into LoKi-style N-Tuple.

std::vector<double> data = ... ;
Tuple tuple = ntuple( "My Ntuple" );
tuple->farray( "data" , // data item name
sqrt , // "function" to be applied
data.begin () , // begin of data sequence
data.end () , // end of data sequence
"length" , // name of "length" tuple item
10000 ) ; // maximal array length

Since the method is templated, one can use arbitrary combinations of "sequences" and "functions", e.g. one can directly manipulate with complex objects. The only one thing is required - the result of FUNCTION(*DATA) formal operation MUST be convertible to type float

// some container of particles.
ParticleVector particles = ... ;
Tuple tuple = ntuple( "My Ntuple" );
// put the transverse momentum of all particles into N-Tuple
tuple->farray( "pt" , // data item name
PT , // function object
particles.begin () , // begin of data sequence
particles.end () , // end of data sequence
"num" , // name of "length" tuple item
10000 ) ; // maximal array length
// create the appropriate function object
Fun fun = Q / P ;
// put Q/P of all particles into N-Tuple
tuple->farray( "qp" , // data item name
fun , // function object
particles.begin () , // begin of data sequence
particles.end () , // end of data sequence
"num" , // name of "length" tuple item
10000 ) ; // maximal array length
Parameters
nametuple item name
functionfunction to be applied
firstbegin of data sequence
lastend of data sequence
lengthname of "length" tuple name
maxvmaximal length of the array
Returns
status code

Definition at line 1013 of file TupleObj.h.

1019  {
1020  if ( invalid () ) { return InvalidTuple ; }
1021  if ( rowWise () ) { return InvalidOperation ; }
1022 
1023  // adjust the length
1024  if( std::distance(first,last) > static_cast<std::ptrdiff_t>(maxv) ) {
1025  Warning("farray('"
1026  + name + "'): array is overflow, skip extra entries") ;
1027  last = std::next(first,maxv);
1028  }
1029 
1030  // get the length item
1031  Int* len = ints( length , 0 , maxv ) ;
1032  if( !len ) { return InvalidColumn ; }
1033 
1034  // adjust the length
1035  *len = std::distance(first,last);
1036 
1037  // get the array itself
1038  FArray* var = fArray ( name , len ) ;
1039  if( !var ) { return InvalidColumn ; }
1040 
1041  // fill the array
1042  std::transform( first, last, std::begin(*var), std::cref(function) );
1043 
1044  return StatusCode::SUCCESS ;
1045  }
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
virtual StatusCode Warning(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
bool rowWise() const
row wise NTuple ?
Definition: TupleObj.h:2047
FArray * fArray(const std::string &name, Int *item)
get the column
Definition: TupleObj.cpp:650
NTuple::Item< int > Int
basic type for int items
Definition: TupleObj.h:210
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
Int * ints(const std::string &name)
get the column
Definition: TupleObj.cpp:550
NTuple::Array< float > FArray
basic type for array of floats
Definition: TupleObj.h:231
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class FUNC1 , class FUNC2 , class DATA >
StatusCode Tuples::TupleObj::farray ( const std::string &  name1,
const FUNC1 &  func1,
const std::string &  name2,
const FUNC2 &  func2,
DATA  first,
DATA  last,
const std::string &  length,
size_t  maxv 
)
inline

Put two functions from one data array into LoKi-style N-Tuple simultaneously (effective!)

std::vector<double> data = ... ;
Tuple tuple = ntuple( "My Ntuple" );
tuple->farray( "sqr" , // the first data item name
sqrt , // "func1" to be used
"sinus" , // the second data item name
sin , // "func2" to be used
data.begin () , // begin of data sequence
data.end () , // end of data sequence
"length" , // name of "length" tuple item
10000 ) ; // maximal array length
Parameters
name1the first tuple item name
func1the first function to be applied
name2the second tuple item name
func2the second function to be applied
firstbegin of data sequence
lastend of data sequence
lengthname of "length" tuple name
maxvmaximal length of the array
Returns
status code

Definition at line 1079 of file TupleObj.h.

1087  {
1088  if ( invalid () ) { return InvalidTuple ; }
1089  if ( rowWise () ) { return InvalidOperation ; }
1090 
1091  // adjust the lenfth
1092  if( std::distance(first,last) > static_cast<std::ptrdiff_t>(maxv) )
1093  {
1094  Warning("farray('"
1095  + name1 + ","
1096  + name2 + "'): array is overflow, skip extra entries").ignore() ;
1097  Warning("farray('"+name1+"'): array is overflow, skip extra items").ignore() ;
1098  last = std::next(first, maxv) ;
1099  }
1100 
1101  // get the length item
1102  Int* len = ints ( length , 0 , maxv ) ;
1103  if ( !len ) { return InvalidColumn ; }
1104 
1105  // adjust the length
1106  *len = std::distance(first,last);
1107 
1108  // get the array itself
1109  FArray* var1 = fArray ( name1 , len ) ;
1110  if ( !var1 ) { return InvalidColumn ; }
1111 
1112  // get the array itself
1113  FArray* var2 = fArray ( name2 , len ) ;
1114  if ( !var2 ) { return InvalidColumn ; }
1115 
1116  // fill the array
1117  size_t index = 0 ;
1118  for( ; first != last ; ++first )
1119  {
1120  ( *var1 ) [ index ] = func1 ( *first ) ;
1121  ( *var2 ) [ index ] = func2 ( *first ) ;
1122  ++index ;
1123  }
1124 
1125  return StatusCode::SUCCESS ;
1126  }
virtual StatusCode Warning(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
bool rowWise() const
row wise NTuple ?
Definition: TupleObj.h:2047
FArray * fArray(const std::string &name, Int *item)
get the column
Definition: TupleObj.cpp:650
NTuple::Item< int > Int
basic type for int items
Definition: TupleObj.h:210
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
Int * ints(const std::string &name)
get the column
Definition: TupleObj.cpp:550
NTuple::Array< float > FArray
basic type for array of floats
Definition: TupleObj.h:231
void ignore() const
Definition: StatusCode.h:108
template<class FUNC1 , class FUNC2 , class DATA >
StatusCode Tuples::TupleObj::farray ( const std::string &  name1,
const FUNC1 &  func1,
const std::string &  name2,
const FUNC2 &  func2,
DATA  first,
DATA  last,
const std::string &  length,
size_t  maxv 
)
inline

Put two functions from one data array into LoKi-style N-Tuple simultaneously (effective!)

std::vector<double> data = ... ;
Tuple tuple = ntuple( "My Ntuple" );
tuple->farray( "sqr" , // the first data item name
sqrt , // "func1" to be used
"sinus" , // the second data item name
sin , // "func2" to be used
data.begin () , // begin of data sequence
data.end () , // end of data sequence
"length" , // name of "length" tuple item
10000 ) ; // maximal array length
Parameters
name1the first tuple item name
func1the first function to be applied
name2the second tuple item name
func2the second function to be applied
firstbegin of data sequence
lastend of data sequence
lengthname of "length" tuple name
maxvmaximal length of the array
Returns
status code

Definition at line 1079 of file TupleObj.h.

1087  {
1088  if ( invalid () ) { return InvalidTuple ; }
1089  if ( rowWise () ) { return InvalidOperation ; }
1090 
1091  // adjust the lenfth
1092  if( std::distance(first,last) > static_cast<std::ptrdiff_t>(maxv) )
1093  {
1094  Warning("farray('"
1095  + name1 + ","
1096  + name2 + "'): array is overflow, skip extra entries").ignore() ;
1097  Warning("farray('"+name1+"'): array is overflow, skip extra items").ignore() ;
1098  last = std::next(first, maxv) ;
1099  }
1100 
1101  // get the length item
1102  Int* len = ints ( length , 0 , maxv ) ;
1103  if ( !len ) { return InvalidColumn ; }
1104 
1105  // adjust the length
1106  *len = std::distance(first,last);
1107 
1108  // get the array itself
1109  FArray* var1 = fArray ( name1 , len ) ;
1110  if ( !var1 ) { return InvalidColumn ; }
1111 
1112  // get the array itself
1113  FArray* var2 = fArray ( name2 , len ) ;
1114  if ( !var2 ) { return InvalidColumn ; }
1115 
1116  // fill the array
1117  size_t index = 0 ;
1118  for( ; first != last ; ++first )
1119  {
1120  ( *var1 ) [ index ] = func1 ( *first ) ;
1121  ( *var2 ) [ index ] = func2 ( *first ) ;
1122  ++index ;
1123  }
1124 
1125  return StatusCode::SUCCESS ;
1126  }
virtual StatusCode Warning(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
bool rowWise() const
row wise NTuple ?
Definition: TupleObj.h:2047
FArray * fArray(const std::string &name, Int *item)
get the column
Definition: TupleObj.cpp:650
NTuple::Item< int > Int
basic type for int items
Definition: TupleObj.h:210
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
Int * ints(const std::string &name)
get the column
Definition: TupleObj.cpp:550
NTuple::Array< float > FArray
basic type for array of floats
Definition: TupleObj.h:231
void ignore() const
Definition: StatusCode.h:108
template<class FUNC1 , class FUNC2 , class FUNC3 , class DATA >
StatusCode Tuples::TupleObj::farray ( const std::string &  name1,
const FUNC1 &  func1,
const std::string &  name2,
const FUNC2 &  func2,
const std::string &  name3,
const FUNC3 &  func3,
DATA  first,
DATA  last,
const std::string &  length,
size_t  maxv 
)
inline

Put three functions from one data array into LoKi-style N-Tuple simultaneously (effective!)

std::vector<double> data = ... ;
Tuple tuple = ntuple( "My Ntuple" );
tuple->farray( "sqr" , // the first data item name
sqrt , // "func1" to be used
"sinus" , // the second data item name
sin , // "func2" to be used
"tan" , // the third data item name
tan , // "func3" to be used
data.begin () , // begin of data sequence
data.end () , // end of data sequence
"length" , // name of "length" tuple item
10000 ) ; // maximal array length
Parameters
name1the first tuple item name
func1the first function to be applied
name2the second tuple item name
func2the second function to be applied
name3the third tuple item name
func3the third function to be applied
firstbegin of data sequence
lastend of data sequence
lengthname of "length" tuple name
maxvmaximal length of the array
Returns
status code

Definition at line 1165 of file TupleObj.h.

1175  {
1176  if ( invalid () ) { return InvalidTuple ; }
1177  if ( rowWise () ) { return InvalidOperation ; }
1178 
1179  // adjust the length
1180  if( (size_t)std::distance(first,last) > maxv )
1181  {
1182  Warning("farray('"
1183  + name1 + ","
1184  + name2 + ","
1185  + name3 + "'): array is overflow, skip extra entries").ignore() ;
1186  last = std::next(first, maxv) ;
1187  }
1188 
1189  // get the length item
1190  Int* len = ints ( length , 0 , maxv ) ;
1191  if( !len ) { return InvalidColumn ; }
1192 
1193  // adjust the length
1194  *len = std::distance(first,last);
1195 
1196  // get the array itself
1197  FArray* var1 = fArray ( name1 , len ) ;
1198  if( !var1 ) { return InvalidColumn ; }
1199 
1200  // get the array itself
1201  FArray* var2 = fArray ( name2 , len ) ;
1202  if( !var2 ) { return InvalidColumn ; }
1203 
1204  // get the array itself
1205  FArray* var3 = fArray ( name3 , len ) ;
1206  if( !var3 ) { return InvalidColumn ; }
1207 
1208  // fill the array
1209  size_t index = 0 ;
1210  for( ; first != last ; ++first )
1211  {
1212  ( *var1 ) [ index ] = (float)func1 ( *first ) ;
1213  ( *var2 ) [ index ] = (float)func2 ( *first ) ;
1214  ( *var3 ) [ index ] = (float)func3 ( *first ) ;
1215  ++index ;
1216  }
1217  return StatusCode::SUCCESS ;
1218  }
virtual StatusCode Warning(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
bool rowWise() const
row wise NTuple ?
Definition: TupleObj.h:2047
FArray * fArray(const std::string &name, Int *item)
get the column
Definition: TupleObj.cpp:650
NTuple::Item< int > Int
basic type for int items
Definition: TupleObj.h:210
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
Int * ints(const std::string &name)
get the column
Definition: TupleObj.cpp:550
NTuple::Array< float > FArray
basic type for array of floats
Definition: TupleObj.h:231
void ignore() const
Definition: StatusCode.h:108
template<class FUNC1 , class FUNC2 , class FUNC3 , class DATA >
StatusCode Tuples::TupleObj::farray ( const std::string &  name1,
const FUNC1 &  func1,
const std::string &  name2,
const FUNC2 &  func2,
const std::string &  name3,
const FUNC3 &  func3,
DATA  first,
DATA  last,
const std::string &  length,
size_t  maxv 
)
inline

Put three functions from one data array into LoKi-style N-Tuple simultaneously (effective!)

std::vector<double> data = ... ;
Tuple tuple = ntuple( "My Ntuple" );
tuple->farray( "sqr" , // the first data item name
sqrt , // "func1" to be used
"sinus" , // the second data item name
sin , // "func2" to be used
"tan" , // the third data item name
tan , // "func3" to be used
data.begin () , // begin of data sequence
data.end () , // end of data sequence
"length" , // name of "length" tuple item
10000 ) ; // maximal array length
Parameters
name1the first tuple item name
func1the first function to be applied
name2the second tuple item name
func2the second function to be applied
name3the third tuple item name
func3the third function to be applied
firstbegin of data sequence
lastend of data sequence
lengthname of "length" tuple name
maxvmaximal length of the array
Returns
status code

Definition at line 1165 of file TupleObj.h.

1175  {
1176  if ( invalid () ) { return InvalidTuple ; }
1177  if ( rowWise () ) { return InvalidOperation ; }
1178 
1179  // adjust the length
1180  if( (size_t)std::distance(first,last) > maxv )
1181  {
1182  Warning("farray('"
1183  + name1 + ","
1184  + name2 + ","
1185  + name3 + "'): array is overflow, skip extra entries").ignore() ;
1186  last = std::next(first, maxv) ;
1187  }
1188 
1189  // get the length item
1190  Int* len = ints ( length , 0 , maxv ) ;
1191  if( !len ) { return InvalidColumn ; }
1192 
1193  // adjust the length
1194  *len = std::distance(first,last);
1195 
1196  // get the array itself
1197  FArray* var1 = fArray ( name1 , len ) ;
1198  if( !var1 ) { return InvalidColumn ; }
1199 
1200  // get the array itself
1201  FArray* var2 = fArray ( name2 , len ) ;
1202  if( !var2 ) { return InvalidColumn ; }
1203 
1204  // get the array itself
1205  FArray* var3 = fArray ( name3 , len ) ;
1206  if( !var3 ) { return InvalidColumn ; }
1207 
1208  // fill the array
1209  size_t index = 0 ;
1210  for( ; first != last ; ++first )
1211  {
1212  ( *var1 ) [ index ] = (float)func1 ( *first ) ;
1213  ( *var2 ) [ index ] = (float)func2 ( *first ) ;
1214  ( *var3 ) [ index ] = (float)func3 ( *first ) ;
1215  ++index ;
1216  }
1217  return StatusCode::SUCCESS ;
1218  }
virtual StatusCode Warning(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
bool rowWise() const
row wise NTuple ?
Definition: TupleObj.h:2047
FArray * fArray(const std::string &name, Int *item)
get the column
Definition: TupleObj.cpp:650
NTuple::Item< int > Int
basic type for int items
Definition: TupleObj.h:210
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
Int * ints(const std::string &name)
get the column
Definition: TupleObj.cpp:550
NTuple::Array< float > FArray
basic type for array of floats
Definition: TupleObj.h:231
void ignore() const
Definition: StatusCode.h:108
template<class FUNC1 , class FUNC2 , class FUNC3 , class FUNC4 , class DATA >
StatusCode Tuples::TupleObj::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,
DATA  first,
DATA  last,
const std::string &  length,
size_t  maxv 
)
inline

Put four functions from one data array into LoKi-style N-Tuple simultaneously (effective!)

std::vector<double> data = ... ;
Tuple tuple = ntuple( "My Ntuple" );
tuple->farray( "sqr" , // the first data item name
sqrt , // "func1" to be used
"sinus" , // the second data item name
sin , // "func2" to be used
"tan" , // the third data item name
tan , // "func3" to be used
"tanh" , //
tanh , //
data.begin () , // begin of data sequence
data.end () , // end of data sequence
"length" , // name of "length" tuple item
10000 ) ; // maximal array length
Parameters
name1the first tuple item name
func1the first function to be applied
name2the second tuple item name
func2the second function to be applied
name3the third tuple item name
func3the third function to be applied
name4the fourth tuple item name
func4the fourth function to be applied
firstbegin of data sequence
lastend of data sequence
lengthname of "length" tuple name
maxvmaximal length of the array
Returns
status code

Definition at line 1260 of file TupleObj.h.

1272  {
1273  if ( invalid () ) { return InvalidTuple ; }
1274  if ( rowWise () ) { return InvalidOperation ; }
1275 
1276  // adjust the length
1277  if( std::distance(first,last) > static_cast<std::ptrdiff_t>(maxv) )
1278  {
1279  Warning("farray('"
1280  + name1 + ","
1281  + name2 + ","
1282  + name3 + ","
1283  + name4 + "'): array is overflow, skip extra entries").ignore() ;
1284  last = std::next(first, maxv);
1285  }
1286 
1287  // get the length item
1288  Int* len = ints ( length , 0 , maxv ) ;
1289  if( !len ) { return InvalidColumn ; }
1290 
1291  // adjust the length
1292  *len = std::distance(first,last);
1293 
1294  // get the array itself
1295  FArray* var1 = fArray ( name1 , len ) ;
1296  if( !var1 ) { return InvalidColumn ; }
1297 
1298  // get the array itself
1299  FArray* var2 = fArray ( name2 , len ) ;
1300  if( !var2 ) { return InvalidColumn ; }
1301 
1302  // get the array itself
1303  FArray* var3 = fArray ( name3 , len ) ;
1304  if( !var3 ) { return InvalidColumn ; }
1305 
1306  // get the array itself
1307  FArray* var4 = fArray ( name4 , len ) ;
1308  if( !var4 ) { return InvalidColumn ; }
1309 
1310  // fill the array
1311  size_t index = 0 ;
1312  for( ; first != last ; ++first )
1313  {
1314  ( *var1 ) [ index ] = func1 ( *first );
1315  ( *var2 ) [ index ] = func2 ( *first );
1316  ( *var3 ) [ index ] = func3 ( *first );
1317  ( *var4 ) [ index ] = func4 ( *first );
1318  ++index ;
1319  }
1320 
1321  return StatusCode::SUCCESS ;
1322  }
virtual StatusCode Warning(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
bool rowWise() const
row wise NTuple ?
Definition: TupleObj.h:2047
FArray * fArray(const std::string &name, Int *item)
get the column
Definition: TupleObj.cpp:650
NTuple::Item< int > Int
basic type for int items
Definition: TupleObj.h:210
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
Int * ints(const std::string &name)
get the column
Definition: TupleObj.cpp:550
NTuple::Array< float > FArray
basic type for array of floats
Definition: TupleObj.h:231
void ignore() const
Definition: StatusCode.h:108
template<class FUNC1 , class FUNC2 , class FUNC3 , class FUNC4 , class DATA >
StatusCode Tuples::TupleObj::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,
DATA  first,
DATA  last,
const std::string &  length,
size_t  maxv 
)
inline

Put four functions from one data array into LoKi-style N-Tuple simultaneously (effective!)

std::vector<double> data = ... ;
Tuple tuple = ntuple( "My Ntuple" );
tuple->farray( "sqr" , // the first data item name
sqrt , // "func1" to be used
"sinus" , // the second data item name
sin , // "func2" to be used
"tan" , // the third data item name
tan , // "func3" to be used
"tanh" , //
tanh , //
data.begin () , // begin of data sequence
data.end () , // end of data sequence
"length" , // name of "length" tuple item
10000 ) ; // maximal array length
Parameters
name1the first tuple item name
func1the first function to be applied
name2the second tuple item name
func2the second function to be applied
name3the third tuple item name
func3the third function to be applied
name4the fourth tuple item name
func4the fourth function to be applied
firstbegin of data sequence
lastend of data sequence
lengthname of "length" tuple name
maxvmaximal length of the array
Returns
status code

Definition at line 1260 of file TupleObj.h.

1272  {
1273  if ( invalid () ) { return InvalidTuple ; }
1274  if ( rowWise () ) { return InvalidOperation ; }
1275 
1276  // adjust the length
1277  if( std::distance(first,last) > static_cast<std::ptrdiff_t>(maxv) )
1278  {
1279  Warning("farray('"
1280  + name1 + ","
1281  + name2 + ","
1282  + name3 + ","
1283  + name4 + "'): array is overflow, skip extra entries").ignore() ;
1284  last = std::next(first, maxv);
1285  }
1286 
1287  // get the length item
1288  Int* len = ints ( length , 0 , maxv ) ;
1289  if( !len ) { return InvalidColumn ; }
1290 
1291  // adjust the length
1292  *len = std::distance(first,last);
1293 
1294  // get the array itself
1295  FArray* var1 = fArray ( name1 , len ) ;
1296  if( !var1 ) { return InvalidColumn ; }
1297 
1298  // get the array itself
1299  FArray* var2 = fArray ( name2 , len ) ;
1300  if( !var2 ) { return InvalidColumn ; }
1301 
1302  // get the array itself
1303  FArray* var3 = fArray ( name3 , len ) ;
1304  if( !var3 ) { return InvalidColumn ; }
1305 
1306  // get the array itself
1307  FArray* var4 = fArray ( name4 , len ) ;
1308  if( !var4 ) { return InvalidColumn ; }
1309 
1310  // fill the array
1311  size_t index = 0 ;
1312  for( ; first != last ; ++first )
1313  {
1314  ( *var1 ) [ index ] = func1 ( *first );
1315  ( *var2 ) [ index ] = func2 ( *first );
1316  ( *var3 ) [ index ] = func3 ( *first );
1317  ( *var4 ) [ index ] = func4 ( *first );
1318  ++index ;
1319  }
1320 
1321  return StatusCode::SUCCESS ;
1322  }
virtual StatusCode Warning(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
bool rowWise() const
row wise NTuple ?
Definition: TupleObj.h:2047
FArray * fArray(const std::string &name, Int *item)
get the column
Definition: TupleObj.cpp:650
NTuple::Item< int > Int
basic type for int items
Definition: TupleObj.h:210
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
Int * ints(const std::string &name)
get the column
Definition: TupleObj.cpp:550
NTuple::Array< float > FArray
basic type for array of floats
Definition: TupleObj.h:231
void ignore() const
Definition: StatusCode.h:108
Tuples::TupleObj::FArray * Tuples::TupleObj::fArray ( const std::string &  name,
Int item 
)
private

get the column

Definition at line 650 of file TupleObj.cpp.

652 {
653  // existing array ?
654  auto found = m_farrays.find( name ) ;
655  if( m_farrays.end() != found ) { return found->second.get() ; }
656  return create_(this, m_farrays, name,
657  [&](const std::string& n, FArray& i)
658  { return this->tuple()->addIndexedItem(n,*length,i); });
659 }
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
FArrays m_farrays
the actual storage of all 'FArray' columns
Definition: TupleObj.h:2307
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:743
iterator end()
Definition: Map.h:132
iterator find(const key_type &key)
Definition: Map.h:149
NTuple::Array< float > FArray
basic type for array of floats
Definition: TupleObj.h:231
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
FArray* Tuples::TupleObj::fArray ( const std::string &  name,
Int item 
)
private

get the column

Tuples::TupleObj::FArray * Tuples::TupleObj::fArray ( const std::string &  name,
const MIndex rows 
)
private

get the column

Definition at line 664 of file TupleObj.cpp.

666 {
667  // existing array ?
668  auto found = m_arraysf.find( name ) ;
669  if( m_arraysf.end() != found ) { return found->second.get() ; }
670  return create_(this, m_arraysf, name,
671  [&](const std::string& n, FArray& i)
672  { return this->tuple()->addItem(n,rows,i); });
673 }
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
FArrays m_arraysf
the actual storage of all 'FArray' columns (fixed)
Definition: TupleObj.h:2310
iterator end()
Definition: Map.h:132
iterator find(const key_type &key)
Definition: Map.h:149
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
Definition: NTuple.h:554
NTuple::Array< float > FArray
basic type for array of floats
Definition: TupleObj.h:231
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
FArray* Tuples::TupleObj::fArray ( const std::string &  name,
const MIndex rows 
)
private

get the column

StatusCode Tuples::TupleObj::fill ( const char *  format...)

Set the values for several columns simultaneously.

Number of columns is arbitrary, but it should not be less than number of blank or comma separated tags in format string. Non-existing columns will be automatically created and appended to the ntuple.

double r1 , r2 , r3 , r4 , mass , length ;
tuple->fill( "var1 var2, radius rad4 mass len" ,
r1, r2, r3, r4, mass, length);
Warning
ALL columns are assumed to be of type double
Parameters
formatblank-separated list of variables, followed by variable number of arguments.
Attention
All variables are assumed to be double numbers
Author
Vanya Belyaev Ivan..nosp@m.Bely.nosp@m.aev@i.nosp@m.tep..nosp@m.ru
Date
2002-10-30
StatusCode Tuples::TupleObj::fill ( const char *  format...)

Set the values for several columns simultaneously.

Number of columns is arbitrary, but it should not be less than number of blank or comma separated tags in format string. Non-existing columns will be automatically created and appended to the ntuple.

double r1 , r2 , r3 , r4 , mass , length ;
tuple->fill( "var1 var2, radius rad4 mass len" ,
r1, r2, r3, r4, mass, length);
Warning
ALL columns are assumed to be of type double
Parameters
formatblank-separated list of variables, followed by variable number of arguments.
Attention
All variables are assumed to be double numbers
Author
Vanya Belyaev Ivan..nosp@m.Bely.nosp@m.aev@i.nosp@m.tep..nosp@m.ru
Date
2002-10-30

decode arguments

Definition at line 214 of file TupleObj.cpp.

215 {
216  // check the underlying tuple
217  if ( invalid() ) { return InvalidTuple ; }
218  // decode format string into tokens
219  auto tokens = tokenize( format , " ,;" );
221  va_list valist ;
222  va_start( valist , format ) ;
223  // loop over all tokens
225  for( auto token = tokens.cbegin() ;
226  tokens.cend() != token && status.isSuccess() ; ++token )
227  {
228  double val = va_arg( valist , double );
229  status = column( *token , val );
230  if( status.isFailure() )
231  { Error ( "fill(): Can not add column '" + *token + "' " ) ; }
232  }
233  // mandatory !!!
234  va_end( valist );
235  //
236  return status ;
237 }
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
StatusCode column(const std::string &name, float value)
Set the value for selected tuple column.
Definition: TupleObj.cpp:263
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
virtual StatusCode Error(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:120
Tuples::TupleObj::Float * Tuples::TupleObj::floats ( const std::string &  name)
private

get the column

Definition at line 436 of file TupleObj.cpp.

437 {
438  auto found = m_floats.find( name ) ;
439  if ( m_floats.end() != found ) { return found->second.get() ; }
440  return create_(this, m_floats,name,
441  [&](const std::string& n, Float& i)
442  { return this->tuple()->addItem(n,i); });
443 }
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
NTuple::Item< float > Float
basic type for float items
Definition: TupleObj.h:222
Floats m_floats
the actual storage of all 'Float' columns
Definition: TupleObj.h:2298
iterator end()
Definition: Map.h:132
iterator find(const key_type &key)
Definition: Map.h:149
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
Definition: NTuple.h:554
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
Float* Tuples::TupleObj::floats ( const std::string &  name)
private

get the column

template<class MATRIX >
StatusCode Tuples::TupleObj::fmatrix ( const std::string &  name,
const MATRIX &  data,
size_t  rows,
const MIndex cols,
const std::string &  length,
size_t  maxv 
)
inline

Fill N-Tuple with data from variable-size matrix.

"Matrix" could be of any type, which supports data[iRow][iCol] indexing, e.g.

  • std::vector<std::vector<TYPE> >
  • CLHEP::HepMatrix, etc...
typedef std::vector<double> Row ;
typedef std::vector<Row> Mtrx ;
// number of columns (fixed!)
const size_t numCols = 5 ;
// maximal number of rows
const size_t maxRows = 300 ;
// number of rows (variable)
size_t numRows = .... ;
...
tuple -> fMatrix ( "mtrx" , // "column" name
mtrx , // matrix
numRows , // number of rows (variable!)
numCols , // number of columns (fixed)
"Length" , // name for "length" column
maxRows ) ; // maximal number of columns
CLHEP::HepMatrix mtrx = ... ;
...
tuple -> fMatrix ( "mtrx" , // "column" name
mtrx , // matrix
mtrx.num_row() , // number of rows (variable!)
mtrx.num_col() , // number of columns (fixed)
"Length" , // name for "length" column
maxRows ) ; // maximal number of columns
Parameters
nameentry name in N-Tuple
datamatrix itself
rowsnumber of rows of matrix (variable)
colsnumber of columns of matrix (fixed)
lengthentry name in NTuple for number of matrix column
maxvmaximal number of rows in matrix
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@l.nosp@m.app..nosp@m.in2p3.nosp@m..fr
Date
2005-05-01

fill the matrix

Definition at line 1377 of file TupleObj.h.

1383  {
1384  if ( invalid () ) { return InvalidTuple ; }
1385  if ( rowWise () ) { return InvalidOperation ; }
1386 
1387  // adjust the length
1388  if ( rows >= maxv )
1389  {
1390  Warning ( "fmatrix('"+name+"'): matrix is overflow, skip extra items").ignore() ;
1391  rows = ( 0 < maxv ) ? ( maxv - 1 ) : 0 ;
1392  }
1393 
1394  // get the length item
1395  Int* len = ints( length , 0 , maxv ) ;
1396  if ( !len ) { return InvalidColumn; }
1397 
1398  // adjust the length item
1399  *len = rows ;
1400 
1401  // get the array itself
1402  FMatrix* var = fMatrix ( name , len , cols ) ;
1403  if ( !var ) { return InvalidColumn ; }
1404 
1406  for ( size_t iCol = 0 ; iCol < cols ; ++iCol )
1407  {
1408  for ( MIndex iRow = 0 ; iRow < rows ; ++iRow )
1409  { (*var)[ iRow ] [ iCol ] = data[ iRow ][ iCol ] ; }
1410  }
1411 
1412  return StatusCode::SUCCESS ;
1413  }
unsigned short MIndex
Definition: TupleObj.h:237
virtual StatusCode Warning(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
NTuple::Matrix< float > FMatrix
basic type for matrix of floats
Definition: TupleObj.h:234
bool rowWise() const
row wise NTuple ?
Definition: TupleObj.h:2047
NTuple::Item< int > Int
basic type for int items
Definition: TupleObj.h:210
FMatrix * fMatrix(const std::string &name, Int *item, const MIndex &cols)
get the column
Definition: TupleObj.cpp:679
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
Int * ints(const std::string &name)
get the column
Definition: TupleObj.cpp:550
void ignore() const
Definition: StatusCode.h:108
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class MATRIX >
StatusCode Tuples::TupleObj::fmatrix ( const std::string &  name,
const MATRIX &  data,
size_t  rows,
const MIndex cols,
const std::string &  length,
size_t  maxv 
)
inline

Fill N-Tuple with data from variable-size matrix.

"Matrix" could be of any type, which supports data[iRow][iCol] indexing, e.g.

  • std::vector<std::vector<TYPE> >
  • CLHEP::HepMatrix, etc...
typedef std::vector<double> Row ;
typedef std::vector<Row> Mtrx ;
// number of columns (fixed!)
const size_t numCols = 5 ;
// maximal number of rows
const size_t maxRows = 300 ;
// number of rows (variable)
size_t numRows = .... ;
...
tuple -> fMatrix ( "mtrx" , // "column" name
mtrx , // matrix
numRows , // number of rows (variable!)
numCols , // number of columns (fixed)
"Length" , // name for "length" column
maxRows ) ; // maximal number of columns
CLHEP::HepMatrix mtrx = ... ;
...
tuple -> fMatrix ( "mtrx" , // "column" name
mtrx , // matrix
mtrx.num_row() , // number of rows (variable!)
mtrx.num_col() , // number of columns (fixed)
"Length" , // name for "length" column
maxRows ) ; // maximal number of columns
Parameters
nameentry name in N-Tuple
datamatrix itself
rowsnumber of rows of matrix (variable)
colsnumber of columns of matrix (fixed)
lengthentry name in NTuple for number of matrix column
maxvmaximal number of rows in matrix
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@l.nosp@m.app..nosp@m.in2p3.nosp@m..fr
Date
2005-05-01

fill the matrix

Definition at line 1377 of file TupleObj.h.

1383  {
1384  if ( invalid () ) { return InvalidTuple ; }
1385  if ( rowWise () ) { return InvalidOperation ; }
1386 
1387  // adjust the length
1388  if ( rows >= maxv )
1389  {
1390  Warning ( "fmatrix('"+name+"'): matrix is overflow, skip extra items").ignore() ;
1391  rows = ( 0 < maxv ) ? ( maxv - 1 ) : 0 ;
1392  }
1393 
1394  // get the length item
1395  Int* len = ints( length , 0 , maxv ) ;
1396  if ( !len ) { return InvalidColumn; }
1397 
1398  // adjust the length item
1399  *len = rows ;
1400 
1401  // get the array itself
1402  FMatrix* var = fMatrix ( name , len , cols ) ;
1403  if ( !var ) { return InvalidColumn ; }
1404 
1406  for ( size_t iCol = 0 ; iCol < cols ; ++iCol )
1407  {
1408  for ( MIndex iRow = 0 ; iRow < rows ; ++iRow )
1409  { (*var)[ iRow ] [ iCol ] = data[ iRow ][ iCol ] ; }
1410  }
1411 
1412  return StatusCode::SUCCESS ;
1413  }
unsigned short MIndex
Definition: TupleObj.h:237
virtual StatusCode Warning(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
NTuple::Matrix< float > FMatrix
basic type for matrix of floats
Definition: TupleObj.h:234
bool rowWise() const
row wise NTuple ?
Definition: TupleObj.h:2047
NTuple::Item< int > Int
basic type for int items
Definition: TupleObj.h:210
FMatrix * fMatrix(const std::string &name, Int *item, const MIndex &cols)
get the column
Definition: TupleObj.cpp:679
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
Int * ints(const std::string &name)
get the column
Definition: TupleObj.cpp:550
void ignore() const
Definition: StatusCode.h:108
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class DATA >
StatusCode Tuples::TupleObj::fmatrix ( const std::string &  name,
DATA  first,
DATA  last,
const MIndex cols,
const std::string &  length,
size_t  maxv 
)
inline

Fill N-Tuple with data from variable-size matrix.

"Matrix" could be of any type, which supports iteration from the first column to the last column and for each iterating column supports the indexing: (*first)[iCol]

typedef std::vector<double> Row ;
typedef std::vector<Row> Mtrx ;
// number of rows (fixed!)
const size_t numRows = 5 ;
// maximal number of columns
const size_t maxCols = 300 ;
// number of columns (variable)
size_t numCols = .... ;
...
tuple -> fMatrix ( "mtrx" , // entry name
mtrx.begin() , // first row of matrix
mtrx.end () , // last row of matrix
numCols , // number of columns (fixed!)
"Length" , // name for "length" column
maxRows ) ; // maximal number of rows
Parameters
nameentry name in N-Tuple
firstiterator for the first row of matrix
lastiterator for the last row of matrix
colsnumber of columns for matrix (fixed!)
lengthentry name in NTuple for number of matrix column
maxvmaximal number of rows in matrix
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@l.nosp@m.app..nosp@m.in2p3.nosp@m..fr
Date
2005-05-01

fill the matrix

Definition at line 1452 of file TupleObj.h.

1458  {
1459  if ( invalid () ) { return InvalidTuple ; }
1460  if ( rowWise () ) { return InvalidOperation ; }
1461 
1462  // adjust the length
1463  if ( first + maxv < last )
1464  {
1465  Warning("fmatrix('"+name+"'): matrix is overflow, skip extra items").ignore() ;
1466  last = first + maxv ;
1467  }
1468 
1469  // get the length item
1470  Int* len = ints( length , 0 , maxv ) ;
1471  if ( !len ) { return InvalidColumn; }
1472 
1473  // adjust the length item
1474  *len = last - first ;
1475 
1476  // get the array itself
1477  FMatrix* var = fMatrix ( name , len , cols ) ;
1478  if ( !var ) { return InvalidColumn ; }
1479 
1481  size_t iRow = 0 ;
1482  for ( ; first != last ; ++first )
1483  {
1484  //
1485  for ( MIndex iCol = 0 ; iCol < cols ; ++iCol )
1486  { (*var)[ iRow ] [ iCol ] = (float)((*first)[ iCol ]) ; }
1487  //
1488  ++iRow ;
1489  }
1490 
1491  return StatusCode::SUCCESS ;
1492  }
unsigned short MIndex
Definition: TupleObj.h:237
virtual StatusCode Warning(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
NTuple::Matrix< float > FMatrix
basic type for matrix of floats
Definition: TupleObj.h:234
bool rowWise() const
row wise NTuple ?
Definition: TupleObj.h:2047
NTuple::Item< int > Int
basic type for int items
Definition: TupleObj.h:210
FMatrix * fMatrix(const std::string &name, Int *item, const MIndex &cols)
get the column
Definition: TupleObj.cpp:679
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
Int * ints(const std::string &name)
get the column
Definition: TupleObj.cpp:550
void ignore() const
Definition: StatusCode.h:108
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class DATA >
StatusCode Tuples::TupleObj::fmatrix ( const std::string &  name,
DATA  first,
DATA  last,
const MIndex cols,
const std::string &  length,
size_t  maxv 
)
inline

Fill N-Tuple with data from variable-size matrix.

"Matrix" could be of any type, which supports iteration from the first column to the last column and for each iterating column supports the indexing: (*first)[iCol]

typedef std::vector<double> Row ;
typedef std::vector<Row> Mtrx ;
// number of rows (fixed!)
const size_t numRows = 5 ;
// maximal number of columns
const size_t maxCols = 300 ;
// number of columns (variable)
size_t numCols = .... ;
...
tuple -> fMatrix ( "mtrx" , // entry name
mtrx.begin() , // first row of matrix
mtrx.end () , // last row of matrix
numCols , // number of columns (fixed!)
"Length" , // name for "length" column
maxRows ) ; // maximal number of rows
Parameters
nameentry name in N-Tuple
firstiterator for the first row of matrix
lastiterator for the last row of matrix
colsnumber of columns for matrix (fixed!)
lengthentry name in NTuple for number of matrix column
maxvmaximal number of rows in matrix
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@l.nosp@m.app..nosp@m.in2p3.nosp@m..fr
Date
2005-05-01

fill the matrix

Definition at line 1452 of file TupleObj.h.

1458  {
1459  if ( invalid () ) { return InvalidTuple ; }
1460  if ( rowWise () ) { return InvalidOperation ; }
1461 
1462  // adjust the length
1463  if ( first + maxv < last )
1464  {
1465  Warning("fmatrix('"+name+"'): matrix is overflow, skip extra items").ignore() ;
1466  last = first + maxv ;
1467  }
1468 
1469  // get the length item
1470  Int* len = ints( length , 0 , maxv ) ;
1471  if ( !len ) { return InvalidColumn; }
1472 
1473  // adjust the length item
1474  *len = last - first ;
1475 
1476  // get the array itself
1477  FMatrix* var = fMatrix ( name , len , cols ) ;
1478  if ( !var ) { return InvalidColumn ; }
1479 
1481  size_t iRow = 0 ;
1482  for ( ; first != last ; ++first )
1483  {
1484  //
1485  for ( MIndex iCol = 0 ; iCol < cols ; ++iCol )
1486  { (*var)[ iRow ] [ iCol ] = (float)((*first)[ iCol ]) ; }
1487  //
1488  ++iRow ;
1489  }
1490 
1491  return StatusCode::SUCCESS ;
1492  }
unsigned short MIndex
Definition: TupleObj.h:237
virtual StatusCode Warning(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
NTuple::Matrix< float > FMatrix
basic type for matrix of floats
Definition: TupleObj.h:234
bool rowWise() const
row wise NTuple ?
Definition: TupleObj.h:2047
NTuple::Item< int > Int
basic type for int items
Definition: TupleObj.h:210
FMatrix * fMatrix(const std::string &name, Int *item, const MIndex &cols)
get the column
Definition: TupleObj.cpp:679
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
Int * ints(const std::string &name)
get the column
Definition: TupleObj.cpp:550
void ignore() const
Definition: StatusCode.h:108
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class FUN , class DATA >
StatusCode Tuples::TupleObj::fmatrix ( const std::string &  name,
FUN  funF,
FUN  funL,
DATA  first,
DATA  last,
const std::string &  length,
size_t  maxv 
)
inline

fill N-Tuple with matrix of "direct-product" of "data-vector" [first,last) and "function-vector" [funF, funL)

The elements of effective matrix are:

mtrx[iCol][iRow] = (*(funF+iRow))( *(first+iCol) )

Attention
The length of data-vector is variable, while the length of "function" vector is fixed!
typedef std::vector<double> Array ;
Array array = ... ;
typedef double (*fun)( double ) ;
typedef std::vector<fun> Funs ;
Funs funs ;
funs.push_back( sin ) ;
funs.push_back( cos ) ;
funs.push_back( tan ) ;
funs.push_back( sinh ) ;
funs.push_back( cosh ) ;
funs.push_back( tanh ) ;
tuple->fmatrix ( "mtrx" , // N-Tuple entry name
funs.begin () , // begin of "function-vector"
funs.end () , // end of "function-vector"
array.begin () , // begin of "data-vector"
array.end () , // end of "data-vector"
"Length" ,
100 ) ;

This method is very convenient e.g. for using within LoKi:

typedef std::vector<Fun> VctFun ;
// sequence of Particles
Range particles = .... ;
// vector of functions:
VctFun funs ;
funs.push_back( E / GeV ) ;
funs.push_back( PX / GeV ) ;
funs.push_back( PY / GeV ) ;
funs.push_back( PZ / GeV ) ;
funs.push_back( PT / GeV ) ;
funs.push_back( M / GeV ) ;
funs.push_back( ID ) ;
// fill N-Tuple with information about each particle
tuple -> fmatrix ( "vars" ,
funs.begin () ,
funs.end () ,
particles.begin () ,
particles.end () ,
"nParts" ,
200 ) ;
Parameters
nameentry name in N-Tuple
funF"begin"-iterator for vector of functions
funL"end"-iterator for vector of functions
first"begin"-iterator for vector of data
last"end"-iterator for vector of data
lengthentry name in NTuple for number of matrix column
maxvmaximal number of rows in matrix
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@l.nosp@m.app..nosp@m.in2p3.nosp@m..fr
Date
2005-05-01

fill the matrix

Definition at line 1573 of file TupleObj.h.

1580  {
1581  if ( invalid () ) { return InvalidTuple ; }
1582  if ( rowWise () ) { return InvalidOperation ; }
1583 
1584  // adjust the length
1585  if ( std::distance(first,last) > static_cast<std::ptrdiff_t>(maxv) )
1586  {
1587  Warning("fmatrix('"+name+"'): matrix is overflow, skip extra items").ignore() ;
1588  last = std::next(first, maxv) ;
1589  }
1590 
1591  // get the length item
1592  Int* len = ints( length , 0 , maxv ) ;
1593  if ( !len ) { return InvalidColumn; }
1594 
1595  // adjust the length item
1596  *len = std::distance(first,last);
1597 
1598  // get the array itself
1599  auto cols = std::distance(funF,funL);
1600  FMatrix* var = fMatrix ( name , len , cols ) ;
1601  if ( !var ) { return InvalidColumn ; }
1602 
1604  size_t iRow = 0 ;
1605  for ( ; first != last ; ++first )
1606  {
1607  //
1608  for ( FUN fun = funF ; fun < funL ; ++fun )
1609  { (*var)[ iRow ] [ fun - funF ] = (*fun) ( *first ) ; }
1610  //
1611  ++iRow;
1612  }
1613 
1614  return StatusCode::SUCCESS ;
1615  }
virtual StatusCode Warning(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
NTuple::Matrix< float > FMatrix
basic type for matrix of floats
Definition: TupleObj.h:234
bool rowWise() const
row wise NTuple ?
Definition: TupleObj.h:2047
double fun(const std::vector< double > &x)
Definition: PFuncTest.cpp:26
NTuple::Item< int > Int
basic type for int items
Definition: TupleObj.h:210
FMatrix * fMatrix(const std::string &name, Int *item, const MIndex &cols)
get the column
Definition: TupleObj.cpp:679
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
Int * ints(const std::string &name)
get the column
Definition: TupleObj.cpp:550
void ignore() const
Definition: StatusCode.h:108
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class FUN , class DATA >
StatusCode Tuples::TupleObj::fmatrix ( const std::string &  name,
FUN  funF,
FUN  funL,
DATA  first,
DATA  last,
const std::string &  length,
size_t  maxv 
)
inline

fill N-Tuple with matrix of "direct-product" of "data-vector" [first,last) and "function-vector" [funF, funL)

The elements of effective matrix are:

mtrx[iCol][iRow] = (*(funF+iRow))( *(first+iCol) )

Attention
The length of data-vector is variable, while the length of "function" vector is fixed!
typedef std::vector<double> Array ;
Array array = ... ;
typedef double (*fun)( double ) ;
typedef std::vector<fun> Funs ;
Funs funs ;
funs.push_back( sin ) ;
funs.push_back( cos ) ;
funs.push_back( tan ) ;
funs.push_back( sinh ) ;
funs.push_back( cosh ) ;
funs.push_back( tanh ) ;
tuple->fmatrix ( "mtrx" , // N-Tuple entry name
funs.begin () , // begin of "function-vector"
funs.end () , // end of "function-vector"
array.begin () , // begin of "data-vector"
array.end () , // end of "data-vector"
"Length" ,
100 ) ;

This method is very convenient e.g. for using within LoKi:

typedef std::vector<Fun> VctFun ;
// sequence of Particles
Range particles = .... ;
// vector of functions:
VctFun funs ;
funs.push_back( E / GeV ) ;
funs.push_back( PX / GeV ) ;
funs.push_back( PY / GeV ) ;
funs.push_back( PZ / GeV ) ;
funs.push_back( PT / GeV ) ;
funs.push_back( M / GeV ) ;
funs.push_back( ID ) ;
// fill N-Tuple with information about each particle
tuple -> fmatrix ( "vars" ,
funs.begin () ,
funs.end () ,
particles.begin () ,
particles.end () ,
"nParts" ,
200 ) ;
Parameters
nameentry name in N-Tuple
funF"begin"-iterator for vector of functions
funL"end"-iterator for vector of functions
first"begin"-iterator for vector of data
last"end"-iterator for vector of data
lengthentry name in NTuple for number of matrix column
maxvmaximal number of rows in matrix
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@l.nosp@m.app..nosp@m.in2p3.nosp@m..fr
Date
2005-05-01

fill the matrix

Definition at line 1573 of file TupleObj.h.

1580  {
1581  if ( invalid () ) { return InvalidTuple ; }
1582  if ( rowWise () ) { return InvalidOperation ; }
1583 
1584  // adjust the length
1585  if ( std::distance(first,last) > static_cast<std::ptrdiff_t>(maxv) )
1586  {
1587  Warning("fmatrix('"+name+"'): matrix is overflow, skip extra items").ignore() ;
1588  last = std::next(first, maxv) ;
1589  }
1590 
1591  // get the length item
1592  Int* len = ints( length , 0 , maxv ) ;
1593  if ( !len ) { return InvalidColumn; }
1594 
1595  // adjust the length item
1596  *len = std::distance(first,last);
1597 
1598  // get the array itself
1599  auto cols = std::distance(funF,funL);
1600  FMatrix* var = fMatrix ( name , len , cols ) ;
1601  if ( !var ) { return InvalidColumn ; }
1602 
1604  size_t iRow = 0 ;
1605  for ( ; first != last ; ++first )
1606  {
1607  //
1608  for ( FUN fun = funF ; fun < funL ; ++fun )
1609  { (*var)[ iRow ] [ fun - funF ] = (*fun) ( *first ) ; }
1610  //
1611  ++iRow;
1612  }
1613 
1614  return StatusCode::SUCCESS ;
1615  }
virtual StatusCode Warning(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
NTuple::Matrix< float > FMatrix
basic type for matrix of floats
Definition: TupleObj.h:234
bool rowWise() const
row wise NTuple ?
Definition: TupleObj.h:2047
double fun(const std::vector< double > &x)
Definition: PFuncTest.cpp:26
NTuple::Item< int > Int
basic type for int items
Definition: TupleObj.h:210
FMatrix * fMatrix(const std::string &name, Int *item, const MIndex &cols)
get the column
Definition: TupleObj.cpp:679
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
Int * ints(const std::string &name)
get the column
Definition: TupleObj.cpp:550
void ignore() const
Definition: StatusCode.h:108
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class KEY , class VALUE >
StatusCode Tuples::TupleObj::fmatrix ( const std::string &  name,
const GaudiUtils::VectorMap< KEY, VALUE > &  info,
const std::string &  length,
const size_t  maxv = 100 
)
inline

shortcut to put "ExtraInfo" fields of major into N-Tuple

const LHCb::Particle* B = ...
Tuple tuple = nTuple("My N-Tuple") ;
// put the vector into N-Tuple:
tuple -> fmatrix ( "Info" , B->extraInfo() , "nInfo" , 100 ) ;
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-11-26

Definition at line 1973 of file TupleObj.h.

1977  {
1978  using Info = std::pair<KEY,VALUE>;
1979  static const std::array< std::function<float(const Info&)>, 2>
1980  fns = { [](const Info& i) { return i.first; } ,
1981  [](const Info& i) { return i.second; } };
1982  return fmatrix( name,
1983  std::begin(fns), std::end(fns),
1984  std::begin(info), std::end(info),
1985  length,maxv );
1986  }
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
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:1377
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class KEY , class VALUE >
StatusCode Tuples::TupleObj::fmatrix ( const std::string &  name,
const GaudiUtils::VectorMap< KEY, VALUE > &  info,
const std::string &  length,
const size_t  maxv = 100 
)
inline

shortcut to put "ExtraInfo" fields of major into N-Tuple

const LHCb::Particle* B = ...
Tuple tuple = nTuple("My N-Tuple") ;
// put the vector into N-Tuple:
tuple -> fmatrix ( "Info" , B->extraInfo() , "nInfo" , 100 ) ;
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-11-26

Definition at line 1973 of file TupleObj.h.

1977  {
1978  using Info = std::pair<KEY,VALUE>;
1979  static const std::array< std::function<float(const Info&)>, 2>
1980  fns = { [](const Info& i) { return i.first; } ,
1981  [](const Info& i) { return i.second; } };
1982  return fmatrix( name,
1983  std::begin(fns), std::end(fns),
1984  std::begin(info), std::end(info),
1985  length,maxv );
1986  }
auto begin(reverse_wrapper< T > &w)
Definition: reverse.h:45
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:1377
auto end(reverse_wrapper< T > &w)
Definition: reverse.h:47
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
Tuples::TupleObj::FMatrix * Tuples::TupleObj::fMatrix ( const std::string &  name,
Int item,
const MIndex cols 
)
private

get the column

Definition at line 679 of file TupleObj.cpp.

682 {
683  // existing array ?
684  auto found = m_fmatrices.find( name ) ;
685  if( m_fmatrices.end() != found ) { return found->second.get() ; }
686  return create_(this, m_fmatrices, name,
687  [&](const std::string& n, FMatrix& i)
688  { return this->tuple()->addIndexedItem(n,*length,cols,i); });
689 }
FMatrices m_fmatrices
the actual storage of all 'FArray' columns
Definition: TupleObj.h:2313
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
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:743
iterator end()
Definition: Map.h:132
NTuple::Matrix< float > FMatrix
basic type for matrix of floats
Definition: TupleObj.h:234
iterator find(const key_type &key)
Definition: Map.h:149
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
FMatrix* Tuples::TupleObj::fMatrix ( const std::string &  name,
Int item,
const MIndex cols 
)
private

get the column

FMatrix* Tuples::TupleObj::fMatrix ( const std::string &  name,
const MIndex rows,
const MIndex cols 
)
private

get the column

Tuples::TupleObj::FMatrix * Tuples::TupleObj::fMatrix ( const std::string &  name,
const MIndex rows,
const MIndex cols 
)
private

get the column

Definition at line 695 of file TupleObj.cpp.

698 {
699  // existing array ?
700  auto found = m_matricesf.find( name ) ;
701  if( m_matricesf.end() != found ) { return found->second.get() ; }
702  return create_(this, m_matricesf, name,
703  [&](const std::string& n, FMatrix& i)
704  { return this->tuple()->addItem(n,rows,cols,i); });
705 }
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
FMatrices m_matricesf
the actual storage of all 'FMatrix' columns (fixed)
Definition: TupleObj.h:2316
iterator end()
Definition: Map.h:132
NTuple::Matrix< float > FMatrix
basic type for matrix of floats
Definition: TupleObj.h:234
iterator find(const key_type &key)
Definition: Map.h:149
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
Definition: NTuple.h:554
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
bool Tuples::TupleObj::goodItem ( const std::string &  name) const
inline

check the uniqueness of the name

Parameters
namethe name of the item
Returns
true if the name is indeed unique

Definition at line 2073 of file TupleObj.h.

2074  { return m_items.end() == m_items.find ( name ) ; }
ItemMap m_items
all booked types:
Definition: TupleObj.h:2319
const std::string & name() const
get the name
Definition: TupleObj.h:2009
bool Tuples::TupleObj::goodItem ( const std::string &  name) const
inline

check the uniqueness of the name

Parameters
namethe name of the item
Returns
true if the name is indeed unique

Definition at line 2073 of file TupleObj.h.

2074  { return m_items.end() == m_items.find ( name ) ; }
ItemMap m_items
all booked types:
Definition: TupleObj.h:2319
const std::string & name() const
get the name
Definition: TupleObj.h:2009
Int* Tuples::TupleObj::ints ( const std::string &  name)
private

get the column

Tuples::TupleObj::Int * Tuples::TupleObj::ints ( const std::string &  name)
private

get the column

Definition at line 550 of file TupleObj.cpp.

551 {
552  auto found = m_ints.find( name ) ;
553  if( m_ints.end() != found ) { return found->second.get() ; }
554  return create_(this, m_ints, name,
555  [&](const std::string& n, Int& i)
556  { return this->tuple()->addItem(n,i); });
557 }
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
iterator end()
Definition: Map.h:132
iterator find(const key_type &key)
Definition: Map.h:149
Ints m_ints
the actual storage of all 'Int' columns
Definition: TupleObj.h:2286
NTuple::Item< int > Int
basic type for int items
Definition: TupleObj.h:210
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
Definition: NTuple.h:554
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
Int* Tuples::TupleObj::ints ( const std::string &  name,
int  minv,
int  maxv 
)
private

get the column

Tuples::TupleObj::Int * Tuples::TupleObj::ints ( const std::string &  name,
int  minv,
int  maxv 
)
private

get the column

Definition at line 560 of file TupleObj.cpp.

563 {
564  auto found = m_ints.find( name ) ;
565  if( m_ints.end() != found ) { return found->second.get() ; }
566  return create_(this, m_ints, name,
567  [&](const std::string& n, Int& i)
568  { return this->tuple()->addItem(n,i,minv,maxv); });
569 }
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
iterator end()
Definition: Map.h:132
iterator find(const key_type &key)
Definition: Map.h:149
Ints m_ints
the actual storage of all 'Int' columns
Definition: TupleObj.h:2286
NTuple::Item< int > Int
basic type for int items
Definition: TupleObj.h:210
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
Definition: NTuple.h:554
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
bool Tuples::TupleObj::invalid ( ) const
inline

invalid pointer to tuple ?

Definition at line 2056 of file TupleObj.h.

2056 { return ! valid() ; }
bool valid() const
valid pointer to tuple ?
Definition: TupleObj.h:2053
bool Tuples::TupleObj::invalid ( ) const
inline

invalid pointer to tuple ?

Definition at line 2056 of file TupleObj.h.

2056 { return ! valid() ; }
bool valid() const
valid pointer to tuple ?
Definition: TupleObj.h:2053
const ItemMap& Tuples::TupleObj::items ( ) const
inline

get the full list of booked items

Definition at line 2077 of file TupleObj.h.

2077 { return m_items ; }
ItemMap m_items
all booked types:
Definition: TupleObj.h:2319
const ItemMap& Tuples::TupleObj::items ( ) const
inline

get the full list of booked items

Definition at line 2077 of file TupleObj.h.

2077 { return m_items ; }
ItemMap m_items
all booked types:
Definition: TupleObj.h:2319
LongLong* Tuples::TupleObj::longlongs ( const std::string &  name)
private

get the column

Tuples::TupleObj::LongLong * Tuples::TupleObj::longlongs ( const std::string &  name)
private

get the column

Definition at line 594 of file TupleObj.cpp.

595 {
596  auto found = m_longlongs.find( name ) ;
597  if( m_longlongs.end() != found ) { return found->second.get() ; }
598  return create_(this, m_longlongs, name,
599  [&](const std::string& n, LongLong& i)
600  { return this->tuple()->addItem(n,i); });
601 }
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
iterator end()
Definition: Map.h:132
iterator find(const key_type &key)
Definition: Map.h:149
LongLongs m_longlongs
the actual storage of all 'longlong' columns
Definition: TupleObj.h:2292
NTuple::Item< long long > LongLong
basic type for unsigned long long items
Definition: TupleObj.h:216
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
Definition: NTuple.h:554
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
LongLong* Tuples::TupleObj::longlongs ( const std::string &  name,
long long  minv,
long long  maxv 
)
private

get the column

Tuples::TupleObj::LongLong * Tuples::TupleObj::longlongs ( const std::string &  name,
long long  minv,
long long  maxv 
)
private

get the column

Definition at line 604 of file TupleObj.cpp.

607 {
608  auto found = m_longlongs.find( name ) ;
609  if( m_longlongs.end() != found ) { return found->second.get() ; }
610  return create_(this, m_longlongs, name,
611  [&](const std::string& n, LongLong& i)
612  { return this->tuple()->addItem(n,i,minv,maxv); });
613 }
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
iterator end()
Definition: Map.h:132
iterator find(const key_type &key)
Definition: Map.h:149
LongLongs m_longlongs
the actual storage of all 'longlong' columns
Definition: TupleObj.h:2292
NTuple::Item< long long > LongLong
basic type for unsigned long long items
Definition: TupleObj.h:216
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
Definition: NTuple.h:554
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class MATRIX >
StatusCode Tuples::TupleObj::matrix ( const std::string &  name,
const MATRIX &  data,
const MIndex rows,
const MIndex cols 
)
inline

fill N-Tuple with fixed-size matrix

"MATRIX" must support indexing operations: data[iRow][iCol]

e.g it could be of type:

  • std::vector<std::vector<TYPE> >
  • CLHEP::HepMatrix , CLHEP::GenMatrix, etc ...
  • "TYPE"[n][m]

The content of MATRIX should be implicitly convertible to "float"

CLHEP::HepMatrix mtrx1(3,20) ;
...
tuple -> matrix ( "m1" ,
mtrx1 ,
mtrx1.num_row() ,
mtrx1.num_col() ) ;
typedef std::vector<double> Row ;
typedef std:vector<Row> Mtrx ;
Mtrx mtrx2( 3 , Row(10) ) ;
...
tuple -> matrix ( "m2" ,
mtrx2 ,
3 ,
10 ) ;
float mtrx3[3][10] ;
...
tuple -> matrix ( "m3" ,
mtrx3 ,
3 ,
10 ) ;
Parameters
nameN-Tuple entry name
datadata source (matrix)
colsnumber of columns
rowsnumber of rows
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@l.nosp@m.app..nosp@m.in2p3.nosp@m..fr
Date
2005-05-01

fill the matrix

Definition at line 1803 of file TupleObj.h.

1807  {
1808  if ( invalid () ) { return InvalidTuple ; }
1809  if ( rowWise () ) { return InvalidOperation ; }
1810 
1811  // get the matrix itself
1812  FMatrix* var = fMatrix ( name , rows , cols ) ;
1813  if ( !var ) { return InvalidColumn ; }
1814 
1816  for ( size_t iCol = 0 ; iCol < cols ; ++iCol )
1817  {
1818  for ( size_t iRow = 0 ; iRow < rows ; ++iRow )
1819  { (*var)[iRow][iCol] = data[iRow][iCol]; }
1820  };
1821  return StatusCode::SUCCESS ;
1822  }
NTuple::Matrix< float > FMatrix
basic type for matrix of floats
Definition: TupleObj.h:234
bool rowWise() const
row wise NTuple ?
Definition: TupleObj.h:2047
FMatrix * fMatrix(const std::string &name, Int *item, const MIndex &cols)
get the column
Definition: TupleObj.cpp:679
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class MATRIX >
StatusCode Tuples::TupleObj::matrix ( const std::string &  name,
const MATRIX &  data,
const MIndex rows,
const MIndex cols 
)
inline

fill N-Tuple with fixed-size matrix

"MATRIX" must support indexing operations: data[iRow][iCol]

e.g it could be of type:

  • std::vector<std::vector<TYPE> >
  • CLHEP::HepMatrix , CLHEP::GenMatrix, etc ...
  • "TYPE"[n][m]

The content of MATRIX should be implicitly convertible to "float"

CLHEP::HepMatrix mtrx1(3,20) ;
...
tuple -> matrix ( "m1" ,
mtrx1 ,
mtrx1.num_row() ,
mtrx1.num_col() ) ;
typedef std::vector<double> Row ;
typedef std:vector<Row> Mtrx ;
Mtrx mtrx2( 3 , Row(10) ) ;
...
tuple -> matrix ( "m2" ,
mtrx2 ,
3 ,
10 ) ;
float mtrx3[3][10] ;
...
tuple -> matrix ( "m3" ,
mtrx3 ,
3 ,
10 ) ;
Parameters
nameN-Tuple entry name
datadata source (matrix)
colsnumber of columns
rowsnumber of rows
Author
Vanya BELYAEV Ivan..nosp@m.Bely.nosp@m.aev@l.nosp@m.app..nosp@m.in2p3.nosp@m..fr
Date
2005-05-01

fill the matrix

Definition at line 1803 of file TupleObj.h.

1807  {
1808  if ( invalid () ) { return InvalidTuple ; }
1809  if ( rowWise () ) { return InvalidOperation ; }
1810 
1811  // get the matrix itself
1812  FMatrix* var = fMatrix ( name , rows , cols ) ;
1813  if ( !var ) { return InvalidColumn ; }
1814 
1816  for ( size_t iCol = 0 ; iCol < cols ; ++iCol )
1817  {
1818  for ( size_t iRow = 0 ; iRow < rows ; ++iRow )
1819  { (*var)[iRow][iCol] = data[iRow][iCol]; }
1820  };
1821  return StatusCode::SUCCESS ;
1822  }
NTuple::Matrix< float > FMatrix
basic type for matrix of floats
Definition: TupleObj.h:234
bool rowWise() const
row wise NTuple ?
Definition: TupleObj.h:2047
FMatrix * fMatrix(const std::string &name, Int *item, const MIndex &cols)
get the column
Definition: TupleObj.cpp:679
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class TYPE , unsigned int D1, unsigned int D2, class REP >
StatusCode Tuples::TupleObj::matrix ( const std::string &  name,
const ROOT::Math::SMatrix< TYPE, D1, D2, REP > &  mtrx 
)
inline

shortcut to put Smatrix into N-tuple:

Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-11-26

fill the matrix

Definition at line 1934 of file TupleObj.h.

1936  {
1937  if ( invalid () ) { return InvalidTuple ; }
1938  if ( rowWise () ) { return InvalidOperation ; }
1939 
1940  // get the matrix itself
1941  FMatrix* var = fMatrix ( name , (MIndex)D1 , (MIndex)D2 ) ;
1942  if ( !var ) { return InvalidColumn ; }
1943 
1945  for ( size_t iCol = 0 ; iCol < D2 ; ++iCol )
1946  {
1947  for ( size_t iRow = 0 ; iRow < D1 ; ++iRow )
1948  { (*var)[iRow][iCol] = mtrx(iRow,iCol) ; }
1949  };
1950 
1951  return StatusCode::SUCCESS ;
1952  }
unsigned short MIndex
Definition: TupleObj.h:237
NTuple::Matrix< float > FMatrix
basic type for matrix of floats
Definition: TupleObj.h:234
bool rowWise() const
row wise NTuple ?
Definition: TupleObj.h:2047
FMatrix * fMatrix(const std::string &name, Int *item, const MIndex &cols)
get the column
Definition: TupleObj.cpp:679
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
const std::string & name() const
get the name
Definition: TupleObj.h:2009
template<class TYPE , unsigned int D1, unsigned int D2, class REP >
StatusCode Tuples::TupleObj::matrix ( const std::string &  name,
const ROOT::Math::SMatrix< TYPE, D1, D2, REP > &  mtrx 
)
inline

shortcut to put Smatrix into N-tuple:

Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-11-26

fill the matrix

Definition at line 1934 of file TupleObj.h.

1936  {
1937  if ( invalid () ) { return InvalidTuple ; }
1938  if ( rowWise () ) { return InvalidOperation ; }
1939 
1940  // get the matrix itself
1941  FMatrix* var = fMatrix ( name , (MIndex)D1 , (MIndex)D2 ) ;
1942  if ( !var ) { return InvalidColumn ; }
1943 
1945  for ( size_t iCol = 0 ; iCol < D2 ; ++iCol )
1946  {
1947  for ( size_t iRow = 0 ; iRow < D1 ; ++iRow )
1948  { (*var)[iRow][iCol] = mtrx(iRow,iCol) ; }
1949  };
1950 
1951  return StatusCode::SUCCESS ;
1952  }
unsigned short MIndex
Definition: TupleObj.h:237
NTuple::Matrix< float > FMatrix
basic type for matrix of floats
Definition: TupleObj.h:234
bool rowWise() const
row wise NTuple ?
Definition: TupleObj.h:2047
FMatrix * fMatrix(const std::string &name, Int *item, const MIndex &cols)
get the column
Definition: TupleObj.cpp:679
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
const std::string & name() const
get the name
Definition: TupleObj.h:2009
const std::string& Tuples::TupleObj::name ( ) const
inline

get the name

Definition at line 2009 of file TupleObj.h.

2009 { return m_name ; }
std::string m_name
name
Definition: TupleObj.h:2256
const std::string& Tuples::TupleObj::name ( ) const
inline

get the name

Definition at line 2009 of file TupleObj.h.

2009 { return m_name ; }
std::string m_name
name
Definition: TupleObj.h:2256
TupleObj& Tuples::TupleObj::operator= ( const TupleObj )
privatedelete
TupleObj& Tuples::TupleObj::operator= ( const TupleObj )
privatedelete
template<class TYPE >
StatusCode Tuples::TupleObj::put ( const std::string &  name,
const TYPE *  obj 
)

The function allows to add almost arbitrary object into N-tuple.

Attention
it requires POOL persistency
Parameters
namecolumn name
objpointer to the object
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-04-08
template<class TYPE >
StatusCode Tuples::TupleObj::put ( const std::string &  name,
const TYPE *  obj 
)
inline

The function allows to add almost arbitrary object into N-tuple.

Attention
it requires POOL persistency
Parameters
namecolumn name
objpointer to the object
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2007-04-08

Definition at line 124 of file TuplePut.h.

125 {
126  if ( invalid () ) { return InvalidTuple ; } // RETURN
127  if ( !evtColType () ) { return InvalidOperation ; } // RETURN
128 
129  // static block: The type description & the flag
130  static bool s_fail = false ; // STATIC
131  static TClass* s_type = nullptr; // STATIC
132  // check the status
133  if ( s_fail ) { return InvalidItem ; } // RETURN
134  else if ( !s_type )
135  {
136  s_type = TClass::GetClass(typeid(TYPE));
137  if ( !s_type )
138  {
139  s_fail = true ;
140  return Error ( " put('"+name+"'," + System::typeinfoName(typeid(TYPE)) +
141  ") :Invalid ROOT Type", InvalidItem ) ; // RETURN
142  }
143  }
144  // the local storage of items
145  static Tuples::ItemStore<TYPE*> s_map ;
146  // get the variable by name:
147  auto item = s_map.getItem ( name , this ) ;
148  if ( !item )
149  { return Error ( " put('" + name + "'): invalid item detected", InvalidItem ) ; }
150  // assign the item!
151  (*item) = const_cast<TYPE*> ( obj ) ; // THATS ALL!!
152  //
153  return StatusCode::SUCCESS ; // RETURN
154 }
bool evtColType() const
Event collection ?
Definition: TupleObj.h:2050
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:299
virtual StatusCode Error(const std::string &msg, const StatusCode sc=StatusCode::FAILURE) const =0
tuple item
print s1,s2
Definition: ana.py:146
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056
Simple class, which represents the local storage of N-tuple items of the given type.
Definition: TuplePut.h:38
NTuple::Item< VALUE > * getItem(const std::string &key, Tuples::TupleObj *tuple)
the only one method:
Definition: TuplePut.h:49
const std::string & name() const
get the name
Definition: TupleObj.h:2009
unsigned long Tuples::TupleObj::refCount ( ) const
inline

return the reference counter

Returns
current reference counter

Definition at line 2024 of file TupleObj.h.

2024 { return m_refCount ; }
size_t m_refCount
reference counter
Definition: TupleObj.h:2268
unsigned long Tuples::TupleObj::refCount ( ) const
inline

return the reference counter

Returns
current reference counter

Definition at line 2024 of file TupleObj.h.

2024 { return m_refCount ; }
size_t m_refCount
reference counter
Definition: TupleObj.h:2268
void Tuples::TupleObj::release ( )

release the reference to TupleObj if reference counter becomes zero, object will be automatically deleted

Definition at line 170 of file TupleObj.cpp.

171 {
172  // decrease the reference counter
173  if( refCount() > 0 ) { --m_refCount; }
174  // check references -- delete if needed
175  if( 0 == refCount() ) delete this;
176 }
size_t m_refCount
reference counter
Definition: TupleObj.h:2268
unsigned long refCount() const
return the reference counter
Definition: TupleObj.h:2024
void Tuples::TupleObj::release ( )

release the reference to TupleObj if reference counter becomes zero, object will be automatically deleted

bool Tuples::TupleObj::rowWise ( ) const
inline

row wise NTuple ?

Definition at line 2047 of file TupleObj.h.

2047 { return CLID_RowWiseTuple == clid() ; }
const CLID & clid() const
accessor to the N-Tuple CLID
Definition: TupleObj.h:2038
bool Tuples::TupleObj::rowWise ( ) const
inline

row wise NTuple ?

Definition at line 2047 of file TupleObj.h.

2047 { return CLID_RowWiseTuple == clid() ; }
const CLID & clid() const
accessor to the N-Tuple CLID
Definition: TupleObj.h:2038
Short* Tuples::TupleObj::shorts ( const std::string &  name)
private

get the column

Tuples::TupleObj::Short * Tuples::TupleObj::shorts ( const std::string &  name)
private

get the column

Definition at line 506 of file TupleObj.cpp.

507 {
508  auto found = m_shorts.find( name ) ;
509  if( m_shorts.end() != found ) { return found->second.get() ; }
510  return create_(this, m_shorts, name,
511  [&](const std::string& n, Short& i)
512  { return this->tuple()->addItem(n,i); });
513 }
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
NTuple::Item< short > Short
basic type for int items
Definition: TupleObj.h:204
iterator end()
Definition: Map.h:132
iterator find(const key_type &key)
Definition: Map.h:149
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
Definition: NTuple.h:554
Shorts m_shorts
the actual storage of all 'Int' columns
Definition: TupleObj.h:2280
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
Short* Tuples::TupleObj::shorts ( const std::string &  name,
short  minv,
short  maxv 
)
private

get the column

Tuples::TupleObj::Short * Tuples::TupleObj::shorts ( const std::string &  name,
short  minv,
short  maxv 
)
private

get the column

Definition at line 516 of file TupleObj.cpp.

519 {
520  auto found = m_shorts.find( name ) ;
521  if( m_shorts.end() != found ) { return found->second.get(); }
522  return create_(this, m_shorts, name,
523  [&](const std::string& n, Short& i)
524  { return this->tuple()->addItem(n,i,minv,maxv); });
525 }
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
NTuple::Item< short > Short
basic type for int items
Definition: TupleObj.h:204
iterator end()
Definition: Map.h:132
iterator find(const key_type &key)
Definition: Map.h:149
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
Definition: NTuple.h:554
Shorts m_shorts
the actual storage of all 'Int' columns
Definition: TupleObj.h:2280
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
const NTuple::Tuple* Tuples::TupleObj::tuple ( ) const
inline

provide the access to underlying Gaudi N-tuple

Returns
pointer to Gaudi N-tuple object

Definition at line 2014 of file TupleObj.h.

2014 { return m_tuple ; }
NTuple::Tuple * m_tuple
tuple itself
Definition: TupleObj.h:2259
const NTuple::Tuple* Tuples::TupleObj::tuple ( ) const
inline

provide the access to underlying Gaudi N-tuple

Returns
pointer to Gaudi N-tuple object

Definition at line 2014 of file TupleObj.h.

2014 { return m_tuple ; }
NTuple::Tuple * m_tuple
tuple itself
Definition: TupleObj.h:2259
NTuple::Tuple* Tuples::TupleObj::tuple ( )
inline

provide the access to underlying Gaudi N-tuple

Returns
pointer to Gaudi N-tuple object

Definition at line 2019 of file TupleObj.h.

2019 { return m_tuple ; }
NTuple::Tuple * m_tuple
tuple itself
Definition: TupleObj.h:2259
NTuple::Tuple* Tuples::TupleObj::tuple ( )
inline

provide the access to underlying Gaudi N-tuple

Returns
pointer to Gaudi N-tuple object

Definition at line 2019 of file TupleObj.h.

2019 { return m_tuple ; }
NTuple::Tuple * m_tuple
tuple itself
Definition: TupleObj.h:2259
Tuples::Type Tuples::TupleObj::type ( ) const
inline

accessor to the N-Tuple type

Definition at line 2041 of file TupleObj.h.

2041 { return m_type ; }
Tuples::Type m_type
tuple 'type'
Definition: TupleObj.h:2265
Tuples::Type Tuples::TupleObj::type ( ) const
inline

accessor to the N-Tuple type

Definition at line 2041 of file TupleObj.h.

2041 { return m_type ; }
Tuples::Type m_type
tuple 'type'
Definition: TupleObj.h:2265
Tuples::TupleObj::UChar * Tuples::TupleObj::uchars ( const std::string &  name)
private

get the column

Definition at line 486 of file TupleObj.cpp.

487 {
488  auto found = m_uchars.find( name ) ;
489  return ( found != m_uchars.end() ) ? found->second.get()
490  : create_(this, m_uchars, name,
491  [&](const std::string& n, UChar& i)
492  { return this->tuple()->addItem(n,i); });
493 }
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
NTuple::Item< unsigned char > UChar
basic type for unsigned int items
Definition: TupleObj.h:201
iterator end()
Definition: Map.h:132
iterator find(const key_type &key)
Definition: Map.h:149
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
Definition: NTuple.h:554
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
UChars m_uchars
the actual storage of all 'unsigned int' columns
Definition: TupleObj.h:2277
UChar* Tuples::TupleObj::uchars ( const std::string &  name)
private

get the column

Tuples::TupleObj::UChar * Tuples::TupleObj::uchars ( const std::string &  name,
unsigned char  minv,
unsigned char  maxv 
)
private

get the column

Definition at line 496 of file TupleObj.cpp.

497 {
498  auto found = m_uchars.find( name ) ;
499  return ( found != m_uchars.end() ) ? found->second.get()
500  : create_(this, m_uchars, name,
501  [&](const std::string& n, UChar& i)
502  { return this->tuple()->addItem(n,i,minv,maxv); });
503 }
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
NTuple::Item< unsigned char > UChar
basic type for unsigned int items
Definition: TupleObj.h:201
iterator end()
Definition: Map.h:132
iterator find(const key_type &key)
Definition: Map.h:149
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
Definition: NTuple.h:554
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
UChars m_uchars
the actual storage of all 'unsigned int' columns
Definition: TupleObj.h:2277
UChar* Tuples::TupleObj::uchars ( const std::string &  name,
unsigned char  minv,
unsigned char  maxv 
)
private

get the column

UInt* Tuples::TupleObj::uints ( const std::string &  name)
private

get the column

Tuples::TupleObj::UInt * Tuples::TupleObj::uints ( const std::string &  name)
private

get the column

Definition at line 572 of file TupleObj.cpp.

573 {
574  auto found = m_uints.find( name ) ;
575  if( m_uints.end() != found ) { return found->second.get() ; }
576  return create_(this, m_uints, name,
577  [&](const std::string& n, UInt& i)
578  { return this->tuple()->addItem(n,i); });
579 }
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
iterator end()
Definition: Map.h:132
UInts m_uints
the actual storage of all 'unsigned int' columns
Definition: TupleObj.h:2289
iterator find(const key_type &key)
Definition: Map.h:149
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
Definition: NTuple.h:554
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
NTuple::Item< unsigned int > UInt
basic type for unsigned int items
Definition: TupleObj.h:213
Tuples::TupleObj::UInt * Tuples::TupleObj::uints ( const std::string &  name,
unsigned int  minv,
unsigned int  maxv 
)
private

get the column

Definition at line 582 of file TupleObj.cpp.

585 {
586  auto found = m_uints.find( name ) ;
587  if( m_uints.end() != found ) { return found->second.get() ; }
588  return create_(this, m_uints, name,
589  [&](const std::string& n, UInt& i)
590  { return this->tuple()->addItem(n,i,minv,maxv); });
591 }
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
iterator end()
Definition: Map.h:132
UInts m_uints
the actual storage of all 'unsigned int' columns
Definition: TupleObj.h:2289
iterator find(const key_type &key)
Definition: Map.h:149
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
Definition: NTuple.h:554
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
NTuple::Item< unsigned int > UInt
basic type for unsigned int items
Definition: TupleObj.h:213
UInt* Tuples::TupleObj::uints ( const std::string &  name,
unsigned int  minv,
unsigned int  maxv 
)
private

get the column

ULongLong* Tuples::TupleObj::ulonglongs ( const std::string &  name)
private

get the column

Tuples::TupleObj::ULongLong * Tuples::TupleObj::ulonglongs ( const std::string &  name)
private

get the column

Definition at line 616 of file TupleObj.cpp.

617 {
618  auto found = m_ulonglongs.find( name ) ;
619  if( m_ulonglongs.end() != found ) { return found->second.get() ; }
620  return create_(this, m_ulonglongs, name,
621  [&](const std::string& n, ULongLong& i)
622  { return this->tuple()->addItem(n,i); });
623 }
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
NTuple::Item< unsigned long long > ULongLong
basic type for unsigned long long items
Definition: TupleObj.h:219
ULongLongs m_ulonglongs
the actual storage of all 'ulonglong' columns
Definition: TupleObj.h:2295
iterator end()
Definition: Map.h:132
iterator find(const key_type &key)
Definition: Map.h:149
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
Definition: NTuple.h:554
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
Tuples::TupleObj::ULongLong * Tuples::TupleObj::ulonglongs ( const std::string &  name,
unsigned long long  minv,
unsigned long long  maxv 
)
private

get the column

Definition at line 626 of file TupleObj.cpp.

629 {
630  auto found = m_ulonglongs.find( name ) ;
631  if( m_ulonglongs.end() != found ) { return found->second.get() ; }
632  return create_(this, m_ulonglongs, name,
633  [&](const std::string& n, ULongLong& i)
634  { return this->tuple()->addItem(n,i,minv,maxv); });
635 }
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
NTuple::Item< unsigned long long > ULongLong
basic type for unsigned long long items
Definition: TupleObj.h:219
ULongLongs m_ulonglongs
the actual storage of all 'ulonglong' columns
Definition: TupleObj.h:2295
iterator end()
Definition: Map.h:132
iterator find(const key_type &key)
Definition: Map.h:149
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
Definition: NTuple.h:554
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
ULongLong* Tuples::TupleObj::ulonglongs ( const std::string &  name,
unsigned long long  minv,
unsigned long long  maxv 
)
private

get the column

UShort* Tuples::TupleObj::ushorts ( const std::string &  name)
private

get the column

Tuples::TupleObj::UShort * Tuples::TupleObj::ushorts ( const std::string &  name)
private

get the column

Definition at line 528 of file TupleObj.cpp.

529 {
530  auto found = m_ushorts.find( name ) ;
531  if( m_ushorts.end() != found ) { return found->second.get() ; }
532  return create_(this, m_ushorts, name,
533  [&](const std::string& n, UShort& i)
534  { return this->tuple()->addItem(n,i); });
535 }
UShorts m_ushorts
the actual storage of all 'unsigned int' columns
Definition: TupleObj.h:2283
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
NTuple::Item< unsigned short > UShort
basic type for unsigned int items
Definition: TupleObj.h:207
iterator end()
Definition: Map.h:132
iterator find(const key_type &key)
Definition: Map.h:149
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
Definition: NTuple.h:554
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
UShort* Tuples::TupleObj::ushorts ( const std::string &  name,
unsigned short  minv,
unsigned short  maxv 
)
private

get the column

Tuples::TupleObj::UShort * Tuples::TupleObj::ushorts ( const std::string &  name,
unsigned short  minv,
unsigned short  maxv 
)
private

get the column

Definition at line 538 of file TupleObj.cpp.

541 {
542  auto found = m_ushorts.find( name ) ;
543  if( m_ushorts.end() != found ) { return found->second.get() ; }
544  return create_(this, m_ushorts, name,
545  [&](const std::string& n, UShort& i)
546  { return this->tuple()->addItem(n,i,minv,maxv); });
547 }
UShorts m_ushorts
the actual storage of all 'unsigned int' columns
Definition: TupleObj.h:2283
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
NTuple::Item< unsigned short > UShort
basic type for unsigned int items
Definition: TupleObj.h:207
iterator end()
Definition: Map.h:132
iterator find(const key_type &key)
Definition: Map.h:149
StatusCode addItem(const std::string &name, Item< TYPE > &itm)
Add a scalar data item a N tuple.
Definition: NTuple.h:554
list i
Definition: ana.py:128
const std::string & name() const
get the name
Definition: TupleObj.h:2009
bool Tuples::TupleObj::valid ( ) const
inline

valid pointer to tuple ?

Definition at line 2053 of file TupleObj.h.

2053 { return 0 != tuple() ; }
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
bool Tuples::TupleObj::valid ( ) const
inline

valid pointer to tuple ?

Definition at line 2053 of file TupleObj.h.

2053 { return 0 != tuple() ; }
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
virtual StatusCode Tuples::TupleObj::Warning ( const std::string &  msg,
const StatusCode  sc = StatusCode::FAILURE 
) const
pure virtual
virtual StatusCode Tuples::TupleObj::Warning ( const std::string &  msg,
const StatusCode  sc = StatusCode::FAILURE 
) const
pure virtual
StatusCode Tuples::TupleObj::write ( )

write a record to NTuple

Returns
status code
StatusCode Tuples::TupleObj::write ( )

write a record to NTuple

Returns
status code

Definition at line 180 of file TupleObj.cpp.

181 {
182  if ( invalid() ) { return InvalidTuple ; }
183  return tuple()->write() ;
184 }
virtual StatusCode write()=0
Write record of the NTuple (Shortcut of writeRecord)
const NTuple::Tuple * tuple() const
provide the access to underlying Gaudi N-tuple
Definition: TupleObj.h:2014
bool invalid() const
invalid pointer to tuple ?
Definition: TupleObj.h:2056

Member Data Documentation

Addresses Tuples::TupleObj::m_addresses
mutableprivate

the actual storage of all 'Address' columns

Definition at line 2304 of file TupleObj.h.

FArrays Tuples::TupleObj::m_arraysf
mutableprivate

the actual storage of all 'FArray' columns (fixed)

Definition at line 2310 of file TupleObj.h.

Bools Tuples::TupleObj::m_bools
mutableprivate

the actual storage of all 'bool' columns

Definition at line 2271 of file TupleObj.h.

Chars Tuples::TupleObj::m_chars
mutableprivate

the actual storage of all 'Int' columns

Definition at line 2274 of file TupleObj.h.

CLID Tuples::TupleObj::m_clid
private

tuple CLID

Definition at line 2262 of file TupleObj.h.

Doubles Tuples::TupleObj::m_doubles
mutableprivate

the actual storage of all 'Double' columns

Definition at line 2301 of file TupleObj.h.

FArrays Tuples::TupleObj::m_farrays
mutableprivate

the actual storage of all 'FArray' columns

Definition at line 2307 of file TupleObj.h.

Floats Tuples::TupleObj::m_floats
mutableprivate

the actual storage of all 'Float' columns

Definition at line 2298 of file TupleObj.h.

FMatrices Tuples::TupleObj::m_fmatrices
mutableprivate

the actual storage of all 'FArray' columns

Definition at line 2313 of file TupleObj.h.

Ints Tuples::TupleObj::m_ints
mutableprivate

the actual storage of all 'Int' columns

Definition at line 2286 of file TupleObj.h.

ItemMap Tuples::TupleObj::m_items
private

all booked types:

Definition at line 2319 of file TupleObj.h.

LongLongs Tuples::TupleObj::m_longlongs
mutableprivate

the actual storage of all 'longlong' columns

Definition at line 2292 of file TupleObj.h.

FMatrices Tuples::TupleObj::m_matricesf
mutableprivate

the actual storage of all 'FMatrix' columns (fixed)

Definition at line 2316 of file TupleObj.h.

std::string Tuples::TupleObj::m_name
private

name

Definition at line 2256 of file TupleObj.h.

size_t Tuples::TupleObj::m_refCount = 0
private

reference counter

Definition at line 2268 of file TupleObj.h.

Shorts Tuples::TupleObj::m_shorts
mutableprivate

the actual storage of all 'Int' columns

Definition at line 2280 of file TupleObj.h.

NTuple::Tuple * Tuples::TupleObj::m_tuple
private

tuple itself

Definition at line 2259 of file TupleObj.h.

Tuples::Type Tuples::TupleObj::m_type
private

tuple 'type'

Definition at line 2265 of file TupleObj.h.

UChars Tuples::TupleObj::m_uchars
mutableprivate

the actual storage of all 'unsigned int' columns

Definition at line 2277 of file TupleObj.h.

UInts Tuples::TupleObj::m_uints
mutableprivate

the actual storage of all 'unsigned int' columns

Definition at line 2289 of file TupleObj.h.

ULongLongs Tuples::TupleObj::m_ulonglongs
mutableprivate

the actual storage of all 'ulonglong' columns

Definition at line 2295 of file TupleObj.h.

UShorts Tuples::TupleObj::m_ushorts
mutableprivate

the actual storage of all 'unsigned int' columns

Definition at line 2283 of file TupleObj.h.


The documentation for this class was generated from the following files: