TrackEfficiency.h
Go to the documentation of this file.
1 #ifndef art_test_Integration_product_aggregation_physics_workflow_TrackEfficiency_h
2 #define art_test_Integration_product_aggregation_physics_workflow_TrackEfficiency_h
3 
5 
6 namespace arttest {
7 
9  public:
10  explicit TrackEfficiency() = default;
11  explicit TrackEfficiency(unsigned const num, unsigned const denom)
12  : num_{num}, denom_{denom}
13  {}
14 
15  auto
16  efficiency() const
17  {
18  return static_cast<double>(num_) / denom_;
19  }
20 
21  auto
22  num() const
23  {
24  return num_;
25  }
26  auto
27  denom() const
28  {
29  return denom_;
30  }
31 
32  void
34  {
35  num_ += other.num_;
36  denom_ += other.denom_;
37  }
38 
39  private:
40  unsigned num_;
41  unsigned denom_;
42  };
43 
44 } // namespace arttest
45 
46 #endif /* art_test_Integration_product_aggregation_physics_workflow_TrackEfficiency_h */
47 
48 // Local variables:
49 // mode: c++
50 // End:
TrackEfficiency(unsigned const num, unsigned const denom)
void aggregate(TrackEfficiency const &other)