CMS 3D CMS Logo

Public Member Functions | Private Attributes

JetCorrectionESChain Class Reference

#include <JetCorrectionESChain.h>

Inheritance diagram for JetCorrectionESChain:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

List of all members.

Public Member Functions

 JetCorrectionESChain (edm::ParameterSet const &fParameters)
boost::shared_ptr< JetCorrectorproduce (JetCorrectionsRecord const &)
 ~JetCorrectionESChain ()

Private Attributes

boost::shared_ptr< JetCorrectormChainCorrector
std::vector< std::string > mCorrectors

Detailed Description

Definition at line 24 of file JetCorrectionESChain.h.


Constructor & Destructor Documentation

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.

{}

Member Function Documentation

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;
}

Member Data Documentation

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().