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 410 of file ProductResolvers.h.

Member Typedef Documentation

◆ ProductStatus

Definition at line 412 of file ProductResolvers.h.

Constructor & Destructor Documentation

◆ ParentProcessProductResolver()

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

Definition at line 413 of file ProductResolvers.h.

414  : 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 464 of file ProductResolvers.h.

464 { return *bd_; }

◆ connectTo()

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

Implements edm::ProductResolverBase.

Definition at line 416 of file ProductResolvers.h.

416  {
417  realProduct_ = &iOther;
418  parentPrincipal_ = iParentPrincipal;
419  };

◆ 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 435 of file ProductResolvers.h.

440  {
441  if (principal.branchType() == InProcess &&
442  (mcc->parent().globalContext()->transition() == GlobalContext::Transition::kBeginProcessBlock ||
443  mcc->parent().globalContext()->transition() == GlobalContext::Transition::kEndProcessBlock)) {
444  return;
445  }
446 
447  skipCurrentProcess = false;
448  realProduct_->prefetchAsync(waitTask, *parentPrincipal_, skipCurrentProcess, token, sra, mcc);
449  }

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().

◆ productProvenancePtr_()

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

Implements edm::ProductResolverBase.

Definition at line 811 of file ProductResolvers.cc.

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

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

◆ productResolved_()

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

Implements edm::ProductResolverBase.

Definition at line 457 of file ProductResolvers.h.

457 { return realProduct_->productResolved(); }

◆ productUnavailable_()

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

Implements edm::ProductResolverBase.

Definition at line 456 of file ProductResolvers.h.

456 { return realProduct_->productUnavailable(); }

◆ productWasDeleted_()

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

Implements edm::ProductResolverBase.

Definition at line 458 of file ProductResolvers.h.

458 { return realProduct_->productWasDeleted(); }

◆ productWasFetchedAndIsValid_()

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

Implements edm::ProductResolverBase.

Definition at line 459 of file ProductResolvers.h.

459  {
460  iSkipCurrentProcess = false;
461  return realProduct_->productWasFetchedAndIsValid(iSkipCurrentProcess);
462  }

◆ provenance_()

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

Implements edm::ProductResolverBase.

Definition at line 466 of file ProductResolvers.h.

466 { return realProduct_->provenance(); }

◆ resetBranchDescription_()

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

Implements edm::ProductResolverBase.

Definition at line 465 of file ProductResolvers.h.

465 { bd_ = bd; }

◆ resetProductData_()

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

Implements edm::ProductResolverBase.

Definition at line 815 of file ProductResolvers.cc.

815 {}

◆ resolvedModuleLabel_()

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

Implements edm::ProductResolverBase.

Definition at line 467 of file ProductResolvers.h.

467 { 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 422 of file ProductResolvers.h.

425  {
426  if (principal.branchType() == InProcess &&
427  (mcc->parent().globalContext()->transition() == GlobalContext::Transition::kBeginProcessBlock ||
428  mcc->parent().globalContext()->transition() == GlobalContext::Transition::kEndProcessBlock)) {
429  return Resolution(nullptr);
430  }
431 
432  skipCurrentProcess = false;
433  return realProduct_->resolveProduct(*parentPrincipal_, skipCurrentProcess, sra, mcc);
434  }

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

◆ setProductID_()

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

Implements edm::ProductResolverBase.

Definition at line 809 of file ProductResolvers.cc.

809 {}

◆ setProductProvenanceRetriever_()

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

Implements edm::ProductResolverBase.

Definition at line 805 of file ProductResolvers.cc.

805  {
806  provRetriever_ = provRetriever;
807  }

References provRetriever_.

◆ singleProduct_()

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

Implements edm::ProductResolverBase.

Definition at line 817 of file ProductResolvers.cc.

817 { return true; }

◆ throwNullRealProduct()

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

Definition at line 819 of file ProductResolvers.cc.

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

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

◆ unscheduledWasNotRun_()

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

Implements edm::ProductResolverBase.

Definition at line 450 of file ProductResolvers.h.

450  {
451  if (realProduct_)
454  return false;
455  }

Member Data Documentation

◆ bd_

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

Definition at line 476 of file ProductResolvers.h.

Referenced by productProvenancePtr_().

◆ parentPrincipal_

Principal const* edm::ParentProcessProductResolver::parentPrincipal_
private

Definition at line 478 of file ProductResolvers.h.

◆ provRetriever_

ProductProvenanceRetriever const* edm::ParentProcessProductResolver::provRetriever_
private

Definition at line 477 of file ProductResolvers.h.

Referenced by productProvenancePtr_(), and setProductProvenanceRetriever_().

◆ realProduct_

ProductResolverBase const* edm::ParentProcessProductResolver::realProduct_
private

Definition at line 475 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:476
bd
deep_tau::DeepTauBase::BasicDiscriminator bd
Definition: DeepTauId.cc:1082
edm::errors::LogicError
Definition: EDMException.h:37
deep_tau::DeepTauBase::BasicDiscriminator
BasicDiscriminator
Definition: DeepTauBase.h:115
edm::ProductResolverBase::productResolved
bool productResolved() const
Definition: ProductResolverBase.h:90
edm::ParentProcessProductResolver::provRetriever_
ProductProvenanceRetriever const * provRetriever_
Definition: ProductResolvers.h:477
edm::ParentProcessProductResolver::realProduct_
ProductResolverBase const * realProduct_
Definition: ProductResolvers.h:475
edm::ProductResolverBase::prefetchAsync
void prefetchAsync(WaitingTaskHolder waitTask, Principal const &principal, bool skipCurrentProcess, ServiceToken const &token, SharedResourcesAcquirer *sra, ModuleCallingContext const *mcc) const
Definition: ProductResolverBase.h:69
edm::ProductResolverBase::productUnavailable
bool productUnavailable() const
Definition: ProductResolverBase.h:87
edm::InProcess
Definition: BranchType.h:11
edm::ParentProcessProductResolver::throwNullRealProduct
void throwNullRealProduct() const
Definition: ProductResolvers.cc:819
edm::ParentProcessProductResolver::parentPrincipal_
Principal const * parentPrincipal_
Definition: ProductResolvers.h:478
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::ProductProvenanceLookup::branchIDToProvenance
ProductProvenance const * branchIDToProvenance(BranchID const &bid) const
Definition: ProductProvenanceLookup.cc:59
Resolution
Definition: trackSplitPlot.h:33
edm::GlobalContext::Transition::kEndProcessBlock
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:245
edm::ProductResolverBase::productWasDeleted
bool productWasDeleted() const
Definition: ProductResolverBase.h:100
edm::GlobalContext::Transition::kBeginProcessBlock
unpackBuffers-CaloStage2.token
token
Definition: unpackBuffers-CaloStage2.py:316