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 132 of file PrincipalGetAdapter.h.

Member Typedef Documentation

◆ BasicHandleVec

Definition at line 170 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 134 of file PrincipalGetAdapter.cc.

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

Referenced by getByToken_(), and transition().

134 { 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 217 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.

218  {
219  ProductResolverIndexHelper const& productResolverIndexHelper = principal_.productLookup();
220  ProductResolverIndex index = productResolverIndexHelper.index(
221  PRODUCT_TYPE, type, md_.moduleLabel().c_str(), productInstanceName.c_str(), md_.processName().c_str());
223  throwUnregisteredPutException(type, productInstanceName);
224  }
225  ProductResolverBase const* phb = principal_.getProductResolverByIndex(index);
226  assert(phb != nullptr);
227  return phb->branchDescription();
228  }
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 230 of file PrincipalGetAdapter.cc.

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

230  {
231  auto index = prodBase_->putTokenIndexToProductResolverIndex()[iPutTokenIndex];
232  ProductResolverBase const* phb = principal_.getProductResolverByIndex(index);
233  assert(phb != nullptr);
234  return phb->branchDescription();
235  }
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 136 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().

138  {
140  }
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 142 of file PrincipalGetAdapter.cc.

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

146  {
148  }
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 150 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().

153  {
154  ProductResolverIndexAndSkipBit indexAndBit = consumer_->indexFrom(token, branchType(), id);
155  ProductResolverIndex index = indexAndBit.productResolverIndex();
156  bool skipCurrentProcess = indexAndBit.skipCurrentProcess();
158  return makeFailToGetException(kindOfType, id, token);
160  // This deals with ambiguities where the process is specified
162  }
163  bool ambiguous = false;
164  BasicHandle h =
165  principal_.getByToken(kindOfType, id, index, skipCurrentProcess, ambiguous, resourcesAcquirer_, mcc);
166  if (ambiguous) {
167  // This deals with ambiguities where the process is not specified
169  } else if (!h.isValid()) {
170  return makeFailToGetException(kindOfType, id, token);
171  }
172  return h;
173  }
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 144 of file PrincipalGetAdapter.h.

References consumer_.

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

144 { return consumer_; }
EDConsumerBase const * consumer_

◆ getMatchingSequenceByLabel_() [1/2]

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

Definition at line 175 of file PrincipalGetAdapter.cc.

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

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

177  {
179  }
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 181 of file PrincipalGetAdapter.cc.

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

185  {
187  return h;
188  }
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 237 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().

237  {
238  auto index = prodBase_->putTokenIndexToProductResolverIndex()[iPutTokenIndex];
239  ProductResolverBase const* phb = principal_.getProductResolverByIndex(index);
240  assert(phb != nullptr);
241  auto prov = phb->stableProvenance();
242  assert(prov != nullptr);
243  return prov->productID();
244  }
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 264 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().

265  {
266  auto tran = transition();
267  size_t index = 0;
268  for (auto const& tl : prodBase_->typeLabelList()) {
269  if ((tran == tl.transition_) and (type == tl.typeID_) and (productInstanceName == tl.productInstanceName_)) {
270  return index;
271  }
272  ++index;
273  }
274  throwUnregisteredPutException(type, productInstanceName);
276  }
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 147 of file PrincipalGetAdapter.h.

References resourcesAcquirer_.

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

147 { 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 83 of file PrincipalGetAdapter.cc.

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

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

83  {
84  consumer_->labelsForToken(iToken, oLabels);
85  }
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 91 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_().

93  {
96  //no need to copy memory since the exception will no occur after the
97  // const char* have been deleted
98  return BasicHandle(
99  makeHandleExceptionFactory([labels, kindOfType, productType]() -> std::shared_ptr<cms::Exception> {
100  std::shared_ptr<cms::Exception> exception(std::make_shared<Exception>(errors::ProductNotFound));
101  if (kindOfType == PRODUCT_TYPE) {
102  *exception << "Principal::getByToken: Found zero products matching all criteria\nLooking for type: "
103  << productType << "\n"
104  << "Looking for module label: " << labels.module << "\n"
105  << "Looking for productInstanceName: " << labels.productInstance << "\n"
106  << (0 == labels.process[0] ? "" : "Looking for process: ") << labels.process << "\n";
107  } else {
108  *exception << "Principal::getByToken: Found zero products matching all criteria\nLooking for a container "
109  "with elements of type: "
110  << productType << "\n"
111  << "Looking for module label: " << labels.module << "\n"
112  << "Looking for productInstanceName: " << labels.productInstance << "\n"
113  << (0 == labels.process[0] ? "" : "Looking for process: ") << labels.process << "\n";
114  }
115  return exception;
116  }));
117  }
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 174 of file PrincipalGetAdapter.h.

References md_.

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

174 { return md_; }
ModuleDescription const & md_

◆ numberOfProductsConsumed()

size_t PrincipalGetAdapter::numberOfProductsConsumed ( ) const

Definition at line 81 of file PrincipalGetAdapter.cc.

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

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

81 { 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 87 of file PrincipalGetAdapter.cc.

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

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

87  {
89  }
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 294 of file PrincipalGetAdapter.cc.

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

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

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

◆ productInstanceLabel()

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

Definition at line 278 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().

278  {
279  return prodBase_->typeLabelList()[iToken.index()].productInstanceName_;
280  }
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 290 of file PrincipalGetAdapter.cc.

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

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

290  {
292  }
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 119 of file PrincipalGetAdapter.cc.

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

Referenced by getByToken_().

119  {
122  cms::Exception exception("AmbiguousProduct");
123  exception << "Principal::getByToken: More than 1 product matches all criteria\nLooking for a container with "
124  "elements of type: "
125  << productType << "\n"
126  << "Looking for module label: " << labels.module << "\n"
127  << "Looking for productInstanceName: " << labels.productInstance << "\n"
128  << (0 == labels.process[0] ? "" : "Looking for process: ") << labels.process << "\n"
129  << "This can only occur with get function calls using a Handle<View> argument.\n"
130  << "Try a get not using a View or change the instance name of one of the products";
131  throw exception;
132  }
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 192 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().

193  {
194  std::ostringstream str;
195  for (auto branchDescription : principal_.productRegistry().allBranchDescriptions()) {
196  if (branchDescription->moduleLabel() == md_.moduleLabel() and
197  branchDescription->processName() == md_.processName()) {
198  str << *branchDescription << "-----\n";
199  }
200  }
202  << "Illegal attempt to 'put' an unregistered product.\n"
203  << "No product is registered for\n"
204  << " product friendly class name: '" << type.friendlyClassName() << "'\n"
205  << " module label: '" << md_.moduleLabel() << "'\n"
206  << " product instance name: '" << productInstanceName << "'\n"
207  << " process name: '" << md_.processName() << "'\n"
208 
209  << "The following data products are registered for production by " << md_.moduleLabel() << ":\n"
210  << str.str() << '\n'
211  << "To correct the problem:\n"
212  " 1) make sure the proper 'produce' call is being made in the module's constructor,\n"
213  " 2) if 'produce' exists and uses a product instance name make sure that same name is used during the "
214  "'put' call.";
215  }
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 244 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