CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
JetResolutionDBReader.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Author: Sébastien Brochet
4 //
5 
6 // system include files
7 #include <memory>
8 
9 // user include files
12 
18 
22 
23 //
24 // class declaration
25 //
26 
28  public:
31 
32 
33  private:
34  virtual void beginJob() override ;
35  virtual void analyze(const edm::Event&, const edm::EventSetup&) override;
36  virtual void endJob() override ;
37 
40 
42  bool m_print;
43 };
44 
46  public:
48 
49 
50  private:
51  virtual void analyze(const edm::Event&, const edm::EventSetup&) override;
52 
55 
57  bool m_print;
58 };
59 
60 
62 {
63  m_era = iConfig.getUntrackedParameter<std::string>("era");
64  m_label = iConfig.getUntrackedParameter<std::string>("label");
65  m_print = iConfig.getUntrackedParameter<bool>("dump", true);
66  m_save_file = iConfig.getUntrackedParameter<bool>("saveFile", false);
67 }
68 
69 
71 {
72 
73 }
74 
76 {
78  std::cout << "Inspecting JER payload for label: "<< m_label << std::endl;
79 
80  iSetup.get<JetResolutionRcd>().get(m_label, jerObjectHandle);
81 
82  if (m_print) {
83  jerObjectHandle->dump();
84  }
85 
86  if (m_save_file) {
87  std::string f = m_era + "_" + m_label + ".txt";
88  jerObjectHandle->saveToFile(f);
89  std::cout << "JER payload saved as " << f << std::endl;
90  }
91 }
92 
94 {
95 }
96 
98 {
99 }
100 
102 {
103  m_era = iConfig.getUntrackedParameter<std::string>("era");
104  m_label = iConfig.getUntrackedParameter<std::string>("label");
105  m_print = iConfig.getUntrackedParameter<bool>("dump", true);
106  m_save_file = iConfig.getUntrackedParameter<bool>("saveFile", false);
107 }
108 
110 {
112  std::cout << "Inspecting JER SF payload for label: "<< m_label << std::endl;
113 
114  iSetup.get<JetResolutionScaleFactorRcd>().get(m_label, jerObjectHandle);
115 
116  if (m_print) {
117  jerObjectHandle->dump();
118  }
119 
120  if (m_save_file) {
121  std::string f = m_era + "_" + m_label + ".txt";
122  jerObjectHandle->saveToFile(f);
123  std::cout << "JER SF payload saved as " << f << std::endl;
124  }
125 }
126 
127 //define this as a plug-in
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
JetResolutionScaleFactorDBReader(const edm::ParameterSet &)
int iEvent
Definition: GenABIO.cc:230
double f[11][100]
const T & get() const
Definition: EventSetup.h:56
virtual void analyze(const edm::Event &, const edm::EventSetup &) override
virtual void beginJob() override
JetResolutionDBReader(const edm::ParameterSet &)
tuple cout
Definition: gather_cfg.py:145
virtual void endJob() override
virtual void analyze(const edm::Event &, const edm::EventSetup &) override