CMS 3D CMS Logo

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

Constructor & Destructor Documentation

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

Definition at line 197 of file EgammaHLTPixelMatchParamObjects.h.

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

Definition at line 198 of file EgammaHLTPixelMatchParamObjects.h.

References egPM::AbsEtaNrClus::pass().

198 {}

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

References Exception, edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

209  {
210  auto funcType = readFuncStr(config.getParameter<std::string>("funcType"));
211  auto funcParams = config.getParameter<std::vector<double> >("funcParams");
212  if(funcType.first=="TF1" && has1D<ParamType>(0)) return TF1Wrap<ParamType,has1D<ParamType>(0)>(funcType.second,funcParams);
213  else if(funcType.first=="TF2" && has2D<ParamType>(0)) return TF2Wrap<ParamType,has2D<ParamType>(0)>(funcType.second,funcParams);
214  else if(funcType.first=="TF3" && has3D<ParamType>(0)) return TF3Wrap<ParamType,has3D<ParamType>(0)>(funcType.second,funcParams);
215  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;
216  }
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 203 of file EgammaHLTPixelMatchParamObjects.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

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