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;
25} // End NS RDF
26} // End NS Detail
27
28namespace RDF {
29
30class TCutInfo {
31 friend class RCutFlowReport;
33
34private:
35 std::string fName;
38 TCutInfo(const std::string &name, ULong64_t pass, ULong64_t all) : fName(name), fPass(pass), fAll(all) {}
39
40public:
41 // Default constructor for the I/O
42 TCutInfo() = default;
43 const std::string &GetName() const { return fName; }
44 ULong64_t GetAll() const { return fAll; }
45 ULong64_t GetPass() const { return fPass; }
46 float GetEff() const { return 100.f * (fPass / float(fAll)); }
47};
48
51
52private:
53 std::vector<TCutInfo> fCutInfos;
54 void AddCut(TCutInfo &&ci) { fCutInfos.emplace_back(std::move(ci)); };
55
56public:
57 using const_iterator = typename std::vector<TCutInfo>::const_iterator;
58 void Print();
59 const TCutInfo &operator[](std::string_view cutName);
60 const TCutInfo &At(std::string_view cutName) { return operator[](cutName); }
61 const_iterator begin() const { return fCutInfos.begin(); }
62 const_iterator end() const { return fCutInfos.end(); }
63};
64
65} // End NS RDF
66} // End NS ROOT
67
68#endif
unsigned long long ULong64_t
Definition RtypesCore.h:81
char name[80]
Definition TGX11.cxx:110
void AddCut(TCutInfo &&ci)
const_iterator begin() const
const TCutInfo & At(std::string_view cutName)
std::vector< TCutInfo > fCutInfos
typename std::vector< TCutInfo >::const_iterator const_iterator
const TCutInfo & operator[](std::string_view cutName)
const_iterator end() 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)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...