#include <JetCorrectionESChain.h>
Public Member Functions | |
JetCorrectionESChain (edm::ParameterSet const &fParameters) | |
boost::shared_ptr< JetCorrector > | produce (JetCorrectionsRecord const &) |
~JetCorrectionESChain () | |
Private Attributes | |
boost::shared_ptr< JetCorrector > | mChainCorrector |
std::vector< std::string > | mCorrectors |
Definition at line 24 of file JetCorrectionESChain.h.
JetCorrectionESChain::JetCorrectionESChain | ( | edm::ParameterSet const & | fParameters | ) |
Definition at line 17 of file JetCorrectionESChain.cc.
References Exception, spr::find(), edm::ParameterSet::getParameter(), label, mCorrectors, and edm::ESProducer::setWhatProduced().
: mCorrectors (fParameters.getParameter < std::vector<std::string> > ("correctors")), mChainCorrector (new ChainedJetCorrector ()) { std::string label(fParameters.getParameter<std::string>("@module_label")); if (std::find(mCorrectors.begin(), mCorrectors.end(), label) != mCorrectors.end()) { throw cms::Exception("Recursion is not allowed") << "JetCorrectionESChain: corrector " << label << " is chained to itself"; } setWhatProduced(this, label); }
JetCorrectionESChain::~JetCorrectionESChain | ( | ) |
Definition at line 29 of file JetCorrectionESChain.cc.
{}
boost::shared_ptr< JetCorrector > JetCorrectionESChain::produce | ( | JetCorrectionsRecord const & | fRecord | ) |
Definition at line 31 of file JetCorrectionESChain.cc.
References ChainedJetCorrector::clear(), edm::eventsetup::EventSetupRecord::get(), patZpeak::handle, i, mChainCorrector, mCorrectors, and ChainedJetCorrector::push_back().
{ ChainedJetCorrector* corrector = dynamic_cast<ChainedJetCorrector*>(&*mChainCorrector); corrector->clear (); for (size_t i = 0; i < mCorrectors.size(); ++i) { edm::ESHandle <JetCorrector> handle; fRecord.get(mCorrectors[i], handle); corrector->push_back(&*handle); } return mChainCorrector; }
boost::shared_ptr<JetCorrector> JetCorrectionESChain::mChainCorrector [private] |
Definition at line 33 of file JetCorrectionESChain.h.
Referenced by produce().
std::vector<std::string> JetCorrectionESChain::mCorrectors [private] |
Definition at line 32 of file JetCorrectionESChain.h.
Referenced by JetCorrectionESChain(), and produce().