CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
edm::PrincipalGetAdapter Class Reference

#include <PrincipalGetAdapter.h>

Public Types

typedef std::vector< BasicHandleBasicHandleVec
 

Public Member Functions

template<typename PROD >
bool checkIfComplete () const
 
BranchDescription const & getBranchDescription (TypeID const &type, std::string const &productInstanceName) const
 
BranchDescription const & getBranchDescription (unsigned int iPutTokenIndex) const
 
BasicHandle getByLabel_ (TypeID const &tid, InputTag const &tag, ModuleCallingContext const *mcc) const
 
BasicHandle getByLabel_ (TypeID const &tid, std::string const &label, std::string const &instance, std::string const &process, ModuleCallingContext const *mcc) const
 
BasicHandle getByToken_ (TypeID const &id, KindOfType kindOfType, EDGetToken token, ModuleCallingContext const *mcc) const
 
template<typename PROD >
void getManyByType (std::vector< Handle< PROD > > &results, ModuleCallingContext const *mcc) const
 
void getManyByType_ (TypeID const &tid, BasicHandleVec &results, ModuleCallingContext const *mcc) const
 
BasicHandle getMatchingSequenceByLabel_ (TypeID const &typeID, InputTag const &tag, ModuleCallingContext const *mcc) const
 
BasicHandle getMatchingSequenceByLabel_ (TypeID const &typeID, std::string const &label, std::string const &instance, std::string const &process, ModuleCallingContext const *mcc) const
 
ProductID const & getProductID (unsigned int iPutTokenIndex) const
 
EDPutToken::value_type getPutTokenIndex (TypeID const &type, std::string const &productInstanceName) const
 
TypeID const & getTypeIDForPutTokenIndex (EDPutToken::value_type index) const
 
bool isComplete () const
 
void labelsForToken (EDGetToken const &iToken, ProductLabels &oLabels) const
 
size_t numberOfProductsConsumed () const
 
PrincipalGetAdapteroperator= (PrincipalGetAdapter const &)=delete
 
Principal const & principal () const
 
 PrincipalGetAdapter (Principal const &pcpl, ModuleDescription const &md, bool isComplete)
 
 PrincipalGetAdapter (PrincipalGetAdapter const &)=delete
 
ProcessHistory const & processHistory () const
 
EDProductGetter const * prodGetter () const
 
std::string const & productInstanceLabel (EDPutToken) const
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void setConsumer (EDConsumerBase const *iConsumer)
 
void setProducer (ProducerBase const *iProd)
 
void setSharedResourcesAcquirer (SharedResourcesAcquirer *iSra)
 
Transition transition () const
 
 ~PrincipalGetAdapter ()
 

Private Member Functions

BranchType const & branchType () const
 
BasicHandle makeFailToGetException (KindOfType, TypeID const &, EDGetToken) const
 
void throwAmbiguousException (TypeID const &productType, EDGetToken token) const
 
void throwUnregisteredPutException (TypeID const &type, std::string const &productInstanceLabel) const
 

Private Attributes

EDConsumerBase const * consumer_
 
bool isComplete_
 
ModuleDescription const & md_
 
Principal const & principal_
 
ProducerBase const * prodBase_ = 0
 
SharedResourcesAcquirerresourcesAcquirer_
 

Detailed Description

Definition at line 132 of file PrincipalGetAdapter.h.

Member Typedef Documentation

Definition at line 171 of file PrincipalGetAdapter.h.

Constructor & Destructor Documentation

PrincipalGetAdapter::PrincipalGetAdapter ( Principal const &  pcpl,
ModuleDescription const &  md,
bool  isComplete 
)

Definition at line 22 of file PrincipalGetAdapter.cc.

23  : //putProducts_(),
24  principal_(pcpl),
25  md_(md),
26  consumer_(nullptr),
27  resourcesAcquirer_(nullptr),
SharedResourcesAcquirer * resourcesAcquirer_
EDConsumerBase const * consumer_
ModuleDescription const & md_
PrincipalGetAdapter::~PrincipalGetAdapter ( )

Definition at line 30 of file PrincipalGetAdapter.cc.

30 {}
edm::PrincipalGetAdapter::PrincipalGetAdapter ( PrincipalGetAdapter const &  )
delete

Member Function Documentation

BranchType const & PrincipalGetAdapter::branchType ( ) const
private

Definition at line 131 of file PrincipalGetAdapter.cc.

References edm::Principal::branchType(), and principal_.

Referenced by getByToken_(), and transition().

131 { return principal_.branchType(); }
BranchType const & branchType() const
Definition: Principal.h:180
template<typename PROD >
bool PrincipalGetAdapter::checkIfComplete ( ) const
inline

Definition at line 309 of file PrincipalGetAdapter.h.

BranchDescription const & PrincipalGetAdapter::getBranchDescription ( TypeID const &  type,
std::string const &  productInstanceName 
) const

Definition at line 220 of file PrincipalGetAdapter.cc.

References edm::ProductResolverBase::branchDescription(), edm::Principal::getProductResolverByIndex(), edm::ProductResolverIndexHelper::index(), md_, edm::ModuleDescription::moduleLabel(), principal_, edm::ModuleDescription::processName(), edm::PRODUCT_TYPE, edm::Principal::productLookup(), edm::ProductResolverIndexInvalid, throwUnregisteredPutException(), and UNLIKELY.

221  {
222  ProductResolverIndexHelper const& productResolverIndexHelper = principal_.productLookup();
223  ProductResolverIndex index = productResolverIndexHelper.index(
224  PRODUCT_TYPE, type, md_.moduleLabel().c_str(), productInstanceName.c_str(), md_.processName().c_str());
225  if (UNLIKELY(index == ProductResolverIndexInvalid)) {
226  throwUnregisteredPutException(type, productInstanceName);
227  }
228  ProductResolverBase const* phb = principal_.getProductResolverByIndex(index);
229  assert(phb != nullptr);
230  return phb->branchDescription();
231  }
type
Definition: HCALResponse.h:21
unsigned int ProductResolverIndex
void throwUnregisteredPutException(TypeID const &type, std::string const &productInstanceLabel) const
std::string const & processName() const
std::string const & moduleLabel() const
ProductResolverIndexHelper const & productLookup() const
Definition: Principal.h:148
ConstProductResolverPtr getProductResolverByIndex(ProductResolverIndex const &oid) const
Definition: Principal.cc:535
ModuleDescription const & md_
#define UNLIKELY(x)
Definition: Likely.h:21
BranchDescription const & PrincipalGetAdapter::getBranchDescription ( unsigned int  iPutTokenIndex) const

Definition at line 233 of file PrincipalGetAdapter.cc.

References edm::ProductResolverBase::branchDescription(), edm::Principal::getProductResolverByIndex(), principal_, prodBase_, and edm::ProducerBase::putTokenIndexToProductResolverIndex().

233  {
234  auto index = prodBase_->putTokenIndexToProductResolverIndex()[iPutTokenIndex];
235  ProductResolverBase const* phb = principal_.getProductResolverByIndex(index);
236  assert(phb != nullptr);
237  return phb->branchDescription();
238  }
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex() const
Definition: ProducerBase.h:93
ProducerBase const * prodBase_
ConstProductResolverPtr getProductResolverByIndex(ProductResolverIndex const &oid) const
Definition: Principal.cc:535
BasicHandle PrincipalGetAdapter::getByLabel_ ( TypeID const &  tid,
InputTag const &  tag,
ModuleCallingContext const *  mcc 
) const

Definition at line 133 of file PrincipalGetAdapter.cc.

References consumer_, edm::Principal::getByLabel(), principal_, edm::PRODUCT_TYPE, and resourcesAcquirer_.

Referenced by edm::LuminosityBlock::getByLabelImpl(), edm::Run::getByLabelImpl(), and edm::Event::getByLabelImpl().

135  {
137  }
SharedResourcesAcquirer * resourcesAcquirer_
EDConsumerBase const * consumer_
BasicHandle getByLabel(KindOfType kindOfType, TypeID const &typeID, InputTag const &inputTag, EDConsumerBase const *consumes, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
Definition: Principal.cc:540
BasicHandle PrincipalGetAdapter::getByLabel_ ( TypeID const &  tid,
std::string const &  label,
std::string const &  instance,
std::string const &  process,
ModuleCallingContext const *  mcc 
) const

Definition at line 139 of file PrincipalGetAdapter.cc.

References consumer_, edm::Principal::getByLabel(), principal_, edm::PRODUCT_TYPE, and resourcesAcquirer_.

143  {
145  }
SharedResourcesAcquirer * resourcesAcquirer_
static PFTauRenderPlugin instance
EDConsumerBase const * consumer_
char const * label
BasicHandle getByLabel(KindOfType kindOfType, TypeID const &typeID, InputTag const &inputTag, EDConsumerBase const *consumes, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
Definition: Principal.cc:540
BasicHandle PrincipalGetAdapter::getByToken_ ( TypeID const &  id,
KindOfType  kindOfType,
EDGetToken  token,
ModuleCallingContext const *  mcc 
) const

Definition at line 147 of file PrincipalGetAdapter.cc.

References branchType(), consumer_, edm::Principal::getByToken(), h, edm::EDConsumerBase::indexFrom(), edm::BasicHandle::isValid(), makeFailToGetException(), principal_, edm::ProductResolverIndexAndSkipBit::productResolverIndex(), edm::ProductResolverIndexAmbiguous, edm::ProductResolverIndexInvalid, resourcesAcquirer_, edm::ProductResolverIndexAndSkipBit::skipCurrentProcess(), throwAmbiguousException(), and UNLIKELY.

Referenced by edm::OccurrenceForOutput::getByToken().

150  {
151  ProductResolverIndexAndSkipBit indexAndBit = consumer_->indexFrom(token, branchType(), id);
152  ProductResolverIndex index = indexAndBit.productResolverIndex();
153  bool skipCurrentProcess = indexAndBit.skipCurrentProcess();
154  if (UNLIKELY(index == ProductResolverIndexInvalid)) {
155  return makeFailToGetException(kindOfType, id, token);
156  } else if (UNLIKELY(index == ProductResolverIndexAmbiguous)) {
157  // This deals with ambiguities where the process is specified
158  throwAmbiguousException(id, token);
159  }
160  bool ambiguous = false;
161  BasicHandle h =
162  principal_.getByToken(kindOfType, id, index, skipCurrentProcess, ambiguous, resourcesAcquirer_, mcc);
163  if (ambiguous) {
164  // This deals with ambiguities where the process is not specified
165  throwAmbiguousException(id, token);
166  } else if (!h.isValid()) {
167  return makeFailToGetException(kindOfType, id, token);
168  }
169  return h;
170  }
SharedResourcesAcquirer * resourcesAcquirer_
unsigned int ProductResolverIndex
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
EDConsumerBase const * consumer_
BranchType const & branchType() const
ProductResolverIndexAndSkipBit indexFrom(EDGetToken, BranchType, TypeID const &) const
BasicHandle makeFailToGetException(KindOfType, TypeID const &, EDGetToken) const
BasicHandle getByToken(KindOfType kindOfType, TypeID const &typeID, ProductResolverIndex index, bool skipCurrentProcess, bool &ambiguous, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
Definition: Principal.cc:578
#define UNLIKELY(x)
Definition: Likely.h:21
void throwAmbiguousException(TypeID const &productType, EDGetToken token) const
template<typename PROD >
void PrincipalGetAdapter::getManyByType ( std::vector< Handle< PROD > > &  results,
ModuleCallingContext const *  mcc 
) const
inline

Definition at line 314 of file PrincipalGetAdapter.h.

References end, eostools::move(), PROD, edm::es::products(), and mps_update::results.

315  {
316  BasicHandleVec bhv;
317  this->getManyByType_(TypeID(typeid(PROD)), bhv, mcc);
318 
319  // Go through the returned handles; for each element,
320  // 1. create a Handle<PROD> and
321  //
322  // This function presents an exception safety difficulty. If an
323  // exception is thrown when converting a handle, the "got
324  // products" record will be wrong.
325  //
326  // Since EDProducers are not allowed to use this function,
327  // the problem does not seem too severe.
328  //
329  // Question: do we even need to keep track of the "got products"
330  // for this function, since it is *not* to be used by EDProducers?
331  std::vector<Handle<PROD> > products;
332 
333  typename BasicHandleVec::iterator it = bhv.begin();
334  typename BasicHandleVec::iterator end = bhv.end();
335 
336  while (it != end) {
337  products.push_back(convert_handle<PROD>(std::move(*it)));
338  ++it;
339  }
340  results.swap(products);
341  }
ESProducts< std::remove_reference_t< TArgs >... > products(TArgs &&...args)
Definition: ESProducts.h:128
#define end
Definition: vmac.h:39
void getManyByType_(TypeID const &tid, BasicHandleVec &results, ModuleCallingContext const *mcc) const
#define PROD(A, B)
def move(src, dest)
Definition: eostools.py:511
std::vector< BasicHandle > BasicHandleVec
void PrincipalGetAdapter::getManyByType_ ( TypeID const &  tid,
BasicHandleVec results,
ModuleCallingContext const *  mcc 
) const

Definition at line 187 of file PrincipalGetAdapter.cc.

References consumer_, edm::Principal::getManyByType(), principal_, and resourcesAcquirer_.

189  {
191  }
SharedResourcesAcquirer * resourcesAcquirer_
EDConsumerBase const * consumer_
void getManyByType(TypeID const &typeID, BasicHandleVec &results, EDConsumerBase const *consumes, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
Definition: Principal.cc:614
BasicHandle PrincipalGetAdapter::getMatchingSequenceByLabel_ ( TypeID const &  typeID,
InputTag const &  tag,
ModuleCallingContext const *  mcc 
) const

Definition at line 172 of file PrincipalGetAdapter.cc.

References consumer_, edm::ELEMENT_TYPE, edm::Principal::getByLabel(), principal_, and resourcesAcquirer_.

174  {
176  }
SharedResourcesAcquirer * resourcesAcquirer_
EDConsumerBase const * consumer_
BasicHandle getByLabel(KindOfType kindOfType, TypeID const &typeID, InputTag const &inputTag, EDConsumerBase const *consumes, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
Definition: Principal.cc:540
BasicHandle PrincipalGetAdapter::getMatchingSequenceByLabel_ ( TypeID const &  typeID,
std::string const &  label,
std::string const &  instance,
std::string const &  process,
ModuleCallingContext const *  mcc 
) const

Definition at line 178 of file PrincipalGetAdapter.cc.

References consumer_, edm::ELEMENT_TYPE, edm::Principal::getByLabel(), h, principal_, and resourcesAcquirer_.

182  {
184  return h;
185  }
SharedResourcesAcquirer * resourcesAcquirer_
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
static PFTauRenderPlugin instance
EDConsumerBase const * consumer_
char const * label
BasicHandle getByLabel(KindOfType kindOfType, TypeID const &typeID, InputTag const &inputTag, EDConsumerBase const *consumes, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
Definition: Principal.cc:540
ProductID const & PrincipalGetAdapter::getProductID ( unsigned int  iPutTokenIndex) const

Definition at line 240 of file PrincipalGetAdapter.cc.

References edm::Principal::getProductResolverByIndex(), principal_, prodBase_, edm::ProducerBase::putTokenIndexToProductResolverIndex(), and edm::ProductResolverBase::stableProvenance().

240  {
241  auto index = prodBase_->putTokenIndexToProductResolverIndex()[iPutTokenIndex];
242  ProductResolverBase const* phb = principal_.getProductResolverByIndex(index);
243  assert(phb != nullptr);
244  auto prov = phb->stableProvenance();
245  assert(prov != nullptr);
246  return prov->productID();
247  }
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex() const
Definition: ProducerBase.h:93
ProducerBase const * prodBase_
ConstProductResolverPtr getProductResolverByIndex(ProductResolverIndex const &oid) const
Definition: Principal.cc:535
EDPutToken::value_type PrincipalGetAdapter::getPutTokenIndex ( TypeID const &  type,
std::string const &  productInstanceName 
) const

Definition at line 267 of file PrincipalGetAdapter.cc.

References SiStripPI::max, prodBase_, throwUnregisteredPutException(), transition(), and edm::ProductRegistryHelper::typeLabelList().

268  {
269  auto tran = transition();
270  size_t index = 0;
271  for (auto const& tl : prodBase_->typeLabelList()) {
272  if ((tran == tl.transition_) and (type == tl.typeID_) and (productInstanceName == tl.productInstanceName_)) {
273  return index;
274  }
275  ++index;
276  }
277  throwUnregisteredPutException(type, productInstanceName);
279  }
type
Definition: HCALResponse.h:21
Transition transition() const
void throwUnregisteredPutException(TypeID const &type, std::string const &productInstanceLabel) const
TypeLabelList const & typeLabelList() const
used by the fwk to register the list of products of this module
ProducerBase const * prodBase_
TypeID const & PrincipalGetAdapter::getTypeIDForPutTokenIndex ( EDPutToken::value_type  index) const

Definition at line 285 of file PrincipalGetAdapter.cc.

References prodBase_, and edm::ProductRegistryHelper::typeLabelList().

285  {
286  return prodBase_->typeLabelList()[index].typeID_;
287  }
TypeLabelList const & typeLabelList() const
used by the fwk to register the list of products of this module
ProducerBase const * prodBase_
bool edm::PrincipalGetAdapter::isComplete ( ) const
inline

Definition at line 151 of file PrincipalGetAdapter.h.

References mps_update::results.

Referenced by edm::OccurrenceForOutput::getByToken(), and transition().

void PrincipalGetAdapter::labelsForToken ( EDGetToken const &  iToken,
ProductLabels oLabels 
) const

Definition at line 84 of file PrincipalGetAdapter.cc.

References consumer_, and edm::EDConsumerBase::labelsForToken().

84  {
85  consumer_->labelsForToken(iToken, oLabels);
86  }
EDConsumerBase const * consumer_
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
BasicHandle PrincipalGetAdapter::makeFailToGetException ( KindOfType  kindOfType,
TypeID const &  productType,
EDGetToken  token 
) const
private

Definition at line 88 of file PrincipalGetAdapter.cc.

References consumer_, cppFunctionSkipper::exception, tablePrinter::labels, edm::EDConsumerBase::labelsForToken(), edm::makeHandleExceptionFactory(), edm::ProductLabels::module, edm::ProductLabels::process, edm::PRODUCT_TYPE, edm::ProductLabels::productInstance, and edm::errors::ProductNotFound.

Referenced by getByToken_().

90  {
92  consumer_->labelsForToken(token, labels);
93  //no need to copy memory since the exception will no occur after the
94  // const char* have been deleted
95  return BasicHandle(
96  makeHandleExceptionFactory([labels, kindOfType, productType]() -> std::shared_ptr<cms::Exception> {
97  std::shared_ptr<cms::Exception> exception(std::make_shared<Exception>(errors::ProductNotFound));
98  if (kindOfType == PRODUCT_TYPE) {
99  *exception << "Principal::getByToken: Found zero products matching all criteria\nLooking for type: "
100  << productType << "\n"
101  << "Looking for module label: " << labels.module << "\n"
102  << "Looking for productInstanceName: " << labels.productInstance << "\n"
103  << (0 == labels.process[0] ? "" : "Looking for process: ") << labels.process << "\n";
104  } else {
105  *exception << "Principal::getByToken: Found zero products matching all criteria\nLooking for a container "
106  "with elements of type: "
107  << productType << "\n"
108  << "Looking for module label: " << labels.module << "\n"
109  << "Looking for productInstanceName: " << labels.productInstance << "\n"
110  << (0 == labels.process[0] ? "" : "Looking for process: ") << labels.process << "\n";
111  }
112  return exception;
113  }));
114  }
EDConsumerBase const * consumer_
std::shared_ptr< HandleExceptionFactory > makeHandleExceptionFactory(T &&iFunctor)
ProductLabels Labels
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
size_t PrincipalGetAdapter::numberOfProductsConsumed ( ) const

Definition at line 82 of file PrincipalGetAdapter.cc.

References consumer_, edm::InEvent, and edm::EDConsumerBase::itemsToGetFrom().

Referenced by edm::Event::setConsumer().

82 { return consumer_->itemsToGetFrom(InEvent).size(); }
EDConsumerBase const * consumer_
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom(BranchType iType) const
PrincipalGetAdapter& edm::PrincipalGetAdapter::operator= ( PrincipalGetAdapter const &  )
delete
Principal const& edm::PrincipalGetAdapter::principal ( ) const
inline
ProcessHistory const & PrincipalGetAdapter::processHistory ( ) const
EDProductGetter const * PrincipalGetAdapter::prodGetter ( ) const

Definition at line 297 of file PrincipalGetAdapter.cc.

References principal_, and edm::Principal::prodGetter().

297 { return principal_.prodGetter(); }
EDProductGetter const * prodGetter() const
Definition: Principal.h:92
std::string const & PrincipalGetAdapter::productInstanceLabel ( EDPutToken  iToken) const

Definition at line 281 of file PrincipalGetAdapter.cc.

References edm::EDPutToken::index(), prodBase_, and edm::ProductRegistryHelper::typeLabelList().

281  {
282  return prodBase_->typeLabelList()[iToken.index()].productInstanceName_;
283  }
TypeLabelList const & typeLabelList() const
used by the fwk to register the list of products of this module
ProducerBase const * prodBase_
std::vector< edm::ProductResolverIndex > const & PrincipalGetAdapter::putTokenIndexToProductResolverIndex ( ) const
std::vector< bool > const & PrincipalGetAdapter::recordProvenanceList ( ) const

Definition at line 293 of file PrincipalGetAdapter.cc.

References prodBase_, and edm::ProductRegistryHelper::recordProvenanceList().

Referenced by edm::Event::commit_aux(), and edm::Event::setProducer().

293  {
295  }
std::vector< bool > const & recordProvenanceList() const
ProducerBase const * prodBase_
void edm::PrincipalGetAdapter::setConsumer ( EDConsumerBase const *  iConsumer)
inline
void edm::PrincipalGetAdapter::setProducer ( ProducerBase const *  iProd)
inline
void edm::PrincipalGetAdapter::setSharedResourcesAcquirer ( SharedResourcesAcquirer iSra)
inline
void PrincipalGetAdapter::throwAmbiguousException ( TypeID const &  productType,
EDGetToken  token 
) const
private

Definition at line 116 of file PrincipalGetAdapter.cc.

References consumer_, cppFunctionSkipper::exception, tablePrinter::labels, edm::EDConsumerBase::labelsForToken(), edm::ProductLabels::module, edm::ProductLabels::process, and edm::ProductLabels::productInstance.

Referenced by getByToken_().

116  {
118  consumer_->labelsForToken(token, labels);
119  cms::Exception exception("AmbiguousProduct");
120  exception << "Principal::getByToken: More than 1 product matches all criteria\nLooking for a container with "
121  "elements of type: "
122  << productType << "\n"
123  << "Looking for module label: " << labels.module << "\n"
124  << "Looking for productInstanceName: " << labels.productInstance << "\n"
125  << (0 == labels.process[0] ? "" : "Looking for process: ") << labels.process << "\n"
126  << "This can only occur with get function calls using a Handle<View> argument.\n"
127  << "Try a get not using a View or change the instance name of one of the products";
128  throw exception;
129  }
EDConsumerBase const * consumer_
ProductLabels Labels
void labelsForToken(EDGetToken iToken, Labels &oLabels) const
void PrincipalGetAdapter::throwUnregisteredPutException ( TypeID const &  type,
std::string const &  productInstanceLabel 
) const
private

Definition at line 195 of file PrincipalGetAdapter.cc.

References edm::ProductRegistry::allBranchDescriptions(), Exception, edm::TypeID::friendlyClassName(), edm::errors::InsertFailure, md_, edm::ModuleDescription::moduleLabel(), principal_, edm::ModuleDescription::processName(), edm::Principal::productRegistry(), and str.

Referenced by getBranchDescription(), and getPutTokenIndex().

196  {
197  std::ostringstream str;
198  for (auto branchDescription : principal_.productRegistry().allBranchDescriptions()) {
199  if (branchDescription->moduleLabel() == md_.moduleLabel() and
200  branchDescription->processName() == md_.processName()) {
201  str << *branchDescription << "-----\n";
202  }
203  }
205  << "Illegal attempt to 'put' an unregistered product.\n"
206  << "No product is registered for\n"
207  << " product friendly class name: '" << type.friendlyClassName() << "'\n"
208  << " module label: '" << md_.moduleLabel() << "'\n"
209  << " product instance name: '" << productInstanceName << "'\n"
210  << " process name: '" << md_.processName() << "'\n"
211 
212  << "The following data products are registered for production by " << md_.moduleLabel() << ":\n"
213  << str.str() << '\n'
214  << "To correct the problem:\n"
215  " 1) make sure the proper 'produce' call is being made in the module's constructor,\n"
216  " 2) if 'produce' exists and uses a product instance name make sure that same name is used during the "
217  "'put' call.";
218  }
type
Definition: HCALResponse.h:21
ProductRegistry const & productRegistry() const
Definition: Principal.h:146
std::string const & processName() const
std::string const & moduleLabel() const
std::vector< BranchDescription const * > allBranchDescriptions() const
ModuleDescription const & md_
#define str(s)
Transition PrincipalGetAdapter::transition ( ) const

Member Data Documentation

EDConsumerBase const* edm::PrincipalGetAdapter::consumer_
private
bool edm::PrincipalGetAdapter::isComplete_
private

Definition at line 244 of file PrincipalGetAdapter.h.

ModuleDescription const& edm::PrincipalGetAdapter::md_
private

Definition at line 239 of file PrincipalGetAdapter.h.

Referenced by getBranchDescription(), and throwUnregisteredPutException().

Principal const& edm::PrincipalGetAdapter::principal_
private
ProducerBase const* edm::PrincipalGetAdapter::prodBase_ = 0
private
SharedResourcesAcquirer* edm::PrincipalGetAdapter::resourcesAcquirer_
private