RDFAnalysis  0.1.1
Physics analysis with ROOT::RDataFrame
CutflowDetail.h
Go to the documentation of this file.
1 #ifndef RDFAnalysis_CutflowDetail_H
2 #define RDFAnalysis_CutflowDetail_H
3 
4 #include "RDFAnalysis/NodeFwd.h"
5 
11 namespace RDFAnalysis {
17  class CutflowDetail {
18  public:
21  m_stats(node.Count() ),
22  m_weightedStats(
23  node.getWeight().empty() ?
24  SysResultPtr<std::pair<float,float>>(node.namer().nominalName() ) :
25  node.Aggregate(
26  [] (const std::pair<float, float>& lhs, float rhs)
27  { return std::make_pair(lhs.first + rhs, lhs.second + rhs*rhs); },
28  [] (const std::pair<float, float>& lhs, const std::pair<float, float>& rhs)
29  { return std::make_pair(lhs.first+rhs.first, lhs.second+rhs.second); },
30  node.getWeight() ) )
31  {}
32 
34  SysResultPtr<ULong64_t> stats() { return m_stats; }
35 
39  { return m_weightedStats; }
40 
41  private:
44 
46  SysResultPtr<std::pair<float, float>> m_weightedStats;
47  }; //> end class CutflowDetail
48 } //> end namespace RDFAnalysis
49 
50 #endif //> !RDFAnalysis_CutflowDetail_H
Definition: CutflowDetail.h:11
Class to represent a single step in the analysis process.
Definition: Node.h:32
CutflowDetail(Node< CutflowDetail > &node)
Create the detail from its parent node.
Definition: CutflowDetail.h:20
Class to wrap together RResultPtrs for different systematic variations.
Definition: SysResultPtr.h:24
Forward declaration for the node class.
SysResultPtr< ULong64_t > stats()
Get the unweighted cutflow information.
Definition: CutflowDetail.h:34
Detail class containing cutflow information.
Definition: CutflowDetail.h:17
SysResultPtr< std::pair< float, float > > weightedStats()
Get the weighted cutflow information (sum of weights, sum of weights squared.
Definition: CutflowDetail.h:38