npstat is hosted by Hepforge, IPPP Durham
NPStat  5.10.0

#include <InMemoryNtuple.hh>

Inheritance diagram for npstat::InMemoryNtuple< T >:
npstat::AbsNtuple< T >

Public Member Functions

 InMemoryNtuple (const std::vector< std::string > &colNames, const char *ntTitle=0)
 
unsigned long nRows () const
 
void fill (const T *values, unsigned long lenValues)
 
void fill (const T &v0)
 
void fill (const T &v0, const T &v1)
 
void fill (const T &v0, const T &v1, const T &v2)
 
void fill (const T &v0, const T &v1, const T &v2, const T &v3)
 
void fill (const T &v0, const T &v1, const T &v2, const T &v3, const T &v4)
 
void fill (const T &v0, const T &v1, const T &v2, const T &v3, const T &v4, const T &v5)
 
void fill (const T &v0, const T &v1, const T &v2, const T &v3, const T &v4, const T &v5, const T &v6)
 
void fill (const T &v0, const T &v1, const T &v2, const T &v3, const T &v4, const T &v5, const T &v6, const T &v7)
 
void fill (const T &v0, const T &v1, const T &v2, const T &v3, const T &v4, const T &v5, const T &v6, const T &v7, const T &v8)
 
void fill (const T &v0, const T &v1, const T &v2, const T &v3, const T &v4, const T &v5, const T &v6, const T &v7, const T &v8, const T &v9)
 
operator() (const unsigned long r, const unsigned long c) const
 
at (const unsigned long r, const unsigned long c) const
 
void clear ()
 
void rowContents (unsigned long row, T *buf, unsigned long lenBuf) const
 
void columnContents (const Column &c, T *buf, unsigned long lenBuf) const
 
virtual gs::ClassId classId () const
 
bool write (std::ostream &) const
 
- Public Member Functions inherited from npstat::AbsNtuple< T >
 AbsNtuple (const std::vector< std::string > &columnNames, const char *ntTitle)
 
const std::string & title () const
 
virtual void setTitle (const char *newtitle)
 
unsigned long nColumns () const
 
const std::string & columnName (const unsigned long i) const
 
const std::vector< std::string > & columnNames () const
 
virtual bool setColumnName (unsigned long i, const char *newname)
 
unsigned long columnNumber (const char *columnName) const
 
unsigned long validColumn (const char *columnName) const
 
unsigned long length () const
 
template<typename T2 >
void append (const AbsNtuple< T2 > &another)
 
element (unsigned long r, const Column &c) const
 
elementAt (unsigned long r, const Column &c) const
 
row_iterator row_begin (unsigned long rowNumber) const
 
row_iterator row_end () const
 
column_iterator column_begin (const Column &column) const
 
column_iterator column_end () const
 
template<class Accumulator >
void cycleOverRows (Accumulator &acc) const
 
template<class Filter , class Accumulator >
unsigned long conditionalCycleOverRows (const Filter &f, Accumulator &acc) const
 
template<class Filter >
unsigned long conditionalRowCount (const Filter &f) const
 
template<class Accumulator , class WeightCalc >
void weightedCycleOverRows (Accumulator &acc, const WeightCalc &wcalc, bool skipZeroWeights=false) const
 
template<class Filter , class Accumulator , class WeightCalc >
double weightedConditionalCycleOverRows (const Filter &f, Accumulator &acc, const WeightCalc &wcalc, bool skipZeroWeights=false) const
 
template<class Filter , class WeightCalc >
double weightedConditionalRowCount (const Filter &f, const WeightCalc &wcalc) const
 
std::vector< unsigned long > columnIndices (const Column &c0) const
 
std::vector< unsigned long > columnIndices (const Column &c0, const Column &c1) const
 
std::vector< unsigned long > columnIndices (const Column &c0, const Column &c1, const Column &c2) const
 
std::vector< unsigned long > columnIndices (const Column &c0, const Column &c1, const Column &c2, const Column &c3) const
 
std::vector< unsigned long > columnIndices (const Column &c0, const Column &c1, const Column &c2, const Column &c3, const Column &c4) const
 
std::vector< unsigned long > columnIndices (const Column &c0, const Column &c1, const Column &c2, const Column &c3, const Column &c4, const Column &c5) const
 
std::vector< unsigned long > columnIndices (const Column &c0, const Column &c1, const Column &c2, const Column &c3, const Column &c4, const Column &c5, const Column &c6) const
 
std::vector< unsigned long > columnIndices (const Column &c0, const Column &c1, const Column &c2, const Column &c3, const Column &c4, const Column &c5, const Column &c6, const Column &c7) const
 
std::vector< unsigned long > columnIndices (const Column &c0, const Column &c1, const Column &c2, const Column &c3, const Column &c4, const Column &c5, const Column &c6, const Column &c7, const Column &c8) const
 
std::vector< unsigned long > columnIndices (const Column &c0, const Column &c1, const Column &c2, const Column &c3, const Column &c4, const Column &c5, const Column &c6, const Column &c7, const Column &c8, const Column &c9) const
 
std::vector< unsigned long > columnIndices (const std::vector< std::string > &colNames) const
 
bool operator== (const AbsNtuple &r) const
 
bool operator!= (const AbsNtuple &r) const
 

Static Public Member Functions

static const char * classname ()
 
static unsigned version ()
 
static InMemoryNtupleread (const gs::ClassId &id, std::istream &in)
 

Protected Member Functions

virtual bool isEqual (const AbsNtuple< T > &other) const
 

Additional Inherited Members

- Public Types inherited from npstat::AbsNtuple< T >
typedef T value_type
 

Detailed Description

template<typename T>
class npstat::InMemoryNtuple< T >

Homogeneous ntuple which must fit in memory (so its size is limited). See ArchivedNtuple class if you need to create really large ntuples.

Constructor & Destructor Documentation

◆ InMemoryNtuple()

template<typename T >
npstat::InMemoryNtuple< T >::InMemoryNtuple ( const std::vector< std::string > &  colNames,
const char *  ntTitle = 0 
)
inlineexplicit

Constructor arguments are as follows:

colNames – naturally, the names of the ntuple columns

ntTitle – some title for the ntuple (arbitrary string)

Member Function Documentation

◆ at()

template<typename T >
T npstat::InMemoryNtuple< T >::at ( const unsigned long  r,
const unsigned long  c 
) const
inlinevirtual

Access individual elements with bounds checking

Implements npstat::AbsNtuple< T >.

◆ classId()

template<typename T >
virtual gs::ClassId npstat::InMemoryNtuple< T >::classId ( ) const
inlinevirtual

Method needed for "geners" I/O

Implements npstat::AbsNtuple< T >.

◆ clear()

template<typename T >
void npstat::InMemoryNtuple< T >::clear ( )
inlinevirtual

Clear all ntuple contents

Implements npstat::AbsNtuple< T >.

◆ columnContents()

template<typename T >
void npstat::InMemoryNtuple< T >::columnContents ( const Column c,
T *  buf,
unsigned long  lenBuf 
) const
virtual

Access one column at a time. The provided buffer should be sufficiently large to contain the complete column.

Implements npstat::AbsNtuple< T >.

◆ fill() [1/2]

template<typename T >
void npstat::InMemoryNtuple< T >::fill ( const T &  v0)
virtual

Convenience method which works if the number of arguments equals the number if colums (otherwise an exception will be thrown)

Implements npstat::AbsNtuple< T >.

◆ fill() [2/2]

template<typename T >
void npstat::InMemoryNtuple< T >::fill ( const T *  values,
unsigned long  lenValues 
)
virtual

Add data to the ntuple. Will throw std::invalid_argument in case lenValues is not divisible by the number of columns.

Implements npstat::AbsNtuple< T >.

◆ isEqual()

template<typename T >
virtual bool npstat::InMemoryNtuple< T >::isEqual ( const AbsNtuple< T > &  r) const
inlineprotectedvirtual

Comparison for equality to be overriden by the derived classes. Don't forget to call "isEqual" method of the base class.

Reimplemented from npstat::AbsNtuple< T >.

◆ nRows()

template<typename T >
unsigned long npstat::InMemoryNtuple< T >::nRows ( ) const
inlinevirtual

Number of rows. If the ntuple is always filled one row at a time, this is also the number of fills.

Implements npstat::AbsNtuple< T >.

◆ operator()()

template<typename T >
T npstat::InMemoryNtuple< T >::operator() ( const unsigned long  r,
const unsigned long  c 
) const
inlinevirtual

Access individual elements without bounds checking

Implements npstat::AbsNtuple< T >.

◆ rowContents()

template<typename T >
void npstat::InMemoryNtuple< T >::rowContents ( unsigned long  row,
T *  buf,
unsigned long  lenBuf 
) const
virtual

Access one row at a time. The provided buffer should be sufficiently large to contain the complete row.

Implements npstat::AbsNtuple< T >.


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