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) {
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 }
mps_fire.i
i
Definition: mps_fire.py:355
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
dqmiodumpmetadata.n
n
Definition: dqmiodumpmetadata.py:28
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
pat::helper::KinResolutionsLoader::eslabels_
std::vector< std::string > eslabels_
Labels of the KinematicResolutionProvider in the EventSetup.
Definition: KinResolutionsLoader.h:43
pat::helper::KinResolutionsLoader::patlabels_
std::vector< std::string > patlabels_
Labels of the resolutions in PAT.
Definition: KinResolutionsLoader.h:41
edm::ParameterSetDescription::addOptional
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:105
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
pat::helper::KinResolutionsLoader
Definition: KinResolutionsLoader.h:18
KinResolutionsLoader.h
pat::helper::KinResolutionsLoader::handles_
std::vector< edm::ESHandle< KinematicResolutionProvider > > handles_
Handles to the EventSetup.
Definition: KinResolutionsLoader.h:45
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:36
pat::helper::KinResolutionsLoader::fillDescription
static void fillDescription(edm::ParameterSetDescription &iDesc)
Method for documentation and validation of PSet.
Definition: KinResolutionsLoader.cc:34
edm::ParameterSet::getParameterNamesForType
std::vector< std::string > getParameterNamesForType(bool trackiness=true) const
Definition: ParameterSet.h:168
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::EventSetup
Definition: EventSetup.h:57
edm::ParameterSetDescription::setAllowAnything
void setAllowAnything()
allow any parameter label/value pairs
Definition: ParameterSetDescription.cc:37
get
#define get
pat::helper::KinResolutionsLoader::newEvent
void newEvent(const edm::Event &event, const edm::EventSetup &setup)
To be called for each new event, reads in the EventSetup object.
Definition: KinResolutionsLoader.cc:27
KinematicResolutionRcd
Definition: KinematicResolutionRcd.h:24
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
KinematicResolutionRcd.h
edm::ParameterDescriptionNode::setComment
void setComment(std::string const &value)
Definition: ParameterDescriptionNode.cc:106
edm::Event
Definition: Event.h:73