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 (WaitingTaskHolder 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 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_ (WaitingTaskHolder 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 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 440 of file ProductResolvers.h.

Member Typedef Documentation

◆ ProductStatus

Definition at line 442 of file ProductResolvers.h.

Constructor & Destructor Documentation

◆ ParentProcessProductResolver()

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

Definition at line 443 of file ProductResolvers.h.

444  : ProductResolverBase(), realProduct_(nullptr), bd_(bd), provRetriever_(nullptr), parentPrincipal_(nullptr) {}
std::shared_ptr< BranchDescription const > bd_
ProductProvenanceRetriever const * provRetriever_
ProductResolverBase const * realProduct_

Member Function Documentation

◆ branchDescription_()

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

Implements edm::ProductResolverBase.

Definition at line 494 of file ProductResolvers.h.

494 { return *bd_; }
std::shared_ptr< BranchDescription const > bd_

◆ connectTo()

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

Implements edm::ProductResolverBase.

Definition at line 446 of file ProductResolvers.h.

446  {
447  realProduct_ = &iOther;
448  parentPrincipal_ = iParentPrincipal;
449  };
ProductResolverBase const * realProduct_

◆ prefetchAsync_()

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

Implements edm::ProductResolverBase.

Definition at line 465 of file ProductResolvers.h.

References edm::Principal::branchType(), edm::ParentContext::globalContext(), edm::InProcess, edm::GlobalContext::kBeginProcessBlock, edm::GlobalContext::kEndProcessBlock, edm::ModuleCallingContext::parent(), unpackBuffers-CaloStage2::token, and edm::GlobalContext::transition().

470  {
471  if (principal.branchType() == InProcess &&
472  (mcc->parent().globalContext()->transition() == GlobalContext::Transition::kBeginProcessBlock ||
473  mcc->parent().globalContext()->transition() == GlobalContext::Transition::kEndProcessBlock)) {
474  return;
475  }
476 
477  skipCurrentProcess = false;
478  realProduct_->prefetchAsync(waitTask, *parentPrincipal_, skipCurrentProcess, token, sra, mcc);
479  }
ProductResolverBase const * realProduct_
void prefetchAsync(WaitingTaskHolder waitTask, Principal const &principal, bool skipCurrentProcess, ServiceToken const &token, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const

◆ productProvenancePtr_()

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

Implements edm::ProductResolverBase.

Definition at line 881 of file ProductResolvers.cc.

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

881  {
882  return provRetriever_ ? provRetriever_->branchIDToProvenance(bd_->originalBranchID()) : nullptr;
883  }
std::shared_ptr< BranchDescription const > bd_
ProductProvenanceRetriever const * provRetriever_
ProductProvenance const * branchIDToProvenance(BranchID const &bid) const

◆ productResolved_()

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

Implements edm::ProductResolverBase.

Definition at line 487 of file ProductResolvers.h.

487 { return realProduct_->productResolved(); }
ProductResolverBase const * realProduct_

◆ productUnavailable_()

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

Implements edm::ProductResolverBase.

Definition at line 486 of file ProductResolvers.h.

486 { return realProduct_->productUnavailable(); }
ProductResolverBase const * realProduct_

◆ productWasDeleted_()

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

Implements edm::ProductResolverBase.

Definition at line 488 of file ProductResolvers.h.

488 { return realProduct_->productWasDeleted(); }
ProductResolverBase const * realProduct_

◆ productWasFetchedAndIsValid_()

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

Implements edm::ProductResolverBase.

Definition at line 489 of file ProductResolvers.h.

489  {
490  iSkipCurrentProcess = false;
491  return realProduct_->productWasFetchedAndIsValid(iSkipCurrentProcess);
492  }
ProductResolverBase const * realProduct_
bool productWasFetchedAndIsValid(bool iSkipCurrentProcess) const

◆ provenance_()

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

Implements edm::ProductResolverBase.

Definition at line 496 of file ProductResolvers.h.

496 { return realProduct_->provenance(); }
Provenance const * provenance() const
ProductResolverBase const * realProduct_

◆ resetBranchDescription_()

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

Implements edm::ProductResolverBase.

Definition at line 495 of file ProductResolvers.h.

495 { bd_ = bd; }
std::shared_ptr< BranchDescription const > bd_
deep_tau::DeepTauBase::BasicDiscriminator bd
Definition: DeepTauId.cc:808

◆ resetProductData_()

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

Implements edm::ProductResolverBase.

Definition at line 885 of file ProductResolvers.cc.

885 {}

◆ resolvedModuleLabel_()

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

Implements edm::ProductResolverBase.

Definition at line 497 of file ProductResolvers.h.

497 { return realProduct_->moduleLabel(); }
ProductResolverBase const * realProduct_
std::string const & moduleLabel() const

◆ resolveProduct_()

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

Implements edm::ProductResolverBase.

Definition at line 452 of file ProductResolvers.h.

References edm::Principal::branchType(), edm::ParentContext::globalContext(), edm::InProcess, edm::GlobalContext::kBeginProcessBlock, edm::GlobalContext::kEndProcessBlock, edm::ModuleCallingContext::parent(), Resolution, and edm::GlobalContext::transition().

455  {
456  if (principal.branchType() == InProcess &&
457  (mcc->parent().globalContext()->transition() == GlobalContext::Transition::kBeginProcessBlock ||
458  mcc->parent().globalContext()->transition() == GlobalContext::Transition::kEndProcessBlock)) {
459  return Resolution(nullptr);
460  }
461 
462  skipCurrentProcess = false;
463  return realProduct_->resolveProduct(*parentPrincipal_, skipCurrentProcess, sra, mcc);
464  }
Resolution resolveProduct(Principal const &principal, bool skipCurrentProcess, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
ProductResolverBase const * realProduct_

◆ setProductID_()

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

Implements edm::ProductResolverBase.

Definition at line 879 of file ProductResolvers.cc.

879 {}

◆ setProductProvenanceRetriever_()

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

Implements edm::ProductResolverBase.

Definition at line 875 of file ProductResolvers.cc.

References provRetriever_.

875  {
876  provRetriever_ = provRetriever;
877  }
ProductProvenanceRetriever const * provRetriever_

◆ singleProduct_()

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

Implements edm::ProductResolverBase.

Definition at line 887 of file ProductResolvers.cc.

887 { return true; }

◆ throwNullRealProduct()

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

Definition at line 889 of file ProductResolvers.cc.

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

889  {
890  // In principle, this ought to be fixed. I noticed one hits this error
891  // when in a SubProcess and calling the Event::getProvenance function
892  // with a BranchID to a branch from an earlier SubProcess or the top
893  // level process and this branch is not kept in this SubProcess. It might
894  // be possible to hit this in other contexts. I say it ought to be
895  // fixed because one does not encounter this issue if the SubProcesses
896  // are split into genuinely different processes (in principle that
897  // ought to give identical behavior and results). No user has ever
898  // reported this issue which has been around for some time and it was only
899  // noticed when testing some rare corner cases after modifying Core code.
900  // After discussing this with Chris we decided that at least for the moment
901  // there are higher priorities than fixing this ... I converted it so it
902  // causes an exception instead of a seg fault. The issue that may need to
903  // be addressed someday is how ProductResolvers for non-kept branches are
904  // connected to earlier SubProcesses.
906  << "ParentProcessProductResolver::throwNullRealProduct RealProduct pointer not set in this context.\n"
907  << "Contact a Framework developer\n";
908  }

◆ unscheduledWasNotRun_()

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

Implements edm::ProductResolverBase.

Definition at line 480 of file ProductResolvers.h.

480  {
481  if (realProduct_)
484  return false;
485  }
ProductResolverBase const * realProduct_

Member Data Documentation

◆ bd_

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

Definition at line 506 of file ProductResolvers.h.

Referenced by productProvenancePtr_().

◆ parentPrincipal_

Principal const* edm::ParentProcessProductResolver::parentPrincipal_
private

Definition at line 508 of file ProductResolvers.h.

◆ provRetriever_

ProductProvenanceRetriever const* edm::ParentProcessProductResolver::provRetriever_
private

Definition at line 507 of file ProductResolvers.h.

Referenced by productProvenancePtr_(), and setProductProvenanceRetriever_().

◆ realProduct_

ProductResolverBase const* edm::ParentProcessProductResolver::realProduct_
private

Definition at line 505 of file ProductResolvers.h.