CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private 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

virtual unsigned minDim () const
 
virtual double operator() (const double *point, unsigned dim) const
 
void setConverter (const Converter &conv)
 
template<class Num2 , class Conv2 >
 StorableInterpolationFunctor (const StorableInterpolationFunctor< Num2, Axis, Conv2 > &tab)
 
virtual ~StorableInterpolationFunctor ()
 
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=0)
 
 StorableInterpolationFunctor (const Axis &xAxis, bool leftX, bool rightX, const char *functionLabel=0)
 
 StorableInterpolationFunctor (const Axis &xAxis, bool leftX, bool rightX, const Axis &yAxis, bool leftY, bool rightY, const char *functionLabel=0)
 
 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=0)
 
 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=0)
 
 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=0)
 
Tableinterpolator ()
 
const Tableinterpolator () const
 
ArrayND< Numeric > & table ()
 
const ArrayND< Numeric > & table () const
 
virtual gs::ClassId classId () const
 
virtual bool write (std::ostream &of) const
 
- 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
 
virtual ~StorableMultivariateFunctor ()
 
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
StorableInterpolationFunctor
read (const gs::ClassId &id, std::istream &in)
 
static unsigned version ()
 
- Static Public Member Functions inherited from npstat::StorableMultivariateFunctor
static const char * classname ()
 
static
StorableMultivariateFunctor
read (const gs::ClassId &id, std::istream &in)
 
static unsigned version ()
 

Protected Member Functions

virtual bool isEqual (const StorableMultivariateFunctor &other) const
 

Private Member Functions

 StorableInterpolationFunctor ()
 

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 30 of file StorableInterpolationFunctor.h.

Member Typedef Documentation

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

Definition at line 36 of file StorableInterpolationFunctor.h.

Constructor & Destructor Documentation

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
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
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 54 of file StorableInterpolationFunctor.h.

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 = 0 
)
inline

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

Definition at line 65 of file StorableInterpolationFunctor.h.

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 = 0 
)
inline
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 = 0 
)
inline

Definition at line 78 of file StorableInterpolationFunctor.h.

83  table_(xAxis, leftX, rightX,
84  yAxis, leftY, rightY, functionLabel) {}
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 = 0 
)
inline

Definition at line 86 of file StorableInterpolationFunctor.h.

92  table_(xAxis, leftX, rightX,
93  yAxis, leftY, rightY,
94  zAxis, leftZ, rightZ, functionLabel) {}
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 = 0 
)
inline

Definition at line 96 of file StorableInterpolationFunctor.h.

103  table_(xAxis, leftX, rightX,
104  yAxis, leftY, rightY,
105  zAxis, leftZ, rightZ,
106  tAxis, leftT, rightT, functionLabel) {}
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 = 0 
)
inline

Definition at line 108 of file StorableInterpolationFunctor.h.

116  table_(xAxis, leftX, rightX,
117  yAxis, leftY, rightY,
118  zAxis, leftZ, rightZ,
119  tAxis, leftT, rightT,
120  vAxis, leftV, rightV, functionLabel) {}
template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
virtual npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::~StorableInterpolationFunctor ( )
inlinevirtual

Definition at line 123 of file StorableInterpolationFunctor.h.

123 {}
template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::StorableInterpolationFunctor ( )
private

Member Function Documentation

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

Method related to "geners" I/O

Implements npstat::StorableMultivariateFunctor.

Definition at line 147 of file StorableInterpolationFunctor.h.

147 {return gs::ClassId(*this);}
template<typename Numeric , class Axis , class Converter >
const char * npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::classname ( )
inlinestatic

Definition at line 182 of file StorableInterpolationFunctor.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

183  {
184  static const std::string myClass(gs::template_class_name<Numeric,Axis>(
185  "npstat::StorableInterpolationFunctor"));
186  return myClass.c_str();
187  }
template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
Table& npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::interpolator ( )
inline
template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
const Table& npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::interpolator ( ) const
inline
template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
virtual bool npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::isEqual ( const StorableMultivariateFunctor ) const
inlineprotectedvirtual

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 158 of file StorableInterpolationFunctor.h.

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

159  {
160  // Note the use of static_cast rather than dynamic_cast below.
161  // static_cast works faster and it is guaranteed to succeed here.
163  static_cast<const StorableInterpolationFunctor&>(other);
164  return table_ == r.table_ &&
165  this->description() == other.description();
166  }
template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
virtual unsigned npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::minDim ( ) const
inlinevirtual
template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
virtual double npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::operator() ( const double *  point,
unsigned  dim 
) const
inlinevirtual

Function value

Implements npstat::AbsMultivariateFunctor.

Definition at line 127 of file StorableInterpolationFunctor.h.

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

128  {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
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 199 of file StorableInterpolationFunctor.h.

References cond::rpcobimon::current, SiPixelLorentzAngle_cfi::read, AlCaHLTBitMon_QueryRunRegistry::string, and accesses::tab.

201  {
202  static const gs::ClassId current(
203  gs::ClassId::makeId<StorableInterpolationFunctor<Numeric,Axis> >());
204  current.ensureSameId(id);
205 
206  std::string descr;
207  gs::read_pod(in, &descr);
208  gs::ClassId tabid(in, 1);
209  if (in.fail()) throw gs::IOReadFailure(
210  "In npstat::StorableInterpolationFunctor::read: "
211  "input stream failure");
212  CPP11_auto_ptr<Table> tab(Table::read(tabid, in));
213  return new StorableInterpolationFunctor(*tab, descr);
214  }
static LinInterpolatedTableND * read(const gs::ClassId &id, std::istream &in)
tuple tab
Definition: accesses.py:4
template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
void npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::setConverter ( const Converter &  conv)
inline

Change the coordinate converter

Definition at line 143 of file StorableInterpolationFunctor.h.

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

143 {conv_ = conv;}
static HepMC::IO_HEPEVT conv
template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
ArrayND<Numeric>& npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::table ( )
inline
template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
const ArrayND<Numeric>& npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::table ( ) const
inline
template<class Numeric, class Axis = UniformAxis, class Converter = Same<Numeric>>
static unsigned npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::version ( )
inlinestatic

Definition at line 153 of file StorableInterpolationFunctor.h.

153 {return 1;}
template<typename Numeric , class Axis , class Converter >
bool npstat::StorableInterpolationFunctor< Numeric, Axis, Converter >::write ( std::ostream &  of) const
virtual

Implements npstat::StorableMultivariateFunctor.

Definition at line 190 of file StorableInterpolationFunctor.h.

References idDealer::description, and table_.

192  {
193  gs::write_pod(of, this->description());
194  return table_.classId().write(of) && table_.write(of);
195  }
bool write(std::ostream &of) const

Friends And Related Function Documentation

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

Definition at line 33 of file StorableInterpolationFunctor.h.

Member Data Documentation

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