Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RCutFlowReport.hxx
Go to the documentation of this file.
1// Author: Enrico Guiraud, Danilo Piparo CERN 02/2018
2
3/*************************************************************************
4 * Copyright (C) 1995-2018, Rene Brun and Fons Rademakers. *
5 * All rights reserved. *
6 * *
7 * For the licensing terms see $ROOTSYS/LICENSE. *
8 * For the list of contributors see $ROOTSYS/README/CREDITS. *
9 *************************************************************************/
10
11#ifndef ROOT_RCUTFLOWREPORT
12#define ROOT_RCUTFLOWREPORT
13
14#include <string_view>
15#include "RtypesCore.h"
16
17#include <string>
18#include <vector>
19
20namespace ROOT {
21
22namespace Detail {
23namespace RDF {
24class RFilterBase;
25class RMergeableReport;
26} // End NS RDF
27} // End NS Detail
28
29namespace Internal {
30namespace RDF {
31template <typename RNode_t>
33} // namespace RDF
34} // namespace Internal
35
36namespace RDF {
37
38class TCutInfo {
39 friend class RCutFlowReport;
42
43private:
44 std::string fName;
47 TCutInfo(const std::string &name, ULong64_t pass, ULong64_t all) : fName(name), fPass(pass), fAll(all) {}
48
49public:
50 // Default constructor for the I/O
51 TCutInfo() = default;
52 const std::string &GetName() const { return fName; }
53 ULong64_t GetAll() const { return fAll; }
54 ULong64_t GetPass() const { return fPass; }
55 float GetEff() const { return 100.f * (fPass / float(fAll)); }
56};
57
61 template <typename RNode_t>
63
64private:
65 std::vector<TCutInfo> fCutInfos;
66 void AddCut(TCutInfo &&ci) { fCutInfos.emplace_back(std::move(ci)); };
67
68public:
69 using const_iterator = typename std::vector<TCutInfo>::const_iterator;
70 void Print() const;
71 std::string AsString() const;
72 const TCutInfo &operator[](std::string_view cutName);
73 const TCutInfo &At(std::string_view cutName) { return operator[](cutName); }
74 const_iterator begin() const { return fCutInfos.begin(); }
75 const_iterator end() const { return fCutInfos.end(); }
76};
77
78} // End NS RDF
79} // End NS ROOT
80
81#endif
Basic types used by ROOT and required by TInterpreter.
char name[80]
Definition TGX11.cxx:110
Specialization of RMergeableValue for the Report action.
void AddCut(TCutInfo &&ci)
const_iterator begin() const
const TCutInfo & At(std::string_view cutName)
std::vector< TCutInfo > fCutInfos
const TCutInfo & operator[](std::string_view cutName)
const_iterator end() const
std::string AsString() const
ULong64_t GetPass() const
const std::string & GetName() const
ULong64_t GetAll() const
TCutInfo(const std::string &name, ULong64_t pass, ULong64_t all)