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