1 #ifndef art_Framework_IO_ProductMix_MixOp_h 2 #define art_Framework_IO_ProductMix_MixOp_h 19 #include "cetlib/exempt_ptr.h" 29 template <
typename Prod,
typename OProd>
32 template <
typename FUNC>
33 MixOp(std::string
const& moduleLabel,
35 std::string
const& outputInstanceLabel,
38 bool compactMissingProducts,
78 template <
typename Prod,
typename OProd>
79 template <
typename FUNC>
82 std::string
const& outputInstanceLabel,
84 bool const outputProduct,
85 bool const compactMissingProducts,
98 template <
typename Prod,
typename OProd>
104 std::vector<Prod const*> inConverted;
105 inConverted.reserve(inProducts.size());
107 for (
auto const& ep : inProducts) {
109 std::dynamic_pointer_cast<
Wrapper<Prod> const>(ep)->product();
111 inConverted.emplace_back(prod);
115 catch (std::bad_cast
const&) {
117 <<
"Unable to obtain correctly-typed product from wrapper.\n";
120 auto rProd = std::make_unique<OProd>();
122 if (
mixFunc_(inConverted, *rProd, remap)) {
125 <<
"Returned true (output product to be put in event) from a mix " 127 <<
"declared with outputProduct=false.\n";
133 template <
typename Prod,
typename OProd>
140 template <
typename Prod,
typename OProd>
147 template <
typename Prod,
typename OProd>
153 TypeID const outputType{
typeid(OProd)};
155 auto const productName =
165 template <
typename Prod,
typename OProd>
BranchType branchType() const override
std::string const moduleLabel_
ProductID incomingProductID_
BranchType const branchType_
ProductID incomingProductID() const override
InputTag const & inputTag() const override
std::vector< std::shared_ptr< EDProduct const >> SpecProdList
bool const outputProduct_
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
EDProduct const * newIncomingWrappedProduct() const override
std::string const outputInstanceLabel_
MixOp(std::string const &moduleLabel, InputTag const &inputTag, std::string const &outputInstanceLabel, FUNC mixFunc, bool outputProduct, bool compactMissingProducts, BranchType bt)
std::function< bool(std::vector< PROD const * > const &, OPROD &, PtrRemapper const &)> MixFunc
std::string canonicalProductName(std::string const &friendlyClassName, std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName)
bool const compactMissingProducts_
std::string const processName_
MixFunc< Prod, OProd > const mixFunc_
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
TypeID inputType() const override
std::string const & processName() const
static constexpr ProductID invalid() noexcept
void mixAndPut(Event &e, SpecProdList const &inProducts, PtrRemapper const &remap) const override
static Globals * instance()
ProductID outgoingProductID() const override
void setIncomingProductID(ProductID) override