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

Constructor & Destructor Documentation

◆ ParamBin()

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

Definition at line 196 of file EgammaHLTPixelMatchParamObjects.h.

196 {}

◆ ~ParamBin()

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

Definition at line 197 of file EgammaHLTPixelMatchParamObjects.h.

197 {}

Member Function Documentation

◆ makeFunc()

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.

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  }

References Exception, HLT_FULL_cff::funcParams, egPM::ParamBin< InputType >::readFuncStr(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ operator()()

template<typename InputType >
virtual float egPM::ParamBin< InputType >::operator() ( const InputType &  ) const
pure virtual

◆ pass()

template<typename InputType >
virtual bool egPM::ParamBin< InputType >::pass ( const InputType &  ) const
pure virtual

◆ readFuncStr()

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.

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  }

References AlCaHLTBitMon_QueryRunRegistry::string.

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

funcType
funcType
Definition: SiPixelActionExecutor.h:17
pos
Definition: PixelAliasList.h:18
HLT_FULL_cff.funcParams
funcParams
Definition: HLT_FULL_cff.py:15319
config
Definition: config.py:1
egPM::ParamBin::readFuncStr
static std::pair< std::string, std::string > readFuncStr(const std::string &inStr)
Definition: EgammaHLTPixelMatchParamObjects.h:203
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
Exception
Definition: hltDiff.cc:245