LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
ProducerBase.h
Go to the documentation of this file.
1 #ifndef art_Framework_Core_ProducerBase_h
2 #define art_Framework_Core_ProducerBase_h
3 
4 //----------------------------------------------------------------------
5 // ProducerBase: The base class of all "modules" that will insert new
6 // EDProducts into an Event.
7 //----------------------------------------------------------------------
8 
17 #include "fhiclcpp/types/Atom.h"
20 #include "fhiclcpp/types/Table.h"
22 
23 #include <functional>
24 #include <memory>
25 #include <sstream>
26 #include <string>
27 
28 namespace art {
29 
30  class BranchDescription;
31  class ModuleDescription;
32 
34  public:
38 
39  bool
40  modifiesEvent() const
41  {
42  return true;
43  }
44 
45  template <typename PROD, BranchType B>
46  ProductID getProductID(ModuleDescription const& moduleDescription,
47  std::string const& instanceName) const;
48 
49  template <typename UserConfig, typename UserKeysToIgnore = void>
50  using Table =
52  };
53 
54  template <typename PROD, BranchType B>
55  ProductID
57  std::string const& instanceName) const
58  {
59  auto const& pd =
60  get_ProductDescription<PROD>(B, md.moduleLabel(), instanceName);
61  return pd.productID();
62  }
63 
64  template <typename T>
65  inline std::ostream&
66  operator<<(std::ostream& os, ProducerBase::Table<T> const& t)
67  {
68  std::ostringstream config;
69  t.print_allowed_configuration(config, std::string(3, ' '));
70  return os << config.str();
71  }
72 
73 } // art
74 
75 #endif /* art_Framework_Core_ProducerBase_h */
76 
77 // Local Variables:
78 // mode: c++
79 // End:
void registerProducts(MasterProductRegistry &mpr, ProductDescriptions &productsToRegister, ModuleDescription const &md)
Int_t B
Definition: plot.C:25
void produces(std::string const &instanceName={}, Persistable const persistable=Persistable::Yes)
ProductID getProductID(ModuleDescription const &moduleDescription, std::string const &instanceName) const
Definition: ProducerBase.h:56
std::string const & moduleLabel() const
bool modifiesEvent() const
Definition: ProducerBase.h:40
std::set< TypeLabel > const & expectedProducts() const
HLT enums.