|
|
Go to the documentation of this file. 1 #ifndef NPSTAT_STORABLEHISTONDFUNCTOR_HH_
2 #define NPSTAT_STORABLEHISTONDFUNCTOR_HH_
25 template <
class Numeric,
class Axis = HistoAxis,
class Converter = Same<Numeric> >
27 template <
typename Num2,
typename Axis2,
typename Conv2>
53 template <
class Num2,
class Conv2>
92 gs::ClassId
classId()
const override {
return gs::ClassId(*
this); }
93 bool write(std::ostream& of)
const override;
98 static inline unsigned version() {
return 1; }
120 #include "Alignment/Geners/interface/binaryIO.hh"
121 #include "Alignment/Geners/interface/CPP11_auto_ptr.hh"
122 #include "Alignment/Geners/interface/IOException.hh"
127 template <
class Numeric,
class Axis,
class Converter>
132 template <
class Numeric,
class Axis,
class Converter>
134 static const std::string myClass(gs::template_class_name<Numeric, Axis>(
"npstat::StorableHistoNDFunctor"));
135 return myClass.c_str();
138 template <
class Numeric,
class Axis,
class Converter>
141 gs::write_pod(of, deg_);
145 template <
class Numeric,
class Axis,
class Converter>
147 const gs::ClassId&
id, std::istream&
in) {
149 current.ensureSameId(
id);
152 gs::read_pod(
in, &descr);
154 gs::read_pod(
in, °);
155 gs::ClassId tabid(
in, 1);
157 throw gs::IOReadFailure(
158 "In npstat::StorableHistoNDFunctor::read: "
159 "input stream failure");
164 template <
class Numeric,
class Axis,
class Converter>
166 validateInterDegree(deg,
table_.isUniformlyBinned());
170 template <
class Numeric,
class Axis,
class Converter>
172 const bool isUniform) {
173 const bool ok = isUniform ? (deg == 0 || deg == 1 || deg == 3) : (deg == 0 || deg == 1);
176 "In npstat::StorableHistoNDFunctor::validateInterDegree: "
177 "unsupported interpolation degree");
181 #endif // NPSTAT_STORABLEHISTONDFUNCTOR_HH_
gs::ClassId classId() const override
static void validateInterDegree(unsigned deg, bool isUniform)
bool isEqual(const StorableMultivariateFunctor &other) const override
StorableHistoNDFunctor()=delete
const std::string & description() const
StorableHistoNDFunctor(const StorableHistoNDFunctor< Num2, Axis, Conv2 > &tab)
StorableHistoNDFunctor(const HistoND< Num2, Axis > &table, const unsigned degree, const std::string &descr)
unsigned minDim() const override
const ArrayND< Numeric > & table() const
StorableHistoNDFunctor(const HistoND< Num2, Axis > &table, const unsigned degree=1)
HistoND< Numeric, Axis > Table
Interface definitions and concrete simple functors for a variety of functor-based calculations.
unsigned interpolationDegree() const
void setInterpolationDegree(const unsigned deg)
Float interpolateHistoND(const HistoND< Float, Axis > &histo, const double *coords, unsigned coordsDim, unsigned interpolationDegree)
static unsigned version()
static const char * classname()
double operator()(const double *point, unsigned dim) const override
bool write(std::ostream &of) const override
const Table & interpolator() const
ArrayND< Numeric > & table()
Interface definition for storable multivariate functors.
void setConverter(const Converter &conv)
static StorableHistoNDFunctor * read(const gs::ClassId &id, std::istream &in)
const ArrayND< Numeric > & binContents() const
Interpolate histogram contents.
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Exceptions for the npstat namespace.
~StorableHistoNDFunctor() override
Arbitrary-dimensional histogram template.