Logo ROOT  
Reference Guide
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 "RtypesCore.h"
15 #include "TString.h"
16 
17 #include <string>
18 #include <vector>
19 
20 namespace ROOT {
21 
22 namespace Detail {
23 namespace RDF {
24 class RFilterBase;
25 } // End NS RDF
26 } // End NS Detail
27 
28 namespace RDF {
29 
30 class TCutInfo {
31  friend class RCutFlowReport;
33 
34 private:
35  const std::string fName;
37  const ULong64_t fAll;
38  TCutInfo(const std::string &name, ULong64_t pass, ULong64_t all) : fName(name), fPass(pass), fAll(all) {}
39 
40 public:
41  const std::string &GetName() const { return fName; }
42  ULong64_t GetAll() const { return fAll; }
43  ULong64_t GetPass() const { return fPass; }
44  float GetEff() const { return 100.f * (fPass / float(fAll)); }
45 };
46 
49 
50 private:
51  std::vector<TCutInfo> fCutInfos;
52  void AddCut(TCutInfo &&ci) { fCutInfos.emplace_back(std::move(ci)); };
53 
54 public:
55  using const_iterator = typename std::vector<TCutInfo>::const_iterator;
56  void Print();
57  const TCutInfo &operator[](std::string_view cutName);
58  const TCutInfo &At(std::string_view cutName) { return operator[](cutName); }
59  const_iterator begin() const { return fCutInfos.begin(); }
60  const_iterator end() const { return fCutInfos.end(); }
61 };
62 
63 } // End NS RDF
64 } // End NS ROOT
65 
66 #endif
ROOT::Detail::RDF::RFilterBase
Definition: RFilterBase.hxx:36
ROOT::RDF::TCutInfo::fAll
const ULong64_t fAll
Definition: RCutFlowReport.hxx:37
ROOT::RDF::RCutFlowReport::At
const TCutInfo & At(std::string_view cutName)
Definition: RCutFlowReport.hxx:58
ROOT::RDF::TCutInfo::fName
const std::string fName
Definition: RCutFlowReport.hxx:35
ROOT::RDF::TCutInfo::GetPass
ULong64_t GetPass() const
Definition: RCutFlowReport.hxx:43
ROOT::RDF::RCutFlowReport::const_iterator
typename std::vector< TCutInfo >::const_iterator const_iterator
Definition: RCutFlowReport.hxx:55
ROOT::RDF::TCutInfo::fPass
const ULong64_t fPass
Definition: RCutFlowReport.hxx:36
ROOT::RDF::TCutInfo
Definition: RCutFlowReport.hxx:30
string_view
basic_string_view< char > string_view
Definition: libcpp_string_view.h:785
ROOT::RDF::TCutInfo::GetAll
ULong64_t GetAll() const
Definition: RCutFlowReport.hxx:42
ROOT::RDF::RCutFlowReport::Print
void Print()
Definition: RCutFlowReport.cxx:20
ROOT::RDF::TCutInfo::GetEff
float GetEff() const
Definition: RCutFlowReport.hxx:44
TString.h
ROOT::RDF::TCutInfo::TCutInfo
TCutInfo(const std::string &name, ULong64_t pass, ULong64_t all)
Definition: RCutFlowReport.hxx:38
ROOT::RDF::TCutInfo::GetName
const std::string & GetName() const
Definition: RCutFlowReport.hxx:41
ROOT::RDF::RCutFlowReport::fCutInfos
std::vector< TCutInfo > fCutInfos
Definition: RCutFlowReport.hxx:51
ULong64_t
unsigned long long ULong64_t
Definition: RtypesCore.h:74
RtypesCore.h
ROOT::RDF::RCutFlowReport
Definition: RCutFlowReport.hxx:47
name
char name[80]
Definition: TGX11.cxx:110
ROOT
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
Definition: EExecutionPolicy.hxx:4
ROOT::RDF::RCutFlowReport::end
const_iterator end() const
Definition: RCutFlowReport.hxx:60
ROOT::RDF::RCutFlowReport::begin
const_iterator begin() const
Definition: RCutFlowReport.hxx:59
ROOT::RDF::RCutFlowReport::operator[]
const TCutInfo & operator[](std::string_view cutName)
Definition: RCutFlowReport.cxx:32
ROOT::RDF::RCutFlowReport::AddCut
void AddCut(TCutInfo &&ci)
Definition: RCutFlowReport.hxx:52