CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/PhysicsTools/PatAlgos/src/EfficiencyLoader.cc

Go to the documentation of this file.
00001 #include "PhysicsTools/PatAlgos/interface/EfficiencyLoader.h"
00002 
00003 #include <algorithm>
00004 
00005 using pat::helper::EfficiencyLoader;
00006 
00007 EfficiencyLoader::EfficiencyLoader(const edm::ParameterSet &iConfig) 
00008 {
00009     // Get the names (sorted)
00010     names_ = iConfig.getParameterNamesForType<edm::InputTag>();
00011     std::sort(names_.begin(), names_.end());
00012     
00013     // get the InputTags
00014     for (std::vector<std::string>::const_iterator it = names_.begin(), ed = names_.end(); it != ed; ++it) {
00015         tags_.push_back( iConfig.getParameter<edm::InputTag>(*it) );
00016     }
00017 
00018     // prepare the Handles
00019     handles_.resize(names_.size());
00020 }
00021 
00022 void
00023 EfficiencyLoader::newEvent(const edm::Event &iEvent) const {
00024     for (size_t i = 0, n = names_.size(); i < n; ++i) {
00025         iEvent.getByLabel(tags_[i], handles_[i]);
00026     }    
00027 }