CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
pat::helper::KinResolutionsLoader Class Reference

#include <KinResolutionsLoader.h>

Public Member Functions

bool enabled () const
 'true' if this there is at least one efficiency configured More...
 
 KinResolutionsLoader ()
 Empty constructor. More...
 
 KinResolutionsLoader (const edm::ParameterSet &iConfig)
 Constructor from a PSet. More...
 
void newEvent (const edm::Event &event, const edm::EventSetup &setup)
 To be called for each new event, reads in the EventSetup object. More...
 
template<typename T >
void setResolutions (pat::PATObject< T > &obj) const
 Sets the efficiencies for this object, using the reference to the original objects. More...
 

Static Public Member Functions

static void fillDescription (edm::ParameterSetDescription &iDesc)
 Method for documentation and validation of PSet. More...
 

Private Attributes

std::vector< std::string > eslabels_
 Labels of the KinematicResolutionProvider in the EventSetup. More...
 
std::vector< edm::ESHandle< KinematicResolutionProvider > > handles_
 Handles to the EventSetup. More...
 
std::vector< std::string > patlabels_
 Labels of the resolutions in PAT. More...
 

Detailed Description

Definition at line 18 of file KinResolutionsLoader.h.

Constructor & Destructor Documentation

◆ KinResolutionsLoader() [1/2]

pat::helper::KinResolutionsLoader::KinResolutionsLoader ( )
inline

Empty constructor.

Definition at line 21 of file KinResolutionsLoader.h.

21 {}

◆ KinResolutionsLoader() [2/2]

KinResolutionsLoader::KinResolutionsLoader ( const edm::ParameterSet iConfig)

Constructor from a PSet.

Definition at line 8 of file KinResolutionsLoader.cc.

8  {
9  // Get the names (sorted)
11 
12  // get the InputTags
13  for (std::vector<std::string>::const_iterator it = patlabels_.begin(), ed = patlabels_.end(); it != ed; ++it) {
14  eslabels_.push_back(iConfig.getParameter<std::string>(*it));
15  }
16 
17  // prepare the Handles
18  handles_.resize(patlabels_.size());
19 
20  // 'default' maps to empty string
21  for (std::vector<std::string>::iterator it = patlabels_.begin(), ed = patlabels_.end(); it != ed; ++it) {
22  if (*it == "default")
23  *it = "";
24  }
25 }

References eslabels_, edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNamesForType(), handles_, patlabels_, and AlCaHLTBitMon_QueryRunRegistry::string.

Member Function Documentation

◆ enabled()

bool pat::helper::KinResolutionsLoader::enabled ( ) const
inline

◆ fillDescription()

void KinResolutionsLoader::fillDescription ( edm::ParameterSetDescription iDesc)
static

Method for documentation and validation of PSet.

Definition at line 34 of file KinResolutionsLoader.cc.

34  {
35  iDesc.add<bool>("addResolutions", false)->setComment("Add resolutions into this PAT Object");
36  edm::ParameterSetDescription resolutionPSet;
37  resolutionPSet.setAllowAnything();
38  iDesc.addOptional("resolutions", resolutionPSet)->setComment("Resolution values to get from EventSetup");
39 }

References edm::ParameterSetDescription::add(), edm::ParameterSetDescription::addOptional(), edm::ParameterSetDescription::setAllowAnything(), and edm::ParameterDescriptionNode::setComment().

Referenced by pat::PATMETProducer::fillDescriptions(), pat::PATJetProducer::fillDescriptions(), pat::PATTauProducer::fillDescriptions(), pat::PATElectronProducer::fillDescriptions(), pat::PATPhotonProducer::fillDescriptions(), and pat::PATMuonProducer::fillDescriptions().

◆ newEvent()

void KinResolutionsLoader::newEvent ( const edm::Event event,
const edm::EventSetup setup 
)

◆ setResolutions()

template<typename T >
void pat::helper::KinResolutionsLoader::setResolutions ( pat::PATObject< T > &  obj) const

Member Data Documentation

◆ eslabels_

std::vector<std::string> pat::helper::KinResolutionsLoader::eslabels_
private

Labels of the KinematicResolutionProvider in the EventSetup.

Definition at line 43 of file KinResolutionsLoader.h.

Referenced by KinResolutionsLoader(), and newEvent().

◆ handles_

std::vector<edm::ESHandle<KinematicResolutionProvider> > pat::helper::KinResolutionsLoader::handles_
private

Handles to the EventSetup.

Definition at line 45 of file KinResolutionsLoader.h.

Referenced by KinResolutionsLoader(), newEvent(), and setResolutions().

◆ patlabels_

std::vector<std::string> pat::helper::KinResolutionsLoader::patlabels_
private

Labels of the resolutions in PAT.

Definition at line 41 of file KinResolutionsLoader.h.

Referenced by enabled(), KinResolutionsLoader(), newEvent(), and setResolutions().

mps_fire.i
i
Definition: mps_fire.py:355
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
pat::helper::KinResolutionsLoader::eslabels_
std::vector< std::string > eslabels_
Labels of the KinematicResolutionProvider in the EventSetup.
Definition: KinResolutionsLoader.h:43
pat::helper::KinResolutionsLoader::patlabels_
std::vector< std::string > patlabels_
Labels of the resolutions in PAT.
Definition: KinResolutionsLoader.h:41
edm::ParameterSetDescription::addOptional
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:105
pat::helper::KinResolutionsLoader::handles_
std::vector< edm::ESHandle< KinematicResolutionProvider > > handles_
Handles to the EventSetup.
Definition: KinResolutionsLoader.h:45
getGTfromDQMFile.obj
obj
Definition: getGTfromDQMFile.py:32
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet::getParameterNamesForType
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:168
edm::ParameterSetDescription::setAllowAnything
void setAllowAnything()
allow any parameter label/value pairs
Definition: ParameterSetDescription.cc:37
get
#define get
KinematicResolutionRcd
Definition: KinematicResolutionRcd.h:24
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
edm::ParameterDescriptionNode::setComment
void setComment(std::string const &value)
Definition: ParameterDescriptionNode.cc:106