EventIDFilterChecker_module.cc
Go to the documentation of this file.
4 #include "fhiclcpp/types/Atom.h"
5 
6 #include <atomic>
7 #include <cassert>
8 
9 namespace {
10  class EventIDFilterChecker : public art::EDAnalyzer {
11  public:
12  struct Config {
13  fhicl::Atom<unsigned> expPassedEvents{fhicl::Name{"expPassedEvents"}};
14  };
15 
16  using Parameters = Table<Config>;
17  explicit EventIDFilterChecker(Parameters const& p)
18  : art::EDAnalyzer{p}, expPassedEvents_{p().expPassedEvents()}
19  {}
20 
21  private:
22  unsigned const expPassedEvents_;
23  std::atomic<unsigned> nPassedEvents_{};
24 
25  void
26  analyze(art::Event const&) override
27  {
28  ++nPassedEvents_;
29  }
30 
31  void
32  endJob() override
33  {
34  assert(nPassedEvents_ == expPassedEvents_);
35  }
36  };
37 }
38 
39 DEFINE_ART_MODULE(EventIDFilterChecker)
def analyze(root, level, gtrees, gbranches, doprint)
Definition: rootstat.py:67
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:68
p
Definition: test.py:228