ESSecondaryProducer_module.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // Class: ESSecondaryProducer
3 // Module Type: producer
4 // File: ESSecondaryProducer_module.cc
5 //
6 // Generated at Mon Feb 3 11:00:24 2014 by Christopher Green using artmod
7 // from cetpkgsupport v1_05_03.
8 ////////////////////////////////////////////////////////////////////////
9 
18 #include "fhiclcpp/ParameterSet.h"
19 
20 #include <memory>
21 
22 namespace arttest {
23  class ESSecondaryProducer;
24 }
25 
27 public:
28  explicit ESSecondaryProducer(fhicl::ParameterSet const& p);
29 
30 private:
31  void produce(art::Event& e) override;
32 
34  size_t const index_;
35 };
36 
38  : EDProducer{p}
39  , label_(p.get<std::string>("moduleLabel"))
40  , index_(p.get<size_t>("index"))
41 {
42  produces<arttest::ESPtrSimple>();
43  produces<arttest::IntProduct>();
44 }
45 
46 void
48 {
50  if (!(h->size() > index_)) {
52  << "Specified index " << index_ << "is invalid for loaded product.";
53  }
54  e.put(std::make_unique<arttest::ESPtrSimple>(
56  e.put(std::make_unique<arttest::IntProduct>(static_cast<int>(h->size())));
57 }
58 
ESSecondaryProducer(fhicl::ParameterSet const &p)
std::string string
Definition: nybbler.cc:12
EDProducer()=default
void produce(art::Event &e) override
const double e
std::vector< Simple > VSimpleProduct
Definition: ToyProducts.h:216
#define DEFINE_ART_MODULE(klass)
Definition: ModuleMacros.h:68
ValidHandle< PROD > getValidHandle(InputTag const &tag) const
Definition: DataViewImpl.h:480
p
Definition: test.py:228
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
ProductID put(std::unique_ptr< PROD > &&edp, FullSemantic< Level::Run > const semantic)
Definition: DataViewImpl.h:692
h
training ###############################
Definition: train_cnn.py:186