The Gaudi Framework
v29r0 (ff2e7097)
|
A simple wrapper class over standard Gaudi NTuple::Tuple facility. More...
#include <GaudiAlg/TupleObj.h>
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 |
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... | |
template<typename Value , typename... Args> | |
StatusCode | columns (Value &&value, Args &&...args) |
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<typename Iterator , template< typename, typename... > class Container = std::initializer_list, typename Fun = std::function<float( detail::const_ref_t<Iterator> )>, typename Item = std::pair<std::string, Fun>, typename = std::enable_if_t<!std::is_same<std::string, Container<Item>>::value>> | |
StatusCode | farray (const Container< Item > &items, Iterator first, Iterator last, const std::string &length, size_t maxv) |
Put arbitrary number of functions from one data array into LoKi-style N-Tuple simultaneously (effective!) More... | |
template<class FUNC1 , class FUNC2 , class Iterator > | |
StatusCode | farray (const std::string &name1, const FUNC1 &func1, const std::string &name2, const FUNC2 &func2, Iterator &&first, Iterator &&last, const std::string &length, size_t maxv) |
Put two functions from one data array into LoKi-style N-Tuple simultaneously (effective!) More... | |
template<class FUNC1 , class FUNC2 , class FUNC3 , class Iterator > | |
StatusCode | farray (const std::string &name1, const FUNC1 &func1, const std::string &name2, const FUNC2 &func2, const std::string &name3, const FUNC3 &func3, Iterator &&first, Iterator &&last, const std::string &length, size_t maxv) |
Put three functions from one data array into LoKi-style N-Tuple simultaneously (effective!) More... | |
template<class FUNC1 , class FUNC2 , class FUNC3 , class FUNC4 , class Iterator > | |
StatusCode | farray (const std::string &name1, const FUNC1 &func1, const std::string &name2, const FUNC2 &func2, const std::string &name3, const FUNC3 &func3, const std::string &name4, const FUNC4 &func4, Iterator &&first, Iterator &&last, const std::string &length, size_t maxv) |
Put four functions from one data array into LoKi-style N-Tuple simultaneously (effective!) 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::Tuple * | tuple () const |
provide the access to underlying Gaudi N-tuple More... | |
NTuple::Tuple * | tuple () |
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 CLID & | clid () 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 ItemMap & | items () 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... | |
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... | |
Private Member Functions | |
template<typename Tuple , typename Value , std::size_t... I> | |
StatusCode | columns_helper (const Value &value, const Tuple &tup, std::index_sequence< I... >) |
Set the values for several columns simultaneously, for the same object Non-existing columns will be automatically created and appended to the ntuple. More... | |
Int * | ints (const std::string &name, int minv, int maxv) |
get the column More... | |
FArray * | fArray (const std::string &name, Int *item) |
get the column More... | |
FArray * | fArray (const std::string &name, const MIndex &rows) |
get the column More... | |
Address * | addresses (const std::string &name) |
get the column More... | |
FMatrix * | fMatrix (const std::string &name, Int *item, const MIndex &cols) |
get the column More... | |
FMatrix * | fMatrix (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 | |
TupleObj & | operator= (const TupleObj &)=delete |
Private Attributes | |
std::string | m_name |
name More... | |
NTuple::Tuple * | m_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... | |
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
NTuple::Tuple
object using INTupleSvc
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:
One could fill some Tuple variables in one go
Even ALL variables could be filled in one go:
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'
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
)Definition at line 199 of file TupleObj.h.
basic type for address items
Definition at line 237 of file TupleObj.h.
|
private |
the actual storage type for address columns
Definition at line 2069 of file TupleObj.h.
typedef NTuple::Item<bool> Tuples::TupleObj::Bool |
basic type for int items
Definition at line 204 of file TupleObj.h.
|
private |
the actual storage type for short columns
Definition at line 2036 of file TupleObj.h.
typedef NTuple::Item<char> Tuples::TupleObj::Char |
basic type for int items
Definition at line 207 of file TupleObj.h.
|
private |
the actual storage type for short columns
Definition at line 2039 of file TupleObj.h.
typedef NTuple::Item<double> Tuples::TupleObj::Double |
basic type for double items
Definition at line 234 of file TupleObj.h.
|
private |
the actual storage type for float columns
Definition at line 2066 of file TupleObj.h.
typedef NTuple::Array<float> Tuples::TupleObj::FArray |
basic type for array of floats
Definition at line 240 of file TupleObj.h.
|
private |
the actual storage type for array columns
Definition at line 2072 of file TupleObj.h.
typedef NTuple::Item<float> Tuples::TupleObj::Float |
basic type for float items
Definition at line 231 of file TupleObj.h.
|
private |
the actual storage type for float columns
Definition at line 2063 of file TupleObj.h.
|
private |
the actual storage type for matrix columns
Definition at line 2075 of file TupleObj.h.
typedef NTuple::Matrix<float> Tuples::TupleObj::FMatrix |
basic type for matrix of floats
Definition at line 243 of file TupleObj.h.
typedef NTuple::Item<int> Tuples::TupleObj::Int |
basic type for int items
Definition at line 219 of file TupleObj.h.
|
private |
the actual storage type for integer columns
Definition at line 2051 of file TupleObj.h.
Definition at line 249 of file TupleObj.h.
typedef NTuple::Item<long long> Tuples::TupleObj::LongLong |
basic type for unsigned long long items
Definition at line 225 of file TupleObj.h.
|
private |
the actual storage type for longlong columns
Definition at line 2057 of file TupleObj.h.
typedef unsigned short Tuples::TupleObj::MIndex |
Definition at line 246 of file TupleObj.h.
typedef NTuple::Item<short> Tuples::TupleObj::Short |
basic type for int items
Definition at line 213 of file TupleObj.h.
|
private |
the actual storage type for short columns
Definition at line 2045 of file TupleObj.h.
typedef NTuple::Item<unsigned char> Tuples::TupleObj::UChar |
basic type for unsigned int items
Definition at line 210 of file TupleObj.h.
|
private |
the actual storage type for unsigned short columns
Definition at line 2042 of file TupleObj.h.
typedef NTuple::Item<unsigned int> Tuples::TupleObj::UInt |
basic type for unsigned int items
Definition at line 222 of file TupleObj.h.
|
private |
the actual storage type for unsigned integer columns
Definition at line 2054 of file TupleObj.h.
typedef NTuple::Item<unsigned long long> Tuples::TupleObj::ULongLong |
basic type for unsigned long long items
Definition at line 228 of file TupleObj.h.
|
private |
the actual storage type for ulonglong columns
Definition at line 2060 of file TupleObj.h.
typedef NTuple::Item<unsigned short> Tuples::TupleObj::UShort |
basic type for unsigned int items
Definition at line 216 of file TupleObj.h.
|
private |
the actual storage type for unsigned short columns
Definition at line 2048 of file TupleObj.h.
|
protected |
Standard constructor.
name | name of the object |
tuple | pointer to standard Gaudi NTuple::Tuple object |
clid | CLID_ColumnWiseTuple or CLID_RowWiseTuple |
type | the type of the tuple |
Definition at line 202 of file TupleObj.cpp.
|
protectedvirtual |
destructor is protected
Definition at line 215 of file TupleObj.cpp.
|
privatedelete |
delete the default/copy constructor and assignment
|
privatedelete |
|
inline |
add the item name into the list of known items
name | the name of the item |
type | the type of the item |
Definition at line 1986 of file TupleObj.h.
|
inline |
add the reference to TupleObj
Definition at line 1950 of file TupleObj.h.
|
private |
get the column
|
inline |
fill N-Tuple with fixed-size array
Sequence may be of any objects, implicitly convertible into "float"
name | N-Tuple entry name |
first | begin-iterator for data sequence |
last | end-iterator for data sequence |
fill the array
Definition at line 1587 of file TupleObj.h.
|
inline |
fill N-Tuple with fixed-size array
"ARRAY" must support indexing operations: e.g it coudl be of type:
The content of array should be implicitly convertible to "float"
name | N-Tuple entry name |
data | data sequence |
length | data length (fixed!) |
Definition at line 1651 of file TupleObj.h.
|
inline |
fill N-Tuple with fixed-size array
"ARRAY" is any sequence, which supports ARRAY::begin() and ARRAY::end() protocol, e.g.
The content of array should be implicitly convertible to "float"
name | N-Tupel entry name |
data | data sequence |
Definition at line 1692 of file TupleObj.h.
|
inline |
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
name | the name of the column |
value | the value of the variable |
Definition at line 315 of file TupleObj.cpp.
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.
name | the name of the column |
value | the value of the variable |
Definition at line 320 of file TupleObj.cpp.
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
name | the name of the column |
value | the value of the variable |
Definition at line 346 of file TupleObj.cpp.
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
name | name of the column |
value | value of the variable |
minv | minimum value of the variable |
maxv | maximum value of the variable |
Definition at line 351 of file TupleObj.cpp.
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
name | the name of the column |
value | the value of the variable |
Definition at line 356 of file TupleObj.cpp.
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
name | name of the column |
value | value of the variable |
minv | minimum value of the variable |
maxv | maximum value of the variable |
Definition at line 361 of file TupleObj.cpp.
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
name | the name of the column |
value | the value of the variable |
Definition at line 325 of file TupleObj.cpp.
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
name | name of the column |
value | value of the variable |
minv | minimum value of the variable |
maxv | maximum value of the variable |
Definition at line 330 of file TupleObj.cpp.
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
name | the name of the column |
value | the value of the variable |
Definition at line 335 of file TupleObj.cpp.
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
name | name of the column |
value | value of the variable |
minv | minimum value of the variable |
maxv | maximum value of the variable |
Definition at line 340 of file TupleObj.cpp.
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
name | name of the column |
value | value of the variable |
Definition at line 367 of file TupleObj.cpp.
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
name | name of the column |
value | value of the variable |
minv | minimum value of the variable |
maxv | maximum value of the variable |
Definition at line 372 of file TupleObj.cpp.
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
name | name of the column |
value | value of the variable |
Definition at line 382 of file TupleObj.cpp.
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
name | name of the column |
value | value of the variable |
minv | minimum value of the variable |
maxv | maximum value of the variable |
Definition at line 387 of file TupleObj.cpp.
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
name | the name of the column |
value | the value of the variable |
Definition at line 392 of file TupleObj.cpp.
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
name | name of the column |
value | value of the variable |
minv | minimum value of the variable |
maxv | maximum value of the variable |
Definition at line 400 of file TupleObj.cpp.
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
name | the name of the column |
value | the value of the variable |
Definition at line 409 of file TupleObj.cpp.
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
name | name of the column |
value | value of the variable |
minv | minimum value of the variable |
maxv | maximum value of the variable |
Definition at line 417 of file TupleObj.cpp.
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
name | name of the column |
value | value of the variable |
Definition at line 427 of file TupleObj.cpp.
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
name | name of the column |
value | value of the variable |
minv | minimum value of the variable |
maxv | maximum value of the variable |
Definition at line 432 of file TupleObj.cpp.
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
name | name of the column |
value | value of the variable |
Definition at line 437 of file TupleObj.cpp.
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
name | name of the column |
value | value of the variable |
minv | minimum value of the variable |
maxv | maximum value of the variable |
Definition at line 442 of file TupleObj.cpp.
|
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
name | the name of the column |
value | the value of tve variable |
Definition at line 707 of file TupleObj.h.
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
name | the name of the column |
value | the value of the variable |
Definition at line 448 of file TupleObj.cpp.
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.
name | name of the column ("Address" is a recommended convention!) |
address | IOpaqueAddress |
Definition at line 298 of file TupleObj.cpp.
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"
address | IOpaqueAddress |
Definition at line 312 of file TupleObj.cpp.
|
inline |
Useful shortcut to put LorentzVector directly into N-Tuple:
Definition at line 1793 of file TupleObj.h.
|
inline |
Useful shortcut to put 3D-Vector directly into N-Tuple:
Definition at line 1818 of file TupleObj.h.
|
inline |
Useful shortcut to put 3D-Vector directly into N-Tuple:
Definition at line 1842 of file TupleObj.h.
|
inline |
Definition at line 808 of file TupleObj.h.
|
inlineprivate |
Set the values for several columns simultaneously, for the same object Non-existing columns will be automatically created and appended to the ntuple.
Gaudi::XYZPoint::X()
Definition at line 792 of file TupleObj.h.
|
inline |
column wise NTuple ?
Definition at line 1965 of file TupleObj.h.
|
pure virtual |
Implemented in Tuples::detail::TupleObjImp< HANDLER1, HANDLER2 >.
|
inline |
Event collection ?
Definition at line 1971 of file TupleObj.h.
|
inline |
Add an indexed array (of type float) to N-tuple.
The method is not VERY efficient since it copies the data.
The name of "length" item can be reused for several arrays. The last assignement "wins"
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
name | name of N-tuple item |
first | begin of data sequence |
last | end of data sequence |
length | name of "length" item |
maxv | maximal length of array |
Definition at line 892 of file TupleObj.h.
|
inline |
Add an indexed array (of type float) to N-tuple.
it is just a small adaptor for the previous method
The name of "length" item can be reused for several arrays. The last assignment "wins"
Any sequence which provides begin()
and end()
methods can be used.
name | name of N-tuple item |
data | data sequence |
length | name of "length" item |
maxv | maximal length of array |
Definition at line 942 of file TupleObj.h.
|
inline |
Put an indexed array into LoKi-style N-Tuple.
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
name | tuple item name |
function | function to be applied |
first | begin of data sequence |
last | end of data sequence |
length | name of "length" tuple name |
maxv | maximal length of the array |
Definition at line 1010 of file TupleObj.h.
|
inline |
Put arbitrary number of functions from one data array into LoKi-style N-Tuple simultaneously (effective!)
items | vector of pairs { name, callable } |
first | begin of data sequence |
last | end of data sequence |
length | name of "length" tuple name |
maxv | maximal length of the array |
Definition at line 1077 of file TupleObj.h.
|
inline |
Put two functions from one data array into LoKi-style N-Tuple simultaneously (effective!)
name1 | the first tuple item name |
func1 | the first function to be applied |
name2 | the second tuple item name |
func2 | the second function to be applied |
first | begin of data sequence |
last | end of data sequence |
length | name of "length" tuple name |
maxv | maximal length of the array |
Definition at line 1158 of file TupleObj.h.
|
inline |
Put three functions from one data array into LoKi-style N-Tuple simultaneously (effective!)
name1 | the first tuple item name |
func1 | the first function to be applied |
name2 | the second tuple item name |
func2 | the second function to be applied |
name3 | the third tuple item name |
func3 | the third function to be applied |
first | begin of data sequence |
last | end of data sequence |
length | name of "length" tuple name |
maxv | maximal length of the array |
Definition at line 1202 of file TupleObj.h.
|
inline |
Put four functions from one data array into LoKi-style N-Tuple simultaneously (effective!)
name1 | the first tuple item name |
func1 | the first function to be applied |
name2 | the second tuple item name |
func2 | the second function to be applied |
name3 | the third tuple item name |
func3 | the third function to be applied |
name4 | the fourth tuple item name |
func4 | the fourth function to be applied |
first | begin of data sequence |
last | end of data sequence |
length | name of "length" tuple name |
maxv | maximal length of the array |
Definition at line 1250 of file TupleObj.h.
|
private |
get the column
Definition at line 455 of file TupleObj.cpp.
|
private |
get the column
Definition at line 468 of file TupleObj.cpp.
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
format | blank-separated list of variables, followed by variable number of arguments. |
double
numbers decode arguments
Definition at line 269 of file TupleObj.cpp.
|
inline |
Fill N-Tuple with data from variable-size matrix.
"Matrix" could be of any type, which supports data[iRow][iCol] indexing, e.g.
name | entry name in N-Tuple |
data | matrix itself |
rows | number of rows of matrix (variable) |
cols | number of columns of matrix (fixed) |
length | entry name in NTuple for number of matrix column |
maxv | maximal number of rows in matrix |
fill the matrix
Definition at line 1314 of file TupleObj.h.
|
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]
name | entry name in N-Tuple |
first | iterator for the first row of matrix |
last | iterator for the last row of matrix |
cols | number of columns for matrix (fixed!) |
length | entry name in NTuple for number of matrix column |
maxv | maximal number of rows in matrix |
fill the matrix
Definition at line 1392 of file TupleObj.h.
|
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) )
This method is very convenient e.g. for using within LoKi:
name | entry 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 |
length | entry name in NTuple for number of matrix column |
maxv | maximal number of rows in matrix |
fill the matrix
Definition at line 1516 of file TupleObj.h.
|
inline |
shortcut to put "ExtraInfo" fields of major into N-Tuple
Definition at line 1901 of file TupleObj.h.
|
private |
get the column
Definition at line 481 of file TupleObj.cpp.
|
private |
get the column
Definition at line 496 of file TupleObj.cpp.
|
inline |
check the uniqueness of the name
name | the name of the item |
Definition at line 1995 of file TupleObj.h.
|
private |
get the column
Definition at line 377 of file TupleObj.cpp.
|
inline |
|
inline |
|
inline |
fill N-Tuple with fixed-size matrix
"MATRIX" must support indexing operations: data[iRow][iCol]
e.g it could be of type:
The content of MATRIX should be implicitly convertible to "float"
name | N-Tuple entry name |
data | data source (matrix) |
cols | number of columns |
rows | number of rows |
fill the matrix
Definition at line 1750 of file TupleObj.h.
|
inline |
shortcut to put Smatrix into N-tuple:
fill the matrix
Definition at line 1858 of file TupleObj.h.
|
inline |
|
inline |
The function allows to add almost arbitrary object into N-tuple.
name | column name |
obj | pointer to the object |
Definition at line 121 of file TuplePut.h.
|
inline |
return the reference counter
Definition at line 1945 of file TupleObj.h.
void Tuples::TupleObj::release | ( | ) |
release the reference to TupleObj if reference counter becomes zero, object will be automatically deleted
Definition at line 225 of file TupleObj.cpp.
|
inline |
row wise NTuple ?
Definition at line 1968 of file TupleObj.h.
|
inline |
provide the access to underlying Gaudi N-tuple
Definition at line 1935 of file TupleObj.h.
|
inline |
provide the access to underlying Gaudi N-tuple
Definition at line 1940 of file TupleObj.h.
|
inline |
|
inline |
valid pointer to tuple ?
Definition at line 1974 of file TupleObj.h.
|
pure virtual |
Implemented in Tuples::detail::TupleObjImp< HANDLER1, HANDLER2 >.
StatusCode Tuples::TupleObj::write | ( | ) |
write a record to NTuple
Definition at line 237 of file TupleObj.cpp.
|
mutableprivate |
the actual storage of all 'Address' columns
Definition at line 2128 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'FArray' columns (fixed)
Definition at line 2134 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'bool' columns
Definition at line 2095 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'Int' columns
Definition at line 2098 of file TupleObj.h.
|
private |
tuple CLID
Definition at line 2086 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'Double' columns
Definition at line 2125 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'FArray' columns
Definition at line 2131 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'Float' columns
Definition at line 2122 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'FArray' columns
Definition at line 2137 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'Int' columns
Definition at line 2110 of file TupleObj.h.
|
private |
all booked types:
Definition at line 2143 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'longlong' columns
Definition at line 2116 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'FMatrix' columns (fixed)
Definition at line 2140 of file TupleObj.h.
|
private |
name
Definition at line 2080 of file TupleObj.h.
|
private |
reference counter
Definition at line 2092 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'Int' columns
Definition at line 2104 of file TupleObj.h.
|
private |
tuple itself
Definition at line 2083 of file TupleObj.h.
|
private |
tuple 'type'
Definition at line 2089 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'unsigned int' columns
Definition at line 2101 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'unsigned int' columns
Definition at line 2113 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'ulonglong' columns
Definition at line 2119 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'unsigned int' columns
Definition at line 2107 of file TupleObj.h.