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

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

Referenced by getByToken_(), and transition().

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

◆ 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 224 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.

225  {
226  ProductResolverIndexHelper const& productResolverIndexHelper = principal_.productLookup();
227  ProductResolverIndex index = productResolverIndexHelper.index(
228  PRODUCT_TYPE, type, md_.moduleLabel().c_str(), productInstanceName.c_str(), md_.processName().c_str());
230  throwUnregisteredPutException(type, productInstanceName);
231  }
232  ProductResolverBase const* phb = principal_.getProductResolverByIndex(index);
233  assert(phb != nullptr);
234  return phb->branchDescription();
235  }
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:148
ModuleDescription const & md_
#define UNLIKELY(x)
Definition: Likely.h:21
std::string const & moduleLabel() const
ConstProductResolverPtr getProductResolverByIndex(ProductResolverIndex const &oid) const
Definition: Principal.cc:570

◆ getBranchDescription() [2/2]

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

Definition at line 237 of file PrincipalGetAdapter.cc.

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

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

◆ getByLabel_() [1/2]

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

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

139  {
141  }
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:579

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

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

147  {
149  }
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:579

◆ getByToken_()

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

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

154  {
155  ProductResolverIndexAndSkipBit indexAndBit = consumer_->indexFrom(token, branchType(), id);
156  ProductResolverIndex index = indexAndBit.productResolverIndex();
157  bool skipCurrentProcess = indexAndBit.skipCurrentProcess();
159  return makeFailToGetException(kindOfType, id, token);
161  // This deals with ambiguities where the process is specified
163  }
164  bool ambiguous = false;
165  BasicHandle h =
166  principal_.getByToken(kindOfType, id, index, skipCurrentProcess, ambiguous, resourcesAcquirer_, mcc);
167  if (ambiguous) {
168  // This deals with ambiguities where the process is not specified
170  } else if (!h.isValid()) {
171  return makeFailToGetException(kindOfType, id, token);
172  }
173  return h;
174  }
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:621
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_

◆ getManyByType()

template<typename PROD >
void PrincipalGetAdapter::getManyByType ( std::vector< Handle< PROD > > &  results,
ModuleCallingContext const *  mcc 
) const
inline

Definition at line 319 of file PrincipalGetAdapter.h.

References getManyByType_(), eostools::move(), PROD, edm::es::products(), and mysort::results.

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

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

◆ getManyByType_()

void PrincipalGetAdapter::getManyByType_ ( TypeID const &  tid,
BasicHandleVec results,
ModuleCallingContext const *  mcc 
) const

Definition at line 191 of file PrincipalGetAdapter.cc.

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

Referenced by getManyByType().

193  {
195  }
SharedResourcesAcquirer * resourcesAcquirer_
EDConsumerBase const * consumer_
void getManyByType(TypeID const &typeID, BasicHandleVec &results, EDConsumerBase const *consumes, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
Definition: Principal.cc:657
results
Definition: mysort.py:8

◆ getMatchingSequenceByLabel_() [1/2]

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

Definition at line 176 of file PrincipalGetAdapter.cc.

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

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

178  {
180  }
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:579

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

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

186  {
188  return h;
189  }
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:579
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 244 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().

244  {
245  auto index = prodBase_->putTokenIndexToProductResolverIndex()[iPutTokenIndex];
246  ProductResolverBase const* phb = principal_.getProductResolverByIndex(index);
247  assert(phb != nullptr);
248  auto prov = phb->stableProvenance();
249  assert(prov != nullptr);
250  return prov->productID();
251  }
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:570

◆ getPutTokenIndex()

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

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

272  {
273  auto tran = transition();
274  size_t index = 0;
275  for (auto const& tl : prodBase_->typeLabelList()) {
276  if ((tran == tl.transition_) and (type == tl.typeID_) and (productInstanceName == tl.productInstanceName_)) {
277  return index;
278  }
279  ++index;
280  }
281  throwUnregisteredPutException(type, productInstanceName);
283  }
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 84 of file PrincipalGetAdapter.cc.

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

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

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

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

References md_.

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

177 { return md_; }
ModuleDescription const & md_

◆ numberOfProductsConsumed()

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(); }
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 88 of file PrincipalGetAdapter.cc.

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

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

88  {
90  }
virtual unsigned int processBlockIndex(std::string const &processName) const
Definition: Principal.cc:575

◆ processHistory()

ProcessHistory const & PrincipalGetAdapter::processHistory ( ) const

◆ prodGetter()

EDProductGetter const * PrincipalGetAdapter::prodGetter ( ) const

Definition at line 301 of file PrincipalGetAdapter.cc.

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

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

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

◆ productInstanceLabel()

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

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

285  {
286  return prodBase_->typeLabelList()[iToken.index()].productInstanceName_;
287  }
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 297 of file PrincipalGetAdapter.cc.

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

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

297  {
299  }
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 120 of file PrincipalGetAdapter.cc.

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

Referenced by getByToken_().

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

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