CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | Friends
npstat::StorableInterpolationFunctor< Numeric, Axis, Converter > Class Template Reference

#include <StorableInterpolationFunctor.h>

Inheritance diagram for npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >:
npstat::StorableMultivariateFunctor npstat::AbsMultivariateFunctor

Public Types

typedef LinInterpolatedTableND< Numeric, Axis > Table
 

Public Member Functions

unsigned minDim () const override
 
double operator() (const double *point, unsigned dim) const override
 
void setConverter (const Converter &conv)
 
template<class Num2 , class Conv2 >
 StorableInterpolationFunctor (const StorableInterpolationFunctor< Num2, Axis, Conv2 > &tab)
 
 StorableInterpolationFunctor ()=delete
 
 ~StorableInterpolationFunctor () override
 
template<class Num2 >
 StorableInterpolationFunctor (const LinInterpolatedTableND< Num2, Axis > &table)
 
template<class Num2 >
 StorableInterpolationFunctor (const LinInterpolatedTableND< Num2, Axis > &table, const std::string &descr)
 
 StorableInterpolationFunctor (const std::vector< Axis > &axes, const std::vector< std::pair< bool, bool > > &interpolationType, const char *functionLabel=nullptr)
 
 StorableInterpolationFunctor (const Axis &xAxis, bool leftX, bool rightX, const char *functionLabel=nullptr)
 
 StorableInterpolationFunctor (const Axis &xAxis, bool leftX, bool rightX, const Axis &yAxis, bool leftY, bool rightY, const char *functionLabel=nullptr)
 
 StorableInterpolationFunctor (const Axis &xAxis, bool leftX, bool rightX, const Axis &yAxis, bool leftY, bool rightY, const Axis &zAxis, bool leftZ, bool rightZ, const char *functionLabel=nullptr)
 
 StorableInterpolationFunctor (const Axis &xAxis, bool leftX, bool rightX, const Axis &yAxis, bool leftY, bool rightY, const Axis &zAxis, bool leftZ, bool rightZ, const Axis &tAxis, bool leftT, bool rightT, const char *functionLabel=nullptr)
 
 StorableInterpolationFunctor (const Axis &xAxis, bool leftX, bool rightX, const Axis &yAxis, bool leftY, bool rightY, const Axis &zAxis, bool leftZ, bool rightZ, const Axis &tAxis, bool leftT, bool rightT, const Axis &vAxis, bool leftV, bool rightV, const char *functionLabel=nullptr)
 
Tableinterpolator ()
 
const Tableinterpolator () const
 
ArrayND< Numeric > & table ()
 
const ArrayND< Numeric > & table () const
 
gs::ClassId classId () const override
 
bool write (std::ostream &of) const override
 
- Public Member Functions inherited from npstat::StorableMultivariateFunctor
const std::string & description () const
 
void setDescription (const std::string &newDescription)
 
 StorableMultivariateFunctor ()
 
 StorableMultivariateFunctor (const std::string &descr)
 
void validateDescription (const std::string &description) const
 
 ~StorableMultivariateFunctor () override
 
bool operator== (const StorableMultivariateFunctor &r) const
 
bool operator!= (const StorableMultivariateFunctor &r) const
 
- Public Member Functions inherited from npstat::AbsMultivariateFunctor
virtual unsigned maxDim () const
 
virtual ~AbsMultivariateFunctor ()
 

Static Public Member Functions

static const char * classname ()
 
static StorableInterpolationFunctorread (const gs::ClassId &id, std::istream &in)
 
static unsigned version ()
 
- Static Public Member Functions inherited from npstat::StorableMultivariateFunctor
static const char * classname ()
 
static StorableMultivariateFunctorread (const gs::ClassId &id, std::istream &in)
 
static unsigned version ()
 

Protected Member Functions

bool isEqual (const StorableMultivariateFunctor &other) const override
 

Private Attributes

Converter conv_
 
Table table_
 

Friends

template<typename Num2 , typename Axis2 , typename Conv2 >
class StorableInterpolationFunctor
 

Detailed Description

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
class npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >

This class adapts LinInterpolatedTableND template to the StorableMultivariateFunctor interface

Definition at line 25 of file StorableInterpolationFunctor.h.

Member Typedef Documentation

◆ Table

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
typedef LinInterpolatedTableND<Numeric, Axis> npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::Table

Definition at line 30 of file StorableInterpolationFunctor.h.

Constructor & Destructor Documentation

◆ StorableInterpolationFunctor() [1/10]

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
template<class Num2 >
npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::StorableInterpolationFunctor ( const LinInterpolatedTableND< Num2, Axis > &  table)
inline

◆ StorableInterpolationFunctor() [2/10]

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
template<class Num2 >
npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::StorableInterpolationFunctor ( const LinInterpolatedTableND< Num2, Axis > &  table,
const std::string &  descr 
)
inline

◆ StorableInterpolationFunctor() [3/10]

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
template<class Num2 , class Conv2 >
npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::StorableInterpolationFunctor ( const StorableInterpolationFunctor< Num2, Axis, Conv2 > &  tab)
inline

Converting copy constructor

Definition at line 45 of file StorableInterpolationFunctor.h.

◆ StorableInterpolationFunctor() [4/10]

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::StorableInterpolationFunctor ( const std::vector< Axis > &  axes,
const std::vector< std::pair< bool, bool > > &  interpolationType,
const char *  functionLabel = nullptr 
)
inline

Constructor which builds the table in place. It basically passses its arguments to the corresponding constructor of LinInterpolatedTableND.

Definition at line 54 of file StorableInterpolationFunctor.h.

◆ StorableInterpolationFunctor() [5/10]

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::StorableInterpolationFunctor ( const Axis &  xAxis,
bool  leftX,
bool  rightX,
const char *  functionLabel = nullptr 
)
inline

◆ StorableInterpolationFunctor() [6/10]

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::StorableInterpolationFunctor ( const Axis &  xAxis,
bool  leftX,
bool  rightX,
const Axis &  yAxis,
bool  leftY,
bool  rightY,
const char *  functionLabel = nullptr 
)
inline

◆ StorableInterpolationFunctor() [7/10]

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::StorableInterpolationFunctor ( const Axis &  xAxis,
bool  leftX,
bool  rightX,
const Axis &  yAxis,
bool  leftY,
bool  rightY,
const Axis &  zAxis,
bool  leftZ,
bool  rightZ,
const char *  functionLabel = nullptr 
)
inline

◆ StorableInterpolationFunctor() [8/10]

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::StorableInterpolationFunctor ( const Axis &  xAxis,
bool  leftX,
bool  rightX,
const Axis &  yAxis,
bool  leftY,
bool  rightY,
const Axis &  zAxis,
bool  leftZ,
bool  rightZ,
const Axis &  tAxis,
bool  leftT,
bool  rightT,
const char *  functionLabel = nullptr 
)
inline

Definition at line 84 of file StorableInterpolationFunctor.h.

◆ StorableInterpolationFunctor() [9/10]

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::StorableInterpolationFunctor ( const Axis &  xAxis,
bool  leftX,
bool  rightX,
const Axis &  yAxis,
bool  leftY,
bool  rightY,
const Axis &  zAxis,
bool  leftZ,
bool  rightZ,
const Axis &  tAxis,
bool  leftT,
bool  rightT,
const Axis &  vAxis,
bool  leftV,
bool  rightV,
const char *  functionLabel = nullptr 
)
inline

Definition at line 101 of file StorableInterpolationFunctor.h.

118  table_(xAxis,
119  leftX,
120  rightX,
121  yAxis,
122  leftY,
123  rightY,
124  zAxis,
125  leftZ,
126  rightZ,
127  tAxis,
128  leftT,
129  rightT,
130  vAxis,
131  leftV,
132  rightV,
133  functionLabel) {}

◆ StorableInterpolationFunctor() [10/10]

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::StorableInterpolationFunctor ( )
delete

Default constructor not implemented

◆ ~StorableInterpolationFunctor()

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::~StorableInterpolationFunctor ( )
inlineoverride

Definition at line 139 of file StorableInterpolationFunctor.h.

139 {}

Member Function Documentation

◆ classId()

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
gs::ClassId npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::classId ( ) const
inlineoverridevirtual

Method related to "geners" I/O

Implements npstat::StorableMultivariateFunctor.

Definition at line 162 of file StorableInterpolationFunctor.h.

162 { return gs::ClassId(*this); }

◆ classname()

template<typename Numeric , class Axis , class Converter >
const char * npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::classname ( )
inlinestatic

Definition at line 191 of file StorableInterpolationFunctor.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

191  {
192  static const std::string myClass(gs::template_class_name<Numeric, Axis>("npstat::StorableInterpolationFunctor"));
193  return myClass.c_str();
194  }

◆ interpolator() [1/2]

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
Table& npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::interpolator ( )
inline

◆ interpolator() [2/2]

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
const Table& npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::interpolator ( ) const
inline

◆ isEqual()

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
bool npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::isEqual ( const StorableMultivariateFunctor ) const
inlineoverrideprotectedvirtual

Method needed to compare objects for equality. Must be overriden by derived classes. It is left up to the derived classes to decide whether they should compare description strings in order to establish equality.

Implements npstat::StorableMultivariateFunctor.

Definition at line 172 of file StorableInterpolationFunctor.h.

References npstat::StorableMultivariateFunctor::description(), trackingPlots::other, alignCSCRings::r, and npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::table_.

172  {
173  // Note the use of static_cast rather than dynamic_cast below.
174  // static_cast works faster and it is guaranteed to succeed here.
176  return table_ == r.table_ && this->description() == other.description();
177  }

◆ minDim()

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
unsigned npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::minDim ( ) const
inlineoverridevirtual

◆ operator()()

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
double npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::operator() ( const double *  point,
unsigned  dim 
) const
inlineoverridevirtual

Function value

Implements npstat::AbsMultivariateFunctor.

Definition at line 143 of file StorableInterpolationFunctor.h.

References npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::conv_, point, and npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::table_.

143 { return conv_(table_(point, dim)); }
*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
Definition: invegas.h:5

◆ read()

template<typename Numeric , class Axis , class Converter >
StorableInterpolationFunctor< Numeric, Axis, Converter > * npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::read ( const gs::ClassId &  id,
std::istream &  in 
)
static

Definition at line 203 of file StorableInterpolationFunctor.h.

References recoMuon::in, fileinputsource_cfi::read, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by edmIntegrityCheck.PublishToFileSystem::get().

204  {
205  static const gs::ClassId current(gs::ClassId::makeId<StorableInterpolationFunctor<Numeric, Axis> >());
206  current.ensureSameId(id);
207 
208  std::string descr;
209  gs::read_pod(in, &descr);
210  gs::ClassId tabid(in, 1);
211  if (in.fail())
212  throw gs::IOReadFailure(
213  "In npstat::StorableInterpolationFunctor::read: "
214  "input stream failure");
215  CPP11_auto_ptr<Table> tab(Table::read(tabid, in));
216  return new StorableInterpolationFunctor(*tab, descr);
217  }
static LinInterpolatedTableND * read(const gs::ClassId &id, std::istream &in)

◆ setConverter()

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
void npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::setConverter ( const Converter &  conv)
inline

◆ table() [1/2]

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
ArrayND<Numeric>& npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::table ( )
inline

◆ table() [2/2]

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
const ArrayND<Numeric>& npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::table ( ) const
inline

◆ version()

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
static unsigned npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::version ( )
inlinestatic

Definition at line 168 of file StorableInterpolationFunctor.h.

Referenced by validation.Sample::datasetpattern(), and validation.Sample::filename().

168 { return 1; }

◆ write()

template<typename Numeric , class Axis , class Converter >
bool npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::write ( std::ostream &  of) const
overridevirtual

Implements npstat::StorableMultivariateFunctor.

Definition at line 197 of file StorableInterpolationFunctor.h.

References makeListRunsInFiles::description, haddnano::of, and table_.

197  {
198  gs::write_pod(of, this->description());
199  return table_.classId().write(of) && table_.write(of);
200  }
bool write(std::ostream &of) const

Friends And Related Function Documentation

◆ StorableInterpolationFunctor

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
template<typename Num2 , typename Axis2 , typename Conv2 >
friend class StorableInterpolationFunctor
friend

Definition at line 27 of file StorableInterpolationFunctor.h.

Member Data Documentation

◆ conv_

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
Converter npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::conv_
private

◆ table_

template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
Table npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::table_
private