39 theDbe->setCurrentFolder(
"Muons/EfficiencyAnalyzer");
41 LogTrace(
metname)<<
"[EfficiencyPlotter] beginJob: Parameters initialization";
44 etaBin =
parameters.getParameter<
int>(
"etaBin");
47 h_eff_eta_TightMu = theDbe->book1D(
"Eff_eta_TightMu",
"TightMu Efficiency vs #eta", etaBin, etaMin, etaMax);
48 h_eff_hp_eta_TightMu = theDbe->book1D(
"Eff_hp_eta_TightMu",
"High Pt TightMu Efficiency vs #eta", etaBin, etaMin, etaMax);
50 phiBin =
parameters.getParameter<
int>(
"phiBin");
53 h_eff_phi_TightMu = theDbe->book1D(
"Eff_phi_TightMu",
"TightMu Efficiency vs #phi", phiBin, phiMin, phiMax);
58 h_eff_pt_TightMu = theDbe->book1D(
"Eff_pt_TightMu",
"TightMu Efficiency vs Pt", ptBin, ptMin, ptMax);
59 h_eff_pt_barrel_TightMu = theDbe->book1D(
"Eff_pt_barrel_TightMu",
"Barrel: TightMu Efficiency vs Pt", ptBin, ptMin, ptMax);
60 h_eff_pt_endcap_TightMu = theDbe->book1D(
"Eff_pt_endcap_TightMu",
"Endcap: TightMu Efficiency vs Pt", ptBin, ptMin, ptMax);
63 h_eff_eta_TightMu->setEfficiencyFlag();
64 h_eff_hp_eta_TightMu->setEfficiencyFlag();
65 h_eff_phi_TightMu->setEfficiencyFlag();
66 h_eff_pt_TightMu->setEfficiencyFlag();
67 h_eff_pt_barrel_TightMu->setEfficiencyFlag();
68 h_eff_pt_endcap_TightMu->setEfficiencyFlag();
91 LogTrace(
metname)<<
"[EfficiencyPlotter]: endRun, performing the DQM end of run client operation";
95 string numpath_pt =
"Muons/EfficiencyAnalyzer/passProbes_TightMu_pt";
96 string denpath_pt =
"Muons/EfficiencyAnalyzer/allProbes_pt";
101 if (Numerator_pt && Denominator_pt){
103 TH1F *h_numerator_pt = Numerator_pt->
getTH1F();
104 TH1F *h_denominator_pt = Denominator_pt->
getTH1F();
106 TH1F *h_eff_pt = h_eff_pt_TightMu->getTH1F();
108 if (h_eff_pt->GetSumw2N() == 0) h_eff_pt->Sumw2();
111 h_eff_pt->Divide(h_numerator_pt, h_denominator_pt, 1., 1.,
"B");
115 string numpath_barrel_pt =
"Muons/EfficiencyAnalyzer/passProbes_TightMu_barrel_pt";
116 string denpath_barrel_pt =
"Muons/EfficiencyAnalyzer/allProbes_barrel_pt";
118 MonitorElement *Numerator_barrel_pt = theDbe->get(numpath_barrel_pt);
119 MonitorElement *Denominator_barrel_pt = theDbe->get(denpath_barrel_pt);
121 if (Numerator_barrel_pt && Denominator_barrel_pt){
123 TH1F *h_numerator_barrel_pt = Numerator_barrel_pt->
getTH1F();
124 TH1F *h_denominator_barrel_pt = Denominator_barrel_pt->
getTH1F();
126 TH1F *h_eff_barrel_pt = h_eff_pt_barrel_TightMu->getTH1F();
128 if (h_eff_barrel_pt->GetSumw2N() == 0) h_eff_barrel_pt->Sumw2();
130 h_eff_barrel_pt->Divide(h_numerator_barrel_pt, h_denominator_barrel_pt, 1., 1.,
"B");
134 string numpath_endcap_pt =
"Muons/EfficiencyAnalyzer/passProbes_TightMu_endcap_pt";
135 string denpath_endcap_pt =
"Muons/EfficiencyAnalyzer/allProbes_endcap_pt";
137 MonitorElement *Numerator_endcap_pt = theDbe->get(numpath_endcap_pt);
138 MonitorElement *Denominator_endcap_pt = theDbe->get(denpath_endcap_pt);
140 if (Numerator_endcap_pt && Denominator_endcap_pt){
142 TH1F *h_numerator_endcap_pt = Numerator_endcap_pt->
getTH1F();
143 TH1F *h_denominator_endcap_pt = Denominator_endcap_pt->
getTH1F();
145 TH1F *h_eff_endcap_pt = h_eff_pt_endcap_TightMu->getTH1F();
147 if (h_eff_endcap_pt->GetSumw2N() == 0) h_eff_endcap_pt->Sumw2();
149 h_eff_endcap_pt->Divide(h_numerator_endcap_pt, h_denominator_endcap_pt, 1., 1.,
"B");
153 string numpath_eta =
"Muons/EfficiencyAnalyzer/passProbes_TightMu_eta";
154 string denpath_eta =
"Muons/EfficiencyAnalyzer/allProbes_eta";
159 if (Numerator_eta && Denominator_eta){
161 TH1F *h_numerator_eta = Numerator_eta->
getTH1F();
162 TH1F *h_denominator_eta = Denominator_eta->
getTH1F();
164 TH1F *h_eff_eta = h_eff_eta_TightMu->getTH1F();
166 if (h_eff_eta->GetSumw2N() == 0) h_eff_eta->Sumw2();
168 h_eff_eta->Divide(h_numerator_eta, h_denominator_eta, 1., 1.,
"B");
172 string numpath_hp_eta =
"Muons/EfficiencyAnalyzer/passProbes_TightMu_hp_eta";
173 string denpath_hp_eta =
"Muons/EfficiencyAnalyzer/allProbes_hp_eta";
178 if (Numerator_hp_eta && Denominator_hp_eta){
180 TH1F *h_numerator_hp_eta = Numerator_hp_eta->
getTH1F();
181 TH1F *h_denominator_hp_eta = Denominator_hp_eta->
getTH1F();
183 TH1F *h_eff_hp_eta = h_eff_hp_eta_TightMu->getTH1F();
185 if (h_eff_hp_eta->GetSumw2N() == 0) h_eff_hp_eta->Sumw2();
187 h_eff_hp_eta->Divide(h_numerator_hp_eta, h_denominator_hp_eta, 1., 1.,
"B");
192 string numpath_phi =
"Muons/EfficiencyAnalyzer/passProbes_TightMu_phi";
193 string denpath_phi =
"Muons/EfficiencyAnalyzer/allProbes_phi";
198 if (Numerator_phi && Denominator_phi){
200 TH1F *h_numerator_phi = Numerator_phi->
getTH1F();
201 TH1F *h_denominator_phi = Denominator_phi->
getTH1F();
203 TH1F *h_eff_phi = h_eff_phi_TightMu->getTH1F();
205 if (h_eff_phi->GetSumw2N() == 0) h_eff_phi->Sumw2();
207 h_eff_phi->Divide(h_numerator_phi, h_denominator_phi, 1., 1.,
"B");
268 theDbe->rmdir(
"Muons/EfficiencyAnalyzer");
void endLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &c)
DQM Client Diagnostic.
LuminosityBlockID id() const
const std::string metname
EfficiencyPlotter(const edm::ParameterSet &ps)
Constructor.
void beginLuminosityBlock(edm::LuminosityBlock const &lumiSeg, edm::EventSetup const &context)
virtual ~EfficiencyPlotter()
Destructor.
void endRun(edm::Run const &run, edm::EventSetup const &eSetup)
void analyze(const edm::Event &e, const edm::EventSetup &c)
Analyze.
TH1F * getTH1F(void) const
void beginJob(void)
BeginJob.
void beginRun(edm::Run const &run, edm::EventSetup const &eSetup)
LuminosityBlockNumber_t luminosityBlock() const