20 void RCutFlowReport::Print()
22 const auto allEntries = fCutInfos.empty() ? 0ULL : fCutInfos.begin()->GetAll();
23 for (
auto &&ci : fCutInfos) {
24 const auto &name = ci.GetName();
25 const auto pass = ci.GetPass();
26 const auto all = ci.GetAll();
27 const auto eff = ci.GetEff();
28 const auto cumulativeEff = 100.f * float(pass) / float(allEntries);
29 Printf(
"%-10s: pass=%-10lld all=%-10lld -- eff=%3.2f %% cumulative eff=%3.2f %%", name.c_str(), pass, all, eff, cumulativeEff);
32 const TCutInfo &RCutFlowReport::operator[](std::string_view cutName)
34 if (cutName.empty()) {
35 throw std::runtime_error(
"Cannot look for an unnamed cut.");
37 auto pred = [&cutName](
const TCutInfo &ci) {
return ci.GetName() == cutName; };
38 const auto ciItEnd = fCutInfos.end();
39 const auto it = std::find_if(fCutInfos.begin(), ciItEnd, pred);
41 std::string err =
"Cannot find a cut called \"";
43 err +=
"\". Available named cuts are: \n";
44 for (
auto &&ci : fCutInfos) {
45 err +=
" - " + ci.GetName() +
"\n";
47 throw std::runtime_error(err);