3 #include "TEfficiency.h"
6 : kLogCategory_(log_category) {}
9 const TH1F&
passed,
const TH1F&
total,
const char*
name,
const char*
title, Double_t confidence_level) {
10 const TAxis* total_x =
total.GetXaxis();
12 TProfile* eff_profile =
new TProfile(
name,
title, total_x->GetNbins(), total_x->GetXmin(), total_x->GetXmax());
13 eff_profile->GetXaxis()->SetTitle(total_x->GetTitle());
14 eff_profile->GetYaxis()->SetTitle(
"#epsilon");
17 Double_t num_passed =
passed.GetBinContent(
bin);
18 Double_t num_total =
total.GetBinContent(
bin);
20 if (num_passed > num_total) {
22 <<
"These numbers are not consistent." << std::endl;
27 eff_profile->SetBinEntries(
bin, 0);
33 Double_t
lower_bound = TEfficiency::ClopperPearson(num_total, num_passed, confidence_level,
false);
34 Double_t
upper_bound = TEfficiency::ClopperPearson(num_total, num_passed, confidence_level,
true);
40 eff_profile->SetBinError(
bin,
error);
41 eff_profile->SetBinEntries(
bin, 1);
52 TH2F* eff_hist = dynamic_cast<TH2F*>(eff.CreateHistogram());
53 eff_hist->SetName(
name);
54 eff_hist->SetTitle(
title);
56 const TAxis* total_x =
total.GetXaxis();
57 TAxis* eff_hist_x = eff_hist->GetXaxis();
58 eff_hist_x->SetTitle(total_x->GetTitle());
60 const char*
label = total_x->GetBinLabel(
bin);
64 const TAxis* total_y =
total.GetYaxis();
65 TAxis* eff_hist_y = eff_hist->GetYaxis();
66 eff_hist_y->SetTitle(total_y->GetTitle());
68 const char*
label = total_y->GetBinLabel(
bin);
77 const TString& passed_path,
78 const TString& total_path,
80 const TString& eff_name,
81 const TString& eff_title) {
82 TH1F*
passed = getElement<TH1F>(getter, passed_path);
88 TH1F*
total = getElement<TH1F>(getter, total_path);
89 if (
total ==
nullptr) {
102 const TString& passed_path,
103 const TString& total_path,
105 const TString& eff_name,
106 const TString& eff_title) {
107 TH2F*
passed = getElement<TH2F>(getter, passed_path);
113 TH2F*
total = getElement<TH2F>(getter, total_path);
114 if (
total ==
nullptr) {
121 booker.
book2D(eff_name, eff);