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

Constructor & Destructor Documentation

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

Definition at line 309 of file EgammaHLTPixelMatchParamObjects.h.

309  {
310  std::vector<edm::ParameterSet> binConfigs = config.getParameter<std::vector<edm::ParameterSet> >("bins");
311  for(auto& binConfig : binConfigs) bins_.emplace_back(createParamBin_(binConfig));
312  }
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 321 of file EgammaHLTPixelMatchParamObjects.h.

321  {
322  std::string type = config.getParameter<std::string>("binType");
323  if(type=="AbsEtaClus") return std::make_unique<ParamBin2D<InputType,AbsEtaNrClus>>(config);
324  else if(type=="AbsEtaClusPhi") return std::make_unique<ParamBin3D<InputType,AbsEtaNrClusPhi>>(config);
325  else if(type=="AbsEtaClusEt") return std::make_unique<ParamBin3D<InputType,AbsEtaNrClusEt>>(config);
326  else throw cms::Exception("InvalidConfig") << " type "<<type<<" is not recognised, configuration is invalid and needs to be fixed"<<std::endl;
327  }
type
Definition: HCALResponse.h:21
T getParameter(std::string const &) const
config
Definition: looper.py:289
template<typename InputType>
float egPM::Param< InputType >::operator() ( const InputType &  input) const
inline

Definition at line 313 of file EgammaHLTPixelMatchParamObjects.h.

313  {
314  for(auto& bin : bins_){
315  if(bin->pass(input)) return (*bin)(input);
316  }
317  return -1; //didnt find a suitable bin, just return -1 for now
318  }
static std::string const input
Definition: EdmProvDump.cc:45
bin
set the eta bin as selection string.
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 307 of file EgammaHLTPixelMatchParamObjects.h.