CMS 3D CMS Logo

Public Member Functions | Private Attributes

pat::helper::EfficiencyLoader Class Reference

#include <EfficiencyLoader.h>

List of all members.

Public Member Functions

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

Private Attributes

std::vector< edm::Handle
< edm::ValueMap
< pat::LookupTableRecord > > > 
handles_
std::vector< std::string > names_
std::vector< edm::InputTagtags_

Detailed Description

Definition at line 15 of file EfficiencyLoader.h.


Constructor & Destructor Documentation

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

Empty constructor.

Definition at line 18 of file EfficiencyLoader.h.

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

Constructor from a PSet.

Definition at line 7 of file EfficiencyLoader.cc.

References edm::ParameterSet::getParameter(), edm::ParameterSet::getParameterNamesForType(), handles_, names_, python::multivaluedict::sort(), and tags_.

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

    // prepare the Handles
    handles_.resize(names_.size());
}

Member Function Documentation

bool pat::helper::EfficiencyLoader::enabled ( ) const [inline]
void EfficiencyLoader::newEvent ( const edm::Event event) const
template<typename T , typename R >
void pat::helper::EfficiencyLoader::setEfficiencies ( pat::PATObject< T > &  obj,
const R &  originalRef 
) const

Member Data Documentation

Definition at line 36 of file EfficiencyLoader.h.

Referenced by EfficiencyLoader(), newEvent(), and setEfficiencies().

std::vector<std::string> pat::helper::EfficiencyLoader::names_ [private]

Definition at line 34 of file EfficiencyLoader.h.

Referenced by EfficiencyLoader(), enabled(), newEvent(), and setEfficiencies().

Definition at line 35 of file EfficiencyLoader.h.

Referenced by EfficiencyLoader(), and newEvent().