CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
JetCorrectionESProducer.h
Go to the documentation of this file.
1 #ifndef JetCorrectionESProducer_h
2 #define JetCorrectionESProducer_h
3 
4 //
5 // Original Author: Fedor Ratnikov
6 // Created: Dec. 28, 2006 (originally JetCorrectionService, renamed in 2011)
7 //
8 
9 #include <string>
10 #include "boost/shared_ptr.hpp"
11 
18 
19 class JetCorrector;
20 
21 #define DEFINE_JET_CORRECTION_ESPRODUCER(corrector_, name_ ) \
22 typedef JetCorrectionESProducer <corrector_> name_; \
23 DEFINE_FWK_EVENTSETUP_MODULE(name_)
24 
25 template <class Corrector>
27 {
28 private:
32 
33 public:
35  {
36  std::string label = fConfig.getParameter<std::string>("@module_label");
37  mLevel = fConfig.getParameter<std::string>("level");
38  mAlgo = fConfig.getParameter<std::string>("algorithm");
39 
40  setWhatProduced(this, label);
41  }
42 
44 
45  boost::shared_ptr<JetCorrector> produce(JetCorrectionsRecord const& iRecord)
46  {
48  iRecord.get(mAlgo,JetCorParColl);
49  JetCorrectorParameters const& JetCorPar = (*JetCorParColl)[mLevel];
50  boost::shared_ptr<JetCorrector> mCorrector(new Corrector(JetCorPar, mParameterSet));
51  return mCorrector;
52  }
53 };
54 #endif
T getParameter(std::string const &) const
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
boost::shared_ptr< JetCorrector > produce(JetCorrectionsRecord const &iRecord)
void get(HolderT &iHolder) const
JetCorrectionESProducer(edm::ParameterSet const &fConfig)