30 auto pHistP = std::unique_ptr<TH1>((TH1*) this->GetPassedHistogram()->Clone());
31 auto pHistT = std::unique_ptr<TH1>((TH1*) this->GetTotalHistogram()->Clone());
34 double range[2] = {pHistP->GetXaxis()->GetXmin(), pHistP->GetXaxis()->GetXmax()};
37 std::unique_ptr<TH1> pHistPR =
nullptr;
38 std::unique_ptr<TH1> pHistTR =
nullptr;
40 if (GetDimension() == 1) {
41 pHistPR = std::unique_ptr<TH1>(pHistP->Rebin(1,
"tmp_passed", range));
42 pHistTR = std::unique_ptr<TH1>(pHistT->Rebin(1,
"tmp_total", range));
44 if (GetDimension() == 2) {
45 auto pHistPProj = std::unique_ptr<TH1>(
static_cast<TH2*
>(pHistP.get())->ProjectionX());
46 auto pHistTProj = std::unique_ptr<TH1>(
static_cast<TH2*
>(pHistT.get())->ProjectionX());
48 pHistPR = std::unique_ptr<TH1>(pHistPProj->Rebin(1,
"tmp_passed", range));
49 pHistTR = std::unique_ptr<TH1>(pHistTProj->Rebin(1,
"tmp_total", range));
53 auto pIntEff = std::make_unique<TEfficiency>(*pHistPR, *pHistTR);
54 pIntEff->SetBetaAlpha(fBeta_alpha);
55 pIntEff->SetBetaBeta(fBeta_beta);
56 pIntEff->SetConfidenceLevel(fConfLevel);
57 pIntEff->SetWeight(fWeight);
58 pIntEff->SetStatisticOption(fStatisticOption);
59 pIntEff->SetPosteriorMode(this->UsesPosteriorMode());
60 pIntEff->SetCentralInterval(this->UsesCentralInterval());
62 double effV = pIntEff->GetEfficiency(1);
63 double effL = pIntEff->GetEfficiencyErrorLow(1);
64 double effU = pIntEff->GetEfficiencyErrorUp(1);
66 return {effV, effL, effU};
74 if (GetDimension() != 1) {
79 auto* pPassed = (TH1D*) (this->GetPassedHistogram());
80 auto* pTotal = (TH1D*) (this->GetTotalHistogram());
87 double range[2] = {0};
93 range[0] = pPassed->GetXaxis()->GetXmin();
94 range[1] = pPassed->GetXaxis()->GetXmax();
98 auto& histPassedReb = *(pPassed->Rebin(1,
"ptmp", range));
99 auto& histTotalReb = *(pTotal->Rebin(1,
"ttmp", range));
101 TString sName = Form(
"%s_integrated", this->GetName());
104 auto* pIntEff =
new CbmQaEff(TEfficiency(histPassedReb, histTotalReb));
106 pIntEff->SetName(sName);
114 TString option = opt;
116 if (gPad && !option.Contains(
"same")) {
119 TString newName =
"";
121 newName.Form(
"%s%s", GetName(), postfix);
124 pNewEff->SetDirectory(
nullptr);
125 pNewEff->SetBit(kCanDelete);
126 if (gPad) gPad->IncrementPaletteColor(1, option);
127 pNewEff->AppendPad(option);
136 fpStats =
new TPaveText(0.20, 0.17, 0.80, 0.24,
"NDC");
147 Form(
"#epsilon_{tot} = %.4f_{-%.4f}^{+%.4f} (CL %3.3f)", effVal, effLErr, effUErr, fConfLevel));