Go to the documentation of this file.
14 #ifndef GAUDI_NTUPLESVC_NTUPLEITEMS_H
15 #define GAUDI_NTUPLESVC_NTUPLEITEMS_H 1
18 #define ALLOW_ALL_TYPES
111 for (
int l = 0;
l < nd - 1;
l++ ) { len *=
dim(
l ); }
115 }
else if ( nd > 0 ) {
116 len *=
dim( nd - 1 );
154 const void*
buffer()
const override {
return this->m_buffer; }
156 virtual void*
buffer() {
return this->m_buffer; }
158 long ndim()
const override {
return 0; }
160 long dim(
long i )
const override {
return ( i == 0 ) ? 1 : 0; }
168 class _ItemImp :
virtual public _DataImp<TYP>,
virtual public _Item<TYP> {
175 :
_DataImp<TYP>( tup,
name, info,
"", 1, min, max, def ) {}
179 void setDefault(
const TYP val )
override { this->m_def = val; }
183 long size()
const override {
return this->m_length *
sizeof( TYP ); }
189 class _ArrayImp :
virtual public _DataImp<TYP>,
virtual public _Array<TYP> {
195 TYP min, TYP max, TYP def )
200 void setDefault(
const TYP val )
override { this->m_def = val; }
204 long size()
const override {
return this->m_length *
sizeof( TYP ); }
206 long ndim()
const override {
return 1; }
208 long dim(
long i )
const override {
return ( i != 0 || this->hasIndex() ) ? 0 : this->m_length; }
214 class _MatrixImp :
virtual public _DataImp<TYP>,
virtual public _Matrix<TYP> {
220 long nrow, TYP min, TYP max, TYP def )
227 void setDefault(
const TYP val )
override { this->m_def = val; }
231 long size()
const override {
return this->m_length *
sizeof( TYP ); }
233 long ndim()
const override {
return 2; }
235 long dim(
long i )
const override {
236 return ( this->hasIndex() ) ? ( ( i == 0 ) ? this->m_rows : this->m_length / this->m_rows )
237 : ( ( i == 1 ) ? this->m_length / this->m_rows : this->m_rows );
241 #endif // GAUDI_NTUPLESVC_NTUPLEITEMS_H
Range< TYP > ItemRange
Set type definition to make life more easy easy.
const INTupleItem * indexItem() const override
Pointer to index column (if present, 0 else) (CONST)
static Type ID(const bool)
Access to type information: bool.
const ItemRange & range() const override
Access the range if specified.
long length() const override
Access the buffer length.
void setDefault(const TYP val) override
Set default value.
void setDefault(const TYP val) override
Compiler type ID.
long size() const override
Size of entire object.
Range< TYP > ItemRange
Set type definition to make life more easy easy.
const std::type_info & CTYPE
std::string typeName() const override
Get proper type name.
std::string m_index
Check that values are within a certain range while filling.
_ItemImp(INTuple *tup, const std::string &name, const std::type_info &info, TYP min, TYP max, TYP def)
Standard Constructor.
_ArrayImp(INTuple *tup, const std::string &name, const std::type_info &typ, const std::string &index, long len, TYP min, TYP max, TYP def)
Standard Constructor.
long m_length
Entire buffer length.
void release() override
Destruct object.
long size() const override
Size of entire object.
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
virtual const INTupleItem * find(const std::string &name) const =0
Find an item row of the Ntuple (CONST)
const std::string & index() const override
Access the index _Column.
Concrete class discribing basic data items in an N tuple.
void setDefault(const TYP val) override
Compiler type ID.
void setType(long t) override
Set the properties of the _Column.
long ndim() const override
Dimension.
Abstract class describing basic data in an Ntuple.
long dim(long i) const override
Access individual dimensions.
const void * buffer() const override
Access data buffer (CONST)
INTuple * tuple() override
Access to hosting ntuple.
Range< TYP > ItemRange
Set type definition to make life more easy easy.
long size() const override
Size of entire object.
virtual const void * buffer() const =0
Access data buffer (CONST)
DataTypeInfo::Type m_type
_Column type
const ItemRange & range() const override
Access the range if specified.
void setDefault(const TYP val) override
Compiler type ID.
Concrete class discribing a column-array in a N tuple.
~_DataImp() override
Standard destructor.
const std::string & name() const override
Access _Column name.
INTuple * m_tuple
Pointer to N tuple.
const std::type_info & m_info
Item type information.
Range< TYP > ItemRange
Set type definition to make life more easy easy.
_MatrixImp(INTuple *tup, const std::string &name, const std::type_info &typ, const std::string &index, long ncol, long nrow, TYP min, TYP max, TYP def)
Standard Constructor.
Concrete class discribing a matrix column in a N tuple.
long filled() const override
Number of items filled.
Range< TYP > m_range
Check that values are within a certain range while filling.
const ItemRange & range() const override
Access the range if specified.
INTupleItem * m_indexItem
Pointer to index item.
INTupleItem * indexItem() override
Pointer to index column (if present, 0 else)
long dim(long i) const override
Access individual dimensions.
const ItemRange & range() const override
Access the range if specified.
long ndim() const override
Dimension.
virtual void * buffer()
Access data buffer.
std::string m_name
_Column name
_DataImp(const _DataImp &)=delete
Inhibit Copy Constructor.
long dim(long i) const override
Access individual dimensions.
const std::type_info & typeID() const override
Compiler type ID.
TYP m_def
Buffer with default value.
bool hasIndex() const override
Is the tuple have an index column?
long ndim() const override
Dimension.
void reset() override
Reset to default.
long type() const override
TYP information of the item.
_DataImp(INTuple *tup, std::string name, const std::type_info &info, std::string index, long len, TYP low, TYP high, TYP def)
Standard Constructor.
size_t index(const Gaudi::ParticleProperty *property, const Gaudi::Interfaces::IParticlePropertySvc *service)
helper utility for mapping of Gaudi::ParticleProperty object into non-negative integral sequential id...
Concrete class discribing a column in a N tuple.
long size() const override
Size of entire object.