#include <EfficiencyLoader.h>
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::InputTag > | tags_ |
Definition at line 15 of file EfficiencyLoader.h.
pat::helper::EfficiencyLoader::EfficiencyLoader | ( | ) | [inline] |
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()); }
bool pat::helper::EfficiencyLoader::enabled | ( | ) | const [inline] |
'true' if this there is at least one efficiency configured
Definition at line 24 of file EfficiencyLoader.h.
References names_.
Referenced by pat::PATElectronProducer::fillElectron(), pat::PATElectronProducer::fillElectron2(), pat::PATMuonProducer::fillMuon(), pat::PATElectronProducer::produce(), pat::PATJetProducer::produce(), pat::PATMETProducer::produce(), pat::PATCompositeCandidateProducer::produce(), pat::PATPhotonProducer::produce(), pat::PATMuonProducer::produce(), pat::PATTauProducer::produce(), pat::PATPFParticleProducer::produce(), and pat::PATGenericParticleProducer::produce().
{ return !names_.empty(); }
void EfficiencyLoader::newEvent | ( | const edm::Event & | event | ) | const |
To be called for each new event, reads in the ValueMaps for efficiencies.
Definition at line 23 of file EfficiencyLoader.cc.
References edm::Event::getByLabel(), handles_, i, n, names_, and tags_.
Referenced by pat::PATElectronProducer::produce(), pat::PATJetProducer::produce(), pat::PATMETProducer::produce(), pat::PATCompositeCandidateProducer::produce(), pat::PATMuonProducer::produce(), pat::PATPhotonProducer::produce(), pat::PATTauProducer::produce(), pat::PATGenericParticleProducer::produce(), and pat::PATPFParticleProducer::produce().
void pat::helper::EfficiencyLoader::setEfficiencies | ( | pat::PATObject< T > & | obj, |
const R & | originalRef | ||
) | const |
Sets the efficiencies for this object, using the reference to the original objects.
Definition at line 41 of file EfficiencyLoader.h.
References handles_, i, n, names_, and pat::PATObject< ObjectType >::setEfficiency().
Referenced by pat::PATElectronProducer::fillElectron(), pat::PATElectronProducer::fillElectron2(), pat::PATMuonProducer::fillMuon(), pat::PATJetProducer::produce(), pat::PATMETProducer::produce(), pat::PATCompositeCandidateProducer::produce(), pat::PATPhotonProducer::produce(), pat::PATTauProducer::produce(), pat::PATGenericParticleProducer::produce(), and pat::PATPFParticleProducer::produce().
std::vector<edm::Handle< edm::ValueMap<pat::LookupTableRecord> > > pat::helper::EfficiencyLoader::handles_ [mutable, private] |
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().
std::vector<edm::InputTag> pat::helper::EfficiencyLoader::tags_ [private] |
Definition at line 35 of file EfficiencyLoader.h.
Referenced by EfficiencyLoader(), and newEvent().