CMS 3D CMS Logo

KinResolutionsLoader.cc
Go to the documentation of this file.
3 
4 #include <algorithm>
5 
7 
8 KinResolutionsLoader::KinResolutionsLoader(const edm::ParameterSet &iConfig) {
9  // Get the names (sorted)
11 
12  // get the InputTags
13  for (std::vector<std::string>::const_iterator it = patlabels_.begin(), ed = patlabels_.end(); it != ed; ++it) {
14  eslabels_.push_back(iConfig.getParameter<std::string>(*it));
15  }
16 
17  // prepare the Handles
18  handles_.resize(patlabels_.size());
19 
20  // 'default' maps to empty string
21  for (std::vector<std::string>::iterator it = patlabels_.begin(), ed = patlabels_.end(); it != ed; ++it) {
22  if (*it == "default")
23  *it = "";
24  }
25 }
26 
28  for (size_t i = 0, n = patlabels_.size(); i < n; ++i) {
29  iSetup.get<KinematicResolutionRcd>().get(eslabels_[i], handles_[i]);
30  handles_[i]->setup(iSetup);
31  }
32 }
33 
35  iDesc.add<bool>("addResolutions", false)->setComment("Add resolutions into this PAT Object");
36  edm::ParameterSetDescription resolutionPSet;
37  resolutionPSet.setAllowAnything();
38  iDesc.addOptional("resolutions", resolutionPSet)->setComment("Resolution values to get from EventSetup");
39 }
T getParameter(std::string const &) const
void setComment(std::string const &value)
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
void setAllowAnything()
allow any parameter label/value pairs
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:168
int iEvent
Definition: GenABIO.cc:224
std::vector< std::string > eslabels_
Labels of the KinematicResolutionProvider in the EventSetup.
void newEvent(const edm::Event &event, const edm::EventSetup &setup)
To be called for each new event, reads in the EventSetup object.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescription(edm::ParameterSetDescription &iDesc)
Method for documentation and validation of PSet.
std::vector< std::string > patlabels_
Labels of the resolutions in PAT.
T get() const
Definition: EventSetup.h:73
std::vector< edm::ESHandle< KinematicResolutionProvider > > handles_
Handles to the EventSetup.