CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
int i
Definition: DBlmapReader.cc:9
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:446
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:192
int iEvent
Definition: GenABIO.cc:230
std::vector< edm::Handle< edm::ValueMap< pat::LookupTableRecord > > > handles_
void newEvent(const edm::Event &event) const
To be called for each new event, reads in the ValueMaps for efficiencies.