CMS 3D CMS Logo

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

gs::ClassId classId () const override
 
Tableinterpolator ()
 
const Tableinterpolator () const
 
unsigned minDim () const override
 
double operator() (const double *point, unsigned dim) const override
 
void setConverter (const Converter &conv)
 
 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)
 
 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 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 char *functionLabel=nullptr)
 
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)
 
template<class Num2 , class Conv2 >
 StorableInterpolationFunctor (const StorableInterpolationFunctor< Num2, Axis, Conv2 > &tab)
 
ArrayND< Numeric > & table ()
 
const ArrayND< Numeric > & table () const
 
bool write (std::ostream &of) const override
 
 ~StorableInterpolationFunctor () override
 
- Public Member Functions inherited from npstat::StorableMultivariateFunctor
const std::string & description () const
 
bool operator!= (const StorableMultivariateFunctor &r) const
 
bool operator== (const StorableMultivariateFunctor &r) const
 
void setDescription (const std::string &newDescription)
 
 StorableMultivariateFunctor ()
 
 StorableMultivariateFunctor (const std::string &descr)
 
void validateDescription (const std::string &description) const
 
 ~StorableMultivariateFunctor () override
 
- 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 Member Functions

 StorableInterpolationFunctor ()=delete
 

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

Constructor from a pre-existing table

Definition at line 35 of file StorableInterpolationFunctor.h.

◆ 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

Definition at line 39 of file StorableInterpolationFunctor.h.

◆ 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.

46  : StorableMultivariateFunctor(tab.description()), table_(tab.table_) {}

◆ 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.

57  : StorableMultivariateFunctor(), table_(axes, interpolationType, functionLabel) {}

◆ 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

Definition at line 59 of file StorableInterpolationFunctor.h.

60  : StorableMultivariateFunctor(), table_(xAxis, leftX, rightX, functionLabel) {}

◆ 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

Definition at line 62 of file StorableInterpolationFunctor.h.

69  : StorableMultivariateFunctor(), table_(xAxis, leftX, rightX, yAxis, leftY, rightY, functionLabel) {}

◆ 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

Definition at line 71 of file StorableInterpolationFunctor.h.

82  table_(xAxis, leftX, rightX, yAxis, leftY, rightY, zAxis, leftZ, rightZ, functionLabel) {}

◆ 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.

98  table_(
99  xAxis, leftX, rightX, yAxis, leftY, rightY, zAxis, leftZ, rightZ, tAxis, leftT, rightT, functionLabel) {}

◆ 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()

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

Definition at line 136 of file StorableInterpolationFunctor.h.

136 {}

◆ StorableInterpolationFunctor() [10/10]

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

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

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

◆ classname()

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

Definition at line 190 of file StorableInterpolationFunctor.h.

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

References AlCaHLTBitMon_QueryRunRegistry::string.

◆ interpolator() [1/2]

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

Retrieve the underlying LinInterpolatedTableND object

Definition at line 144 of file StorableInterpolationFunctor.h.

144 { return table_; }

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

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

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

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

◆ 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

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

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

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

Referenced by edmIntegrityCheck.PublishToFileSystem::get().

◆ setConverter()

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

155 { conv_ = conv; }

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

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

165 { return 1; }

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

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

196  {
197  gs::write_pod(of, this->description());
198  return table_.classId().write(of) && table_.write(of);
199  }

References edmLumisInFiles::description, and table_.

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
npstat::StorableInterpolationFunctor::table_
Table table_
Definition: StorableInterpolationFunctor.h:179
npstat::StorableInterpolationFunctor::table
ArrayND< Numeric > & table()
Definition: StorableInterpolationFunctor.h:150
conv
static HepMC::IO_HEPEVT conv
Definition: BeamHaloProducer.cc:48
npstat::StorableMultivariateFunctor::description
const std::string & description() const
Definition: StorableMultivariateFunctor.h:34
npstat::LinInterpolatedTableND::table
const ArrayND< Numeric > & table() const
Definition: LinInterpolatedTableND.h:150
npstat::StorableInterpolationFunctor::StorableInterpolationFunctor
StorableInterpolationFunctor()=delete
npstat::LinInterpolatedTableND::write
bool write(std::ostream &of) const
Definition: LinInterpolatedTableND.h:455
npstat::StorableInterpolationFunctor::conv_
Converter conv_
Definition: StorableInterpolationFunctor.h:180
HLT_FULL_cff.zAxis
zAxis
Definition: HLT_FULL_cff.py:46155
trackingPlots.other
other
Definition: trackingPlots.py:1460
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
npstat::StorableMultivariateFunctor::StorableMultivariateFunctor
StorableMultivariateFunctor()
Definition: StorableMultivariateFunctor.h:25
npstat::LinInterpolatedTableND::read
static LinInterpolatedTableND * read(const gs::ClassId &id, std::istream &in)
Definition: LinInterpolatedTableND.h:466
npstat::LinInterpolatedTableND::classId
gs::ClassId classId() const
Definition: LinInterpolatedTableND.h:224
HLT_FULL_cff.yAxis
yAxis
Definition: HLT_FULL_cff.py:46156
recoMuon::in
Definition: RecoMuonEnumerators.h:6
npstat::LinInterpolatedTableND::dim
unsigned dim() const
Definition: LinInterpolatedTableND.h:138
alignCSCRings.r
r
Definition: alignCSCRings.py:93
HLT_FULL_cff.xAxis
xAxis
Definition: HLT_FULL_cff.py:46154
point
*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