CMS 3D CMS Logo

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

#include <ProductResolvers.h>

Inheritance diagram for edm::ParentProcessProductResolver:
edm::ProductResolverBase

Public Types

typedef ProducedProductResolver::ProductStatus ProductStatus
 

Public Member Functions

void connectTo (ProductResolverBase const &iOther, Principal const *iParentPrincipal) final
 
 ParentProcessProductResolver (std::shared_ptr< BranchDescription const > bd)
 
- Public Member Functions inherited from edm::ProductResolverBase
BranchDescription const & branchDescription () const
 
std::string const & moduleLabel () const
 
ProductResolverBaseoperator= (ProductResolverBase const &)=delete
 
void prefetchAsync (WaitingTask *waitTask, Principal const &principal, bool skipCurrentProcess, ServiceToken const &token, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
 
std::string const & processName () const
 
ProductID const & productID () const
 
std::string const & productInstanceName () const
 
ProductProvenance const * productProvenancePtr () const
 
bool productResolved () const
 
 ProductResolverBase ()
 
 ProductResolverBase (ProductResolverBase const &)=delete
 
TypeID productType () const
 
bool productUnavailable () const
 
bool productWasDeleted () const
 
bool productWasFetchedAndIsValid (bool iSkipCurrentProcess) const
 
Provenance const * provenance () const
 
bool provenanceAvailable () const
 
void putOrMergeProduct (std::unique_ptr< WrapperBase > edp, MergeableRunProductMetadata const *mergeableRunProductMetadata=nullptr) const
 
void putProduct (std::unique_ptr< WrapperBase > edp) const
 
void resetBranchDescription (std::shared_ptr< BranchDescription const > bd)
 
void resetProductData ()
 
std::string const & resolvedModuleLabel () const
 
Resolution resolveProduct (Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
 
void retrieveAndMerge (Principal const &principal, MergeableRunProductMetadata const *mergeableRunProductMetadata) const
 
void setMergeableRunProductMetadata (MergeableRunProductMetadata const *mrpm)
 
void setProductID (ProductID const &pid)
 
void setProductProvenanceRetriever (ProductProvenanceRetriever const *provRetriever)
 
virtual void setupUnscheduled (UnscheduledConfigurator const &)
 
bool singleProduct () const
 
StableProvenance const * stableProvenance () const
 
void unsafe_deleteProduct () const
 
bool unscheduledWasNotRun () const
 
void write (std::ostream &os) const
 
virtual ~ProductResolverBase ()
 

Private Member Functions

BranchDescription const & branchDescription_ () const override
 
void prefetchAsync_ (WaitingTask *waitTask, Principal const &principal, bool skipCurrentProcess, ServiceToken const &token, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
 
ProductProvenance const * productProvenancePtr_ () const override
 
bool productResolved_ () const final
 
bool productUnavailable_ () const override
 
bool productWasDeleted_ () const override
 
bool productWasFetchedAndIsValid_ (bool iSkipCurrentProcess) const override
 
Provenance const * provenance_ () const final
 
void putOrMergeProduct_ (std::unique_ptr< WrapperBase > prod, MergeableRunProductMetadata const *mergeableRunProductMetadata) const final
 
void putProduct_ (std::unique_ptr< WrapperBase > edp) const override
 
void resetBranchDescription_ (std::shared_ptr< BranchDescription const > bd) override
 
void resetProductData_ (bool deleteEarly) override
 
std::string const & resolvedModuleLabel_ () const override
 
Resolution resolveProduct_ (Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const override
 
void setProductID_ (ProductID const &pid) override
 
void setProductProvenanceRetriever_ (ProductProvenanceRetriever const *provRetriever) override
 
bool singleProduct_ () const override
 
void throwNullRealProduct () const
 
bool unscheduledWasNotRun_ () const override
 

Private Attributes

std::shared_ptr< BranchDescription const > bd_
 
Principal const * parentPrincipal_
 
ProductProvenanceRetriever const * provRetriever_
 
ProductResolverBase const * realProduct_
 

Detailed Description

Definition at line 369 of file ProductResolvers.h.

Member Typedef Documentation

◆ ProductStatus

Definition at line 371 of file ProductResolvers.h.

Constructor & Destructor Documentation

◆ ParentProcessProductResolver()

edm::ParentProcessProductResolver::ParentProcessProductResolver ( std::shared_ptr< BranchDescription const >  bd)
inlineexplicit

Definition at line 372 of file ProductResolvers.h.

373  : ProductResolverBase(), realProduct_(nullptr), bd_(bd), provRetriever_(nullptr), parentPrincipal_(nullptr) {}

Member Function Documentation

◆ branchDescription_()

BranchDescription const& edm::ParentProcessProductResolver::branchDescription_ ( ) const
inlineoverrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 414 of file ProductResolvers.h.

414 { return *bd_; }

◆ connectTo()

void edm::ParentProcessProductResolver::connectTo ( ProductResolverBase const &  iOther,
Principal const *  iParentPrincipal 
)
inlinefinalvirtual

Implements edm::ProductResolverBase.

Definition at line 375 of file ProductResolvers.h.

375  {
376  realProduct_ = &iOther;
377  parentPrincipal_ = iParentPrincipal;
378  };

◆ prefetchAsync_()

void edm::ParentProcessProductResolver::prefetchAsync_ ( WaitingTask waitTask,
Principal const &  principal,
bool  skipCurrentProcess,
ServiceToken const &  token,
SharedResourcesAcquirer sra,
ModuleCallingContext const *  mcc 
) const
inlineoverrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 388 of file ProductResolvers.h.

393  {
394  skipCurrentProcess = false;
395  realProduct_->prefetchAsync(waitTask, *parentPrincipal_, skipCurrentProcess, token, sra, mcc);
396  }

References unpackBuffers-CaloStage2::token.

◆ productProvenancePtr_()

ProductProvenance const * edm::ParentProcessProductResolver::productProvenancePtr_ ( ) const
overrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 810 of file ProductResolvers.cc.

810  {
811  return provRetriever_ ? provRetriever_->branchIDToProvenance(bd_->originalBranchID()) : nullptr;
812  }

References bd_, edm::ProductProvenanceRetriever::branchIDToProvenance(), and provRetriever_.

◆ productResolved_()

bool edm::ParentProcessProductResolver::productResolved_ ( ) const
inlinefinalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 404 of file ProductResolvers.h.

404 { return realProduct_->productResolved(); }

◆ productUnavailable_()

bool edm::ParentProcessProductResolver::productUnavailable_ ( ) const
inlineoverrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 403 of file ProductResolvers.h.

403 { return realProduct_->productUnavailable(); }

◆ productWasDeleted_()

bool edm::ParentProcessProductResolver::productWasDeleted_ ( ) const
inlineoverrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 405 of file ProductResolvers.h.

405 { return realProduct_->productWasDeleted(); }

◆ productWasFetchedAndIsValid_()

bool edm::ParentProcessProductResolver::productWasFetchedAndIsValid_ ( bool  iSkipCurrentProcess) const
inlineoverrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 406 of file ProductResolvers.h.

406  {
407  iSkipCurrentProcess = false;
408  return realProduct_->productWasFetchedAndIsValid(iSkipCurrentProcess);
409  }

◆ provenance_()

Provenance const* edm::ParentProcessProductResolver::provenance_ ( ) const
inlinefinalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 416 of file ProductResolvers.h.

416 { return realProduct_->provenance(); }

◆ putOrMergeProduct_()

void edm::ParentProcessProductResolver::putOrMergeProduct_ ( std::unique_ptr< WrapperBase prod,
MergeableRunProductMetadata const *  mergeableRunProductMetadata 
) const
finalprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 824 of file ProductResolvers.cc.

825  {
827  << "ParentProcessProductResolver::putOrMergeProduct_(std::unique_ptr<WrapperBase> edp, "
828  "MergeableRunProductMetadata const*) not implemented and should never be called.\n"
829  << "Contact a Framework developer\n";
830  }

References Exception, and edm::errors::LogicError.

◆ putProduct_()

void edm::ParentProcessProductResolver::putProduct_ ( std::unique_ptr< WrapperBase edp) const
overrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 818 of file ProductResolvers.cc.

818  {
820  << "ParentProcessProductResolver::putProduct_() not implemented and should never be called.\n"
821  << "Contact a Framework developer\n";
822  }

References Exception, and edm::errors::LogicError.

◆ resetBranchDescription_()

void edm::ParentProcessProductResolver::resetBranchDescription_ ( std::shared_ptr< BranchDescription const >  bd)
inlineoverrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 415 of file ProductResolvers.h.

415 { bd_ = bd; }

◆ resetProductData_()

void edm::ParentProcessProductResolver::resetProductData_ ( bool  deleteEarly)
overrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 814 of file ProductResolvers.cc.

814 {}

◆ resolvedModuleLabel_()

std::string const& edm::ParentProcessProductResolver::resolvedModuleLabel_ ( ) const
inlineoverrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 417 of file ProductResolvers.h.

417 { return realProduct_->moduleLabel(); }

◆ resolveProduct_()

Resolution edm::ParentProcessProductResolver::resolveProduct_ ( Principal const &  principal,
bool  skipCurrentProcess,
SharedResourcesAcquirer sra,
ModuleCallingContext const *  mcc 
) const
inlineoverrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 381 of file ProductResolvers.h.

384  {
385  skipCurrentProcess = false;
386  return realProduct_->resolveProduct(*parentPrincipal_, skipCurrentProcess, sra, mcc);
387  }

◆ setProductID_()

void edm::ParentProcessProductResolver::setProductID_ ( ProductID const &  pid)
overrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 808 of file ProductResolvers.cc.

808 {}

◆ setProductProvenanceRetriever_()

void edm::ParentProcessProductResolver::setProductProvenanceRetriever_ ( ProductProvenanceRetriever const *  provRetriever)
overrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 804 of file ProductResolvers.cc.

804  {
805  provRetriever_ = provRetriever;
806  }

References provRetriever_.

◆ singleProduct_()

bool edm::ParentProcessProductResolver::singleProduct_ ( ) const
overrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 816 of file ProductResolvers.cc.

816 { return true; }

◆ throwNullRealProduct()

void edm::ParentProcessProductResolver::throwNullRealProduct ( ) const
private

Definition at line 832 of file ProductResolvers.cc.

832  {
833  // In principle, this ought to be fixed. I noticed one hits this error
834  // when in a SubProcess and calling the Event::getProvenance function
835  // with a BranchID to a branch from an earlier SubProcess or the top
836  // level process and this branch is not kept in this SubProcess. It might
837  // be possible to hit this in other contexts. I say it ought to be
838  // fixed because one does not encounter this issue if the SubProcesses
839  // are split into genuinely different processes (in principle that
840  // ought to give identical behavior and results). No user has ever
841  // reported this issue which has been around for some time and it was only
842  // noticed when testing some rare corner cases after modifying Core code.
843  // After discussing this with Chris we decided that at least for the moment
844  // there are higher priorities than fixing this ... I converted it so it
845  // causes an exception instead of a seg fault. The issue that may need to
846  // be addressed someday is how ProductResolvers for non-kept branches are
847  // connected to earlier SubProcesses.
849  << "ParentProcessProductResolver::throwNullRealProduct RealProduct pointer not set in this context.\n"
850  << "Contact a Framework developer\n";
851  }

References Exception, and edm::errors::LogicError.

◆ unscheduledWasNotRun_()

bool edm::ParentProcessProductResolver::unscheduledWasNotRun_ ( ) const
inlineoverrideprivatevirtual

Implements edm::ProductResolverBase.

Definition at line 397 of file ProductResolvers.h.

397  {
398  if (realProduct_)
401  return false;
402  }

Member Data Documentation

◆ bd_

std::shared_ptr<BranchDescription const> edm::ParentProcessProductResolver::bd_
private

Definition at line 426 of file ProductResolvers.h.

Referenced by productProvenancePtr_().

◆ parentPrincipal_

Principal const* edm::ParentProcessProductResolver::parentPrincipal_
private

Definition at line 428 of file ProductResolvers.h.

◆ provRetriever_

ProductProvenanceRetriever const* edm::ParentProcessProductResolver::provRetriever_
private

Definition at line 427 of file ProductResolvers.h.

Referenced by productProvenancePtr_(), and setProductProvenanceRetriever_().

◆ realProduct_

ProductResolverBase const* edm::ParentProcessProductResolver::realProduct_
private

Definition at line 425 of file ProductResolvers.h.

edm::ProductResolverBase::ProductResolverBase
ProductResolverBase()
Definition: ProductResolverBase.cc:14
edm::ProductResolverBase::provenance
Provenance const * provenance() const
Definition: ProductResolverBase.cc:31
edm::ParentProcessProductResolver::bd_
std::shared_ptr< BranchDescription const > bd_
Definition: ProductResolvers.h:426
edm::errors::LogicError
Definition: EDMException.h:37
edm::ProductResolverBase::productResolved
bool productResolved() const
Definition: ProductResolverBase.h:90
edm::ParentProcessProductResolver::provRetriever_
ProductProvenanceRetriever const * provRetriever_
Definition: ProductResolvers.h:427
edm::ParentProcessProductResolver::realProduct_
ProductResolverBase const * realProduct_
Definition: ProductResolvers.h:425
edm::ProductResolverBase::productUnavailable
bool productUnavailable() const
Definition: ProductResolverBase.h:87
edm::ParentProcessProductResolver::throwNullRealProduct
void throwNullRealProduct() const
Definition: ProductResolvers.cc:832
edm::ParentProcessProductResolver::parentPrincipal_
Principal const * parentPrincipal_
Definition: ProductResolvers.h:428
edm::ProductResolverBase::unscheduledWasNotRun
bool unscheduledWasNotRun() const
Definition: ProductResolverBase.h:97
edm::ProductResolverBase::resolveProduct
Resolution resolveProduct(Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
Definition: ProductResolverBase.h:60
edm::ProductResolverBase::productWasFetchedAndIsValid
bool productWasFetchedAndIsValid(bool iSkipCurrentProcess) const
Definition: ProductResolverBase.h:102
edm::ProductResolverBase::moduleLabel
std::string const & moduleLabel() const
Definition: ProductResolverBase.h:119
Exception
Definition: hltDiff.cc:246
edm::ProductProvenanceRetriever::branchIDToProvenance
ProductProvenance const * branchIDToProvenance(BranchID const &bid) const
Definition: ProductProvenanceRetriever.cc:148
edm::ProductResolverBase::productWasDeleted
bool productWasDeleted() const
Definition: ProductResolverBase.h:100
edm::ProductResolverBase::prefetchAsync
void prefetchAsync(WaitingTask *waitTask, Principal const &principal, bool skipCurrentProcess, ServiceToken const &token, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
Definition: ProductResolverBase.h:69
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316