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

Constructor & Destructor Documentation

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

Definition at line 306 of file EgammaHLTPixelMatchParamObjects.h.

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

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

Definition at line 310 of file EgammaHLTPixelMatchParamObjects.h.

310  {
311  for(auto& bin : bins_){
312  if(bin->pass(input)) return (*bin)(input);
313  }
314  return -1; //didnt find a suitable bin, just return -1 for now
315  }
static std::string const input
Definition: EdmProvDump.cc:44
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 304 of file EgammaHLTPixelMatchParamObjects.h.