CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
dqmoffline::l1t::L1TEfficiencyPlotHandler Class Reference

#include <L1TEfficiencyHarvesting.h>

Public Types

typedef dqm::legacy::DQMStore DQMStore
 
typedef dqm::legacy::MonitorElement MonitorElement
 

Public Member Functions

void book (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
 
void computeEfficiency (DQMStore::IBooker &ibooker, DQMStore::IGetter &igetter)
 
 L1TEfficiencyPlotHandler (const edm::ParameterSet &ps, std::string plotName)
 
 L1TEfficiencyPlotHandler (const L1TEfficiencyPlotHandler &handler)
 
 ~L1TEfficiencyPlotHandler ()
 

Private Attributes

std::string denominatorDir_
 
std::string denominatorSuffix_
 
MonitorElementh_efficiency_
 
std::string numeratorDir_
 
std::string numeratorSuffix_
 
std::string outputDir_
 
std::string plotName_
 

Detailed Description

Definition at line 35 of file L1TEfficiencyHarvesting.h.

Member Typedef Documentation

◆ DQMStore

Definition at line 37 of file L1TEfficiencyHarvesting.h.

◆ MonitorElement

Definition at line 38 of file L1TEfficiencyHarvesting.h.

Constructor & Destructor Documentation

◆ L1TEfficiencyPlotHandler() [1/2]

dqmoffline::l1t::L1TEfficiencyPlotHandler::L1TEfficiencyPlotHandler ( const edm::ParameterSet ps,
std::string  plotName 
)

Definition at line 17 of file L1TEfficiencyHarvesting.cc.

18  : numeratorDir_(ps.getUntrackedParameter<std::string>("numeratorDir")),
22  numeratorSuffix_(ps.getUntrackedParameter<std::string>("numeratorSuffix", "Num")),
23  denominatorSuffix_(ps.getUntrackedParameter<std::string>("denominatorSuffix", "Den")),
24  h_efficiency_() {}

◆ L1TEfficiencyPlotHandler() [2/2]

dqmoffline::l1t::L1TEfficiencyPlotHandler::L1TEfficiencyPlotHandler ( const L1TEfficiencyPlotHandler handler)

Definition at line 26 of file L1TEfficiencyHarvesting.cc.

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_) {}

◆ ~L1TEfficiencyPlotHandler()

dqmoffline::l1t::L1TEfficiencyPlotHandler::~L1TEfficiencyPlotHandler ( )
inline

Definition at line 44 of file L1TEfficiencyHarvesting.h.

44 {};

Member Function Documentation

◆ book()

void dqmoffline::l1t::L1TEfficiencyPlotHandler::book ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 35 of file L1TEfficiencyHarvesting.cc.

35  {
36  edm::LogInfo("L1TEfficiencyPlotHandler")
37  << "Booking efficiency histogram for " << outputDir_ << " and " << plotName_ << endl;
38 
39  std::string numeratorName = numeratorDir_ + "/" + plotName_ + numeratorSuffix_;
40  std::string denominatorName = denominatorDir_ + "/" + plotName_ + denominatorSuffix_;
41  MonitorElement *num = igetter.get(numeratorName);
42  MonitorElement *den = igetter.get(denominatorName);
43 
44  if (!num || !den) {
45  edm::LogWarning("L1TEfficiencyPlotHandler")
46  << (!num && !den ? numeratorName + " && " + denominatorName : !num ? numeratorName : denominatorName)
47  << " not gettable. Quitting booking" << endl;
48  return;
49  }
50 
51  TH1 *numH = num->getTH1();
52  TH1 *denH = den->getTH1();
53 
54  if (!numH || !denH) {
55  edm::LogWarning("L1TEfficiencyPlotHandler")
56  << (!numH && !denH ? numeratorName + " && " + denominatorName : !num ? numeratorName : denominatorName)
57  << " is not TH1F. Quitting booking" << endl;
58 
59  return;
60  }
61 
62  if (numH->GetNbinsX() != denH->GetNbinsX()) {
63  edm::LogWarning("L1TEfficiencyPlotHandler") << " # X bins in " << numeratorName << " and " << denominatorName
64  << " are different. Quitting booking" << endl;
65  return;
66  }
67 
68  MonitorElement::Kind kind = num->kind();
71 
72  if (is2D) {
73  if (numH->GetNbinsY() != denH->GetNbinsY()) {
74  edm::LogWarning("L1TEfficiencyPlotHandler") << " # Y bins in " << numeratorName << " and " << denominatorName
75  << " are different. Quitting booking" << endl;
76  return;
77  }
78  }
79 
81  if (is1D) {
82  h_efficiency_ = ibooker.book1D(plotName_, den->getTH1F());
83  } else if (is2D) {
84  h_efficiency_ = ibooker.book2D(plotName_, den->getTH2F());
85  }
87  }

References dqm::implementation::IBooker::book1D(), dqm::implementation::IBooker::book2D(), denominatorDir_, denominatorSuffix_, dqm::implementation::IGetter::get(), dqm::legacy::MonitorElement::getTH1(), dqm::legacy::MonitorElement::getTH1F(), dqm::legacy::MonitorElement::getTH2F(), h_efficiency_, fastTrackerRecHitType::is2D(), CalibrationSummaryClient_cfi::kind, EgammaValidation_cff::num, numeratorDir_, numeratorSuffix_, outputDir_, plotName_, dqm::implementation::NavigatorBase::setCurrentFolder(), dqm::impl::MonitorElement::setEfficiencyFlag(), AlCaHLTBitMon_QueryRunRegistry::string, MonitorElementData::TH1D, MonitorElementData::TH1F, MonitorElementData::TH2D, and MonitorElementData::TH2F.

◆ computeEfficiency()

void dqmoffline::l1t::L1TEfficiencyPlotHandler::computeEfficiency ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 89 of file L1TEfficiencyHarvesting.cc.

89  {
90  if (!h_efficiency_)
91  return;
92 
93  edm::LogInfo("L1TEfficiencyPlotHandler") << " Computing efficiency for " << plotName_ << endl;
94 
97 
98  TH1 *numH = num->getTH1();
99  TH1 *denH = den->getTH1();
100  TH1 *effH = h_efficiency_->getTH1();
101 
102  effH->Divide(numH, denH, 1.0, 1.0, "B");
103  }

References denominatorDir_, denominatorSuffix_, dqm::implementation::IGetter::get(), dqm::legacy::MonitorElement::getTH1(), h_efficiency_, EgammaValidation_cff::num, numeratorDir_, numeratorSuffix_, and plotName_.

Member Data Documentation

◆ denominatorDir_

std::string dqmoffline::l1t::L1TEfficiencyPlotHandler::denominatorDir_
private

Definition at line 54 of file L1TEfficiencyHarvesting.h.

Referenced by book(), and computeEfficiency().

◆ denominatorSuffix_

std::string dqmoffline::l1t::L1TEfficiencyPlotHandler::denominatorSuffix_
private

Definition at line 58 of file L1TEfficiencyHarvesting.h.

Referenced by book(), and computeEfficiency().

◆ h_efficiency_

MonitorElement* dqmoffline::l1t::L1TEfficiencyPlotHandler::h_efficiency_
private

Definition at line 60 of file L1TEfficiencyHarvesting.h.

Referenced by book(), and computeEfficiency().

◆ numeratorDir_

std::string dqmoffline::l1t::L1TEfficiencyPlotHandler::numeratorDir_
private

Definition at line 53 of file L1TEfficiencyHarvesting.h.

Referenced by book(), and computeEfficiency().

◆ numeratorSuffix_

std::string dqmoffline::l1t::L1TEfficiencyPlotHandler::numeratorSuffix_
private

Definition at line 57 of file L1TEfficiencyHarvesting.h.

Referenced by book(), and computeEfficiency().

◆ outputDir_

std::string dqmoffline::l1t::L1TEfficiencyPlotHandler::outputDir_
private

◆ plotName_

std::string dqmoffline::l1t::L1TEfficiencyPlotHandler::plotName_
private

Definition at line 56 of file L1TEfficiencyHarvesting.h.

Referenced by book(), and computeEfficiency().

MonitorElementData::Kind::TH1F
dqm::impl::MonitorElement::setEfficiencyFlag
void setEfficiencyFlag()
Definition: MonitorElement.h:267
dqm::implementation::NavigatorBase::setCurrentFolder
virtual void setCurrentFolder(std::string const &fullpath)
Definition: DQMStore.cc:32
dqm::legacy::MonitorElement
Definition: MonitorElement.h:462
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
dqmoffline::l1t::L1TEfficiencyPlotHandler::outputDir_
std::string outputDir_
Definition: L1TEfficiencyHarvesting.h:55
dqm::legacy::MonitorElement::getTH1F
virtual TH1F * getTH1F() const
Definition: MonitorElement.h:479
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
MonitorElementData::Kind::TH2D
MonitorElementData::Kind::TH2F
L1TEGammaDiff_cfi.plotName
plotName
Definition: L1TEGammaDiff_cfi.py:21
dqm::legacy::MonitorElement::getTH1
virtual TH1 * getTH1() const
Definition: MonitorElement.h:475
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
dqmoffline::l1t::L1TEfficiencyPlotHandler::plotName_
std::string plotName_
Definition: L1TEfficiencyHarvesting.h:56
MonitorElementData::Kind
Kind
Definition: MonitorElementCollection.h:129
MonitorElementData::Kind::TH1D
CalibrationSummaryClient_cfi.kind
kind
Definition: CalibrationSummaryClient_cfi.py:37
EgammaValidation_cff.num
num
Definition: EgammaValidation_cff.py:34
dqm::implementation::IBooker::book2D
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
Definition: DQMStore.h:177
dqmoffline::l1t::L1TEfficiencyPlotHandler::numeratorSuffix_
std::string numeratorSuffix_
Definition: L1TEfficiencyHarvesting.h:57
fastTrackerRecHitType::is2D
bool is2D(HitType hitType)
Definition: FastTrackerRecHit.h:36
dqm::implementation::IGetter::get
virtual MonitorElement * get(std::string const &fullpath) const
Definition: DQMStore.cc:651
dqmoffline::l1t::L1TEfficiencyPlotHandler::denominatorSuffix_
std::string denominatorSuffix_
Definition: L1TEfficiencyHarvesting.h:58
dqmoffline::l1t::L1TEfficiencyPlotHandler::numeratorDir_
std::string numeratorDir_
Definition: L1TEfficiencyHarvesting.h:53
dqmoffline::l1t::L1TEfficiencyPlotHandler::h_efficiency_
MonitorElement * h_efficiency_
Definition: L1TEfficiencyHarvesting.h:60
dqmoffline::l1t::L1TEfficiencyPlotHandler::denominatorDir_
std::string denominatorDir_
Definition: L1TEfficiencyHarvesting.h:54
dqm::implementation::IBooker::book1D
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
Definition: DQMStore.h:98
dqm::legacy::MonitorElement::getTH2F
virtual TH2F * getTH2F() const
Definition: MonitorElement.h:491