CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
KinResolutionsLoader.cc
Go to the documentation of this file.
3 
4 #include <algorithm>
5 
7 
8 KinResolutionsLoader::KinResolutionsLoader(const edm::ParameterSet &iConfig)
9 {
10  // Get the names (sorted)
12 
13  // get the InputTags
14  for (std::vector<std::string>::const_iterator it = patlabels_.begin(), ed = patlabels_.end(); it != ed; ++it) {
15  eslabels_.push_back( iConfig.getParameter<std::string>(*it) );
16  }
17 
18  // prepare the Handles
19  handles_.resize(patlabels_.size());
20 
21  // 'default' maps to empty string
22  for (std::vector<std::string>::iterator it = patlabels_.begin(), ed = patlabels_.end(); it != ed; ++it) {
23  if (*it == "default") *it = "";
24  }
25 }
26 
27 void
29  for (size_t i = 0, n = patlabels_.size(); i < n; ++i) {
30  iSetup.get<KinematicResolutionRcd>().get(eslabels_[i], handles_[i]);
31  handles_[i]->setup(iSetup);
32  }
33 }
34 
35 void
37  iDesc.add<bool>("addResolutions",false)->setComment("Add resolutions into this PAT Object");
38  edm::ParameterSetDescription resolutionPSet;
39  resolutionPSet.setAllowAnything();
40  iDesc.addOptional("resolutions", resolutionPSet)->setComment("Resolution values to get from EventSetup");
41 }
T getParameter(std::string const &) const
void setComment(std::string const &value)
int i
Definition: DBlmapReader.cc:9
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:192
int iEvent
Definition: GenABIO.cc:230
std::vector< std::string > eslabels_
Labels of the KinematicResolutionProvider in the EventSetup.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
static void fillDescription(edm::ParameterSetDescription &iDesc)
Method for documentation and validation of PSet.
const T & get() const
Definition: EventSetup.h:55
std::vector< std::string > patlabels_
Labels of the resolutions in PAT.
void newEvent(const edm::Event &event, const edm::EventSetup &setup) const
To be called for each new event, reads in the EventSetup object.
std::vector< edm::ESHandle< KinematicResolutionProvider > > handles_
Handles to the EventSetup.