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

◆ Param()

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  }

Member Function Documentation

◆ createParamBin_()

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  }

Referenced by egPM::Param< reco::ElectronSeed >::Param().

◆ operator()()

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  }

Member Data Documentation

◆ bins_

template<typename InputType>
std::vector<std::unique_ptr<ParamBin<InputType> > > egPM::Param< InputType >::bins_
private
input
static const std::string input
Definition: EdmProvDump.cc:48
config
Definition: config.py:1
submitPVResolutionJobs.config
config
parse the configuration file
Definition: submitPVResolutionJobs.py:281
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
egPM::Param::createParamBin_
std::unique_ptr< ParamBin< InputType > > createParamBin_(const edm::ParameterSet &config)
Definition: EgammaHLTPixelMatchParamObjects.h:326
type
type
Definition: SiPixelVCal_PayloadInspector.cc:37
newFWLiteAna.bin
bin
Definition: newFWLiteAna.py:161
Exception
Definition: hltDiff.cc:246
egPM::Param::bins_
std::vector< std::unique_ptr< ParamBin< InputType > > > bins_
Definition: EgammaHLTPixelMatchParamObjects.h:309