|
|
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>
89 gs::ClassId
classId()
const override {
return gs::ClassId(*
this); }
90 bool write(std::ostream& of)
const override;
95 static inline unsigned version() {
return 1; }
119 #include "Alignment/Geners/interface/binaryIO.hh"
120 #include "Alignment/Geners/interface/CPP11_auto_ptr.hh"
121 #include "Alignment/Geners/interface/IOException.hh"
126 template <
class Numeric,
class Axis,
class Converter>
131 template <
class Numeric,
class Axis,
class Converter>
133 static const std::string myClass(gs::template_class_name<Numeric, Axis>(
"npstat::StorableHistoNDFunctor"));
134 return myClass.c_str();
137 template <
class Numeric,
class Axis,
class Converter>
140 gs::write_pod(of, deg_);
144 template <
class Numeric,
class Axis,
class Converter>
146 const gs::ClassId&
id, std::istream&
in) {
148 current.ensureSameId(
id);
151 gs::read_pod(
in, &descr);
153 gs::read_pod(
in, °);
154 gs::ClassId tabid(
in, 1);
156 throw gs::IOReadFailure(
157 "In npstat::StorableHistoNDFunctor::read: "
158 "input stream failure");
163 template <
class Numeric,
class Axis,
class Converter>
165 validateInterDegree(deg,
table_.isUniformlyBinned());
169 template <
class Numeric,
class Axis,
class Converter>
171 const bool isUniform) {
172 const bool ok = isUniform ? (deg == 0 || deg == 1 || deg == 3) : (deg == 0 || deg == 1);
175 "In npstat::StorableHistoNDFunctor::validateInterDegree: "
176 "unsupported interpolation degree");
180 #endif // NPSTAT_STORABLEHISTONDFUNCTOR_HH_
gs::ClassId classId() const override
static void validateInterDegree(unsigned deg, bool isUniform)
bool isEqual(const StorableMultivariateFunctor &other) const override
static HepMC::IO_HEPEVT conv
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.