CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions | Private Attributes

pat::helper::KinResolutionsLoader Class Reference

#include <KinResolutionsLoader.h>

List of all members.

Public Member Functions

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

Static Public Member Functions

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

Private Attributes

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

Detailed Description

Definition at line 18 of file KinResolutionsLoader.h.


Constructor & Destructor Documentation

pat::helper::KinResolutionsLoader::KinResolutionsLoader ( ) [inline]

Empty constructor.

Definition at line 21 of file KinResolutionsLoader.h.

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

Constructor from a PSet.

Definition at line 8 of file KinResolutionsLoader.cc.

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

{
    // Get the names (sorted)
    patlabels_ = iConfig.getParameterNamesForType<std::string>();
    
    // get the InputTags
    for (std::vector<std::string>::const_iterator it = patlabels_.begin(), ed = patlabels_.end(); it != ed; ++it) {
        eslabels_.push_back( iConfig.getParameter<std::string>(*it) );
    }

    // prepare the Handles
    handles_.resize(patlabels_.size());

    // 'default' maps to empty string
    for (std::vector<std::string>::iterator it = patlabels_.begin(), ed = patlabels_.end(); it != ed; ++it) {
        if (*it == "default") *it = "";
    }
}

Member Function Documentation

bool pat::helper::KinResolutionsLoader::enabled ( ) const [inline]
void KinResolutionsLoader::fillDescription ( edm::ParameterSetDescription iDesc) [static]

Method for documentation and validation of PSet.

Definition at line 36 of file KinResolutionsLoader.cc.

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

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

                                                                        {
    iDesc.add<bool>("addResolutions",false)->setComment("Add resolutions into this PAT Object");
    edm::ParameterSetDescription resolutionPSet;
    resolutionPSet.setAllowAnything();
    iDesc.addOptional("resolutions", resolutionPSet)->setComment("Resolution values to get from EventSetup");
}
void KinResolutionsLoader::newEvent ( const edm::Event event,
const edm::EventSetup setup 
) const
template<typename T >
void pat::helper::KinResolutionsLoader::setResolutions ( pat::PATObject< T > &  obj) const

Member Data Documentation

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

Labels of the KinematicResolutionProvider in the EventSetup.

Definition at line 42 of file KinResolutionsLoader.h.

Referenced by KinResolutionsLoader(), and newEvent().

Handles to the EventSetup.

Definition at line 44 of file KinResolutionsLoader.h.

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

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

Labels of the resolutions in PAT.

Definition at line 40 of file KinResolutionsLoader.h.

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