CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Protected Member Functions
egPM::ParamBin< InputType > Class Template Referenceabstract

#include <EgammaHLTPixelMatchParamObjects.h>

Inheritance diagram for egPM::ParamBin< InputType >:
egPM::ParamBin1D< InputType, ParamType > egPM::ParamBin2D< InputType, ParamType > egPM::ParamBin3D< InputType, ParamType >

Public Member Functions

virtual float operator() (const InputType &) const =0
 
 ParamBin ()
 
virtual bool pass (const InputType &) const =0
 
virtual ~ParamBin ()
 

Static Protected Member Functions

template<typename ParamType >
static std::function< float(const
ParamType &)> 
makeFunc (const edm::ParameterSet &config)
 
static std::pair< std::string,
std::string > 
readFuncStr (const std::string &inStr)
 

Detailed Description

template<typename InputType>
class egPM::ParamBin< InputType >

Definition at line 194 of file EgammaHLTPixelMatchParamObjects.h.

Constructor & Destructor Documentation

template<typename InputType >
egPM::ParamBin< InputType >::ParamBin ( )
inline

Definition at line 196 of file EgammaHLTPixelMatchParamObjects.h.

196 {}
template<typename InputType >
virtual egPM::ParamBin< InputType >::~ParamBin ( )
inlinevirtual

Definition at line 197 of file EgammaHLTPixelMatchParamObjects.h.

197 {}

Member Function Documentation

template<typename InputType >
template<typename ParamType >
static std::function<float(const ParamType&)> egPM::ParamBin< InputType >::makeFunc ( const edm::ParameterSet config)
inlinestaticprotected

Definition at line 211 of file EgammaHLTPixelMatchParamObjects.h.

References Exception, edm::ParameterSet::getParameter(), egPM::ParamBin< InputType >::readFuncStr(), and AlCaHLTBitMon_QueryRunRegistry::string.

211  {
212  auto funcType = readFuncStr(config.getParameter<std::string>("funcType"));
213  auto funcParams = config.getParameter<std::vector<double>>("funcParams");
214  if (funcType.first == "TF1" && has1D<ParamType>(0))
215  return TF1Wrap<ParamType, has1D<ParamType>(0)>(funcType.second, funcParams);
216  else if (funcType.first == "TF2" && has2D<ParamType>(0))
217  return TF2Wrap<ParamType, has2D<ParamType>(0)>(funcType.second, funcParams);
218  else if (funcType.first == "TF3" && has3D<ParamType>(0))
219  return TF3Wrap<ParamType, has3D<ParamType>(0)>(funcType.second, funcParams);
220  else
221  throw cms::Exception("InvalidConfig") << " type " << funcType.first
222  << " is not recognised or is imcompatable with the ParamType, "
223  "configuration is invalid and needs to be fixed"
224  << std::endl;
225  }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
static std::pair< std::string, std::string > readFuncStr(const std::string &inStr)
template<typename InputType >
virtual float egPM::ParamBin< InputType >::operator() ( const InputType &  ) const
pure virtual
template<typename InputType >
virtual bool egPM::ParamBin< InputType >::pass ( const InputType &  ) const
pure virtual
template<typename InputType >
static std::pair<std::string, std::string> egPM::ParamBin< InputType >::readFuncStr ( const std::string &  inStr)
inlinestaticprotected

Definition at line 203 of file EgammaHLTPixelMatchParamObjects.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by egPM::ParamBin< InputType >::makeFunc().

203  {
204  size_t pos = inStr.find(":=");
205  if (pos != std::string::npos)
206  return std::make_pair(inStr.substr(0, pos), inStr.substr(pos + 2));
207  else
208  return std::make_pair(inStr, std::string(""));
209  }