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 "ROOT/RStringView.hxx"
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 const std::string fName;
38 TCutInfo(const std::string &name, ULong64_t pass, ULong64_t all) : fName(name), fPass(pass), fAll(all) {}
39
40public:
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
50private:
51 std::vector<TCutInfo> fCutInfos;
52 void AddCut(TCutInfo &&ci) { fCutInfos.emplace_back(std::move(ci)); };
53
54public:
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
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
const ULong64_t fPass
const ULong64_t fAll
ULong64_t GetAll() const
const std::string fName
TCutInfo(const std::string &name, ULong64_t pass, ULong64_t all)
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.