CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
L1TEfficiencyPlotHandler Class Reference

#include <L1TEfficiency_Harvesting.h>

Public Member Functions

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

Private Attributes

std::string m_dir
 
MonitorElementm_effHisto
 
std::string m_plotName
 

Detailed Description

Definition at line 41 of file L1TEfficiency_Harvesting.h.

Constructor & Destructor Documentation

L1TEfficiencyPlotHandler::L1TEfficiencyPlotHandler ( std::string  dir,
std::string  plotName 
)
inline

Definition at line 45 of file L1TEfficiency_Harvesting.h.

45  :
46  m_dir(dir), m_plotName(plotName), m_effHisto(0) { };
dbl *** dir
Definition: mlp_gen.cc:35
L1TEfficiencyPlotHandler::L1TEfficiencyPlotHandler ( const L1TEfficiencyPlotHandler handler)

Definition at line 34 of file L1TEfficiency_Harvesting.cc.

References m_dir, m_effHisto, and m_plotName.

34  {
35 
36  m_dir = handler.m_dir;
37  m_plotName = handler.m_plotName;
38  m_effHisto = handler.m_effHisto;
39 
40 }
L1TEfficiencyPlotHandler::~L1TEfficiencyPlotHandler ( )
inline

Definition at line 50 of file L1TEfficiency_Harvesting.h.

50 { };

Member Function Documentation

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

Definition at line 43 of file L1TEfficiency_Harvesting.cc.

References DQMStore::IBooker::book1D(), gather_cfg::cout, DQMStore::IGetter::get(), MonitorElement::getTH1F(), edm::max(), edm::min(), pileupDistInMC::num, and DQMStore::IBooker::setCurrentFolder().

43  {
44 
45  cout << "[L1TEfficiencyMuons_Harvesting:] Booking efficiency histo for "
46  << m_dir << " and " << m_plotName << endl;
47 
48  MonitorElement *num = igetter.get(m_dir+"/"+m_plotName+"Num");
49  MonitorElement *den = igetter.get(m_dir+"/"+m_plotName+"Den");
50 
51  if (!num || !den) {
52 
53  cout << "[L1TEfficiencyMuons_Harvesting:] "
54  << (!num && !den ? "Num && Den" : !num ? "Num" : "Den")
55  << " not gettable. Quitting booking" << endl;
56 
57  return;
58 
59  }
60 
61  TH1F *numH = num->getTH1F();
62  TH1F *denH = den->getTH1F();
63 
64  if (!numH || !denH) {
65 
66  cout << "[L1TEfficiencyMuons_Harvesting:] "
67  << (!numH && !denH ? "Num && Den" : !numH ? "Num" : "Den")
68  << " is not TH1F. Quitting booking" << endl;
69 
70  return;
71 
72  }
73 
74  int nBinsNum = numH->GetNbinsX();
75  int nBinsDen = denH->GetNbinsX();
76 
77  if (nBinsNum != nBinsDen) {
78 
79  cout << "[L1TEfficiencyMuons_Harvesting:] # bins in num and den is different. Quitting booking" << endl;
80 
81  return;
82 
83  }
84 
85  double min = numH->GetXaxis()->GetXmin();
86  double max = numH->GetXaxis()->GetXmax();
87 
88  ibooker.setCurrentFolder(m_dir);
89  m_effHisto = ibooker.book1D(m_plotName,m_plotName,nBinsNum,min,max);
90 
91 }
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:301
MonitorElement * book1D(Args &&...args)
Definition: DQMStore.h:115
T min(T a, T b)
Definition: MathUtil.h:58
void setCurrentFolder(const std::string &fullpath)
Definition: DQMStore.cc:273
TH1F * getTH1F(void) const
tuple cout
Definition: gather_cfg.py:145
void L1TEfficiencyPlotHandler::computeEfficiency ( DQMStore::IBooker ibooker,
DQMStore::IGetter igetter 
)

Definition at line 94 of file L1TEfficiency_Harvesting.cc.

References gather_cfg::cout, DQMStore::IGetter::get(), MonitorElement::getTH1F(), and pileupDistInMC::num.

94  {
95 
96  if (!m_effHisto)
97  return;
98 
99  cout << "[L1TEfficiencyMuons_Harvesting:] Computing efficiency for "
100  << m_plotName << endl;
101 
102  MonitorElement *num = igetter.get(m_dir+"/"+m_plotName+"Num");
103  MonitorElement *den = igetter.get(m_dir+"/"+m_plotName+"Den");
104 
105  TH1F *numH = num->getTH1F();
106  TH1F *denH = den->getTH1F();
107 
108  numH->Sumw2();
109  denH->Sumw2();
110 
111  TH1F *effH = m_effHisto->getTH1F();
112 
113  effH->Divide(numH,denH);
114 
115 }
MonitorElement * get(const std::string &path)
Definition: DQMStore.cc:301
TH1F * getTH1F(void) const
tuple cout
Definition: gather_cfg.py:145

Member Data Documentation

std::string L1TEfficiencyPlotHandler::m_dir
private

Definition at line 60 of file L1TEfficiency_Harvesting.h.

Referenced by L1TEfficiencyPlotHandler().

MonitorElement* L1TEfficiencyPlotHandler::m_effHisto
private

Definition at line 63 of file L1TEfficiency_Harvesting.h.

Referenced by L1TEfficiencyPlotHandler().

std::string L1TEfficiencyPlotHandler::m_plotName
private

Definition at line 61 of file L1TEfficiency_Harvesting.h.

Referenced by L1TEfficiencyPlotHandler().