The Gaudi Framework
v30r3 (a5ef0a68)
|
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 | |
virtual | ~TupleObj () |
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) |
Set the values for several columns simultaneously, for the same object Non-existing columns will be automatically created and appended to the 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<typename FunIterator , typename DataIterator > | |
StatusCode | farray_impl (FunIterator first_item, FunIterator last_item, DataIterator first, DataIterator last, const std::string &length, size_t maxv) |
Put arbitrary number of functions from one data array into LoKi-style N-Tuple simultaneously (effective!) More... | |
template<typename DataIterator , template< typename, typename... > class Container = std::initializer_list, typename NamedFunction = std::pair<std::string, std::function<float( detail::const_ref_t<DataIterator> )>>, typename = std::enable_if_t<!std::is_convertible<Container<NamedFunction>, std::string>::value>> | |
StatusCode | farray (const Container< NamedFunction > &funs, DataIterator first, DataIterator last, const std::string &length, size_t maxv) |
template<typename NamedFunctions , typename DataIterator , typename = std::enable_if_t<!std::is_convertible<NamedFunctions, std::string>::value>> | |
StatusCode | farray (const NamedFunctions &funs, DataIterator first, DataIterator last, const std::string &length, size_t maxv) |
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... | |
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... | |
Private Types | |
template<typename T > | |
using | ColumnStorage = GaudiUtils::HashMap< std::string, std::unique_ptr< T >> |
Private Member Functions | |
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 (const TupleObj &)=delete | |
delete the copy constructor and assignment More... | |
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... | |
ColumnStorage< Bool > | m_bools |
the actual storage of all 'bool' columns More... | |
ColumnStorage< Char > | m_chars |
the actual storage of all 'Int' columns More... | |
ColumnStorage< UChar > | m_uchars |
the actual storage of all 'unsigned int' columns More... | |
ColumnStorage< Short > | m_shorts |
the actual storage of all 'Int' columns More... | |
ColumnStorage< UShort > | m_ushorts |
the actual storage of all 'unsigned int' columns More... | |
ColumnStorage< Int > | m_ints |
the actual storage of all 'Int' columns More... | |
ColumnStorage< UInt > | m_uints |
the actual storage of all 'unsigned int' columns More... | |
ColumnStorage< LongLong > | m_longlongs |
the actual storage of all 'longlong' columns More... | |
ColumnStorage< ULongLong > | m_ulonglongs |
the actual storage of all 'ulonglong' columns More... | |
ColumnStorage< Float > | m_floats |
the actual storage of all 'Float' columns More... | |
ColumnStorage< Double > | m_doubles |
the actual storage of all 'Double' columns More... | |
ColumnStorage< Address > | m_addresses |
the actual storage of all 'Address' columns More... | |
ColumnStorage< FArray > | m_farrays |
the actual storage of all 'FArray' columns More... | |
ColumnStorage< FArray > | m_arraysf |
the actual storage of all 'FArray' columns (fixed) More... | |
ColumnStorage< FMatrix > | m_fmatrices |
the actual storage of all 'FArray' columns More... | |
ColumnStorage< FMatrix > | 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 204 of file TupleObj.h.
basic type for address items
Definition at line 242 of file TupleObj.h.
typedef NTuple::Item<bool> Tuples::TupleObj::Bool |
basic type for int items
Definition at line 209 of file TupleObj.h.
typedef NTuple::Item<char> Tuples::TupleObj::Char |
basic type for int items
Definition at line 212 of file TupleObj.h.
|
private |
Definition at line 1989 of file TupleObj.h.
typedef NTuple::Item<double> Tuples::TupleObj::Double |
basic type for double items
Definition at line 239 of file TupleObj.h.
typedef NTuple::Array<float> Tuples::TupleObj::FArray |
basic type for array of floats
Definition at line 245 of file TupleObj.h.
typedef NTuple::Item<float> Tuples::TupleObj::Float |
basic type for float items
Definition at line 236 of file TupleObj.h.
typedef NTuple::Matrix<float> Tuples::TupleObj::FMatrix |
basic type for matrix of floats
Definition at line 248 of file TupleObj.h.
typedef NTuple::Item<int> Tuples::TupleObj::Int |
basic type for int items
Definition at line 224 of file TupleObj.h.
Definition at line 254 of file TupleObj.h.
typedef NTuple::Item<long long> Tuples::TupleObj::LongLong |
basic type for unsigned long long items
Definition at line 230 of file TupleObj.h.
typedef unsigned short Tuples::TupleObj::MIndex |
Definition at line 251 of file TupleObj.h.
typedef NTuple::Item<short> Tuples::TupleObj::Short |
basic type for int items
Definition at line 218 of file TupleObj.h.
typedef NTuple::Item<unsigned char> Tuples::TupleObj::UChar |
basic type for unsigned int items
Definition at line 215 of file TupleObj.h.
typedef NTuple::Item<unsigned int> Tuples::TupleObj::UInt |
basic type for unsigned int items
Definition at line 227 of file TupleObj.h.
typedef NTuple::Item<unsigned long long> Tuples::TupleObj::ULongLong |
basic type for unsigned long long items
Definition at line 233 of file TupleObj.h.
typedef NTuple::Item<unsigned short> Tuples::TupleObj::UShort |
basic type for unsigned int items
Definition at line 221 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 226 of file TupleObj.cpp.
|
virtual |
Definition at line 239 of file TupleObj.cpp.
|
privatedelete |
delete the copy constructor and assignment
|
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 1926 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 1561 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 1619 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 1660 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 709 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 302 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 1755 of file TupleObj.h.
|
inline |
Useful shortcut to put 3D-Vector directly into N-Tuple:
Definition at line 1780 of file TupleObj.h.
|
inline |
Useful shortcut to put 3D-Vector directly into N-Tuple:
Definition at line 1804 of file TupleObj.h.
|
inline |
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 794 of file TupleObj.h.
|
inline |
column wise NTuple ?
Definition at line 1905 of file TupleObj.h.
|
pure virtual |
Implemented in Tuples::detail::TupleObjImp< HANDLER1, HANDLER2 >.
|
inline |
Event collection ?
Definition at line 1911 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 884 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 934 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 1002 of file TupleObj.h.
|
inline |
Definition at line 1107 of file TupleObj.h.
|
inline |
Definition at line 1116 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 1155 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 1199 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 1247 of file TupleObj.h.
|
private |
get the column
Definition at line 455 of file TupleObj.cpp.
|
private |
get the column
Definition at line 466 of file TupleObj.cpp.
|
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 1060 of file TupleObj.h.
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 277 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 1311 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 1381 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 1497 of file TupleObj.h.
|
inline |
shortcut to put "ExtraInfo" fields of major into N-Tuple
Definition at line 1857 of file TupleObj.h.
|
private |
get the column
Definition at line 477 of file TupleObj.cpp.
|
private |
get the column
Definition at line 490 of file TupleObj.cpp.
|
inline |
check the uniqueness of the name
name | the name of the item |
Definition at line 1935 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 1718 of file TupleObj.h.
|
inline |
shortcut to put Smatrix into N-tuple:
fill the matrix
Definition at line 1820 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 116 of file TuplePut.h.
|
inline |
row wise NTuple ?
Definition at line 1908 of file TupleObj.h.
|
inline |
provide the access to underlying Gaudi N-tuple
Definition at line 1891 of file TupleObj.h.
|
inline |
provide the access to underlying Gaudi N-tuple
Definition at line 1896 of file TupleObj.h.
|
inline |
|
inline |
valid pointer to tuple ?
Definition at line 1914 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 247 of file TupleObj.cpp.
|
mutableprivate |
the actual storage of all 'Address' columns
Definition at line 2025 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'FArray' columns (fixed)
Definition at line 2031 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'bool' columns
Definition at line 1992 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'Int' columns
Definition at line 1995 of file TupleObj.h.
|
private |
tuple CLID
Definition at line 1979 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'Double' columns
Definition at line 2022 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'FArray' columns
Definition at line 2028 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'Float' columns
Definition at line 2019 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'FArray' columns
Definition at line 2034 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'Int' columns
Definition at line 2007 of file TupleObj.h.
|
private |
all booked types:
Definition at line 2040 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'longlong' columns
Definition at line 2013 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'FMatrix' columns (fixed)
Definition at line 2037 of file TupleObj.h.
|
private |
name
Definition at line 1973 of file TupleObj.h.
|
private |
reference counter
Definition at line 1985 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'Int' columns
Definition at line 2001 of file TupleObj.h.
|
private |
tuple itself
Definition at line 1976 of file TupleObj.h.
|
private |
tuple 'type'
Definition at line 1982 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'unsigned int' columns
Definition at line 1998 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'unsigned int' columns
Definition at line 2010 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'ulonglong' columns
Definition at line 2016 of file TupleObj.h.
|
mutableprivate |
the actual storage of all 'unsigned int' columns
Definition at line 2004 of file TupleObj.h.