File indexing completed on 2024-04-06 12:23:58
0001 #include "PhysicsTools/PatAlgos/interface/EfficiencyLoader.h"
0002
0003 #include <algorithm>
0004
0005 using pat::helper::EfficiencyLoader;
0006
0007 EfficiencyLoader::EfficiencyLoader(const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iC) {
0008
0009 names_ = iConfig.getParameterNamesForType<edm::InputTag>();
0010 std::sort(names_.begin(), names_.end());
0011
0012
0013 for (std::vector<std::string>::const_iterator it = names_.begin(), ed = names_.end(); it != ed; ++it) {
0014 tokens_.push_back(iC.consumes<edm::ValueMap<pat::LookupTableRecord> >(iConfig.getParameter<edm::InputTag>(*it)));
0015 }
0016
0017
0018 handles_.resize(names_.size());
0019 }
0020
0021 void EfficiencyLoader::newEvent(const edm::Event &iEvent) {
0022 for (size_t i = 0, n = names_.size(); i < n; ++i) {
0023 iEvent.getByToken(tokens_[i], handles_[i]);
0024 }
0025 }