1 #ifndef NPSTAT_STORABLEHISTONDFUNCTOR_HH_
2 #define NPSTAT_STORABLEHISTONDFUNCTOR_HH_
28 class Axis = HistoAxis,
29 class Converter = Same<Numeric>
33 template <
typename Num2,
typename Axis2,
typename Conv2>
54 const unsigned degree,
61 template <
class Num2,
class Conv2>
66 tab.accumulatedDataLabel().c_str()),
deg_(tab.
deg_) {}
100 virtual gs::ClassId
classId()
const {
return gs::ClassId(*
this);}
101 virtual bool write(std::ostream& of)
const;
108 const gs::ClassId&
id, std::istream&
in);
134 #include "Alignment/Geners/interface/binaryIO.hh"
135 #include "Alignment/Geners/interface/CPP11_auto_ptr.hh"
136 #include "Alignment/Geners/interface/IOException.hh"
141 template <
class Numeric,
class Axis,
class Converter>
143 const double*
point,
const unsigned dim)
const
148 template <
class Numeric,
class Axis,
class Converter>
151 static const std::string myClass(gs::template_class_name<Numeric,Axis>(
152 "npstat::StorableHistoNDFunctor"));
153 return myClass.c_str();
156 template <
class Numeric,
class Axis,
class Converter>
160 gs::write_pod(of, deg_);
164 template <
class Numeric,
class Axis,
class Converter>
167 const gs::ClassId&
id, std::istream&
in)
169 static const gs::ClassId current(
171 current.ensureSameId(
id);
174 gs::read_pod(in, &descr);
176 gs::read_pod(in, °);
177 gs::ClassId tabid(in, 1);
178 if (in.fail())
throw gs::IOReadFailure(
179 "In npstat::StorableHistoNDFunctor::read: "
180 "input stream failure");
185 template <
class Numeric,
class Axis,
class Converter>
189 validateInterDegree(deg,
table_.isUniformlyBinned());
193 template <
class Numeric,
class Axis,
class Converter>
195 const unsigned deg,
const bool isUniform)
197 const bool ok = isUniform ? (deg == 0 || deg == 1 || deg == 3) :
198 (deg == 0 || deg == 1);
201 "In npstat::StorableHistoNDFunctor::validateInterDegree: "
202 "unsupported interpolation degree");
207 #endif // NPSTAT_STORABLEHISTONDFUNCTOR_HH_
unsigned interpolationDegree() const
static HepMC::IO_HEPEVT conv
virtual double operator()(const double *point, unsigned dim) const
virtual bool isEqual(const StorableMultivariateFunctor &other) const
Interface definition for storable multivariate functors.
StorableHistoNDFunctor(const StorableHistoNDFunctor< Num2, Axis, Conv2 > &tab)
virtual bool write(std::ostream &of) const
Arbitrary-dimensional histogram template.
static void validateInterDegree(unsigned deg, bool isUniform)
static unsigned version()
const ArrayND< Numeric > & binContents() const
Exceptions for the npstat namespace.
const Table & interpolator() const
bool isUniformlyBinned() const
static StorableHistoNDFunctor * read(const gs::ClassId &id, std::istream &in)
virtual gs::ClassId classId() const
Interface definitions and concrete simple functors for a variety of functor-based calculations...
HistoND< Numeric, Axis > Table
virtual ~StorableHistoNDFunctor()
virtual unsigned minDim() const
static const char * classname()
ArrayND< Numeric > & table()
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)
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)