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_
unsigned interpolationDegree() const
StorableHistoNDFunctor()=delete
Interface definition for storable multivariate functors.
StorableHistoNDFunctor(const StorableHistoNDFunctor< Num2, Axis, Conv2 > &tab)
bool write(std::ostream &of) const override
Arbitrary-dimensional histogram template.
static void validateInterDegree(unsigned deg, bool isUniform)
const std::string & description() const
static unsigned version()
Exceptions for the npstat namespace.
bool isEqual(const StorableMultivariateFunctor &other) const override
~StorableHistoNDFunctor() override
const ArrayND< Numeric > & binContents() const
static StorableHistoNDFunctor * read(const gs::ClassId &id, std::istream &in)
Interface definitions and concrete simple functors for a variety of functor-based calculations...
const ArrayND< Numeric > & table() const
static const char * classname()
double operator()(const double *point, unsigned dim) const override
ArrayND< Numeric > & table()
HistoND< Numeric, Axis > Table
gs::ClassId classId() const override
StorableHistoNDFunctor(const HistoND< Num2, Axis > &table, const unsigned degree, const std::string &descr)
Float interpolateHistoND(const HistoND< Float, Axis > &histo, const double *coords, unsigned coordsDim, unsigned interpolationDegree)
StorableHistoNDFunctor(const HistoND< Num2, Axis > &table, const unsigned degree=1)
unsigned minDim() const override
const Table & interpolator() const
void setInterpolationDegree(const unsigned deg)
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
void setConverter(const Converter &conv)