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
 
EDConsumerBase const * getConsumer () 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
 
SharedResourcesAcquirergetSharedResourcesAcquirer () const
 
TypeID const & getTypeIDForPutTokenIndex (EDPutToken::value_type index) const
 
bool isComplete () const
 
void labelsForToken (EDGetToken const &iToken, ProductLabels &oLabels) const
 
ModuleDescription const & moduleDescription () 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
 
unsigned int processBlockIndex (std::string const &processName) const
 
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_ = nullptr
 
SharedResourcesAcquirerresourcesAcquirer_
 

Detailed Description

Definition at line 131 of file PrincipalGetAdapter.h.

Member Typedef Documentation

◆ BasicHandleVec

Definition at line 169 of file PrincipalGetAdapter.h.

Constructor & Destructor Documentation

◆ PrincipalGetAdapter() [1/2]

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::~PrincipalGetAdapter ( )

Definition at line 30 of file PrincipalGetAdapter.cc.

30 {}

◆ PrincipalGetAdapter() [2/2]

edm::PrincipalGetAdapter::PrincipalGetAdapter ( PrincipalGetAdapter const &  )
delete

Member Function Documentation

◆ branchType()

BranchType const & PrincipalGetAdapter::branchType ( ) const
private

Definition at line 128 of file PrincipalGetAdapter.cc.

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

Referenced by getByToken_(), and transition().

128 { return principal_.branchType(); }
BranchType const & branchType() const
Definition: Principal.h:175

◆ checkIfComplete()

template<typename PROD >
bool PrincipalGetAdapter::checkIfComplete ( ) const
inline

◆ getBranchDescription() [1/2]

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

Definition at line 211 of file PrincipalGetAdapter.cc.

References cms::cuda::assert(), 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.

212  {
213  ProductResolverIndexHelper const& productResolverIndexHelper = principal_.productLookup();
214  ProductResolverIndex index = productResolverIndexHelper.index(
215  PRODUCT_TYPE, type, md_.moduleLabel().c_str(), productInstanceName.c_str(), md_.processName().c_str());
217  throwUnregisteredPutException(type, productInstanceName);
218  }
219  ProductResolverBase const* phb = principal_.getProductResolverByIndex(index);
220  assert(phb != nullptr);
221  return phb->branchDescription();
222  }
unsigned int ProductResolverIndex
assert(be >=bs)
void throwUnregisteredPutException(TypeID const &type, std::string const &productInstanceLabel) const
std::string const & processName() const
ProductResolverIndexHelper const & productLookup() const
Definition: Principal.h:142
ModuleDescription const & md_
#define UNLIKELY(x)
Definition: Likely.h:21
std::string const & moduleLabel() const
ConstProductResolverPtr getProductResolverByIndex(ProductResolverIndex const &oid) const
Definition: Principal.cc:563

◆ getBranchDescription() [2/2]

BranchDescription const & PrincipalGetAdapter::getBranchDescription ( unsigned int  iPutTokenIndex) const

Definition at line 224 of file PrincipalGetAdapter.cc.

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

224  {
225  auto index = prodBase_->putTokenIndexToProductResolverIndex()[iPutTokenIndex];
226  ProductResolverBase const* phb = principal_.getProductResolverByIndex(index);
227  assert(phb != nullptr);
228  return phb->branchDescription();
229  }
ProducerBase const * prodBase_
assert(be >=bs)
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex() const
Definition: ProducerBase.h:101
ConstProductResolverPtr getProductResolverByIndex(ProductResolverIndex const &oid) const
Definition: Principal.cc:563

◆ getByLabel_() [1/2]

BasicHandle PrincipalGetAdapter::getByLabel_ ( TypeID const &  tid,
InputTag const &  tag,
ModuleCallingContext const *  mcc 
) const

Definition at line 130 of file PrincipalGetAdapter.cc.

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

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

132  {
134  }
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:572

◆ getByLabel_() [2/2]

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 136 of file PrincipalGetAdapter.cc.

References consumer_, edm::Principal::getByLabel(), instance, label, principal_, LaserDQM_cfg::process, edm::PRODUCT_TYPE, and resourcesAcquirer_.

140  {
142  }
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:572

◆ getByToken_()

BasicHandle PrincipalGetAdapter::getByToken_ ( TypeID const &  id,
KindOfType  kindOfType,
EDGetToken  token,
ModuleCallingContext const *  mcc 
) const

Definition at line 144 of file PrincipalGetAdapter.cc.

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

Referenced by edm::ProcessBlock::getByToken(), edm::OccurrenceForOutput::getByToken(), edm::Run::getByToken(), edm::LuminosityBlock::getByToken(), edm::Event::getByToken(), edm::Event::getByTokenImpl(), edm::ProcessBlock::getHandle(), edm::OccurrenceForOutput::getHandle(), edm::LuminosityBlock::getHandle(), edm::Run::getHandle(), and edm::Event::getHandle().

147  {
148  ProductResolverIndexAndSkipBit indexAndBit = consumer_->indexFrom(token, branchType(), id);
149  ProductResolverIndex index = indexAndBit.productResolverIndex();
150  bool skipCurrentProcess = indexAndBit.skipCurrentProcess();
152  return makeFailToGetException(kindOfType, id, token);
154  // This deals with ambiguities where the process is specified
156  }
157  bool ambiguous = false;
158  BasicHandle h =
159  principal_.getByToken(kindOfType, id, index, skipCurrentProcess, ambiguous, resourcesAcquirer_, mcc);
160  if (ambiguous) {
161  // This deals with ambiguities where the process is not specified
163  } else if (!h.isValid()) {
164  return makeFailToGetException(kindOfType, id, token);
165  }
166  return h;
167  }
SharedResourcesAcquirer * resourcesAcquirer_
unsigned int ProductResolverIndex
BasicHandle getByToken(KindOfType kindOfType, TypeID const &typeID, ProductResolverIndex index, bool skipCurrentProcess, bool &ambiguous, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
Definition: Principal.cc:614
ProductResolverIndexAndSkipBit indexFrom(EDGetToken, BranchType, TypeID const &) const
EDConsumerBase const * consumer_
void throwAmbiguousException(TypeID const &productType, EDGetToken token) const
BranchType const & branchType() const
BasicHandle makeFailToGetException(KindOfType, TypeID const &, EDGetToken) const
#define UNLIKELY(x)
Definition: Likely.h:21
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ getConsumer()

EDConsumerBase const* edm::PrincipalGetAdapter::getConsumer ( ) const
inline

Definition at line 143 of file PrincipalGetAdapter.h.

References consumer_.

Referenced by edm::Event::fillLuminosityBlock(), and edm::LuminosityBlock::fillRun().

143 { return consumer_; }
EDConsumerBase const * consumer_

◆ getMatchingSequenceByLabel_() [1/2]

BasicHandle PrincipalGetAdapter::getMatchingSequenceByLabel_ ( TypeID const &  typeID,
InputTag const &  tag,
ModuleCallingContext const *  mcc 
) const

Definition at line 169 of file PrincipalGetAdapter.cc.

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

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

171  {
173  }
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:572

◆ getMatchingSequenceByLabel_() [2/2]

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 175 of file PrincipalGetAdapter.cc.

References consumer_, edm::ELEMENT_TYPE, edm::Principal::getByLabel(), h, instance, label, principal_, LaserDQM_cfg::process, and resourcesAcquirer_.

179  {
181  return h;
182  }
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:572
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4

◆ getProductID()

ProductID const & PrincipalGetAdapter::getProductID ( unsigned int  iPutTokenIndex) const

Definition at line 231 of file PrincipalGetAdapter.cc.

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

Referenced by edm::Event::emplaceImpl(), edm::Event::getRefBeforePut(), and edm::Event::putImpl().

231  {
232  auto index = prodBase_->putTokenIndexToProductResolverIndex()[iPutTokenIndex];
233  ProductResolverBase const* phb = principal_.getProductResolverByIndex(index);
234  assert(phb != nullptr);
235  auto prov = phb->stableProvenance();
236  assert(prov != nullptr);
237  return prov->productID();
238  }
ProducerBase const * prodBase_
assert(be >=bs)
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex() const
Definition: ProducerBase.h:101
ConstProductResolverPtr getProductResolverByIndex(ProductResolverIndex const &oid) const
Definition: Principal.cc:563

◆ getPutTokenIndex()

EDPutToken::value_type PrincipalGetAdapter::getPutTokenIndex ( TypeID const &  type,
std::string const &  productInstanceName 
) const

Definition at line 258 of file PrincipalGetAdapter.cc.

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

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

259  {
260  auto tran = transition();
261  size_t index = 0;
262  for (auto const& tl : prodBase_->typeLabelList()) {
263  if ((tran == tl.transition_) and (type == tl.typeID_) and (productInstanceName == tl.productInstanceName_)) {
264  return index;
265  }
266  ++index;
267  }
268  throwUnregisteredPutException(type, productInstanceName);
270  }
ProducerBase const * prodBase_
TypeLabelList const & typeLabelList() const
used by the fwk to register the list of products of this module
void throwUnregisteredPutException(TypeID const &type, std::string const &productInstanceLabel) const

◆ getSharedResourcesAcquirer()

SharedResourcesAcquirer* edm::PrincipalGetAdapter::getSharedResourcesAcquirer ( ) const
inline

Definition at line 146 of file PrincipalGetAdapter.h.

References resourcesAcquirer_.

Referenced by edm::Event::fillLuminosityBlock(), and edm::LuminosityBlock::fillRun().

146 { return resourcesAcquirer_; }
SharedResourcesAcquirer * resourcesAcquirer_

◆ getTypeIDForPutTokenIndex()

TypeID const & PrincipalGetAdapter::getTypeIDForPutTokenIndex ( EDPutToken::value_type  index) const

◆ isComplete()

bool edm::PrincipalGetAdapter::isComplete ( ) const
inline

◆ labelsForToken()

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

Definition at line 77 of file PrincipalGetAdapter.cc.

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

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

77  {
78  consumer_->labelsForToken(iToken, oLabels);
79  }
EDConsumerBase const * consumer_
void labelsForToken(EDGetToken iToken, Labels &oLabels) const

◆ makeFailToGetException()

BasicHandle PrincipalGetAdapter::makeFailToGetException ( KindOfType  kindOfType,
TypeID const &  productType,
EDGetToken  token 
) const
private

Definition at line 85 of file PrincipalGetAdapter.cc.

References consumer_, cppFunctionSkipper::exception, SummaryClient_cfi::labels, edm::EDConsumerBase::labelsForToken(), edm::makeHandleExceptionFactory(), edm::PRODUCT_TYPE, edm::errors::ProductNotFound, and unpackBuffers-CaloStage2::token.

Referenced by getByToken_().

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

◆ moduleDescription()

ModuleDescription const& edm::PrincipalGetAdapter::moduleDescription ( ) const
inline

Definition at line 173 of file PrincipalGetAdapter.h.

References md_.

Referenced by edm::Event::fillLuminosityBlock(), and edm::LuminosityBlock::fillRun().

173 { return md_; }
ModuleDescription const & md_

◆ numberOfProductsConsumed()

size_t PrincipalGetAdapter::numberOfProductsConsumed ( ) const

Definition at line 75 of file PrincipalGetAdapter.cc.

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

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

75 { return consumer_->itemsToGetFrom(InEvent).size(); }
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom(BranchType iType) const
EDConsumerBase const * consumer_

◆ operator=()

PrincipalGetAdapter& edm::PrincipalGetAdapter::operator= ( PrincipalGetAdapter const &  )
delete

◆ principal()

Principal const& edm::PrincipalGetAdapter::principal ( ) const
inline

◆ processBlockIndex()

unsigned int PrincipalGetAdapter::processBlockIndex ( std::string const &  processName) const

Definition at line 81 of file PrincipalGetAdapter.cc.

References principal_, edm::Principal::processBlockIndex(), and SimL1EmulatorRepack_CalouGT_cff::processName.

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

81  {
83  }
virtual unsigned int processBlockIndex(std::string const &processName) const
Definition: Principal.cc:568

◆ processHistory()

ProcessHistory const & PrincipalGetAdapter::processHistory ( ) const

◆ prodGetter()

EDProductGetter const * PrincipalGetAdapter::prodGetter ( ) const

Definition at line 288 of file PrincipalGetAdapter.cc.

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

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

288 { return principal_.prodGetter(); }
EDProductGetter const * prodGetter() const
Definition: Principal.h:92

◆ productInstanceLabel()

std::string const & PrincipalGetAdapter::productInstanceLabel ( EDPutToken  iToken) const

Definition at line 272 of file PrincipalGetAdapter.cc.

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

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

272  {
273  return prodBase_->typeLabelList()[iToken.index()].productInstanceName_;
274  }
ProducerBase const * prodBase_
TypeLabelList const & typeLabelList() const
used by the fwk to register the list of products of this module

◆ putTokenIndexToProductResolverIndex()

std::vector< edm::ProductResolverIndex > const & PrincipalGetAdapter::putTokenIndexToProductResolverIndex ( ) const

◆ recordProvenanceList()

std::vector< bool > const & PrincipalGetAdapter::recordProvenanceList ( ) const

Definition at line 284 of file PrincipalGetAdapter.cc.

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

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

284  {
286  }
std::vector< bool > const & recordProvenanceList() const
ProducerBase const * prodBase_

◆ setConsumer()

void edm::PrincipalGetAdapter::setConsumer ( EDConsumerBase const *  iConsumer)
inline

◆ setProducer()

void edm::PrincipalGetAdapter::setProducer ( ProducerBase const *  iProd)
inline

◆ setSharedResourcesAcquirer()

void edm::PrincipalGetAdapter::setSharedResourcesAcquirer ( SharedResourcesAcquirer iSra)
inline

◆ throwAmbiguousException()

void PrincipalGetAdapter::throwAmbiguousException ( TypeID const &  productType,
EDGetToken  token 
) const
private

Definition at line 113 of file PrincipalGetAdapter.cc.

References consumer_, cppFunctionSkipper::exception, SummaryClient_cfi::labels, edm::EDConsumerBase::labelsForToken(), and unpackBuffers-CaloStage2::token.

Referenced by getByToken_().

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

◆ throwUnregisteredPutException()

void PrincipalGetAdapter::throwUnregisteredPutException ( TypeID const &  type,
std::string const &  productInstanceLabel 
) const
private

Definition at line 186 of file PrincipalGetAdapter.cc.

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

Referenced by getBranchDescription(), and getPutTokenIndex().

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

◆ transition()

Transition PrincipalGetAdapter::transition ( ) const

Member Data Documentation

◆ consumer_

EDConsumerBase const* edm::PrincipalGetAdapter::consumer_
private

◆ isComplete_

bool edm::PrincipalGetAdapter::isComplete_
private

Definition at line 243 of file PrincipalGetAdapter.h.

Referenced by isComplete().

◆ md_

ModuleDescription const& edm::PrincipalGetAdapter::md_
private

◆ principal_

Principal const& edm::PrincipalGetAdapter::principal_
private

◆ prodBase_

ProducerBase const* edm::PrincipalGetAdapter::prodBase_ = nullptr
private

◆ resourcesAcquirer_

SharedResourcesAcquirer* edm::PrincipalGetAdapter::resourcesAcquirer_
private