CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
egPM::Param< InputType > Class Template Reference

#include <EgammaHLTPixelMatchParamObjects.h>

Public Member Functions

float operator() (const InputType &input) const
 
 Param (const edm::ParameterSet &config)
 

Private Member Functions

std::unique_ptr< ParamBin< InputType > > createParamBin_ (const edm::ParameterSet &config)
 

Private Attributes

std::vector< std::unique_ptr< ParamBin< InputType > > > bins_
 

Detailed Description

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

Definition at line 308 of file EgammaHLTPixelMatchParamObjects.h.

Constructor & Destructor Documentation

template<typename InputType>
egPM::Param< InputType >::Param ( const edm::ParameterSet config)
inline

Definition at line 312 of file EgammaHLTPixelMatchParamObjects.h.

312  {
313  std::vector<edm::ParameterSet> binConfigs = config.getParameter<std::vector<edm::ParameterSet>>("bins");
314  for (auto& binConfig : binConfigs)
315  bins_.emplace_back(createParamBin_(binConfig));
316  }
T getParameter(std::string const &) const
std::unique_ptr< ParamBin< InputType > > createParamBin_(const edm::ParameterSet &config)
std::vector< std::unique_ptr< ParamBin< InputType > > > bins_

Member Function Documentation

template<typename InputType>
std::unique_ptr<ParamBin<InputType> > egPM::Param< InputType >::createParamBin_ ( const edm::ParameterSet config)
inlineprivate

Definition at line 326 of file EgammaHLTPixelMatchParamObjects.h.

326  {
327  std::string type = config.getParameter<std::string>("binType");
328  if (type == "AbsEtaClus")
329  return std::make_unique<ParamBin2D<InputType, AbsEtaNrClus>>(config);
330  else if (type == "AbsEtaClusPhi")
331  return std::make_unique<ParamBin3D<InputType, AbsEtaNrClusPhi>>(config);
332  else if (type == "AbsEtaClusEt")
333  return std::make_unique<ParamBin3D<InputType, AbsEtaNrClusEt>>(config);
334  else
335  throw cms::Exception("InvalidConfig")
336  << " type " << type << " is not recognised, configuration is invalid and needs to be fixed" << std::endl;
337  }
type
Definition: HCALResponse.h:21
T getParameter(std::string const &) const
config
Definition: looper.py:291
template<typename InputType>
float egPM::Param< InputType >::operator() ( const InputType &  input) const
inline

Definition at line 317 of file EgammaHLTPixelMatchParamObjects.h.

317  {
318  for (auto& bin : bins_) {
319  if (bin->pass(input))
320  return (*bin)(input);
321  }
322  return -1; //didnt find a suitable bin, just return -1 for now
323  }
static std::string const input
Definition: EdmProvDump.cc:48
std::vector< std::unique_ptr< ParamBin< InputType > > > bins_

Member Data Documentation

template<typename InputType>
std::vector<std::unique_ptr<ParamBin<InputType> > > egPM::Param< InputType >::bins_
private

Definition at line 309 of file EgammaHLTPixelMatchParamObjects.h.