18 : numeratorDir_(ps.getUntrackedParameter<
std::
string>(
"numeratorDir")),
19 denominatorDir_(ps.getUntrackedParameter<
std::
string>(
"denominatorDir", numeratorDir_)),
20 outputDir_(ps.getUntrackedParameter<
std::
string>(
"outputDir", numeratorDir_)),
22 numeratorSuffix_(ps.getUntrackedParameter<
std::
string>(
"numeratorSuffix",
"Num")),
23 denominatorSuffix_(ps.getUntrackedParameter<
std::
string>(
"denominatorSuffix",
"Den")),
27 : numeratorDir_(handler.numeratorDir_),
28 denominatorDir_(handler.denominatorDir_),
29 outputDir_(handler.outputDir_),
30 plotName_(handler.plotName_),
31 numeratorSuffix_(handler.numeratorSuffix_),
32 denominatorSuffix_(handler.denominatorSuffix_),
33 h_efficiency_(handler.h_efficiency_) {}
45 edm::LogWarning(
"L1TEfficiencyPlotHandler") << (!
num && !den ? numeratorName +
" && " + denominatorName
46 : !
num ? numeratorName
48 <<
" not gettable. Quitting booking" << endl;
52 TH1 *numH =
num->getTH1();
56 edm::LogWarning(
"L1TEfficiencyPlotHandler") << (!numH && !denH ? numeratorName +
" && " + denominatorName
57 : !
num ? numeratorName
59 <<
" is not TH1F. Quitting booking" << endl;
64 if (numH->GetNbinsX() != denH->GetNbinsX()) {
65 edm::LogWarning(
"L1TEfficiencyPlotHandler") <<
" # X bins in " << numeratorName <<
" and " << denominatorName
66 <<
" are different. Quitting booking" << endl;
75 if (numH->GetNbinsY() != denH->GetNbinsY()) {
76 edm::LogWarning(
"L1TEfficiencyPlotHandler") <<
" # Y bins in " << numeratorName <<
" and " << denominatorName
77 <<
" are different. Quitting booking" << endl;
100 TH1 *numH =
num->getTH1();
101 TH1 *denH = den->
getTH1();
104 effH->Divide(numH, denH, 1.0, 1.0,
"B");
109 : verbose_(ps.getUntrackedParameter<
bool>(
"verbose")), plotHandlers_() {
111 edm::LogInfo(
"L1TEfficiencyHarvesting") <<
"____________ Storage initialization ____________ " << endl;
114 for (
const auto &plotConfig : ps.
getUntrackedParameter<std::vector<edm::ParameterSet>>(
"plotCfgs")) {
115 vector<string>
plots = plotConfig.getUntrackedParameter<vector<string>>(
"plots");
128 edm::LogInfo(
"L1TEfficiencyHarvesting") <<
"Called endRun." << endl;
132 plotHandler.book(ibooker, igetter);
133 plotHandler.computeEfficiency(ibooker, igetter);
std::string numeratorSuffix_
std::string numeratorDir_
L1TEfficiencyHarvesting(const edm::ParameterSet &ps)
virtual void setCurrentFolder(std::string const &fullpath)
#define DEFINE_FWK_MODULE(type)
L1TEfficiencyPlotHandler(const edm::ParameterSet &ps, std::string plotName)
MonitorElement * h_efficiency_
std::string denominatorDir_
T getUntrackedParameter(std::string const &, T const &) const
virtual TH2F * getTH2F() const
bool is2D(HitType hitType)
~L1TEfficiencyHarvesting() override
void dqmEndJob(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter) override
Log< level::Info, false > LogInfo
L1TEfficiencyPlotHandlerCollection plotHandlers_
void book(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
std::string denominatorSuffix_
virtual TH1F * getTH1F() const
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
virtual MonitorElement * get(std::string const &fullpath) const
virtual TH1 * getTH1() const
void computeEfficiency(DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
Log< level::Warning, false > LogWarning
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())