#include <StorableHistoNDFunctor.h>
Public Types | |
typedef HistoND< Numeric, Axis > | Table |
Public Member Functions | |
unsigned | interpolationDegree () const |
virtual unsigned | minDim () const |
virtual double | operator() (const double *point, unsigned dim) const |
void | setConverter (const Converter &conv) |
void | setInterpolationDegree (const unsigned deg) |
template<class Num2 , class Conv2 > | |
StorableHistoNDFunctor (const StorableHistoNDFunctor< Num2, Axis, Conv2 > &tab) | |
virtual | ~StorableHistoNDFunctor () |
template<class Num2 > | |
StorableHistoNDFunctor (const HistoND< Num2, Axis > &table, const unsigned degree=1) | |
template<class Num2 > | |
StorableHistoNDFunctor (const HistoND< Num2, Axis > &table, const unsigned degree, const std::string &descr) | |
Table & | interpolator () |
const Table & | interpolator () const |
ArrayND< Numeric > & | table () |
const ArrayND< Numeric > & | table () const |
virtual gs::ClassId | classId () const |
virtual bool | write (std::ostream &of) const |
Static Public Member Functions | |
static const char * | classname () |
static StorableHistoNDFunctor * | read (const gs::ClassId &id, std::istream &in) |
static unsigned | version () |
Protected Member Functions | |
virtual bool | isEqual (const StorableMultivariateFunctor &other) const |
Private Member Functions | |
StorableHistoNDFunctor () | |
Static Private Member Functions | |
static void | validateInterDegree (unsigned deg, bool isUniform) |
Private Attributes | |
Converter | conv_ |
unsigned | deg_ |
Table | table_ |
Friends | |
class | StorableHistoNDFunctor |
This class adapts HistoND template together with various histogram interpolation functions to the StorableMultivariateFunctor interface
Definition at line 31 of file StorableHistoNDFunctor.h.
typedef HistoND<Numeric,Axis> npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::Table |
Definition at line 37 of file StorableHistoNDFunctor.h.
npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::StorableHistoNDFunctor | ( | const HistoND< Num2, Axis > & | table, |
const unsigned | degree = 1 |
||
) | [inline] |
Constructor from a pre-existing histogram. The "degree" argument specifies the interpolation degree which can be 0, 1, or 3.
Definition at line 46 of file StorableHistoNDFunctor.h.
References npstat::HistoND< Numeric, Axis >::isUniformlyBinned(), and npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::validateInterDegree().
: StorableMultivariateFunctor(), table_(table), deg_(degree) {validateInterDegree(degree, table.isUniformlyBinned());}
npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::StorableHistoNDFunctor | ( | const HistoND< Num2, Axis > & | table, |
const unsigned | degree, | ||
const std::string & | descr | ||
) | [inline] |
Definition at line 52 of file StorableHistoNDFunctor.h.
References npstat::HistoND< Numeric, Axis >::isUniformlyBinned(), and npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::validateInterDegree().
: StorableMultivariateFunctor(descr), table_(table), deg_(degree) {validateInterDegree(degree, table.isUniformlyBinned());}
npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::StorableHistoNDFunctor | ( | const StorableHistoNDFunctor< Num2, Axis, Conv2 > & | tab | ) | [inline] |
Converting copy constructor
Definition at line 62 of file StorableHistoNDFunctor.h.
virtual npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::~StorableHistoNDFunctor | ( | ) | [inline, virtual] |
Definition at line 68 of file StorableHistoNDFunctor.h.
{}
npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::StorableHistoNDFunctor | ( | ) | [private] |
virtual gs::ClassId npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::classId | ( | ) | const [inline, virtual] |
Method related to "geners" I/O
Implements npstat::StorableMultivariateFunctor.
Definition at line 100 of file StorableHistoNDFunctor.h.
{return gs::ClassId(*this);}
const char * npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::classname | ( | ) | [inline, static] |
Reimplemented from npstat::StorableMultivariateFunctor.
Definition at line 149 of file StorableHistoNDFunctor.h.
References AlCaHLTBitMon_QueryRunRegistry::string.
{ static const std::string myClass(gs::template_class_name<Numeric,Axis>( "npstat::StorableHistoNDFunctor")); return myClass.c_str(); }
unsigned npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::interpolationDegree | ( | ) | const [inline] |
Retrieve interpolation degree
Definition at line 75 of file StorableHistoNDFunctor.h.
References npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::deg_.
{return deg_;}
Table& npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::interpolator | ( | ) | [inline] |
Retrieve the underlying HistoND object
Definition at line 82 of file StorableHistoNDFunctor.h.
References npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::table_.
{return table_;}
const Table& npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::interpolator | ( | ) | const [inline] |
Definition at line 83 of file StorableHistoNDFunctor.h.
References npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::table_.
{return table_;}
virtual bool npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::isEqual | ( | const StorableMultivariateFunctor & | ) | const [inline, protected, virtual] |
Method needed to compare objects for equality. Must be overriden by derived classes. It is left up to the derived classes to decide whether they should compare description strings in order to establish equality.
Implements npstat::StorableMultivariateFunctor.
Definition at line 111 of file StorableHistoNDFunctor.h.
References npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::deg_, npstat::StorableMultivariateFunctor::description(), alignCSCRings::r, and npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::table_.
{ // Note the use of static_cast rather than dynamic_cast below. // static_cast works faster and it is guaranteed to succeed here. const StorableHistoNDFunctor& r = static_cast<const StorableHistoNDFunctor&>(other); return table_ == r.table_ && deg_ == r.deg_ && this->description() == other.description(); }
virtual unsigned npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::minDim | ( | ) | const [inline, virtual] |
Minimum expected dimensionality
Implements npstat::AbsMultivariateFunctor.
Definition at line 70 of file StorableHistoNDFunctor.h.
References npstat::HistoND< Numeric, Axis >::dim(), and npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::table_.
double npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::operator() | ( | const double * | point, |
unsigned | dim | ||
) | const [virtual] |
Function value
Implements npstat::AbsMultivariateFunctor.
Definition at line 142 of file StorableHistoNDFunctor.h.
References npstat::interpolateHistoND(), and table_.
{ return conv_(interpolateHistoND(table_, point, dim, deg_)); }
StorableHistoNDFunctor< Numeric, Axis, Converter > * npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::read | ( | const gs::ClassId & | id, |
std::istream & | in | ||
) | [static] |
Reimplemented from npstat::StorableMultivariateFunctor.
Definition at line 166 of file StorableHistoNDFunctor.h.
References cond::rpcobimon::current, SiPixelLorentzAngle_cfi::read, AlCaHLTBitMon_QueryRunRegistry::string, and accesses::tab.
{ static const gs::ClassId current( gs::ClassId::makeId<StorableHistoNDFunctor<Numeric,Axis> >()); current.ensureSameId(id); std::string descr; gs::read_pod(in, &descr); unsigned deg; gs::read_pod(in, °); gs::ClassId tabid(in, 1); if (in.fail()) throw gs::IOReadFailure( "In npstat::StorableHistoNDFunctor::read: " "input stream failure"); CPP11_auto_ptr<Table> tab(Table::read(tabid, in)); return new StorableHistoNDFunctor(*tab, deg, descr); }
void npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::setConverter | ( | const Converter & | conv | ) | [inline] |
Change the coordinate converter
Definition at line 96 of file StorableHistoNDFunctor.h.
References conv, and npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::conv_.
void npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::setInterpolationDegree | ( | const unsigned | deg | ) | [inline] |
Set interpolation degree (0, 1, or 3)
Definition at line 186 of file StorableHistoNDFunctor.h.
References npstat::HistoND< Numeric, Axis >::isUniformlyBinned(), and table_.
{ validateInterDegree(deg, table_.isUniformlyBinned()); deg_ = deg; }
const ArrayND<Numeric>& npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::table | ( | ) | const [inline] |
Definition at line 91 of file StorableHistoNDFunctor.h.
References npstat::HistoND< Numeric, Axis >::binContents(), and npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::table_.
{return table_.binContents();}
ArrayND<Numeric>& npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::table | ( | ) | [inline] |
Retrieve the tabulated data
Definition at line 88 of file StorableHistoNDFunctor.h.
References npstat::HistoND< Numeric, Axis >::binContents(), and npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::table_.
{return const_cast<ArrayND<Numeric>&>(table_.binContents());}
void npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::validateInterDegree | ( | unsigned | deg, |
bool | isUniform | ||
) | [inline, static, private] |
Definition at line 194 of file StorableHistoNDFunctor.h.
References convertSQLiteXML::ok.
Referenced by npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::StorableHistoNDFunctor().
{ const bool ok = isUniform ? (deg == 0 || deg == 1 || deg == 3) : (deg == 0 || deg == 1); if (!ok) throw npstat::NpstatInvalidArgument( "In npstat::StorableHistoNDFunctor::validateInterDegree: " "unsupported interpolation degree"); }
static unsigned npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::version | ( | ) | [inline, static] |
Reimplemented from npstat::StorableMultivariateFunctor.
Definition at line 106 of file StorableHistoNDFunctor.h.
{return 1;}
bool npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::write | ( | std::ostream & | of | ) | const [virtual] |
Implements npstat::StorableMultivariateFunctor.
Definition at line 157 of file StorableHistoNDFunctor.h.
References npstat::HistoND< Numeric, Axis >::classId(), idDealer::description, table_, and npstat::HistoND< Numeric, Axis >::write().
friend class StorableHistoNDFunctor [friend] |
Definition at line 34 of file StorableHistoNDFunctor.h.
Converter npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::conv_ [private] |
Definition at line 126 of file StorableHistoNDFunctor.h.
Referenced by npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::setConverter().
unsigned npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::deg_ [private] |
Definition at line 125 of file StorableHistoNDFunctor.h.
Referenced by npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::interpolationDegree(), and npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::isEqual().
Table npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::table_ [private] |
Definition at line 124 of file StorableHistoNDFunctor.h.
Referenced by npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::interpolator(), npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::isEqual(), npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::minDim(), and npstat::StorableHistoNDFunctor< Numeric, Axis, Converter >::table().