CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros 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 192 of file EgammaHLTPixelMatchParamObjects.h.

Constructor & Destructor Documentation

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

Definition at line 194 of file EgammaHLTPixelMatchParamObjects.h.

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

Definition at line 195 of file EgammaHLTPixelMatchParamObjects.h.

195 {}

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 206 of file EgammaHLTPixelMatchParamObjects.h.

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

206  {
207  auto funcType = readFuncStr(config.getParameter<std::string>("funcType"));
208  auto funcParams = config.getParameter<std::vector<double> >("funcParams");
209  if(funcType.first=="TF1" && has1D<ParamType>(0)) return TF1Wrap<ParamType,has1D<ParamType>(0)>(funcType.second,funcParams);
210  else if(funcType.first=="TF2" && has2D<ParamType>(0)) return TF2Wrap<ParamType,has2D<ParamType>(0)>(funcType.second,funcParams);
211  else if(funcType.first=="TF3" && has3D<ParamType>(0)) return TF3Wrap<ParamType,has3D<ParamType>(0)>(funcType.second,funcParams);
212  else throw cms::Exception("InvalidConfig") << " type "<<funcType.first<<" is not recognised or is imcompatable with the ParamType, configuration is invalid and needs to be fixed"<<std::endl;
213  }
T getParameter(std::string const &) const
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 200 of file EgammaHLTPixelMatchParamObjects.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

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

200  {
201  size_t pos=inStr.find(":=");
202  if(pos!=std::string::npos) return std::make_pair(inStr.substr(0,pos),inStr.substr(pos+2));
203  else return std::make_pair(inStr,std::string(""));
204  }