ToyProductAnalyzer_module.cc
Go to the documentation of this file.
1 //--------------------------------------------------------------------
2 //
3 // Analyzes products inserted by ToyProductProducer
4 // - tests products with identical names in different branch types
5 //
6 //--------------------------------------------------------------------
7 
15 #include "fhiclcpp/types/Atom.h"
16 
17 namespace arttest {
18 
20  struct Config {
22  };
23 
24  public:
26  explicit ToyProductAnalyzer(Parameters const& pset);
27 
28  private:
29  void beginRun(art::Run const& r) override;
30  void endRun(art::Run const& r) override;
31  void beginSubRun(art::SubRun const& sr) override;
32  void endSubRun(art::SubRun const& sr) override;
33  void analyze(art::Event const& e) override;
34 
36  // Event token
38  // SubRun tokens
42  // Run tokens
46  };
47 } // namespace arttest
48 
50  : art::EDAnalyzer{pset}
51  , inputLabel_{pset().inputLabel()}
52  , eToken_{consumes<StringProduct>(inputLabel_)}
53  , srToken_{consumes<StringProduct, art::InSubRun>(inputLabel_)}
54  , bsrToken_{consumes<StringProduct, art::InSubRun>(
55  {inputLabel_, "bgnSubRun"})}
56  , esrToken_{consumes<StringProduct, art::InSubRun>(
57  {inputLabel_, "endSubRun"})}
58  , rToken_{consumes<StringProduct, art::InRun>(inputLabel_)}
59  , brToken_{consumes<StringProduct, art::InRun>({inputLabel_, "bgnRun"})}
60  , erToken_{consumes<StringProduct, art::InRun>({inputLabel_, "endRun"})}
61 {}
62 
63 void
65 {
68 }
69 
70 void
72 {
75 }
76 
77 void
79 {
81 }
82 
83 void
85 {
87 }
88 
89 void
91 {
93 }
94 
art::ProductToken< StringProduct > brToken_
void beginSubRun(art::SubRun const &sr) override
std::string string
Definition: nybbler.cc:12
art::ProductToken< StringProduct > srToken_
art::ProductToken< StringProduct > eToken_
void endRun(art::Run const &r) override
EDAnalyzer(fhicl::ParameterSet const &pset)
Definition: EDAnalyzer.h:27
Definition: Run.h:21
const double e
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:68
void analyze(art::Event const &e) override
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Definition: DataViewImpl.h:480
art::ProductToken< StringProduct > esrToken_
ToyProductAnalyzer(Parameters const &pset)
art::ProductToken< StringProduct > erToken_
art::ProductToken< StringProduct > rToken_
art::ProductToken< StringProduct > bsrToken_
static const double sr
Definition: Units.h:167
void endSubRun(art::SubRun const &sr) override
void beginRun(art::Run const &r) override