CMS 3D CMS Logo

TestHistoryKeeping.cc
Go to the documentation of this file.
1 // This test module will look for history information in event data.
2 
3 #include <iostream>
4 #include <vector>
5 
10 
11 namespace edmtest {
12  class TestHistoryKeeping : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
13  public:
14  explicit TestHistoryKeeping(edm::ParameterSet const& pset);
15 
16  void analyze(edm::Event const& e, edm::EventSetup const&) final;
17 
18  void beginRun(edm::Run const& r, edm::EventSetup const&) final;
19  void endRun(edm::Run const& r, edm::EventSetup const&) final;
20 
21  private:
22  std::vector<std::string> expectedProcesses_;
24  }; // class TestHistoryKeeping
25 
26  //--------------------------------------------------------------------
27  //
28  // Implementation details
29  //--------------------------------------------------------------------
30 
32  : expectedProcesses_(pset.getParameter<std::vector<std::string> >("expected_processes")),
33  numberOfExpectedHLTProcessesInEachRun_(
34  pset.getParameter<int>("number_of_expected_HLT_processes_for_each_run")) {
35  // Nothing to do.
36  }
37 
39  // At begin run, we're looking at, make sure we can get at the
40  // parameter sets for any HLT processing.
41  }
42 
44  for (std::vector<std::string>::const_iterator i = expectedProcesses_.begin(), e = expectedProcesses_.end(); i != e;
45  ++i) {
47  assert(ev.getProcessParameterSet(*i, ps));
48  assert(!ps.empty());
49  assert(ps.getParameter<std::string>("@process_name") == *i);
50  }
51  }
52 
54  // Nothing to do.
55  }
56 
57 } // namespace edmtest
58 
std::vector< std::string > expectedProcesses_
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
assert(be >=bs)
TestHistoryKeeping(edm::ParameterSet const &pset)
bool empty() const
Definition: ParameterSet.h:202
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
void beginRun(edm::Run const &r, edm::EventSetup const &) final
void endRun(edm::Run const &r, edm::EventSetup const &) final
Definition: Run.h:45
void analyze(edm::Event const &e, edm::EventSetup const &) final