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 {
9  // Get the names (sorted)
11  std::sort(names_.begin(), names_.end());
12 
13  // get the InputTags
14  for (std::vector<std::string>::const_iterator it = names_.begin(), ed = names_.end(); it != ed; ++it) {
15  tokens_.push_back( iC.consumes<edm::ValueMap<pat::LookupTableRecord> >(iConfig.getParameter<edm::InputTag>(*it) ));
16  }
17 
18  // prepare the Handles
19  handles_.resize(names_.size());
20 }
21 
22 void
24  for (size_t i = 0, n = names_.size(); i < n; ++i) {
25  iEvent.getByToken(tokens_[i], handles_[i]);
26  }
27 }
T getParameter(std::string const &) const
void newEvent(const edm::Event &event)
To be called for each new event, reads in the ValueMaps for efficiencies.
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
std::vector< std::string > names_
std::vector< edm::EDGetTokenT< edm::ValueMap< pat::LookupTableRecord > > > tokens_
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:194
int iEvent
Definition: GenABIO.cc:230
std::vector< edm::Handle< edm::ValueMap< pat::LookupTableRecord > > > handles_