Public Member Functions | Private Member Functions | Private Attributes | List of all members
art::MixOp< Prod, OProd > Class Template Reference

#include "/cvmfs/nova.opensciencegrid.org/externals/art/v3_05_01/source/art/Framework/IO/ProductMix/MixOp.h"

Inheritance diagram for art::MixOp< Prod, OProd >:
art::MixOpBase

Public Member Functions

template<typename FUNC >
 MixOp (std::string const &moduleLabel, InputTag const &inputTag, std::string const &outputInstanceLabel, FUNC mixFunc, bool outputProduct, bool compactMissingProducts, BranchType bt)
 
InputTag const & inputTag () const override
 
TypeID inputType () const override
 
EDProduct const * newIncomingWrappedProduct () const override
 
ProductID incomingProductID () const override
 
ProductID outgoingProductID () const override
 
BranchType branchType () const override
 

Private Member Functions

void mixAndPut (Event &e, SpecProdList const &inProducts, PtrRemapper const &remap) const override
 
void setIncomingProductID (ProductID) override
 

Private Attributes

InputTag const inputTag_
 
std::string const outputInstanceLabel_
 
TypeID const inputType_
 
MixFunc< Prod, OProd > const mixFunc_
 
std::string const processName_
 
std::string const moduleLabel_
 
bool const outputProduct_
 
bool const compactMissingProducts_
 
BranchType const branchType_
 
ProductID incomingProductID_ {ProductID::invalid()}
 

Detailed Description

template<typename Prod, typename OProd>
class art::MixOp< Prod, OProd >

Definition at line 31 of file MixOp.h.

Constructor & Destructor Documentation

template<typename Prod , typename OProd >
template<typename FUNC >
art::MixOp< Prod, OProd >::MixOp ( std::string const &  moduleLabel,
InputTag const &  inputTag,
std::string const &  outputInstanceLabel,
FUNC  mixFunc,
bool  outputProduct,
bool  compactMissingProducts,
BranchType  bt 
)

Definition at line 81 of file MixOp.h.

References art::MixOp< Prod, OProd >::branchType_, art::MixOp< Prod, OProd >::compactMissingProducts_, art::MixOp< Prod, OProd >::inputType_, art::Globals::instance(), art::MixOp< Prod, OProd >::mixFunc_, art::MixOp< Prod, OProd >::moduleLabel_, art::MixOp< Prod, OProd >::outputInstanceLabel_, art::MixOp< Prod, OProd >::outputProduct_, art::Globals::processName(), and art::MixOp< Prod, OProd >::processName_.

89  , outputInstanceLabel_{outputInstanceLabel}
90  , inputType_{typeid(Prod)}
91  , mixFunc_{mixFunc}
93  , moduleLabel_{moduleLabel}
94  , outputProduct_{outputProduct}
95  , compactMissingProducts_{compactMissingProducts}
96  , branchType_{bt}
97  {}
std::string const moduleLabel_
Definition: MixOp.h:72
BranchType const branchType_
Definition: MixOp.h:75
InputTag const & inputTag() const override
Definition: MixOp.h:43
bool const outputProduct_
Definition: MixOp.h:73
std::string const outputInstanceLabel_
Definition: MixOp.h:68
InputTag const inputTag_
Definition: MixOp.h:67
bool const compactMissingProducts_
Definition: MixOp.h:74
std::string const processName_
Definition: MixOp.h:71
MixFunc< Prod, OProd > const mixFunc_
Definition: MixOp.h:70
std::string const & processName() const
TypeID const inputType_
Definition: MixOp.h:69
static Globals * instance()

Member Function Documentation

template<typename Prod , typename OProd >
BranchType art::MixOp< Prod, OProd >::branchType ( ) const
inlineoverridevirtual

Implements art::MixOpBase.

Definition at line 168 of file MixOp.h.

References art::MixOp< Prod, OProd >::branchType_.

Referenced by art::MixOp< Prod, OProd >::newIncomingWrappedProduct().

169  {
170  return branchType_;
171  }
BranchType const branchType_
Definition: MixOp.h:75
template<typename Prod , typename OProd >
ProductID art::MixOp< Prod, OProd >::incomingProductID ( ) const
overridevirtual

Implements art::MixOpBase.

Definition at line 143 of file MixOp.h.

References art::MixOp< Prod, OProd >::incomingProductID_.

Referenced by art::MixOp< Prod, OProd >::newIncomingWrappedProduct().

144  {
145  return incomingProductID_;
146  }
ProductID incomingProductID_
Definition: MixOp.h:76
template<typename Prod , typename OProd >
InputTag const& art::MixOp< Prod, OProd >::inputTag ( ) const
inlineoverridevirtual

Implements art::MixOpBase.

Definition at line 43 of file MixOp.h.

References art::MixOp< Prod, OProd >::inputTag_.

44  {
45  return inputTag_;
46  }
InputTag const inputTag_
Definition: MixOp.h:67
template<typename Prod , typename OProd >
TypeID art::MixOp< Prod, OProd >::inputType ( ) const
inlineoverridevirtual

Implements art::MixOpBase.

Definition at line 48 of file MixOp.h.

References art::MixOp< Prod, OProd >::inputType_.

49  {
50  return inputType_;
51  }
TypeID const inputType_
Definition: MixOp.h:69
template<typename Prod , typename OProd >
void art::MixOp< Prod, OProd >::mixAndPut ( Event e,
SpecProdList const &  inProducts,
PtrRemapper const &  remap 
) const
overrideprivatevirtual

Implements art::MixOpBase.

Definition at line 101 of file MixOp.h.

References art::MixOp< Prod, OProd >::compactMissingProducts_, art::errors::DataCorruption, lem_server::ep, art::errors::LogicError, art::MixOp< Prod, OProd >::mixFunc_, art::MixOp< Prod, OProd >::outputInstanceLabel_, art::MixOp< Prod, OProd >::outputProduct_, and art::DataViewImpl::put().

Referenced by art::MixOp< Prod, OProd >::newIncomingWrappedProduct().

104  {
105  std::vector<Prod const*> inConverted;
106  inConverted.reserve(inProducts.size());
107  try {
108  for (auto const& ep : inProducts) {
109  auto const prod =
110  std::dynamic_pointer_cast<Wrapper<Prod> const>(ep)->product();
111  if (prod || !compactMissingProducts_) {
112  inConverted.emplace_back(prod);
113  }
114  }
115  }
116  catch (std::bad_cast const&) {
118  << "Unable to obtain correctly-typed product from wrapper.\n";
119  }
120 
121  auto rProd = std::make_unique<OProd>();
122  // False means don't want this in the event.
123  if (mixFunc_(inConverted, *rProd, remap)) {
124  if (!outputProduct_) {
126  << "Returned true (output product to be put in event) from a mix "
127  "function\n"
128  << "declared with outputProduct=false.\n";
129  }
130  e.put(move(rProd), outputInstanceLabel_);
131  }
132  }
bool const outputProduct_
Definition: MixOp.h:73
std::string const outputInstanceLabel_
Definition: MixOp.h:68
bool const compactMissingProducts_
Definition: MixOp.h:74
MixFunc< Prod, OProd > const mixFunc_
Definition: MixOp.h:70
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Definition: Exception.h:66
Float_t e
Definition: plot.C:35
template<typename Prod , typename OProd >
EDProduct const* art::MixOp< Prod, OProd >::newIncomingWrappedProduct ( ) const
inlineoverridevirtual
template<typename Prod , typename OProd >
ProductID art::MixOp< Prod, OProd >::outgoingProductID ( ) const
overridevirtual

Implements art::MixOpBase.

Definition at line 150 of file MixOp.h.

References art::canonicalProductName(), art::MixOp< Prod, OProd >::moduleLabel_, art::MixOp< Prod, OProd >::outputInstanceLabel_, art::MixOp< Prod, OProd >::outputProduct_, art::MixOp< Prod, OProd >::processName_, and fillBadChanDBTables::result.

Referenced by art::MixOp< Prod, OProd >::newIncomingWrappedProduct().

151  {
152  ProductID result;
153  if (outputProduct_) {
154  TypeID const outputType{typeid(OProd)};
155  // Note: Outgoing product must be InEvent.
156  auto const productName =
157  canonicalProductName(outputType.friendlyClassName(),
158  moduleLabel_,
160  processName_);
161  result = ProductID{productName};
162  }
163  return result;
164  }
std::string const moduleLabel_
Definition: MixOp.h:72
bool const outputProduct_
Definition: MixOp.h:73
std::string const outputInstanceLabel_
Definition: MixOp.h:68
std::string canonicalProductName(std::string const &friendlyClassName, std::string const &moduleLabel, std::string const &productInstanceName, std::string const &processName)
std::string const processName_
Definition: MixOp.h:71
template<typename Prod , typename OProd >
void art::MixOp< Prod, OProd >::setIncomingProductID ( ProductID  prodID)
overrideprivatevirtual

Implements art::MixOpBase.

Definition at line 136 of file MixOp.h.

References art::MixOp< Prod, OProd >::incomingProductID_.

Referenced by art::MixOp< Prod, OProd >::newIncomingWrappedProduct().

137  {
138  incomingProductID_ = prodID;
139  }
ProductID incomingProductID_
Definition: MixOp.h:76

Member Data Documentation

template<typename Prod , typename OProd >
BranchType const art::MixOp< Prod, OProd >::branchType_
private
template<typename Prod , typename OProd >
bool const art::MixOp< Prod, OProd >::compactMissingProducts_
private
template<typename Prod , typename OProd >
ProductID art::MixOp< Prod, OProd >::incomingProductID_ {ProductID::invalid()}
private
template<typename Prod , typename OProd >
InputTag const art::MixOp< Prod, OProd >::inputTag_
private

Definition at line 67 of file MixOp.h.

Referenced by art::MixOp< Prod, OProd >::inputTag().

template<typename Prod , typename OProd >
TypeID const art::MixOp< Prod, OProd >::inputType_
private
template<typename Prod , typename OProd >
MixFunc<Prod, OProd> const art::MixOp< Prod, OProd >::mixFunc_
private
template<typename Prod , typename OProd >
std::string const art::MixOp< Prod, OProd >::moduleLabel_
private
template<typename Prod , typename OProd >
std::string const art::MixOp< Prod, OProd >::outputInstanceLabel_
private
template<typename Prod , typename OProd >
bool const art::MixOp< Prod, OProd >::outputProduct_
private
template<typename Prod , typename OProd >
std::string const art::MixOp< Prod, OProd >::processName_
private

The documentation for this class was generated from the following file: