CMS 3D CMS Logo

EfficiencyLoader.cc
Go to the documentation of this file.
2 
3 #include <algorithm>
4 
6 
7 EfficiencyLoader::EfficiencyLoader(const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iC) {
8  // Get the names (sorted)
10  std::sort(names_.begin(), names_.end());
11 
12  // get the InputTags
13  for (std::vector<std::string>::const_iterator it = names_.begin(), ed = names_.end(); it != ed; ++it) {
14  tokens_.push_back(iC.consumes<edm::ValueMap<pat::LookupTableRecord> >(iConfig.getParameter<edm::InputTag>(*it)));
15  }
16 
17  // prepare the Handles
18  handles_.resize(names_.size());
19 }
20 
22  for (size_t i = 0, n = names_.size(); i < n; ++i) {
23  iEvent.getByToken(tokens_[i], handles_[i]);
24  }
25 }
void newEvent(const edm::Event &event)
To be called for each new event, reads in the ValueMaps for efficiencies.
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
std::vector< std::string > names_
std::vector< edm::EDGetTokenT< edm::ValueMap< pat::LookupTableRecord > > > tokens_
int iEvent
Definition: GenABIO.cc:224
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:179
std::vector< edm::Handle< edm::ValueMap< pat::LookupTableRecord > > > handles_