CMS 3D CMS Logo

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 #include <iostream>
9 
10 // user include files
13 
19 
23 
24 //
25 // class declaration
26 //
27 
29 public:
31  ~JetResolutionDBReader() override;
32 
33 private:
34  void beginJob() override;
35  void analyze(const edm::Event&, const edm::EventSetup&) override;
36  void endJob() override;
37 
40 
42  bool m_print;
43 };
44 
46 public:
48 
49 private:
50  void analyze(const edm::Event&, const edm::EventSetup&) override;
51 
54 
56  bool m_print;
57 };
58 
60  m_era = iConfig.getUntrackedParameter<std::string>("era");
61  m_label = iConfig.getUntrackedParameter<std::string>("label");
62  m_print = iConfig.getUntrackedParameter<bool>("dump", true);
63  m_save_file = iConfig.getUntrackedParameter<bool>("saveFile", false);
64 }
65 
67 
70  std::cout << "Inspecting JER payload for label: " << m_label << std::endl;
71 
72  iSetup.get<JetResolutionRcd>().get(m_label, jerObjectHandle);
73 
74  if (m_print) {
75  jerObjectHandle->dump();
76  }
77 
78  if (m_save_file) {
79  std::string f = m_era + "_" + m_label + ".txt";
80  jerObjectHandle->saveToFile(f);
81  std::cout << "JER payload saved as " << f << std::endl;
82  }
83 }
84 
86 
88 
90  m_era = iConfig.getUntrackedParameter<std::string>("era");
91  m_label = iConfig.getUntrackedParameter<std::string>("label");
92  m_print = iConfig.getUntrackedParameter<bool>("dump", true);
93  m_save_file = iConfig.getUntrackedParameter<bool>("saveFile", false);
94 }
95 
98  std::cout << "Inspecting JER SF payload for label: " << m_label << std::endl;
99 
100  iSetup.get<JetResolutionScaleFactorRcd>().get(m_label, jerObjectHandle);
101 
102  if (m_print) {
103  jerObjectHandle->dump();
104  }
105 
106  if (m_save_file) {
107  std::string f = m_era + "_" + m_label + ".txt";
108  jerObjectHandle->saveToFile(f);
109  std::cout << "JER SF payload saved as " << f << std::endl;
110  }
111 }
112 
113 //define this as a plug-in
JetResolutionObject.h
ESHandle.h
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
JetResolutionDBReader::beginJob
void beginJob() override
Definition: JetResolutionDBReader.cc:85
gather_cfg.cout
cout
Definition: gather_cfg.py:144
JetResolutionScaleFactorDBReader::m_label
std::string m_label
Definition: JetResolutionDBReader.cc:53
JetResolutionDBReader::m_print
bool m_print
Definition: JetResolutionDBReader.cc:42
JetResolutionScaleFactorDBReader::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: JetResolutionDBReader.cc:96
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
EDAnalyzer.h
JetResolutionScaleFactorDBReader
Definition: JetResolutionDBReader.cc:45
JetResolutionScaleFactorDBReader::m_era
std::string m_era
Definition: JetResolutionDBReader.cc:52
edm::EDAnalyzer
Definition: EDAnalyzer.h:28
MakerMacros.h
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
JetResolutionDBReader::m_save_file
bool m_save_file
Definition: JetResolutionDBReader.cc:41
JetResolutionScaleFactorDBReader::m_save_file
bool m_save_file
Definition: JetResolutionDBReader.cc:55
JetResolutionDBReader::JetResolutionDBReader
JetResolutionDBReader(const edm::ParameterSet &)
Definition: JetResolutionDBReader.cc:59
JetResolutionRcd
Definition: JetResolutionRcd.h:9
JetResolutionDBReader::~JetResolutionDBReader
~JetResolutionDBReader() override
Definition: JetResolutionDBReader.cc:66
edm::ESHandle
Definition: DTSurvey.h:22
JetResolutionScaleFactorDBReader::m_print
bool m_print
Definition: JetResolutionDBReader.cc:56
JetResolutionDBReader::m_era
std::string m_era
Definition: JetResolutionDBReader.cc:38
JME::JetResolutionObject::dump
void dump() const
Definition: JetResolutionObject.cc:283
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
iEvent
int iEvent
Definition: GenABIO.cc:224
JetResolutionDBReader
Definition: JetResolutionDBReader.cc:28
edm::EventSetup
Definition: EventSetup.h:58
get
#define get
JetResolutionScaleFactorDBReader::JetResolutionScaleFactorDBReader
JetResolutionScaleFactorDBReader(const edm::ParameterSet &)
Definition: JetResolutionDBReader.cc:89
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
JetResolutionDBReader::endJob
void endJob() override
Definition: JetResolutionDBReader.cc:87
JetResolutionDBReader::m_label
std::string m_label
Definition: JetResolutionDBReader.cc:39
Frameworkfwd.h
EventSetup.h
JetResolutionScaleFactorRcd.h
JetResolutionScaleFactorRcd
Definition: JetResolutionScaleFactorRcd.h:9
ParameterSet.h
JME::JetResolutionObject::saveToFile
void saveToFile(const std::string &file) const
Definition: JetResolutionObject.cc:327
edm::Event
Definition: Event.h:73
JetResolutionDBReader::analyze
void analyze(const edm::Event &, const edm::EventSetup &) override
Definition: JetResolutionDBReader.cc:68
JetResolutionRcd.h