ProductIDGetterAnalyzer_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: ProductIDGetterAnalyzer
3 // Module Type: analyzer
4 // File: ProductIDGetterAnalyzer_module.cc
5 //
6 // Generated at Thu Jun 16 11:18:23 2011 by Chris Green using artmod
7 // from art v0_07_09.
8 ////////////////////////////////////////////////////////////////////////
9 
11 
16 #include "fhiclcpp/types/Atom.h"
17 
18 namespace art {
19  namespace test {
20  class ProductIDGetterAnalyzer;
21  }
22 } // namespace art
23 
25  struct Config {
27  };
28 
29 public:
31  explicit ProductIDGetterAnalyzer(Parameters const& p);
32 
33 private:
34  void beginSubRun(SubRun const& sr) override;
35  void analyze(Event const& e) override;
37 };
38 
40  : EDAnalyzer{p}, input_label_{p().input_label()}
41 {
42  consumes<art::Ptr<int>>(input_label_);
43  consumes<art::Ptr<int>, art::InSubRun>(input_label_);
44 }
45 
46 void
48 {
51  BOOST_REQUIRE_EQUAL(**h, 5);
52  // Retrieve Ptr by its ProductID, *NOT* by the ProductID of the
53  // pointed-to product.
54  auto const pid = h.id();
55  BOOST_REQUIRE(sr.get(pid, h));
56  BOOST_REQUIRE_EQUAL(**h, 5);
57 }
58 
59 void
61 {
64  BOOST_REQUIRE_EQUAL(**h, 4);
65  // Retrieve Ptr by its ProductID, *NOT* by the ProductID of the
66  // pointed-to product.
67  auto const pid = h.id();
68  BOOST_REQUIRE(e.get(pid, h));
69  BOOST_REQUIRE_EQUAL(**h, 4);
70 }
71 
std::string string
Definition: nybbler.cc:12
Definition: test.py:1
bool get(SelectorBase const &, Handle< PROD > &result) const
Definition: DataViewImpl.h:375
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
Definition: DataViewImpl.h:435
const double e
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:68
BOOST_REQUIRE(inFile)
p
Definition: test.py:228
ProductID id() const
Definition: Handle.h:211
static const double sr
Definition: Units.h:167
h
training ###############################
Definition: train_cnn.py:186